|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:huixiang/business_system/home/overview/trade_goods.dart';
|
|
|
|
import 'package:huixiang/business_system/home/overview/trade_order.dart';
|
|
|
|
import 'package:huixiang/business_system/home/overview/trade_summary.dart';
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart';
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import '../../../generated/l10n.dart';
|
|
|
|
import '../../../view_widget/my_tab.dart';
|
|
|
|
|
|
|
|
class TradeOverviewPage extends StatefulWidget {
|
|
|
|
final arguments;
|
|
|
|
|
|
|
|
TradeOverviewPage({this.arguments});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
return _TradeOverviewPage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProviderStateMixin{
|
|
|
|
final RefreshController refreshController = RefreshController();
|
|
|
|
String storeId;
|
|
|
|
TabController tabController;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
storeId = widget?.arguments["storeId"] ??"";
|
|
|
|
tabController = TabController(
|
|
|
|
length: 3, vsync: this, initialIndex: widget?.arguments["index"]??0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return DefaultTabController(
|
|
|
|
length: 3,
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: MyAppBar(
|
|
|
|
title:"",
|
|
|
|
titleColor: Colors.black,
|
|
|
|
background: Colors.white,
|
|
|
|
leadingColor: Colors.black,
|
|
|
|
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
|
|
|
|
bottom: TabBar(
|
|
|
|
// isScrollable: true, //可滚动
|
|
|
|
overlayColor: MaterialStateProperty.all(Colors.white),
|
|
|
|
indicatorColor: 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(0xffA29E9E),
|
|
|
|
indicatorSize: TabBarIndicatorSize.label,
|
|
|
|
//指示器与文字等宽
|
|
|
|
tabs: <Widget>[
|
|
|
|
MyTab(text:"总览"),
|
|
|
|
MyTab(text: S.of(context).dingdan),
|
|
|
|
MyTab(text: "商品"),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: TabBarView(
|
|
|
|
children: [
|
|
|
|
TradeSummary(storeId),
|
|
|
|
TradeOrder(storeId),
|
|
|
|
TradeGoods(storeId,"")],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|