Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/driver-app!62
logout_function
Mohammad Aljammal 6 years ago
commit b8b243735d

@ -161,17 +161,59 @@
] ]
}, },
{ {
"uid": "3a5cc972b7f3f2ab8a20e22287b5598b", "uid": "f454f0b074a5a3194dbf7409c724a0e9",
"css": "group-169", "css": "call",
"code": 59412, "code": 59408,
"src": "custom_icons", "src": "custom_icons",
"selected": false, "selected": true,
"svg": {
"path": "M1185.4 990.2H156.1C78 990.2 9.8 926.8 9.8 843.9V156.1C9.8 78 73.2 9.8 156.1 9.8H1185.4C1263.4 9.8 1331.7 73.2 1331.7 156.1V848.8C1331.7 926.8 1268.3 990.2 1185.4 990.2ZM902.4 619.5L824.4 541.5C804.9 522 780.5 522 761 541.5 761 541.5 761 541.5 761 541.5L717.1 585.4C712.2 590.2 707.3 590.2 702.4 585.4 678 570.7 653.7 551.2 634.1 526.8 614.6 507.3 600 487.8 580.5 468.3 575.6 463.4 580.5 458.5 580.5 453.7L634.1 409.8C653.7 390.2 653.7 365.9 634.1 346.3L556.1 268.3C536.6 253.7 512.2 253.7 492.7 268.3L468.3 297.6C429.3 331.7 419.5 390.2 434.1 439 443.9 473.2 463.4 507.3 482.9 541.5 502.4 570.7 522 595.1 546.3 619.5 570.7 648.8 604.9 668.3 634.1 692.7 668.3 717.1 707.3 731.7 746.3 741.5 756.1 746.3 765.9 746.3 780.5 746.3 819.5 746.3 853.7 731.7 878 707.3L897.6 687.8C922 663.4 922 634.1 902.4 619.5Z",
"width": 1337
},
"search": [
"call"
]
},
{
"uid": "ecb856dd748af0bc0fca50e5c00802b2",
"css": "whatsapp",
"code": 59407,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1180.5 990.2H151.2C73.2 990.2 4.9 926.8 4.9 843.9V151.2C4.9 73.2 68.3 4.9 151.2 4.9H1180.5C1258.5 4.9 1326.8 68.3 1326.8 151.2V843.9C1326.8 926.8 1263.4 990.2 1180.5 990.2ZM448.8 722L478 609.8C458.5 575.6 448.8 536.6 448.8 502.4 448.8 380.5 546.3 282.9 668.3 282.9 726.8 282.9 780.5 307.3 824.4 346.3 863.4 385.4 887.8 443.9 887.8 502.4 887.8 624.4 790.2 722 668.3 722 668.3 722 668.3 722 668.3 722H668.3C629.3 722 595.1 712.2 565.9 697.6L448.8 722ZM570.7 648.8L575.6 653.7C604.9 668.3 634.1 678 668.3 678H668.3C770.7 678 848.8 595.1 848.8 497.6 848.8 448.8 829.3 404.9 795.1 370.7 761 336.6 717.1 317.1 668.3 317.1 565.9 317.1 487.8 400 487.8 497.6 487.8 531.7 497.6 565.9 517.1 595.1L522 600 502.4 668.3 570.7 648.8ZM448.8 722L478 609.8C458.5 575.6 448.8 536.6 448.8 502.4 448.8 380.5 546.3 282.9 668.3 282.9 726.8 282.9 780.5 307.3 824.4 346.3 863.4 385.4 887.8 443.9 887.8 502.4 887.8 624.4 790.2 722 668.3 722 668.3 722 668.3 722 668.3 722H668.3C629.3 722 595.1 712.2 565.9 697.6L448.8 722ZM570.7 648.8L575.6 653.7C604.9 668.3 634.1 678 668.3 678H668.3C770.7 678 848.8 595.1 848.8 497.6 848.8 448.8 829.3 404.9 795.1 370.7 761 336.6 717.1 317.1 668.3 317.1 565.9 317.1 487.8 400 487.8 497.6 487.8 531.7 497.6 565.9 517.1 595.1L522 600 502.4 668.3 570.7 648.8ZM614.6 404.9C609.8 395.1 604.9 395.1 600 395.1 595.1 395.1 595.1 395.1 590.2 395.1 585.4 395.1 580.5 395.1 575.6 400 570.7 404.9 556.1 419.5 556.1 443.9 556.1 473.2 575.6 497.6 580.5 502.4 585.4 507.3 619.5 561 673.2 585.4 717.1 604.9 726.8 600 736.6 600 746.3 600 770.7 585.4 775.6 575.6 780.5 561 780.5 551.2 780.5 551.2 780.5 551.2 775.6 546.3 770.7 546.3 765.9 541.5 736.6 531.7 731.7 526.8 726.8 526.8 722 522 717.1 531.7 712.2 536.6 702.4 551.2 697.6 551.2 692.7 556.1 692.7 556.1 687.8 551.2 682.9 546.3 663.4 541.5 643.9 522 629.3 507.3 614.6 487.8 614.6 482.9 609.8 478 614.6 473.2 614.6 473.2 619.5 468.3 624.4 458.5 629.3 453.7 629.3 448.8 629.3 448.8 629.3 443.9 629.3 443.9 619.5 419.5 614.6 404.9Z",
"width": 1337
},
"search": [
"whatsapp"
]
},
{
"uid": "79e200375e576071502c28bb9054ee19",
"css": "message",
"code": 59406,
"src": "custom_icons",
"selected": true,
"svg": { "svg": {
"path": "", "path": "M1180.5 990.2H151.2C73.2 990.2 4.9 926.8 4.9 843.9V151.2C4.9 73.2 68.3 4.9 151.2 4.9H1180.5C1258.5 4.9 1326.8 68.3 1326.8 151.2V843.9C1326.8 926.8 1263.4 990.2 1180.5 990.2ZM873.2 273.2H463.4C434.1 273.2 409.8 297.6 409.8 326.8V595.1C409.8 624.4 434.1 648.8 463.4 648.8H595.1C595.1 648.8 600 648.8 600 648.8L648.8 712.2C653.7 717.1 658.5 722 668.3 722H668.3C678 722 682.9 717.1 687.8 712.2L736.6 648.8C736.6 648.8 741.5 648.8 741.5 648.8H873.2C902.4 648.8 926.8 624.4 926.8 595.1V326.8C926.8 297.6 902.4 273.2 873.2 273.2L873.2 273.2ZM897.6 595.1C897.6 595.1 897.6 600 897.6 600L741.5 463.4 897.6 331.7 897.6 595.1ZM873.2 302.4C878 302.4 882.9 302.4 887.8 307.3L682.9 473.2C673.2 482.9 658.5 482.9 648.8 473.2L448.8 307.3C453.7 307.3 458.5 302.4 463.4 302.4L873.2 302.4ZM439 600C439 600 439 595.1 439 595.1V336.6L595.1 468.3 439 600ZM712.2 634.1L668.3 692.7 624.4 634.1C619.5 624.4 604.9 619.5 595.1 619.5H463.4L619.5 482.9 634.1 492.7C643.9 502.4 658.5 507.3 668.3 507.3 682.9 507.3 692.7 502.4 702.4 492.7L717.1 482.9 873.2 619.5H741.5C731.7 619.5 717.1 624.4 712.2 634.1L712.2 634.1Z",
"width": 663 "width": 1337
}, },
"search": [ "search": [
"group-169" "message"
]
},
{
"uid": "5c38c3d86ba300ea6939a53b5e4467fa",
"css": "location-1",
"code": 59392,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1180.5 990.2H151.2C73.2 990.2 4.9 926.8 4.9 843.9V151.2C4.9 73.2 68.3 4.9 151.2 4.9H1180.5C1258.5 4.9 1326.8 68.3 1326.8 151.2V843.9C1326.8 926.8 1263.4 990.2 1180.5 990.2ZM863.4 443.9L487.8 287.8C478 282.9 468.3 287.8 463.4 292.7 458.5 297.6 453.7 307.3 458.5 317.1L600 697.6C604.9 707.3 609.8 712.2 619.5 712.2 629.3 712.2 639 707.3 639 697.6L702.4 551.2C707.3 546.3 707.3 541.5 717.1 541.5L863.4 482.9C873.2 482.9 878 473.2 878 463.4 878 458.5 873.2 448.8 863.4 443.9Z",
"width": 1337
},
"search": [
"location"
] ]
} }
] ]

