Files
fcs/lib/pages/buying_online.dart

217 lines
6.6 KiB
Dart
Raw Normal View History

2020-09-04 15:30:10 +06:30
import 'package:fcs/fcs/common/pages/util.dart';
2020-05-31 15:00:11 +06:30
import 'package:fcs/vo/manual.dart';
2020-06-02 14:56:51 +06:30
import 'package:fcs/widget/bottom_up_page_route.dart';
2020-05-29 16:14:17 +06:30
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/progress.dart';
2020-09-04 15:30:10 +06:30
import '../fcs/common/helpers/theme.dart';
2020-05-29 16:14:17 +06:30
import '../widget/label_widgets.dart';
import '../widget/local_text.dart';
2020-05-31 15:00:11 +06:30
import 'instruction.dart';
2020-05-29 16:14:17 +06:30
import 'manual/manual_page.dart';
class BuyingOnlinePage extends StatefulWidget {
@override
_BuyingOnlinePagetate createState() => _BuyingOnlinePagetate();
}
2020-06-26 16:17:40 +06:30
class _BuyingOnlinePagetate extends State<BuyingOnlinePage>
with SingleTickerProviderStateMixin {
2020-05-29 16:14:17 +06:30
bool _isLoading = false;
2020-06-24 16:06:40 +06:30
List<String> images = [
'assets/Fullname.jpeg',
'assets/FirstName&LastName.jpeg'
];
2020-06-26 16:17:40 +06:30
TabController _tabController;
@override
void initState() {
_tabController = TabController(vsync: this, length: 2);
super.initState();
}
2020-05-29 16:14:17 +06:30
@override
Widget build(BuildContext context) {
MainModel mainModel = Provider.of<MainModel>(context);
final phoneBox =
labeledText(context, mainModel.customer.phoneNumber, "user.phone");
final fcsIdBox = Container(
padding: EdgeInsets.only(top: 15),
child: labeledText(context, mainModel.customer.fcsID, "user.fcs_id"));
final shippingAddressBox = Container(
padding: EdgeInsets.only(top: 15),
child: labeledText(context, mainModel.customer.shippingAddress,
"user.shipping_address"));
final deliveryAddressBox = Container(
padding: EdgeInsets.only(top: 15),
child: labeledText(context, mainModel.customer.deliveryAddress,
"user.deliveryAddress"));
final instructionBox = Container(
2020-05-31 15:00:11 +06:30
padding: EdgeInsets.only(left: 10, top: 30, bottom: 10),
2020-05-29 16:14:17 +06:30
child: Center(
child: Wrap(
children: <Widget>[
LocalText(
context,
'user.buying_instruction',
color: labelColor,
fontSize: 15,
)
],
),
),
);
final amazonbutton = Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Container(
height: 45.0,
decoration: BoxDecoration(
2020-05-31 15:00:11 +06:30
color: primaryColor,
shape: BoxShape.rectangle,
// borderRadius: BorderRadius.all(Radius.circular(10.0))
),
2020-05-29 16:14:17 +06:30
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
child: FlatButton(
onPressed: () {
2020-06-02 14:56:51 +06:30
Navigator.of(context).push(BottomUpPageRoute(InstructionPage(
name: 'Amazon',
image: "assets/amazon_ins.png",
)));
2020-05-29 16:14:17 +06:30
},
child: LocalText(
context,
'buy.amazon',
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
),
);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
2020-05-31 15:00:11 +06:30
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
2020-05-29 16:14:17 +06:30
title: LocalText(
context,
2020-05-31 15:00:11 +06:30
"buy_online.title",
2020-05-29 16:14:17 +06:30
fontSize: 20,
color: Colors.white,
),
backgroundColor: primaryColor,
),
body: ListView(
shrinkWrap: true,
padding: EdgeInsets.only(top: 10, left: 10, right: 10),
children: <Widget>[
2020-05-31 15:00:11 +06:30
nameWidget(mainModel.customer.name),
phoneWidget(context, mainModel.customer.phoneNumber),
Row(
children: <Widget>[
SizedBox(
width: 25,
height: 25,
child: FittedBox(
child: Image.asset("assets/logo.jpg"),
fit: BoxFit.fill,
),
),
fcsIdBox,
Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
2020-05-29 16:14:17 +06:30
),
2020-05-31 15:00:11 +06:30
)
],
),
Row(
children: <Widget>[
Icon(Icons.location_on),
shippingAddressBox,
Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
2020-05-29 16:14:17 +06:30
),
2020-05-31 15:00:11 +06:30
)
],
2020-05-29 16:14:17 +06:30
),
2020-06-26 16:17:40 +06:30
2020-05-31 15:00:11 +06:30
// deliveryAddressBox,
2020-05-29 16:14:17 +06:30
instructionBox,
2020-06-26 16:17:40 +06:30
new Container(
decoration: new BoxDecoration(color: Colors.white),
child: new TabBar(
// indicatorColor: primaryColor,
labelColor: primaryColor,
labelStyle: TextStyle(fontWeight: FontWeight.bold),
unselectedLabelColor: Colors.grey,
controller: _tabController,
tabs: [
new Tab(
2020-06-29 16:15:25 +06:30
text: 'With FULL NAME',
2020-06-26 16:17:40 +06:30
),
new Tab(
2020-06-29 16:15:25 +06:30
text: 'With FIRST NAME&\nLAST NAME',
2020-06-26 16:17:40 +06:30
),
],
),
),
new Container(
2020-06-29 16:15:25 +06:30
padding: EdgeInsets.only(top: 10),
2020-06-24 16:06:40 +06:30
height: 500,
width: 500,
2020-06-26 16:17:40 +06:30
child: new TabBarView(
controller: _tabController,
children: <Widget>[
Container(
child:
Image.asset('assets/Fullname.png', fit: BoxFit.contain),
),
Container(
child: Image.asset('assets/FirstName&LastName.png',
fit: BoxFit.contain),
),
],
),
2020-06-24 16:06:40 +06:30
),
2020-06-26 16:17:40 +06:30
// Container(
// height: 500,
// width: 500,
// child: ListView.builder(
// itemCount: images.length,
// scrollDirection: Axis.horizontal,
// itemBuilder: (context, index) {
// return Container(
// padding: EdgeInsets.only(left: 0, right: 5, top: 5),
// child: Image.asset(images[index], fit: BoxFit.contain),
// );
// }),
// ),
2020-06-24 16:06:40 +06:30
2020-05-29 16:14:17 +06:30
SizedBox(height: 10)
],
),
),
);
}
}