2020-05-29 15:54:26 +06:30
|
|
|
import 'package:fcs/model/pickup_model.dart';
|
2020-09-04 15:30:10 +06:30
|
|
|
import 'package:fcs/fcs/common/pages/util.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
import 'package:fcs/vo/pickup.dart';
|
|
|
|
|
import 'package:fcs/widget/fcs_text_field.dart';
|
2020-06-02 14:52:31 +06:30
|
|
|
import 'package:fcs/widget/local_text.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:fcs/widget/progress.dart';
|
|
|
|
|
|
2020-09-04 15:30:10 +06:30
|
|
|
import '../fcs/common/helpers/theme.dart';
|
2020-05-29 15:54:26 +06:30
|
|
|
|
|
|
|
|
class FCSProfilePage extends StatefulWidget {
|
|
|
|
|
final PickUp pickUp;
|
|
|
|
|
FCSProfilePage({this.pickUp});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_FCSProfilePageState createState() => _FCSProfilePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _FCSProfilePageState extends State<FCSProfilePage> {
|
|
|
|
|
TextEditingController _usaAddressEditingController =
|
|
|
|
|
new TextEditingController();
|
|
|
|
|
TextEditingController _mmAddressEditingController =
|
|
|
|
|
new TextEditingController();
|
|
|
|
|
TextEditingController _contactEditingController = new TextEditingController();
|
|
|
|
|
TextEditingController _mmContactEditingController =
|
|
|
|
|
new TextEditingController();
|
|
|
|
|
TextEditingController _mailEditingController = new TextEditingController();
|
|
|
|
|
TextEditingController _fbLinkEditingController = new TextEditingController();
|
|
|
|
|
|
|
|
|
|
PickUp _pickUp;
|
|
|
|
|
bool _isLoading = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
var pickupModel = Provider.of<PickUpModel>(context, listen: false);
|
|
|
|
|
_usaAddressEditingController.text = pickupModel.profile.usaAddress;
|
|
|
|
|
_mmAddressEditingController.text = pickupModel.profile.mmAddress;
|
|
|
|
|
_contactEditingController.text = pickupModel.profile.usaContactNumber;
|
|
|
|
|
_mmContactEditingController.text = pickupModel.profile.mmContactNumber;
|
|
|
|
|
_mailEditingController.text = pickupModel.profile.mail;
|
|
|
|
|
_fbLinkEditingController.text = pickupModel.profile.facebook;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2020-06-02 14:52:31 +06:30
|
|
|
final usaAddress = fcsInput('USA Delivery Address', Icons.location_on,
|
|
|
|
|
controller: _usaAddressEditingController);
|
|
|
|
|
final mmAddress = fcsInput('Yangon, Myanmar Office', Icons.location_on,
|
|
|
|
|
controller: _mmAddressEditingController);
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-06-02 14:52:31 +06:30
|
|
|
final contactNumber = fcsInput('USA contact number', Icons.phone,
|
|
|
|
|
controller: _contactEditingController);
|
|
|
|
|
final mmContactNumber = fcsInput('Myanmar contact number', Icons.phone,
|
|
|
|
|
controller: _mmContactEditingController);
|
2020-05-29 15:54:26 +06:30
|
|
|
|
2020-06-02 14:52:31 +06:30
|
|
|
final mailBox = fcsInput('Email Address', Icons.mail,
|
|
|
|
|
controller: _mailEditingController);
|
|
|
|
|
final fbLinkBox = fcsInput('Facebook Link', FontAwesomeIcons.facebook,
|
|
|
|
|
controller: _fbLinkEditingController);
|
2020-05-29 15:54:26 +06:30
|
|
|
|
|
|
|
|
return LocalProgress(
|
|
|
|
|
inAsyncCall: _isLoading,
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
appBar: AppBar(
|
2020-06-01 14:42:42 +06:30
|
|
|
centerTitle: true,
|
2020-06-02 14:52:31 +06:30
|
|
|
leading: new IconButton(
|
|
|
|
|
icon: new Icon(Icons.close),
|
|
|
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
|
|
|
),
|
2020-05-29 15:54:26 +06:30
|
|
|
backgroundColor: primaryColor,
|
2020-06-02 14:52:31 +06:30
|
|
|
title: LocalText(
|
|
|
|
|
context,
|
|
|
|
|
'fcs.profile',
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
),
|
2020-05-29 15:54:26 +06:30
|
|
|
),
|
|
|
|
|
body: Card(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Padding(
|
2020-06-01 14:42:42 +06:30
|
|
|
padding: const EdgeInsets.only(left: 20.0),
|
2020-05-29 15:54:26 +06:30
|
|
|
child: ListView(children: <Widget>[
|
|
|
|
|
usaAddress,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
mmAddress,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
contactNumber,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
mmContactNumber,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
mailBox,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
fbLinkBox,
|
2020-06-01 14:42:42 +06:30
|
|
|
SizedBox(height: 10),
|
2020-05-29 15:54:26 +06:30
|
|
|
]),
|
|
|
|
|
)),
|
|
|
|
|
widget.pickUp == null
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 250,
|
|
|
|
|
child: FlatButton(
|
|
|
|
|
child: Text('Update'),
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)))
|
|
|
|
|
: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 250,
|
|
|
|
|
child: FlatButton(
|
|
|
|
|
shape: new RoundedRectangleBorder(
|
|
|
|
|
borderRadius:
|
|
|
|
|
new BorderRadius.circular(10)),
|
|
|
|
|
child: Text('Pickuped'),
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
))),
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 250,
|
|
|
|
|
child: FlatButton(
|
|
|
|
|
shape: new RoundedRectangleBorder(
|
|
|
|
|
borderRadius:
|
|
|
|
|
new BorderRadius.circular(10)),
|
|
|
|
|
child: Text('Cancel'),
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)))
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|