add pickups
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -68,6 +71,8 @@ typedef BtnCallback();
|
||||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
final log = Logger('_HomePageState');
|
||||
bool login = false;
|
||||
bool customer = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -91,6 +96,7 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
login=Provider.of<MainModel>(context).isLogin();
|
||||
final helpBtn = _buildBtn2("manual.title",
|
||||
icon: FontAwesomeIcons.readme,
|
||||
imgIcon: Image.asset(
|
||||
@@ -100,7 +106,7 @@ class _HomePageState extends State<HomePage> {
|
||||
color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ManualPage()))
|
||||
.push(BottomUpPageRoute(ManualPage()))
|
||||
// btnCallback: () => Navigator.of(context)
|
||||
// .push(MaterialPageRoute(builder: (_) => TestList()))
|
||||
);
|
||||
@@ -130,15 +136,15 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ReportList())));
|
||||
|
||||
final pickUpBtn = _buildBtn2("pickup.title",
|
||||
icon: FontAwesomeIcons.directions,
|
||||
final pickUpBtn = _buildBtn2("pickup",
|
||||
icon: MaterialCommunityIcons.directions,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => PickUpList())));
|
||||
.push(BottomUpPageRoute(PickUpList())));
|
||||
|
||||
final shipmentCostBtn = _buildBtn2("pickup.title",
|
||||
icon: FontAwesomeIcons.ship,
|
||||
final shipmentCostBtn = _buildBtn2("rate",
|
||||
icon: FontAwesomeIcons.calculator,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ShipmentRates())));
|
||||
.push(BottomUpPageRoute(ShipmentRates())));
|
||||
|
||||
final fcsProfileBtn = _buildBtn2("profile.title",
|
||||
icon: Icons.account_circle,
|
||||
@@ -173,7 +179,8 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => DOList())));
|
||||
|
||||
final shipmentBtn = _buildBtn("shipment.title",
|
||||
final shipmentBtn = _buildBtn2("shipment.title",
|
||||
icon: Ionicons.ios_airplane,
|
||||
imgIcon: Image.asset(
|
||||
"assets/truck.png",
|
||||
width: 50,
|
||||
@@ -203,7 +210,6 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => PDList())));
|
||||
|
||||
|
||||
final termBtn = _buildBtn2("term.title",
|
||||
icon: FontAwesomeIcons.fileContract,
|
||||
imgIcon: Image.asset(
|
||||
@@ -223,16 +229,13 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
});
|
||||
|
||||
final signinBtn = _buildBtn2("login",
|
||||
icon: FontAwesomeIcons.signInAlt,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => SigninPage())));
|
||||
|
||||
final buyingBtn =
|
||||
_buildBtn2("buy_online", icon: Icons.person, btnCallback: () {
|
||||
final buyingBtn = _buildBtn2("buy_online",
|
||||
icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
|
||||
BottomUpPageRoute(BuyingOnlinePage())
|
||||
// MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -240,21 +243,15 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => NotificationList()),
|
||||
BottomUpPageRoute(NotificationList()),
|
||||
);
|
||||
});
|
||||
|
||||
final staffBtn = _buildBtn("staff.title",
|
||||
imgIcon: Image.asset(
|
||||
"assets/employee.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
final staffBtn = _buildBtn2("staff.title",
|
||||
icon: SimpleLineIcons.people,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => StaffList())));
|
||||
|
||||
|
||||
final _bankAccountsBtn = _buildBtn2("banks.title",
|
||||
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
|
||||
Navigator.push(
|
||||
@@ -263,15 +260,14 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
});
|
||||
|
||||
List<Widget> widgets = [helpBtn];
|
||||
widgets.add(signinBtn);
|
||||
List<Widget> widgets = [];
|
||||
widgets.add(buyingBtn);
|
||||
widgets.add(pickUpBtn);
|
||||
widgets.add(shipmentBtn);
|
||||
widgets.add(notiBtn);
|
||||
widgets.add(staffBtn);
|
||||
// widgets.add(_bankAccountsBtn);
|
||||
widgets.add(announcementBtn);
|
||||
widgets.add(pickUpBtn);
|
||||
widgets.add(fcsProfileBtn);
|
||||
widgets.add(shipmentCostBtn);
|
||||
widgets.add(reportBtn);
|
||||
@@ -391,28 +387,44 @@ class _HomePageState extends State<HomePage> {
|
||||
child: Image.asset("assets/logo.jpg", height: 40),
|
||||
borderRadius: new BorderRadius.circular(35.0),
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => Contact()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.notifications),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => Profile()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.tune),
|
||||
),
|
||||
]),
|
||||
actions: login
|
||||
? <Widget>[
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => Contact()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.notifications),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => Profile()),
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.tune),
|
||||
),
|
||||
]
|
||||
: [
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SigninPage()),
|
||||
);
|
||||
},
|
||||
// iconSize: 30,
|
||||
child: Text("Sign in",style: siginButtonStyle,),
|
||||
),
|
||||
]),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient:
|
||||
@@ -425,17 +437,17 @@ class _HomePageState extends State<HomePage> {
|
||||
// ],
|
||||
// stops: [0.4, 1.0],
|
||||
// )
|
||||
LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment
|
||||
.bottomCenter, // 10% of the width, so there are ten blinds.
|
||||
colors: [
|
||||
Color(0xd0272262),
|
||||
Color(0xfa272262),
|
||||
// Color(0xa0ff4400),
|
||||
// secondaryColor,
|
||||
], // whitish to gray
|
||||
),
|
||||
LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment
|
||||
.bottomCenter, // 10% of the width, so there are ten blinds.
|
||||
colors: [
|
||||
Color(0xd0272262),
|
||||
Color(0xfa272262),
|
||||
// Color(0xa0ff4400),
|
||||
// secondaryColor,
|
||||
], // whitish to gray
|
||||
),
|
||||
// SweepGradient(
|
||||
// center: FractionalOffset.centerLeft,
|
||||
// startAngle: 0.0,
|
||||
@@ -450,12 +462,26 @@ class _HomePageState extends State<HomePage> {
|
||||
// stops: const <double>[0.0, 0.25, 0.5, 0.75, 1.0],
|
||||
// ),
|
||||
),
|
||||
child: ListView(children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
])
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: widgets,
|
||||
),
|
||||
]),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
_buildSmallButton(
|
||||
"Policies", FontAwesomeIcons.fileContract),
|
||||
_buildSmallButton("Support", SimpleLineIcons.support),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
// child: StaggeredGridView.count(
|
||||
// crossAxisCount: 3,
|
||||
// crossAxisSpacing: 12.0,
|
||||
@@ -580,33 +606,61 @@ class _HomePageState extends State<HomePage> {
|
||||
child: InkWell(
|
||||
splashColor: primaryColor, // inkwell color
|
||||
child: SizedBox(
|
||||
width: 60, height: 60, child:Icon(icon,color: Colors.white, size: 30)
|
||||
),
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: Icon(icon, color: Colors.white, size: 30)),
|
||||
onTap: btnCallback,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
FittedBox(
|
||||
fit:BoxFit.fitWidth,
|
||||
child: Text(AppTranslations.of(context).text(title),
|
||||
style:
|
||||
languageModel.isEng
|
||||
?
|
||||
TextStyle(
|
||||
fit: BoxFit.fitWidth,
|
||||
child: Text(AppTranslations.of(context).text(title),
|
||||
style: languageModel.isEng
|
||||
? TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14.0,
|
||||
fontFamily: "Roboto")
|
||||
: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12.0,
|
||||
fontFamily: "MyanmarUnicode")
|
||||
),
|
||||
: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12.0,
|
||||
fontFamily: "MyanmarUnicode")),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSmallButton(String text, IconData iconData) {
|
||||
return InkWell(
|
||||
onTap: () => {},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(18.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(iconData, color: Colors.white70),
|
||||
color: Colors.white70,
|
||||
onPressed: null),
|
||||
// RaisedButton(onPressed: ()=>{},child: Row(
|
||||
// children: <Widget>[
|
||||
// IconButton(
|
||||
// icon: Icon(iconData, ),
|
||||
// onPressed: null),
|
||||
// Text(text),
|
||||
// ],
|
||||
// ),color: Colors.transparent,
|
||||
// focusColor: Colors.transparent,),
|
||||
Text(
|
||||
text,
|
||||
style: subMenuStyle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user