144 lines
5.1 KiB
Dart
144 lines
5.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:yumi/app_localizations.dart';
|
|
import 'package:yumi/ui_kit/components/appbar/socialchat_appbar.dart';
|
|
import 'package:yumi/app/routes/sc_fluro_navigator.dart';
|
|
import 'package:yumi/modules/store/store_route.dart';
|
|
import 'package:yumi/modules/user/my_items/chatbox/bags_chatbox_page.dart';
|
|
import 'package:yumi/modules/user/my_items/data_card/bags_data_card_page.dart';
|
|
import 'package:yumi/modules/user/my_items/gift/bags_gift_page.dart';
|
|
import 'package:yumi/modules/user/my_items/headdress/bags_headdress_page.dart';
|
|
import 'package:yumi/modules/user/my_items/mountains/bags_mountains_page.dart';
|
|
|
|
import 'package:yumi/app/constants/sc_global_config.dart';
|
|
import 'package:yumi/shared/business_logic/usecases/sc_fixed_width_tabIndicator.dart';
|
|
|
|
class MyItemsPage extends StatefulWidget {
|
|
const MyItemsPage({super.key});
|
|
|
|
@override
|
|
State<MyItemsPage> createState() => _MyItemsPageState();
|
|
}
|
|
|
|
class _MyItemsPageState extends State<MyItemsPage>
|
|
with SingleTickerProviderStateMixin {
|
|
late TabController _tabController;
|
|
final List<Widget> _pages = [];
|
|
final List<Widget> _tabs = [];
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_pages.add(BagsHeaddressPage());
|
|
_pages.add(BagsMountainsPage());
|
|
_pages.add(BagsGiftPage());
|
|
_pages.add(BagsChatboxPage());
|
|
_pages.add(const BagsDataCardPage());
|
|
_tabController = TabController(length: _pages.length, vsync: this);
|
|
_tabController.addListener(() {});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_tabController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
_tabs.clear();
|
|
_tabs.add(Tab(text: SCAppLocalizations.of(context)!.headdress));
|
|
_tabs.add(Tab(text: SCAppLocalizations.of(context)!.mountains));
|
|
_tabs.add(Tab(text: SCAppLocalizations.of(context)!.gift));
|
|
_tabs.add(Tab(text: SCAppLocalizations.of(context)!.chatBox));
|
|
_tabs.add(const Tab(text: 'Profile Card'));
|
|
return Stack(
|
|
children: [
|
|
Image.asset(
|
|
SCGlobalConfig.businessLogicStrategy.getLanguagePageBackgroundImage(),
|
|
width: ScreenUtil().screenWidth,
|
|
height: ScreenUtil().screenHeight,
|
|
fit: BoxFit.fill,
|
|
),
|
|
Scaffold(
|
|
backgroundColor: Colors.transparent,
|
|
resizeToAvoidBottomInset: false,
|
|
appBar: SocialChatStandardAppBar(
|
|
title: SCAppLocalizations.of(context)!.myItems,
|
|
actions: [
|
|
GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
child: Container(
|
|
padding: EdgeInsets.all(5.w),
|
|
margin: EdgeInsetsDirectional.only(end: 10.w),
|
|
child: Image.asset(
|
|
"sc_images/store/sc_icon_bag_shop.png",
|
|
width: 20.w,
|
|
height: 20.w,
|
|
),
|
|
),
|
|
onTap: () {
|
|
SCNavigatorUtils.push(
|
|
context,
|
|
StoreRoute.list,
|
|
replace: true,
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
body: SafeArea(
|
|
top: false,
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
TabBar(
|
|
tabAlignment: TabAlignment.center,
|
|
isScrollable: true,
|
|
labelColor: Colors.white,
|
|
unselectedLabelStyle: SCGlobalConfig.businessLogicStrategy
|
|
.getStorePageTabUnselectedLabelStyle()
|
|
.copyWith(
|
|
fontSize:
|
|
SCGlobalConfig.businessLogicStrategy
|
|
.getStorePageTabUnselectedLabelStyle()
|
|
.fontSize
|
|
?.sp,
|
|
),
|
|
// indicatorPadding: EdgeInsets.symmetric(
|
|
// vertical: 5.w,
|
|
// horizontal: 15.w,
|
|
// ),
|
|
indicator: SCFixedWidthTabIndicator(
|
|
width: 15.w,
|
|
color:
|
|
SCGlobalConfig.businessLogicStrategy
|
|
.getStorePageTabIndicatorColor(),
|
|
),
|
|
dividerColor:
|
|
SCGlobalConfig.businessLogicStrategy
|
|
.getStorePageTabDividerColor(),
|
|
controller: _tabController,
|
|
tabs: _tabs,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 5.w),
|
|
Expanded(
|
|
child: TabBarView(
|
|
controller: _tabController,
|
|
children: _pages,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|