127 lines
3.9 KiB
Dart
127 lines
3.9 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
import '/common/colorCom.dart';
|
||
|
|
import 'package:bruno/bruno.dart';
|
||
|
|
import 'package:wms_app/page/stockIn/StackInWheel.dart';
|
||
|
|
import 'package:wms_app/page/stockIn/StockInEmpty.dart';
|
||
|
|
import 'package:wms_app/page/stock/stock.dart';
|
||
|
|
import 'package:wms_app/page/pick/pick.dart';
|
||
|
|
|
||
|
|
class Home extends StatefulWidget {
|
||
|
|
const Home({super.key});
|
||
|
|
@override
|
||
|
|
State<Home> createState() => _HomePageState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _HomePageState extends State<Home> {
|
||
|
|
|
||
|
|
List<BrnDoughnutDataItem> stockChartsData = [];
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
appBar: AppBar(
|
||
|
|
iconTheme: const IconThemeData(
|
||
|
|
color: Colors.white
|
||
|
|
),
|
||
|
|
centerTitle: true,
|
||
|
|
backgroundColor: ColorCommon.colorScheme,
|
||
|
|
title: const Text(
|
||
|
|
"景旺WMS移动终端",
|
||
|
|
style: TextStyle(
|
||
|
|
color: Colors.white
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
drawer: Drawer(
|
||
|
|
backgroundColor: Colors.white,
|
||
|
|
child: ListView(
|
||
|
|
padding: const EdgeInsets.all(0),
|
||
|
|
children: [
|
||
|
|
UserAccountsDrawerHeader(
|
||
|
|
accountName: const Text("景旺电子"),
|
||
|
|
accountEmail: const Text("欢迎使用WMS移动终端"),
|
||
|
|
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: ColorCommon.colorScheme
|
||
|
|
)
|
||
|
|
),
|
||
|
|
ListTile(title: const Text("空载具入库"), trailing: const Icon(Icons.grain), onTap: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(builder: (context) => const StockInEmpty()),
|
||
|
|
);
|
||
|
|
}),
|
||
|
|
ListTile(title: const Text("码盘入库"), trailing: const Icon(Icons.add_box), onTap: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(builder: (context) => const StockInWheel()),
|
||
|
|
);
|
||
|
|
}),
|
||
|
|
ListTile(title: const Text("出库拣货"), trailing: const Icon(Icons.back_hand), onTap: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(builder: (context) => const Pick()),
|
||
|
|
);
|
||
|
|
}),
|
||
|
|
ListTile(title: const Text("库存盘点"), trailing: const Icon(Icons.checklist), onTap: () {
|
||
|
|
}),
|
||
|
|
ListTile(title: const Text("库存查询"), trailing: const Icon(Icons.list_alt), onTap: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(builder: (context) => const Stock()),
|
||
|
|
);
|
||
|
|
})
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
body: Padding(padding: const EdgeInsets.only(
|
||
|
|
top: 10,
|
||
|
|
left: 20,
|
||
|
|
right: 20
|
||
|
|
), child: ListView(
|
||
|
|
children: [
|
||
|
|
const Text("库存占用情况:"),
|
||
|
|
Row(
|
||
|
|
children: [
|
||
|
|
Column(
|
||
|
|
children: [
|
||
|
|
BrnDoughnutChart(
|
||
|
|
padding: const EdgeInsets.all(50),
|
||
|
|
width: 150,
|
||
|
|
height: 150,
|
||
|
|
data: stockChartsData,
|
||
|
|
showTitleWhenSelected: false
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
Column(
|
||
|
|
children: [
|
||
|
|
DoughnutChartLegend(data: stockChartsData, legendStyle: BrnDoughnutChartLegendStyle.list),
|
||
|
|
],
|
||
|
|
)
|
||
|
|
],
|
||
|
|
)
|
||
|
|
],
|
||
|
|
))
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
void initState() {
|
||
|
|
super.initState();
|
||
|
|
setState(() {
|
||
|
|
stockChartsData = [
|
||
|
|
BrnDoughnutDataItem(
|
||
|
|
value: 40,
|
||
|
|
title: "空闲", color: Colors.green
|
||
|
|
),
|
||
|
|
BrnDoughnutDataItem(
|
||
|
|
value: 60,
|
||
|
|
title: "占用", color: Colors.orange
|
||
|
|
)
|
||
|
|
];
|
||
|
|
});
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|