add packages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:country_code_picker/country_code.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/pages/shipment_list.dart';
|
||||
import 'package:fcs/pages_fcs/package_list.dart';
|
||||
@@ -94,30 +95,15 @@ class _HomePageState extends State<HomePage> {
|
||||
final numberFormatter = new NumberFormat("#,###");
|
||||
|
||||
String pin;
|
||||
List<bool> isSelected = [true, false];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
login = Provider.of<MainModel>(context).isLogin();
|
||||
final packagesBtn = _buildBtn2("package.name",
|
||||
icon: Octicons.package,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => PackageList())));
|
||||
|
||||
final announcementBtn = _buildBtn2("announcement.title",
|
||||
icon: Icons.announcement,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => AnnouncementList())));
|
||||
|
||||
final reportBtn = _buildBtn2("report.title",
|
||||
icon: FontAwesomeIcons.paperPlane,
|
||||
imgIcon: Image.asset(
|
||||
"assets/report.png",
|
||||
width: 50,
|
||||
height: 50,
|
||||
// color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ReportList())));
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(PackageList())));
|
||||
|
||||
final pickUpBtn = _buildBtn2("pickup",
|
||||
icon: MaterialCommunityIcons.directions,
|
||||
@@ -130,9 +116,10 @@ class _HomePageState extends State<HomePage> {
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
||||
|
||||
final fcsProfileBtn = _buildBtn2("profile.title",
|
||||
icon: Icons.account_circle,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => FCSProfilePage())));
|
||||
// imgIcon: Image.asset("assets/logo_btn.png", height: 25,color:Colors.white),
|
||||
icon: MaterialCommunityIcons.home_city,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(FCSProfilePage())));
|
||||
|
||||
final shipmentBtn = _buildBtn2("shipment.title",
|
||||
icon: Ionicons.ios_airplane,
|
||||
@@ -142,19 +129,8 @@ class _HomePageState extends State<HomePage> {
|
||||
height: 50,
|
||||
color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ShipmentList())));
|
||||
|
||||
final termBtn = _buildBtn2("term.title",
|
||||
icon: FontAwesomeIcons.fileContract,
|
||||
imgIcon: Image.asset(
|
||||
"assets/term.png",
|
||||
width: 40,
|
||||
height: 30,
|
||||
color: primaryColor,
|
||||
), btnCallback: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => Term()));
|
||||
});
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentList())));
|
||||
|
||||
final buyingBtn = _buildBtn2("buy_online",
|
||||
icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
|
||||
@@ -163,8 +139,8 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
});
|
||||
|
||||
final notiBtn = _buildBtn2("notifications.title", icon: Icons.notifications,
|
||||
btnCallback: () {
|
||||
final notiBtn =
|
||||
_buildBtn2("message.btn", icon: Icons.message, btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
BottomUpPageRoute(NotificationList()),
|
||||
@@ -172,17 +148,19 @@ class _HomePageState extends State<HomePage> {
|
||||
});
|
||||
|
||||
final staffBtn = _buildBtn2("staff.title",
|
||||
icon: SimpleLineIcons.people,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => StaffList())));
|
||||
icon: MaterialCommunityIcons.worker,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
|
||||
final _bankAccountsBtn = _buildBtn2("banks.title",
|
||||
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => BankAccounts()),
|
||||
);
|
||||
});
|
||||
final customersBtn = _buildBtn2("customers.btn",
|
||||
icon: Feather.users,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
|
||||
final invoicesBtn = _buildBtn2("invoices.btn",
|
||||
icon: FontAwesomeIcons.fileInvoice,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
|
||||
List<Widget> widgets = [];
|
||||
widgets.add(buyingBtn);
|
||||
@@ -190,13 +168,11 @@ class _HomePageState extends State<HomePage> {
|
||||
widgets.add(shipmentBtn);
|
||||
widgets.add(notiBtn);
|
||||
widgets.add(staffBtn);
|
||||
widgets.add(announcementBtn);
|
||||
widgets.add(fcsProfileBtn);
|
||||
widgets.add(shipmentCostBtn);
|
||||
widgets.add(reportBtn);
|
||||
widgets.add(termBtn);
|
||||
widgets.add(_bankAccountsBtn);
|
||||
widgets.add(packagesBtn);
|
||||
widgets.add(customersBtn);
|
||||
widgets.add(invoicesBtn);
|
||||
|
||||
return OfflineRedirect(
|
||||
child: FlavorBanner(
|
||||
@@ -210,16 +186,23 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
actions: login
|
||||
? <Widget>[
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => Contact()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.notifications),
|
||||
ToggleButtons(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'icons/flags/png/gb.png',
|
||||
package: 'country_icons',
|
||||
fit: BoxFit.fitWidth,
|
||||
width: 25,
|
||||
),
|
||||
Image.asset(
|
||||
'icons/flags/png/mm.png',
|
||||
package: 'country_icons',
|
||||
fit: BoxFit.fitWidth,
|
||||
width: 25,
|
||||
)
|
||||
],
|
||||
onPressed: _langChange,
|
||||
isSelected: isSelected,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
@@ -234,6 +217,24 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
]
|
||||
: <Widget>[
|
||||
ToggleButtons(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'icons/flags/png/gb.png',
|
||||
package: 'country_icons',
|
||||
fit: BoxFit.fitWidth,
|
||||
width: 25,
|
||||
),
|
||||
Image.asset(
|
||||
'icons/flags/png/mm.png',
|
||||
package: 'country_icons',
|
||||
fit: BoxFit.fitWidth,
|
||||
width: 25,
|
||||
)
|
||||
],
|
||||
onPressed: _langChange,
|
||||
isSelected: isSelected,
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
@@ -244,21 +245,10 @@ class _HomePageState extends State<HomePage> {
|
||||
},
|
||||
// iconSize: 30,
|
||||
child: Text(
|
||||
"Sign in",
|
||||
"Sign In",
|
||||
style: siginButtonStyle,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SigninPage()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(MaterialCommunityIcons.login),
|
||||
)
|
||||
),
|
||||
]),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -321,6 +311,15 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
}
|
||||
|
||||
_langChange(index) {
|
||||
setState(() {
|
||||
isSelected.asMap().forEach((i, e) {
|
||||
isSelected[i] = false;
|
||||
});
|
||||
isSelected[index] = !isSelected[index];
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildTile(Widget child, {Function() onTap}) {
|
||||
return Material(
|
||||
elevation: 0,
|
||||
@@ -403,7 +402,9 @@ class _HomePageState extends State<HomePage> {
|
||||
child: SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: Icon(icon, color: Colors.white, size: 30)),
|
||||
child: icon == null
|
||||
? Container(width: 10, height: 10, child: imgIcon)
|
||||
: Icon(icon, color: Colors.white, size: 30)),
|
||||
onTap: btnCallback,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user