|
|
|
@ -12,6 +12,7 @@ import 'package:driverapp/widgets/data_display/circle-container.dart';
|
|
|
|
import 'package:driverapp/widgets/input/text_field.dart';
|
|
|
|
import 'package:driverapp/widgets/input/text_field.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -27,9 +28,8 @@ class LoginPage extends StatelessWidget {
|
|
|
|
duration: Duration(microseconds: 350),
|
|
|
|
duration: Duration(microseconds: 350),
|
|
|
|
child: BaseView<AuthenticationViewModel>(
|
|
|
|
child: BaseView<AuthenticationViewModel>(
|
|
|
|
builder: (_, model, widget) => Scaffold(
|
|
|
|
builder: (_, model, widget) => Scaffold(
|
|
|
|
//baseViewModel: model,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
|
|
|
child: Center(
|
|
|
|
body: Center(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -143,11 +143,13 @@ class LoginPage extends StatelessWidget {
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).enterCredentialsMsg,
|
|
|
|
TranslationBase.of(context).enterCredentialsMsg,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 13, color: Colors.grey),
|
|
|
|
fontSize: 13, color: Colors.grey),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -159,7 +161,6 @@ class LoginPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
onChanged: (value) => {},
|
|
|
|
|
|
|
|
hintText: TranslationBase.of(context).enterId,
|
|
|
|
hintText: TranslationBase.of(context).enterId,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value.isEmpty) {
|
|
|
|
if (value.isEmpty) {
|
|
|
|
@ -179,7 +180,6 @@ class LoginPage extends StatelessWidget {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
borderRadiusValue: 6,
|
|
|
|
borderRadiusValue: 6,
|
|
|
|
onChanged: (value) => {},
|
|
|
|
|
|
|
|
hintText:
|
|
|
|
hintText:
|
|
|
|
TranslationBase.of(context).enterPassword,
|
|
|
|
TranslationBase.of(context).enterPassword,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -219,13 +219,9 @@ class LoginPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
)
|
|
|
|
),Container(
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
height: MediaQuery.of(context).size.height * 0.12,
|
|
|
|
height: MediaQuery.of(context).size.height * 0.22,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
SecondaryButton(
|
|
|
|
SecondaryButton(
|
|
|
|
@ -240,7 +236,12 @@ class LoginPage extends StatelessWidget {
|
|
|
|
height: 30,
|
|
|
|
height: 30,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
))
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -252,7 +253,6 @@ class LoginPage extends StatelessWidget {
|
|
|
|
await model.login(loginRequest);
|
|
|
|
await model.login(loginRequest);
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
// Show error
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context, MaterialPageRoute(builder: (context) => LandingPage()));
|
|
|
|
context, MaterialPageRoute(builder: (context) => LandingPage()));
|
|
|
|
|