@ -21,26 +21,19 @@ class DriverApp {
static const _kFontFam = 'DriverApp'; static const _kFontFam = 'DriverApp';
static const _kFontPkg = null; static const _kFontPkg = null;
static const IconData logo = static const IconData location_1 = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData logo = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData closed_box = static const IconData closed_box = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData location = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData location = static const IconData open_box = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData phone_call = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData open_box = static const IconData qr = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData not_available = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData phone_call = static const IconData rejected_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData not_reachable_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr = static const IconData group_74 = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData message = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData not_available = static const IconData whatsapp = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData call = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData rejected_icon = static const IconData deliverd_icon = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData not_reachable_icon =
IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData group_74 =
IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData deliverd_icon =
IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

Binary file not shown.

@ -10,8 +10,12 @@ const UPDATE_ORDER_STATUS =
'/Patients.svc/REST/PatientER_Delivery_UpdateOrderStatus'; '/Patients.svc/REST/PatientER_Delivery_UpdateOrderStatus';
const NEXT_ORDER = "/Patients.svc/REST/PatientER_Delivery_NextOrder"; const NEXT_ORDER = "/Patients.svc/REST/PatientER_Delivery_NextOrder";
const GET_ALL_DELIVERD_ORDER =
'/Patients.svc/REST/PatientER_Delivery_GetAllDeliverdOrder';
/// Body Constant /// Body Constant
const CHANNEL = 9; const CHANNEL = 9;
const VERSION_ID = 8.3;
/// design constant /// design constant
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;

@ -0,0 +1,48 @@
class DeliverdOrderModel {
int driverID;
String searchKey;
int pageSize;
int pageIndex;
String tokenID;
String userID;
String mobileNo;
String longitude;
String latitude;
DeliverdOrderModel(
{this.driverID,
this.searchKey,
this.pageSize,
this.pageIndex,
this.tokenID,
this.userID,
this.mobileNo,
this.longitude,
this.latitude});
DeliverdOrderModel.fromJson(Map<String, dynamic> json) {
driverID = json['DriverID'];
searchKey = json['SearchKey'];
pageSize = json['PageSize'];
pageIndex = json['PageIndex'];
tokenID = json['TokenID'];
userID = json['UserID'];
mobileNo = json['MobileNo'];
longitude = json['Longitude'];
latitude = json['Latitude'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DriverID'] = this.driverID;
data['SearchKey'] = this.searchKey;
data['PageSize'] = this.pageSize;
data['PageIndex'] = this.pageIndex;
data['TokenID'] = this.tokenID;
data['UserID'] = this.userID;
data['MobileNo'] = this.mobileNo;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
return data;
}
}

@ -16,9 +16,9 @@ class PendingOrdersRes {
String descriptionN; String descriptionN;
double longitude; double longitude;
double latitude; double latitude;
Null amount; dynamic amount;
String orderCreatedOn; String orderCreatedOn;
Null ePharmacyOrderNo; dynamic ePharmacyOrderNo;
int projectID; int projectID;
String appointmentNo; String appointmentNo;
String dischargeID; String dischargeID;

@ -33,9 +33,9 @@ class BaseAppClient {
body['UserID'] = '${doctorProfile?.userID}'; body['UserID'] = '${doctorProfile?.userID}';
body['TokenID'] = token; body['TokenID'] = token;
body['MobileNo'] = doctorProfile?.mobileNumber; body['MobileNo'] = doctorProfile?.mobileNumber;
body['Channel'] = CHANNEL;
} }
body['Channel'] = CHANNEL;
body['VersionID'] = VERSION_ID;
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");

@ -1,22 +1,57 @@
import 'package:driverapp/config/shared_pref_kay.dart'; import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/model/authentication/authenticated_user.dart';
import 'package:driverapp/core/model/authentication/login_request.dart'; import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/service/authentication_service.dart'; import 'package:driverapp/core/service/authentication_service.dart';
import 'package:driverapp/core/service/client/base_app_client.dart'; import 'package:driverapp/core/service/client/base_app_client.dart';
import 'package:driverapp/core/viewModels/base_view_model.dart'; import 'package:flutter/cupertino.dart';
import '../../locator.dart'; import '../../locator.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthenticationViewModel extends BaseViewModel { class AuthenticationViewModel with ChangeNotifier {
AuthenticationService _authenticationService = locator<AuthenticationService>(); AuthenticationService _authenticationService =
locator<AuthenticationService>();
AuthenticatedUser user;
bool isLogin = false;
bool isLoading = false;
bool isError = false;
String error;
AuthenticationViewModel() {
getUser();
}
getUser() async {
if (user == null) {
isLoading = true;
notifyListeners();
var userProfile = await sharedPref.getObject(USER_PROFILE);
if (userProfile != null) {
user = AuthenticatedUser.fromJson(
await sharedPref.getObject(USER_PROFILE));
isLogin = true;
isLoading = false;
notifyListeners();
} else {
isLogin = false;
isLoading = false;
notifyListeners();
}
}
// else
// {
// isLogin = true;
// isLoading = false;
// notifyListeners();
// }
}
APP_STATUS get status { APP_STATUS get status {
if (state == ViewState.Busy || state == ViewState.BusyLocal) { if (isLoading) {
return APP_STATUS.LOADING; return APP_STATUS.LOADING;
} else { } else {
if ( user != null) { if (isLogin) {
return APP_STATUS.AUTHENTICATED; return APP_STATUS.AUTHENTICATED;
} else { } else {
return APP_STATUS.UNAUTHENTICATED; return APP_STATUS.UNAUTHENTICATED;
@ -25,16 +60,20 @@ class AuthenticationViewModel extends BaseViewModel {
} }
login(LoginRequest loginRequest) async { login(LoginRequest loginRequest) async {
setState(ViewState.BusyLocal); isLoading = true;
notifyListeners();
await _authenticationService.login(loginRequest); await _authenticationService.login(loginRequest);
if (_authenticationService.hasError) { if (_authenticationService.hasError) {
error = _authenticationService.error; error = _authenticationService.error;
setState(ViewState.ErrorLocal); isLoading = false;
isError = true;
notifyListeners();
} else { } else {
sharedPref.setObject( sharedPref.setObject(
USER_PROFILE, _authenticationService.authenticatedUser); USER_PROFILE, _authenticationService.authenticatedUser);
sharedPref.setString(TOKEN, _authenticationService.token); sharedPref.setString(TOKEN, _authenticationService.token);
setState(ViewState.Idle); user = _authenticationService.authenticatedUser;
notifyListeners();
} }
} }
} }

@ -5,6 +5,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'config/size_config.dart'; import 'config/size_config.dart';
import 'core/viewModels/authentication_view_model.dart';
import 'core/viewModels/project_view_model.dart'; import 'core/viewModels/project_view_model.dart';
import 'locator.dart'; import 'locator.dart';
@ -25,7 +26,10 @@ class MyApp extends StatelessWidget {
providers: [ providers: [
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
) ),
ChangeNotifierProvider<AuthenticationViewModel>(
create: (context) => AuthenticationViewModel(),
),
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(

@ -1,9 +1,7 @@
import 'package:driverapp/app-icons/driver_app_icons.dart'; import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/authentication/login_request.dart'; import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart'; import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart'; import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/pages/base/base_view.dart';
import 'package:driverapp/pages/dashboard/dashboard_screen.dart'; import 'package:driverapp/pages/dashboard/dashboard_screen.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/uitl/utils.dart'; import 'package:driverapp/uitl/utils.dart';
@ -21,15 +19,15 @@ class LoginPage extends StatelessWidget {
LoginRequest loginRequest = LoginRequest(); LoginRequest loginRequest = LoginRequest();
final loginFormKey = GlobalKey<FormState>(); final loginFormKey = GlobalKey<FormState>();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
authenticationViewModel = Provider.of(context);
return AnimatedSwitcher( return AnimatedSwitcher(
duration: Duration(microseconds: 350), duration: Duration(microseconds: 350),
child: BaseView<AuthenticationViewModel>( child: AppScaffold(
builder: (_, model, widget) =>
AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
@ -55,10 +53,12 @@ class LoginPage extends StatelessWidget {
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.15,
left: !projectViewModel.isArabic left: !projectViewModel.isArabic
? 0 ? 0
: MediaQuery.of(context).size.width * 0.15), : MediaQuery.of(context).size.width *
0.15),
), ),
], ],
), ),
@ -88,50 +88,52 @@ class LoginPage extends StatelessWidget {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
Row(
mainAxisAlignment: MainAxisAlignment.center, // Row(
children: <Widget>[ // mainAxisAlignment: MainAxisAlignment.center,
CircleContainer( // children: <Widget>[
onTap: () => projectViewModel.changeLanguage('en'), // CircleContainer(
child: Text( // onTap: () =>
TranslationBase.of(context).lanEnglish, // projectViewModel.changeLanguage('en'),
style: TextStyle( // child: Text(
fontSize: 12, // TranslationBase.of(context).lanEnglish,
color: projectViewModel.isArabic // style: TextStyle(
? Colors.black // fontSize: 12,
: Colors.white), // color: projectViewModel.isArabic
), // ? Colors.black
color: projectViewModel.isArabic // : Colors.white),
? Colors.transparent // ),
: Theme.of(context).primaryColor, // color: projectViewModel.isArabic
borderWidth: projectViewModel.isArabic ? 3 : 0, // ? Colors.transparent
borderColor: projectViewModel.isArabic // : Theme.of(context).primaryColor,
? Theme.of(context).primaryColor // borderWidth: projectViewModel.isArabic ? 3 : 0,
: Colors.transparent, // borderColor: projectViewModel.isArabic
), // ? Theme.of(context).primaryColor
SizedBox( // : Colors.transparent,
width: 20, // ),
), // SizedBox(
CircleContainer( // width: 20,
onTap: () => // ),
projectViewModel.changeLanguage('ar'), // CircleContainer(
child: Text( // onTap: () =>
TranslationBase.of(context).lanArabic, // projectViewModel.changeLanguage('ar'),
style: TextStyle( // child: Text(
fontSize: 12, // TranslationBase.of(context).lanArabic,
color: !projectViewModel.isArabic // style: TextStyle(
? Colors.black // fontSize: 12,
: Colors.white), // color: !projectViewModel.isArabic
), // ? Colors.black
color: !projectViewModel.isArabic // : Colors.white),
? Colors.transparent // ),
: Theme.of(context).primaryColor, // color: !projectViewModel.isArabic
borderWidth: !projectViewModel.isArabic ? 3 : 0, // ? Colors.transparent
borderColor: !projectViewModel.isArabic // : Theme.of(context).primaryColor,
? Theme.of(context).primaryColor // borderWidth: !projectViewModel.isArabic ? 3 : 0,
: Colors.transparent), // borderColor: !projectViewModel.isArabic
], // ? Theme.of(context).primaryColor
), // : Colors.transparent),
// ],
// ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -148,7 +150,8 @@ class LoginPage extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text( child: Text(
TranslationBase.of(context).enterCredentialsMsg, TranslationBase.of(context)
.enterCredentialsMsg,
style: TextStyle( style: TextStyle(
fontSize: 13, color: Colors.grey), fontSize: 13, color: Colors.grey),
), ),
@ -173,7 +176,8 @@ class LoginPage extends StatelessWidget {
return null; return null;
}, },
onSaved: (value) { onSaved: (value) {
loginRequest.userID = int.parse(value.trim()); loginRequest.userID =
int.parse(value.trim());
}, },
), ),
), ),
@ -195,6 +199,7 @@ class LoginPage extends StatelessWidget {
onSaved: (value) { onSaved: (value) {
loginRequest.password = value; loginRequest.password = value;
}, },
type: 'password',
), ),
), ),
SizedBox( SizedBox(
@ -222,7 +227,9 @@ class LoginPage extends StatelessWidget {
), ),
SizedBox( SizedBox(
height: 10, height: 10,
),Container( ),
Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22, height: MediaQuery.of(context).size.height * 0.22,
child: Column( child: Column(
@ -230,10 +237,10 @@ class LoginPage extends StatelessWidget {
SecondaryButton( SecondaryButton(
label: TranslationBase.of(context).login, label: TranslationBase.of(context).login,
onTap: () { onTap: () {
login(model, context); login(context);
}, },
disabled: model.state == ViewState.BusyLocal, disabled: authenticationViewModel.isLoading,
loading: model.state == ViewState.BusyLocal, loading: authenticationViewModel.isLoading,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
@ -244,23 +251,21 @@ class LoginPage extends StatelessWidget {
), ),
), ),
), ),
),
), ),
); );
} }
login(AuthenticationViewModel model, BuildContext context) async { login(BuildContext context) async {
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState.save();
await model.login(loginRequest); await authenticationViewModel.login(loginRequest);
if (model.state == ViewState.ErrorLocal) { if (authenticationViewModel.isError) {
Utils.showErrorToast(model.error); Utils.showErrorToast(authenticationViewModel.error);
} else { } else {
Navigator.push( Navigator.push(
context, MaterialPageRoute(builder: (context) => DashboardScreen())); context,
MaterialPageRoute(builder: (context) => DashboardScreen()));
} }
} }
} }
} }

