207 lines
5.9 KiB
Dart
207 lines
5.9 KiB
Dart
|
|
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';
|
||
|
|
|
||
|
|
import '../theme/theme.dart';
|
||
|
|
import '../widget/label_widgets.dart';
|
||
|
|
import '../widget/local_text.dart';
|
||
|
|
import 'manual/manual_page.dart';
|
||
|
|
|
||
|
|
class BuyingOnlinePage extends StatefulWidget {
|
||
|
|
@override
|
||
|
|
_BuyingOnlinePagetate createState() => _BuyingOnlinePagetate();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
|
||
|
|
bool _isLoading = false;
|
||
|
|
|
||
|
|
@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(
|
||
|
|
padding: EdgeInsets.only(top: 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(
|
||
|
|
color: primaryColor,
|
||
|
|
shape: BoxShape.rectangle,
|
||
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||
|
|
child: ButtonTheme(
|
||
|
|
minWidth: 900.0,
|
||
|
|
height: 100.0,
|
||
|
|
child: FlatButton(
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(
|
||
|
|
builder: (context) => ManualPage(
|
||
|
|
marketplace: 'Amazon',
|
||
|
|
)));
|
||
|
|
},
|
||
|
|
child: LocalText(
|
||
|
|
context,
|
||
|
|
'buy.amazon',
|
||
|
|
color: Colors.white,
|
||
|
|
fontSize: 16,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
|
||
|
|
final neweggbutton = Container(
|
||
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||
|
|
child: Container(
|
||
|
|
height: 45.0,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: primaryColor,
|
||
|
|
shape: BoxShape.rectangle,
|
||
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||
|
|
child: ButtonTheme(
|
||
|
|
minWidth: 900.0,
|
||
|
|
height: 100.0,
|
||
|
|
child: FlatButton(
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(
|
||
|
|
builder: (context) => ManualPage(
|
||
|
|
marketplace: 'Newegg',
|
||
|
|
)));
|
||
|
|
},
|
||
|
|
child: LocalText(
|
||
|
|
context,
|
||
|
|
'buy.newegg',
|
||
|
|
color: Colors.white,
|
||
|
|
fontSize: 16,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
|
||
|
|
final macybutton = Container(
|
||
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||
|
|
child: Container(
|
||
|
|
height: 45.0,
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: primaryColor,
|
||
|
|
shape: BoxShape.rectangle,
|
||
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||
|
|
child: ButtonTheme(
|
||
|
|
minWidth: 900.0,
|
||
|
|
height: 100.0,
|
||
|
|
child: FlatButton(
|
||
|
|
onPressed: () {
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(
|
||
|
|
builder: (context) => ManualPage(
|
||
|
|
marketplace: "Macy",
|
||
|
|
)));
|
||
|
|
},
|
||
|
|
child: LocalText(
|
||
|
|
context,
|
||
|
|
'buy.macy',
|
||
|
|
color: Colors.white,
|
||
|
|
fontSize: 16,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
|
||
|
|
return LocalProgress(
|
||
|
|
inAsyncCall: _isLoading,
|
||
|
|
child: Scaffold(
|
||
|
|
appBar: AppBar(
|
||
|
|
title: LocalText(
|
||
|
|
context,
|
||
|
|
"buy_online",
|
||
|
|
fontSize: 20,
|
||
|
|
color: Colors.white,
|
||
|
|
),
|
||
|
|
backgroundColor: primaryColor,
|
||
|
|
),
|
||
|
|
body: ListView(
|
||
|
|
shrinkWrap: true,
|
||
|
|
padding: EdgeInsets.only(top: 10, left: 10, right: 10),
|
||
|
|
children: <Widget>[
|
||
|
|
Center(
|
||
|
|
child: Text(
|
||
|
|
mainModel.customer.name,
|
||
|
|
style: TextStyle(
|
||
|
|
color: secondaryColor,
|
||
|
|
fontSize: 16,
|
||
|
|
fontWeight: FontWeight.bold),
|
||
|
|
)),
|
||
|
|
Container(
|
||
|
|
padding: EdgeInsets.only(top: 15),
|
||
|
|
child: Row(
|
||
|
|
children: <Widget>[
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.only(right: 8.0),
|
||
|
|
child: phoneBox,
|
||
|
|
),
|
||
|
|
InkWell(
|
||
|
|
onTap: () {},
|
||
|
|
child: Icon(
|
||
|
|
Icons.open_in_new,
|
||
|
|
color: Colors.grey,
|
||
|
|
size: 15,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
fcsIdBox,
|
||
|
|
shippingAddressBox,
|
||
|
|
deliveryAddressBox,
|
||
|
|
instructionBox,
|
||
|
|
amazonbutton,
|
||
|
|
neweggbutton,
|
||
|
|
macybutton,
|
||
|
|
SizedBox(height: 10)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|