2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/domain/entities/role.dart';
|
2020-10-08 11:38:05 +06:30
|
|
|
import 'package:fcs/domain/vo/delivery_address.dart';
|
2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/localization/app_translations.dart';
|
|
|
|
|
import 'package:fcs/localization/transalation.dart';
|
2020-10-08 15:54:43 +06:30
|
|
|
import 'package:fcs/pages/delivery_address/delivery_address_list.dart';
|
|
|
|
|
import 'package:fcs/pages/delivery_address/model/delivery_address_model.dart';
|
2020-10-07 02:33:06 +06:30
|
|
|
import 'package:fcs/pages/main/model/language_model.dart';
|
|
|
|
|
import 'package:fcs/pages/main/model/main_model.dart';
|
|
|
|
|
import 'package:fcs/pages/profile/profile_edit.dart';
|
|
|
|
|
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
|
|
|
|
import 'package:fcs/pages/widgets/display_text.dart';
|
|
|
|
|
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
|
|
|
|
import 'package:fcs/pages/widgets/local_text.dart';
|
|
|
|
|
import 'package:fcs/pages/widgets/progress.dart';
|
|
|
|
|
import 'package:fcs/pages/main/util.dart';
|
2020-09-12 03:34:52 +06:30
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-08-30 21:26:37 +06:30
|
|
|
import 'package:flutter/material.dart';
|
2020-09-13 21:49:39 +06:30
|
|
|
import 'package:flutter/services.dart';
|
2020-08-30 21:26:37 +06:30
|
|
|
import 'package:provider/provider.dart';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
2020-09-13 21:49:39 +06:30
|
|
|
import '../../helpers/theme.dart';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
|
|
|
|
typedef void ProfileCallback();
|
|
|
|
|
|
|
|
|
|
class Profile extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_ProfileState createState() => _ProfileState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ProfileState extends State<Profile> {
|
2020-09-13 21:49:39 +06:30
|
|
|
GlobalKey key = GlobalKey();
|
2020-05-29 07:45:27 +06:30
|
|
|
bool _isLoading = false;
|
|
|
|
|
String selectedLanguage;
|
|
|
|
|
TextEditingController bizNameController = new TextEditingController();
|
|
|
|
|
|
2020-10-08 15:54:43 +06:30
|
|
|
DeliveryAddress _deliveryAddress = new DeliveryAddress();
|
|
|
|
|
|
2020-05-29 07:45:27 +06:30
|
|
|
static final List<String> languagesList = Translation().supportedLanguages;
|
|
|
|
|
static final List<String> languageCodesList =
|
|
|
|
|
Translation().supportedLanguagesCodes;
|
|
|
|
|
|
|
|
|
|
final Map<dynamic, dynamic> languagesMap = {
|
|
|
|
|
languagesList[0]: languageCodesList[0],
|
|
|
|
|
languagesList[1]: languageCodesList[1],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buildLanguage(LanguageModel languageModel) async {
|
|
|
|
|
var lan = await languageModel.load();
|
|
|
|
|
if (this.selectedLanguage != lan) {
|
|
|
|
|
setState(() {
|
|
|
|
|
this.selectedLanguage = lan;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-08 15:54:43 +06:30
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
var shipmentModel =
|
|
|
|
|
Provider.of<DeliveryAddressModel>(context, listen: false);
|
|
|
|
|
|
|
|
|
|
if (shipmentModel.deliveryAddresses.length != 0) {
|
|
|
|
|
_deliveryAddress = shipmentModel.deliveryAddresses[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-29 07:45:27 +06:30
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
MainModel mainModel = Provider.of<MainModel>(context);
|
2020-09-16 02:29:50 +06:30
|
|
|
if (mainModel.user == null) {
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
2020-09-13 21:49:39 +06:30
|
|
|
final namebox = DisplayText(
|
|
|
|
|
text: mainModel.user.name,
|
2020-10-08 11:38:05 +06:30
|
|
|
labelTextKey: "profile.name",
|
2020-09-13 21:49:39 +06:30
|
|
|
iconData: Icons.person,
|
|
|
|
|
);
|
2020-06-24 16:06:40 +06:30
|
|
|
|
2020-09-13 21:49:39 +06:30
|
|
|
final phonenumberbox = DisplayText(
|
|
|
|
|
text: mainModel.user.phone,
|
2020-10-08 11:38:05 +06:30
|
|
|
labelTextKey: "profile.phone",
|
2020-09-13 21:49:39 +06:30
|
|
|
iconData: Icons.phone,
|
|
|
|
|
);
|
|
|
|
|
final fcsIDBox = Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DisplayText(
|
|
|
|
|
text: mainModel.user.fcsID,
|
2020-10-08 11:38:05 +06:30
|
|
|
labelTextKey: "customer.fcs.id",
|
2020-09-18 04:04:21 +06:30
|
|
|
icon: FcsIDIcon(),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.content_copy, color: Colors.grey),
|
|
|
|
|
onPressed: () => _copy(
|
|
|
|
|
getLocalString(context, "customer.fcs.id"), mainModel.user.fcsID),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
2020-10-08 15:54:43 +06:30
|
|
|
|
2020-09-13 21:49:39 +06:30
|
|
|
final usaShippingAddressBox = Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DisplayText(
|
|
|
|
|
text: mainModel.setting.usaAddress,
|
2020-10-08 11:38:05 +06:30
|
|
|
labelTextKey: "profile.usa.shipping.address",
|
2020-09-13 21:49:39 +06:30
|
|
|
iconData: Icons.location_on,
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.content_copy, color: Colors.grey),
|
|
|
|
|
onPressed: () => _copy(
|
|
|
|
|
getLocalString(context, "profile.usa.shipping.address"),
|
|
|
|
|
mainModel.setting.usaAddress),
|
|
|
|
|
)
|
|
|
|
|
],
|
2020-05-29 07:45:27 +06:30
|
|
|
);
|
|
|
|
|
|
2020-09-13 21:49:39 +06:30
|
|
|
final logoutbutton = fcsButton(
|
|
|
|
|
context, getLocalString(context, "profile.logout"),
|
|
|
|
|
callack: _logout, iconData: Icons.exit_to_app);
|
|
|
|
|
|
2020-05-29 07:45:27 +06:30
|
|
|
return LocalProgress(
|
|
|
|
|
inAsyncCall: _isLoading,
|
|
|
|
|
child: Scaffold(
|
2020-09-13 21:49:39 +06:30
|
|
|
key: key,
|
2020-05-29 07:45:27 +06:30
|
|
|
appBar: AppBar(
|
2020-09-13 21:49:39 +06:30
|
|
|
centerTitle: true,
|
2020-09-12 03:34:52 +06:30
|
|
|
leading: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
CupertinoIcons.back,
|
2020-09-13 21:49:39 +06:30
|
|
|
size: 35,
|
|
|
|
|
color: primaryColor,
|
2020-09-12 03:34:52 +06:30
|
|
|
),
|
|
|
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
|
|
|
),
|
2020-09-18 04:04:21 +06:30
|
|
|
title: LocalText(
|
|
|
|
|
context,
|
|
|
|
|
"profile.title",
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
color: primaryColor,
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
shadowColor: Colors.transparent,
|
|
|
|
|
backgroundColor: Colors.white,
|
2020-06-24 16:06:40 +06:30
|
|
|
actions: <Widget>[],
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
body: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(child: namebox),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(right: 0),
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(Icons.edit, color: Colors.grey),
|
|
|
|
|
onPressed: _editName),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
2020-10-08 11:38:05 +06:30
|
|
|
mainModel.isCustomer()
|
|
|
|
|
? Container()
|
|
|
|
|
: getPrivilegeBox(context),
|
|
|
|
|
getShippingAddressList(context),
|
2020-09-13 21:49:39 +06:30
|
|
|
phonenumberbox,
|
|
|
|
|
fcsIDBox,
|
|
|
|
|
usaShippingAddressBox,
|
2020-09-20 08:06:14 +06:30
|
|
|
DisplayText(
|
|
|
|
|
text: mainModel.user.status,
|
2020-10-08 11:38:05 +06:30
|
|
|
labelTextKey: "customer.status",
|
2020-09-20 08:06:14 +06:30
|
|
|
iconData: Icons.add_alarm,
|
|
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
],
|
|
|
|
|
),
|
2020-06-25 16:19:23 +06:30
|
|
|
),
|
2020-09-13 21:49:39 +06:30
|
|
|
logoutbutton,
|
|
|
|
|
SizedBox(height: 25)
|
|
|
|
|
],
|
|
|
|
|
),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 16:06:40 +06:30
|
|
|
Widget getShippingAddressList(BuildContext context) {
|
2020-10-08 15:59:45 +06:30
|
|
|
var languageModel = Provider.of<LanguageModel>(context);
|
2020-10-08 15:54:43 +06:30
|
|
|
return ListTileTheme(
|
|
|
|
|
contentPadding: EdgeInsets.all(10),
|
|
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
getLocalString(context, 'delivery_addresses'),
|
2020-10-08 15:59:45 +06:30
|
|
|
style: languageModel.isEng
|
|
|
|
|
? TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
|
)
|
|
|
|
|
: TextStyle(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
|
fontFamily: "Myanmar3"),
|
2020-06-24 16:06:40 +06:30
|
|
|
),
|
2020-10-08 15:54:43 +06:30
|
|
|
children: <Widget>[
|
|
|
|
|
showDeliveryAddress(_deliveryAddress),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(top: 20, bottom: 15, right: 15),
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.bottomRight,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 130,
|
|
|
|
|
height: 40,
|
|
|
|
|
child: FloatingActionButton.extended(
|
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
DeliveryAddress deliveryAddress = await Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
BottomUpPageRoute(DeliveryAddressList(
|
|
|
|
|
deliveryAddress: _deliveryAddress)),
|
|
|
|
|
);
|
|
|
|
|
setState(() {
|
|
|
|
|
_deliveryAddress = deliveryAddress;
|
|
|
|
|
});
|
|
|
|
|
},
|
2020-10-08 16:03:29 +06:30
|
|
|
label: LocalText(context,
|
|
|
|
|
'delivery_address.change_address',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.white,
|
2020-10-08 15:54:43 +06:30
|
|
|
),
|
|
|
|
|
backgroundColor: primaryColor,
|
2020-06-24 16:06:40 +06:30
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2020-10-08 15:54:43 +06:30
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
2020-06-24 16:06:40 +06:30
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-08 15:54:43 +06:30
|
|
|
Widget showDeliveryAddress(DeliveryAddress deliveryAddress) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: new Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
new Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.fullName == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.fullName,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.addressLine1 == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.addressLine1,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.addressLine2 == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.addressLine2,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.city == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.city,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.state == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.state,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.country == null
|
|
|
|
|
? ''
|
|
|
|
|
: deliveryAddress.country,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8.0),
|
|
|
|
|
child: new Text(
|
|
|
|
|
deliveryAddress.phoneNumber == null
|
|
|
|
|
? ''
|
|
|
|
|
: "Phone:${deliveryAddress.phoneNumber}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 14.0, color: Colors.grey),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
2020-06-24 16:06:40 +06:30
|
|
|
}
|
|
|
|
|
|
2020-10-07 02:33:06 +06:30
|
|
|
List<Privilege> privileges = [
|
|
|
|
|
Privilege(name: 'Manage shipment'),
|
|
|
|
|
Privilege(name: 'Manage pickups'),
|
|
|
|
|
Privilege(name: 'Manage packages'),
|
|
|
|
|
Privilege(name: 'Manage deliveries'),
|
|
|
|
|
Privilege(name: 'Admin')
|
|
|
|
|
];
|
|
|
|
|
|
2020-05-29 07:45:27 +06:30
|
|
|
Widget getPrivilegeBox(BuildContext context) {
|
|
|
|
|
var languageModel = Provider.of<LanguageModel>(context);
|
2020-05-29 15:53:37 +06:30
|
|
|
|
2020-05-29 07:45:27 +06:30
|
|
|
return ListTileTheme(
|
2020-10-08 11:38:05 +06:30
|
|
|
contentPadding: EdgeInsets.all(10),
|
2020-05-29 07:45:27 +06:30
|
|
|
child: ExpansionTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
AppTranslations.of(context).text("profile.privilege"),
|
|
|
|
|
style: languageModel.isEng
|
|
|
|
|
? TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontStyle: FontStyle.normal,
|
|
|
|
|
)
|
|
|
|
|
: TextStyle(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontStyle: FontStyle.normal,
|
2020-10-07 02:33:06 +06:30
|
|
|
fontFamily: "Myanmar3"),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2020-10-07 02:33:06 +06:30
|
|
|
children: getRowPrivilegeWidget(privileges)),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> getRowPrivilegeWidget(List<Privilege> privileges) {
|
|
|
|
|
return privileges.map((p) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(p.name,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontStyle: FontStyle.normal)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 30,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
"- ${p.desc}",
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontStyle: FontStyle.normal),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
}
|
2020-09-13 21:49:39 +06:30
|
|
|
|
|
|
|
|
_copy(String title, String data) {
|
|
|
|
|
Clipboard.setData(ClipboardData(text: data));
|
|
|
|
|
_showToast(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _showToast(String title) {
|
|
|
|
|
final ScaffoldState scaffold = key.currentState;
|
|
|
|
|
scaffold.showSnackBar(
|
|
|
|
|
SnackBar(
|
|
|
|
|
content: Text('copied "$title" data to clipboard'),
|
|
|
|
|
backgroundColor: secondaryColor,
|
|
|
|
|
duration: Duration(seconds: 1),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_editName() {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.push<void>(CupertinoPageRoute(builder: (context) => ProfileEdit()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logout() {
|
|
|
|
|
showConfirmDialog(context, "profile.logout.confirm", () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = true;
|
|
|
|
|
});
|
2020-09-22 03:52:48 +06:30
|
|
|
try {
|
|
|
|
|
await context.read<MainModel>().signout();
|
|
|
|
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
|
|
|
|
"/welcome", ModalRoute.withName('/welcome'));
|
|
|
|
|
} catch (e) {} finally {
|
|
|
|
|
Future.delayed(Duration(seconds: 1), () {
|
|
|
|
|
if (mounted) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-09-13 21:49:39 +06:30
|
|
|
});
|
|
|
|
|
}
|
2020-05-29 07:45:27 +06:30
|
|
|
}
|