You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

117 lines
3.7 KiB

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/business_system/home/vip/vip_recharge_flow.dart';
import 'package:huixiang/business_system/order/ticket/ticket_tab.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../view_widget/my_appbar.dart';
import '../../../view_widget/my_tab.dart';
import 'balance_change_record.dart';
import 'bus_vip_list.dart';
class BusinessVipPage extends StatefulWidget {
final Map<String, dynamic> arguments;
BusinessVipPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _BusinessVipPage();
}
}
class _BusinessVipPage extends State<BusinessVipPage>
with SingleTickerProviderStateMixin {
List<GlobalKey> _allKey = [];
String storeId;
TabController tabController;
@override
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this, initialIndex: widget?.arguments["index"] ?? 0);
tabController.addListener(() {
if (!tabController.indexIsChanging) {
setState(() {});
FocusScope.of(context).requestFocus(FocusNode());
}
});
loadFinish();
storeId = widget.arguments["storeId"];
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
Expanded(child: DefaultTabController(
length: 3,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "",
leadingColor: Colors.black,
background: Colors.white,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: TabBar (
// isScrollable: true, //可滚动
//去掉按钮阴影
overlayColor: MaterialStateProperty.all(Colors.white),
indicator: const TicketTab(
width: 44,
borderSide:
BorderSide(width: 2.0, color: Color(0xFF30415B))),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)),
controller: tabController,
//未选中文字颜色
unselectedLabelColor: Color(0xFF666666),
//指示器与文字等宽
tabs: <Widget>[
MyTab(text: "会员列表"),
MyTab(text: "会员充值流水"),
MyTab(text: "会员余额变动"),
],
),
),
body: TabBarView(
controller: tabController,
children: [
BusVipList(
_allKey[0],
storeId),
VipRechargeFlow(
_allKey[1],
storeId),
BalanceChangeRecord(
_allKey[2],
storeId,),
],
),
),
)),
// SizedBox(
// height: 76.h,
// ),
],
),
);
}
}