@ -1,6 +1,8 @@
import 'package:barcode_scan/platform_wrapper.dart'; import 'package:barcode_scan/platform_wrapper.dart';
import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart'; import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart';
@ -14,7 +16,8 @@ import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:driverapp/config/size_config.dart'; import 'package:provider/provider.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
@ -23,6 +26,19 @@ class DashboardScreen extends StatefulWidget {
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
bool _isInit = false;
AuthenticationViewModel _authenticationViewModel;
@override
void didChangeDependencies() {
if (!_isInit) {
_authenticationViewModel = Provider.of(context);
_isInit = true;
}
super.didChangeDependencies();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
int orderId; int orderId;
@ -56,8 +72,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding( Padding(
padding: EdgeInsets.only(top: 4.5), padding: EdgeInsets.only(top: 4.5),
child: Text( child: Text(
'Drive Name', _authenticationViewModel.user.userName,
//model.user.userName,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 25.0), fontSize: 25.0),
@ -465,8 +480,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: //model.orders == null ? 0 : model.orders.length, itemCount: model.orders == null
3, ? 0
: model.orders.length < 3 ? model.orders.length : 3,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2), padding: EdgeInsets.symmetric(horizontal: 12.2),
@ -475,7 +491,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
raduis: 25.0, raduis: 25.0,
height: MediaQuery.of(context).orientation == height: MediaQuery.of(context).orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery.of(context).size.height * 0.109 ? MediaQuery.of(context).size.height * 0.120
: MediaQuery.of(context).size.height * 0.209, : MediaQuery.of(context).size.height * 0.209,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -543,12 +559,23 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: 15.0, fontSize: 15.0,
), ),
), ),
Expanded(
child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
borderWidth: 0.9,
child: Text( child: Text(
model.orders[index].distanceInKilometers model.orders[index].distanceInKilometers
.toString() + .toString() +

@ -22,28 +22,19 @@ class DeliveryConfirmedPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrdersViewModel>( return BaseView<OrdersViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarColor: Theme.of(context).primaryColor,
arrowColor: Colors.white,
titleColor: Colors.white,
body: SafeArea( body: SafeArea(
child: Container( child: Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Column( Stack(
children: <Widget>[ children: <Widget>[
Column( Column(
children: <Widget>[ children: <Widget>[
Container(
child: Container(
alignment: Alignment.topLeft,
child: IconButton(
color: Colors.white,
iconSize: 40,
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
),
),
Container( Container(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -51,17 +42,20 @@ class DeliveryConfirmedPage extends StatelessWidget {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 0.7, height: MediaQuery.of(context).size.width * 0.7,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.2, top: MediaQuery.of(context).size.width * 0.12,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white10, color: Colors.white10, shape: BoxShape.circle),
shape: BoxShape.circle),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Icon( Icon(
Icons.check_circle, Icons.check_circle,
color: Colors.white, color: Colors.white,
size: 60, size: 75,
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.03,
), ),
Text( Text(
TranslationBase.of(context).deliveryInfo, TranslationBase.of(context).deliveryInfo,
@ -70,9 +64,12 @@ class DeliveryConfirmedPage extends StatelessWidget {
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.03,
),
Text( Text(
TranslationBase.of(context) TranslationBase.of(context).confirmationSent,
.confirmationSent,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 13, fontSize: 13,
@ -86,18 +83,16 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
], ],
), ),
Stack(
children: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.width,
), ),
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
//800, height: MediaQuery.of(context).size.width * 1.0,
height: MediaQuery.of(context).size.width * 1.2, margin: EdgeInsets.only(
//440, top: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.only(top: 60), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -110,8 +105,7 @@ class DeliveryConfirmedPage extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.width * bottom: MediaQuery.of(context).size.width * 0.09,
0.15, //50
), ),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -119,8 +113,7 @@ class DeliveryConfirmedPage extends StatelessWidget {
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
color: Colors.orangeAccent, color: Colors.orangeAccent,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius: new BorderRadius.circular(10.0),
new BorderRadius.circular(10.0),
), ),
label: Text( label: Text(
TranslationBase.of(context).addNoteBtn, TranslationBase.of(context).addNoteBtn,
@ -134,18 +127,15 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
SizedBox( SizedBox(
height: height:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width * 0.02, //20,
0.1, //20,
), ),
Container( Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context) label: TranslationBase.of(context).nextDelivery,
.nextDelivery,
onTap: () { onTap: () {
getNextOrder(context, model); getNextOrder(context, model);
}, },),
),
), ),
], ],
), ),
@ -153,19 +143,22 @@ class DeliveryConfirmedPage extends StatelessWidget {
], ],
), ),
), ),
CustomerBriefCard( Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.6,
),
child: CustomerBriefCard(
itemId: item.orderID, itemId: item.orderID,
customerFirstName: item.firstName, customerFirstName: item.firstName,
customerLastName: item.lastName, customerLastName: item.lastName,
mobileNo: item.mobileNumber, mobileNo: item.mobileNumber,
totalPayment: item.amount, totalPayment: item.amount,
showDistance: false,
deliveryTime: item.orderCreatedOn), deliveryTime: item.orderCreatedOn),
],
),
],
), ),
], ],
), ),
],),
), ),
), ),
), ),

