2026-07-01 18:25:58 +08:00

89 lines
2.9 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aslan/chatvibe_data/sources/local/user_manager.dart';
import 'package:aslan/app_localizations.dart';
import 'package:aslan/chatvibe_ui/theme/chatvibe_theme.dart';
import 'package:aslan/chatvibe_features/user/profile/props/giftwall_page.dart';
import 'package:aslan/chatvibe_features/user/profile/props/honor_page.dart';
import 'package:aslan/chatvibe_features/user/profile/props/medal_page.dart';
///道具
class PropsPage extends StatefulWidget {
String tageId = "";
bool isFromMe = false;
PropsPage(this.isFromMe, this.tageId);
@override
_PropsPageState createState() => _PropsPageState();
}
class _PropsPageState extends State<PropsPage>
with SingleTickerProviderStateMixin {
late TabController _tabController;
final List<Widget> _pages = [];
final List<Widget> _tabs = [];
@override
void initState() {
super.initState();
_pages.add(MedalPage(widget.tageId));
_pages.add(HonorPage(widget.tageId));
_pages.add(GiftwallPage(widget.tageId));
_tabController = TabController(length: _pages.length, vsync: this);
}
@override
Widget build(BuildContext context) {
_tabs.clear();
_tabs.add(Tab(text: ATAppLocalizations.of(context)!.medal));
_tabs.add(Tab(text: ATAppLocalizations.of(context)!.honor));
_tabs.add(Tab(text: ATAppLocalizations.of(context)!.giftwall));
return Column(
children: [
Row(
children: [
SizedBox(width: 5.w),
SizedBox(
height: 35.w,
child: TabBar(
tabAlignment: TabAlignment.start,
labelPadding: EdgeInsets.symmetric(horizontal: 12.w),
isScrollable: true,
indicator: BoxDecoration(),
labelStyle: TextStyle(
fontSize: 15.sp,
color: Colors.white,
fontWeight: FontWeight.w600,
),
unselectedLabelStyle: TextStyle(
fontSize: 13.sp,
color: Colors.white54,
fontWeight: FontWeight.w500,
),
// indicatorPadding: EdgeInsets.symmetric(
// vertical: 5.w,
// horizontal: 15.w,
// ),
indicatorColor: Colors.transparent,
dividerColor: Colors.transparent,
controller: _tabController,
tabs: _tabs,
),
),
],
),
Expanded(
child: TabBarView(
controller: _tabController,
physics: NeverScrollableScrollPhysics(),
children: _pages,
),
),
widget.tageId!=AccountStorage().getCurrentUser()?.userProfile?.id?SizedBox(height: 55.w,):Container()
],
);
}
}