|
|
@ -1,5 +1,6 @@
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ProfileSettings extends StatefulWidget {
|
|
|
|
class ProfileSettings extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -28,7 +30,9 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
Future.delayed(new Duration(seconds: 0), () {
|
|
|
|
Future.delayed(new Duration(seconds: 0), () {
|
|
|
|
getSettings(context);
|
|
|
|
ProjectViewModel projectProvider;
|
|
|
|
|
|
|
|
projectProvider = Provider.of(context);
|
|
|
|
|
|
|
|
if (projectProvider.isLogin == true) getSettings(context);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -37,8 +41,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
onModelReady: (model) => {},
|
|
|
|
onModelReady: (model) => {},
|
|
|
|
builder: (_, model, wi) => Container(
|
|
|
|
builder: (_, model, wi) => Container(
|
|
|
|
child:
|
|
|
|
child: model.user != null
|
|
|
|
ListView(scrollDirection: Axis.vertical, children: <Widget>[
|
|
|
|
? ListView(scrollDirection: Axis.vertical, children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
@ -63,14 +67,15 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
child: AppText(TranslationBase.of(context).languageSetting,
|
|
|
|
child: AppText(
|
|
|
|
|
|
|
|
TranslationBase.of(context).languageSetting,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -88,8 +93,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -111,8 +116,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -131,8 +136,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -155,8 +160,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -170,8 +175,8 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -185,12 +190,13 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
top: 0, left: 10, right: 10, bottom: 0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppText(TranslationBase.of(context).emergencyContact),
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
TranslationBase.of(context).emergencyContact),
|
|
|
|
TextField(
|
|
|
|
TextField(
|
|
|
|
controller: emergencyContact,
|
|
|
|
controller: emergencyContact,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
@ -212,7 +218,11 @@ class _ProfileSettings extends State<ProfileSettings>
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
))
|
|
|
|
))
|
|
|
|
])));
|
|
|
|
])
|
|
|
|
|
|
|
|
: Center(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
AppText(TranslationBase.of(context).loginToUseService),
|
|
|
|
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getSettings(context) {
|
|
|
|
getSettings(context) {
|
|
|
|