File diff suppressed because one or more lines are too long

@ -38,7 +38,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
raduis: 25.0, raduis: 25.0,
height: MediaQuery.of(context).orientation == height: MediaQuery.of(context).orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery.of(context).size.height * 0.109 ? MediaQuery.of(context).size.height * 0.120
: MediaQuery.of(context).size.height * 0.209, : MediaQuery.of(context).size.height * 0.209,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -96,12 +96,22 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
fontSize: 15.0, fontSize: 15.0,
), ),
), ),
Expanded(
child: Text(
model.orders[index].orderID.toString(),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
borderWidth: 0.8,
child: Text( child: Text(
model.orders[index].distanceInKilometers model.orders[index].distanceInKilometers
.toString() + .toString() +

@ -1,34 +1,35 @@
import 'package:driverapp/pages/authentication/login_page.dart'; import 'package:driverapp/pages/authentication/login_page.dart';
import 'package:driverapp/pages/base/base_view.dart'; import 'package:driverapp/pages/dashboard/dashboard_screen.dart';
import 'package:driverapp/pages/landing/landing_page.dart'; import 'package:driverapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:driverapp/pages/dashboard/dashboard_screen.dart'; import 'package:provider/provider.dart';
import 'core/viewModels/authentication_view_model.dart'; import 'core/viewModels/authentication_view_model.dart';
class RootPage extends StatelessWidget { class RootPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget buildRoot(APP_STATUS status) { AuthenticationViewModel authenticationViewModel = Provider.of(context);
APP_STATUS status = authenticationViewModel.status;
Widget buildRoot() {
switch (status) { switch (status) {
case APP_STATUS.UNAUTHENTICATED: case APP_STATUS.UNAUTHENTICATED:
return LoginPage (); return LoginPage();
break; break;
case APP_STATUS.AUTHENTICATED: case APP_STATUS.AUTHENTICATED:
return DashboardScreen(); return DashboardScreen();
break; break;
case APP_STATUS.LOADING:
return Center(child: AppCircularProgressIndicator());
break;
} }
} }
return AnimatedSwitcher( return AnimatedSwitcher(
duration: Duration(microseconds: 350), duration: Duration(microseconds: 350),
child: BaseView<AuthenticationViewModel>( child: Scaffold(
builder: (_, model, widget) => AppScaffold( body: buildRoot(),
baseViewModel: model,
body: buildRoot((model.status)),
),
), ),
); );
} }

@ -14,6 +14,7 @@ class CustomerBriefCard extends StatelessWidget {
final String deliveryTime; final String deliveryTime;
final double longitude; final double longitude;
final double latitude; final double latitude;
final bool showDistance;
CustomerBriefCard( CustomerBriefCard(
{this.itemId, {this.itemId,
@ -25,7 +26,9 @@ class CustomerBriefCard extends StatelessWidget {
this.totalPayment, this.totalPayment,
this.deliveryTime, this.deliveryTime,
this.longitude, this.longitude,
this.latitude}); this.latitude,
this.showDistance = true,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -63,13 +66,15 @@ class CustomerBriefCard extends StatelessWidget {
style: TextStyle(color: Color(0xFFADACAD)), style: TextStyle(color: Color(0xFFADACAD)),
), ),
), ),
Expanded( Visibility(
visible: showDistance,
child: Expanded(
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Colors.black45, backgroundColor: Colors.black45,
radius: 28.0, radius: 28.0,
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
maxRadius: 25.1, maxRadius: 26.1,
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 3), padding: const EdgeInsets.only(left: 3),
child: Text( child: Text(
@ -83,24 +88,27 @@ class CustomerBriefCard extends StatelessWidget {
), ),
), ),
), ),
),
], ],
), ),
SizedBox(height: MediaQuery.of(context).size.width * 0.02,),
Text( Text(
'${customerFirstName} ${customerLastName}', '${customerFirstName} ${customerLastName}',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w900), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w900),
), ),
SizedBox(height: MediaQuery.of(context).size.width * 0.019,),
Text( Text(
mobileNo, mobileNo,
style: TextStyle(color: Color(0xFF50BDC5)), style: TextStyle(color: Color(0xFF50BDC5)),
), ),
SizedBox( SizedBox(
height: 10, height:MediaQuery.of(context).size.width*0.005,
),
Text(
'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277',
style: TextStyle(
color: Color(0xFF464748), fontWeight: FontWeight.w600),
), ),
// Text(
// 'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277',
// style: TextStyle(
// color: Color(0xFF464748), fontWeight: FontWeight.w600),
// ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -141,7 +149,7 @@ class CustomerBriefCard extends StatelessWidget {
], ],
), ),
SizedBox( SizedBox(
height: 20, height: MediaQuery.of(context).size.width*0.03,
), ),
Row( Row(
children: <Widget>[ children: <Widget>[

@ -24,22 +24,13 @@ class DeliveryInfoButton extends StatelessWidget {
.of(context) .of(context)
.size .size
.width * 0.165, // specific value .width * 0.165, // specific value
child: RaisedButton( child:
padding: EdgeInsets.only(left: 2), InkWell(
color: btnColor,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8.0),
),
child: btnIcon, child: btnIcon,
onPressed: btnFunction, onTap: btnFunction,
), ),
), ),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.05,
),
Text( Text(
btnName, btnName,
style: TextStyle( style: TextStyle(

@ -39,7 +39,8 @@ class NumberTextInputFormatter extends TextInputFormatter {
final _mobileFormatter = NumberTextInputFormatter(); final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget { class TextFields extends StatefulWidget {
TextFields({Key key, TextFields({
Key key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
@ -76,8 +77,9 @@ class TextFields extends StatefulWidget {
this.borderWidth = 1.5, this.borderWidth = 1.5,
this.fieldTextColor, this.fieldTextColor,
this.textAlign = TextAlign.start, this.textAlign = TextAlign.start,
this.borderRadius}) this.borderRadius,
: super(key: key); this.obscureText,
}) : super(key: key);
final String hintText; final String hintText;
final String initialValue; final String initialValue;
@ -116,6 +118,7 @@ class TextFields extends StatefulWidget {
final double borderWidth; final double borderWidth;
final Color fieldTextColor; final Color fieldTextColor;
final TextAlign textAlign; final TextAlign textAlign;
final bool obscureText;
@override @override
_TextFieldsState createState() => _TextFieldsState(); _TextFieldsState createState() => _TextFieldsState();
@ -162,9 +165,7 @@ class _TextFieldsState extends State<TextFields> {
}); });
}, },
child: Icon(EvaIcons.eye, child: Icon(EvaIcons.eye,
size: 24.0, color: Theme size: 24.0, color: Theme.of(context).primaryColor))
.of(context)
.primaryColor))
: InkWell( : InkWell(
onTap: () { onTap: () {
this.setState(() { this.setState(() {
@ -218,9 +219,7 @@ class _TextFieldsState extends State<TextFields> {
blurRadius: focus ? 34.0 : 12.0) blurRadius: focus ? 34.0 : 12.0)
]), ]),
child: TextFormField( child: TextFormField(
keyboardAppearance: Theme keyboardAppearance: Theme.of(context).brightness,
.of(context)
.brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate, autovalidate: widget.autoValidate,
onTap: widget.onTap, onTap: widget.onTap,
@ -248,11 +247,7 @@ class _TextFieldsState extends State<TextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme style: Theme.of(context).textTheme.body2.copyWith(
.of(context)
.textTheme
.body2
.copyWith(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.color), color: widget.color),
@ -268,9 +263,7 @@ class _TextFieldsState extends State<TextFields> {
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: Theme color: Theme.of(context).hintColor),
.of(context)
.hintColor),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding
: EdgeInsets.symmetric( : EdgeInsets.symmetric(
@ -281,9 +274,7 @@ class _TextFieldsState extends State<TextFields> {
? Colors.transparent ? Colors.transparent
: widget.fieldTextColor != null : widget.fieldTextColor != null
? widget.fieldTextColor ? widget.fieldTextColor
: Theme : Theme.of(context).backgroundColor,
.of(context)
.backgroundColor,
suffixIcon: _buildSuffixIcon(), suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.type != "search" prefixIcon: widget.type != "search"
? widget.prefixIcon != null ? widget.prefixIcon != null
@ -304,8 +295,7 @@ class _TextFieldsState extends State<TextFields> {
height: widget.borderOnlyError ? 0.0 : null), height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme color: Theme.of(context)
.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: widget.borderWidth), width: widget.borderWidth),
@ -316,8 +306,7 @@ class _TextFieldsState extends State<TextFields> {
: BorderRadius.circular(widget.borderRadiusValue)), : BorderRadius.circular(widget.borderRadiusValue)),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme color: Theme.of(context)
.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: widget.borderWidth), width: widget.borderWidth),
@ -328,8 +317,7 @@ class _TextFieldsState extends State<TextFields> {
: BorderRadius.circular(widget.borderRadiusValue)), : BorderRadius.circular(widget.borderRadiusValue)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme color: Theme.of(context)
.of(context)
.dividerColor .dividerColor
.withOpacity(widget.bare ? 0.0 : 1.0), .withOpacity(widget.bare ? 0.0 : 1.0),
width: widget.borderWidth), width: widget.borderWidth),
@ -339,18 +327,10 @@ class _TextFieldsState extends State<TextFields> {
? widget.borderRadius ? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)), : BorderRadius.circular(widget.borderRadiusValue)),
disabledBorder: disabledBorder:
OutlineInputBorder(borderSide: BorderSide(color: Theme OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0), width: widget.borderWidth), borderRadius: widget.bare ? BorderRadius.circular(0.0) : widget.borderRadius != null ? widget.borderRadius : BorderRadius.circular(widget.borderRadiusValue)),
.of(context)
.dividerColor
.withOpacity(widget.bare ? 0.0 : 1.0),
width: widget.borderWidth),
borderRadius: widget.bare ? BorderRadius.circular(0.0) : widget
.borderRadius != null ? widget.borderRadius : BorderRadius
.circular(widget.borderRadiusValue)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme color: Theme.of(context)
.of(context)
.dividerColor .dividerColor
.withOpacity(widget.bare ? 0.0 : 1.0), .withOpacity(widget.bare ? 0.0 : 1.0),
width: widget.borderWidth), width: widget.borderWidth),

Loading…
Cancel
Save