Merge branch 'master' of gitlab.com:Cloud_Solution/driver-app into setting_branch

# Conflicts:
#	lib/core/viewModels/authentication_view_model.dart
#	lib/pages/setting/setting.dart
setting_branch
enadhilal 6 years ago
commit e35a322e84

@ -80,10 +80,7 @@ class AuthenticationViewModel with ChangeNotifier {
} }
} }
logout() async{ logout() async {
await sharedPref.clear(); await sharedPref.clear();
isLogin = false;
isLoading = false;
notifyListeners();
} }
} }

@ -1,5 +1,5 @@
import 'package:driverapp/core/viewModels/authentication_view_model.dart'; import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/root_page.dart'; import 'package:driverapp/pages/authentication/login_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -9,14 +9,13 @@ import 'package:provider/provider.dart';
class SettingPage extends StatelessWidget { class SettingPage extends StatelessWidget {
final String driverName; //_authenticationViewModel.user.userName final String driverName; //_authenticationViewModel.user.userName
final int driverID; final int driverID;
AuthenticationViewModel _authenticationViewModel;
SettingPage({this.driverName, this.driverID}); SettingPage({this.driverName, this.driverID});
AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); _authenticationViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarColor: Color(0xff30B7B9), appBarColor: Color(0xff30B7B9),
@ -40,46 +39,53 @@ class SettingPage extends StatelessWidget {
maxRadius: 200.0, maxRadius: 200.0,
child: Image.asset( child: Image.asset(
'assets/images/driver.png', 'assets/images/driver.png',
height: MediaQuery.of(context).size.width * 1, height: MediaQuery.of(context).size.width * 1 ,
width: MediaQuery.of(context).size.width * 1, width: MediaQuery.of(context).size.width * 1,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
), ),
), ),
SizedBox( SizedBox(height: MediaQuery.of(context).size.width *0.05,),
height: MediaQuery.of(context).size.width * 0.05,
),
Container( Container(
child: Text( child: Text(
driverName, driverName,
style: TextStyle( style: TextStyle(
fontSize: 40, fontSize: 40,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white), color: Colors.white
),
), ),
), ),
SizedBox( SizedBox(height: MediaQuery.of(context).size.width *0.05,),
height: MediaQuery.of(context).size.width * 0.05,
),
Container( Container(
child: Text( child: Text(
'ID: ${driverID.toString()}', 'ID: ${driverID.toString()}',
style: TextStyle(fontSize: 20, color: Colors.white), style: TextStyle(
fontSize: 20,
color: Colors.white
),
), ),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(height: MediaQuery.of(context).size.width *0.1,),
height: MediaQuery.of(context).size.width * 0.1,
),
Container( Container(
margin: EdgeInsets.only(left: 35), margin: EdgeInsets.only(left: 35),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () async {
await _authenticationViewModel.logout();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LoginPage()
),
);
},
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -92,25 +98,23 @@ class SettingPage extends StatelessWidget {
size: 40, size: 40,
color: Colors.white, color: Colors.white,
), ),
SizedBox( SizedBox(width: MediaQuery.of(context).size.width *0.05,),
width: MediaQuery.of(context).size.width * 0.05,
),
Text( Text(
TranslationBase.of(context).logout, TranslationBase.of(context).logout,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18), fontSize: 18
),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width * 0.05, height: MediaQuery.of(context).size.width *0.05,
child: Center( child: Center(
child: Container( child: Container(
margin: margin: EdgeInsetsDirectional.only(start: 0, end: 30),
EdgeInsetsDirectional.only(start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
@ -118,21 +122,8 @@ class SettingPage extends StatelessWidget {
), ),
], ],
), ),
onTap: () async {
// await authenticationViewModel.logout();
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (context) => RootPage(),
// ),
// );
// Navigator.of(context).pushNamedAndRemoveUntil(
// '/', ModalRoute.withName('/'));
},
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
), ),
SizedBox(height: MediaQuery.of(context).size.width*0.05,),
InkWell( InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -154,7 +145,8 @@ class SettingPage extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18), fontSize: 18
),
), ),
], ],
), ),
@ -163,19 +155,15 @@ class SettingPage extends StatelessWidget {
height: 10.0, height: 10.0,
child: Center( child: Center(
child: Container( child: Container(
margin: margin: EdgeInsetsDirectional.only(start: 0, end: 30),
EdgeInsetsDirectional.only(start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
SizedBox( SizedBox(height: MediaQuery.of(context).size.width*0.05,),
height: MediaQuery.of(context).size.width * 0.05,
),
], ],
), ),
onTap: () {},
), ),
], ],
), ),
@ -185,4 +173,4 @@ class SettingPage extends StatelessWidget {
), ),
); );
} }
} }

@ -34,7 +34,7 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.80, widthFactor: 0.80,
@ -49,16 +49,16 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
Container( Container(
child: Icon( child: Icon(
DriverApp.logo, DriverApp.logo,
size: 110, size: 120,
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.only( margin: EdgeInsets.only(
right: projectViewModel.isArabic right: projectViewModel.isArabic
? 0 ? 0
: MediaQuery.of(context).size.width * 0.15, : MediaQuery.of(context).size.width * 0.20,
left: !projectViewModel.isArabic left: !projectViewModel.isArabic
? 0 ? 0
: MediaQuery.of(context).size.width * 0.15), : MediaQuery.of(context).size.width * 0.10),
), ),
], ],
), ),
@ -92,7 +92,7 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
], ],
), ),
SizedBox( SizedBox(
height: 280, height: 100,
) )
], ],
), ),

Loading…
Cancel
Save