Merge branch 'merge_into_dev_9/7' into 'development'

Merge into dev 9/7

See merge request Cloud_Solution/driver-app!58
logut
Elham 5 years ago
commit f646f5879f

@ -10,6 +10,9 @@ const UPDATE_ORDER_STATUS =
'/Patients.svc/REST/PatientER_Delivery_UpdateOrderStatus';
const NEXT_ORDER = "/Patients.svc/REST/PatientER_Delivery_NextOrder";
const GET_ALL_DELIVERD_ORDER =
'/Patients.svc/REST/PatientER_Delivery_GetAllDeliverdOrder';
/// Body Constant
const CHANNEL = 9;

@ -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;
double longitude;
double latitude;
Null amount;
dynamic amount;
String orderCreatedOn;
Null ePharmacyOrderNo;
dynamic ePharmacyOrderNo;
int projectID;
String appointmentNo;
String dischargeID;

@ -28,9 +28,8 @@ class LoginPage extends StatelessWidget {
return AnimatedSwitcher(
duration: Duration(microseconds: 350),
child: BaseView<AuthenticationViewModel>(
builder: (_, model, widget) =>
AppScaffold(
isShowAppBar: false,
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: Column(
@ -55,10 +54,12 @@ class LoginPage extends StatelessWidget {
margin: EdgeInsets.only(
right: projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15,
: MediaQuery.of(context).size.width *
0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15),
: MediaQuery.of(context).size.width *
0.15),
),
],
),
@ -88,50 +89,52 @@ class LoginPage extends StatelessWidget {
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleContainer(
onTap: () => projectViewModel.changeLanguage('en'),
child: Text(
TranslationBase.of(context).lanEnglish,
style: TextStyle(
fontSize: 12,
color: projectViewModel.isArabic
? Colors.black
: Colors.white),
),
color: projectViewModel.isArabic
? Colors.transparent
: Theme.of(context).primaryColor,
borderWidth: projectViewModel.isArabic ? 3 : 0,
borderColor: projectViewModel.isArabic
? Theme.of(context).primaryColor
: Colors.transparent,
),
SizedBox(
width: 20,
),
CircleContainer(
onTap: () =>
projectViewModel.changeLanguage('ar'),
child: Text(
TranslationBase.of(context).lanArabic,
style: TextStyle(
fontSize: 12,
color: !projectViewModel.isArabic
? Colors.black
: Colors.white),
),
color: !projectViewModel.isArabic
? Colors.transparent
: Theme.of(context).primaryColor,
borderWidth: !projectViewModel.isArabic ? 3 : 0,
borderColor: !projectViewModel.isArabic
? Theme.of(context).primaryColor
: Colors.transparent),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// CircleContainer(
// onTap: () =>
// projectViewModel.changeLanguage('en'),
// child: Text(
// TranslationBase.of(context).lanEnglish,
// style: TextStyle(
// fontSize: 12,
// color: projectViewModel.isArabic
// ? Colors.black
// : Colors.white),
// ),
// color: projectViewModel.isArabic
// ? Colors.transparent
// : Theme.of(context).primaryColor,
// borderWidth: projectViewModel.isArabic ? 3 : 0,
// borderColor: projectViewModel.isArabic
// ? Theme.of(context).primaryColor
// : Colors.transparent,
// ),
// SizedBox(
// width: 20,
// ),
// CircleContainer(
// onTap: () =>
// projectViewModel.changeLanguage('ar'),
// child: Text(
// TranslationBase.of(context).lanArabic,
// style: TextStyle(
// fontSize: 12,
// color: !projectViewModel.isArabic
// ? Colors.black
// : Colors.white),
// ),
// color: !projectViewModel.isArabic
// ? Colors.transparent
// : Theme.of(context).primaryColor,
// borderWidth: !projectViewModel.isArabic ? 3 : 0,
// borderColor: !projectViewModel.isArabic
// ? Theme.of(context).primaryColor
// : Colors.transparent),
// ],
// ),
SizedBox(
height: 10,
),
@ -148,7 +151,8 @@ class LoginPage extends StatelessWidget {
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context).enterCredentialsMsg,
TranslationBase.of(context)
.enterCredentialsMsg,
style: TextStyle(
fontSize: 13, color: Colors.grey),
),
@ -173,7 +177,8 @@ class LoginPage extends StatelessWidget {
return null;
},
onSaved: (value) {
loginRequest.userID = int.parse(value.trim());
loginRequest.userID =
int.parse(value.trim());
},
),
),
@ -195,6 +200,7 @@ class LoginPage extends StatelessWidget {
onSaved: (value) {
loginRequest.password = value;
},
type: 'password',
),
),
SizedBox(
@ -222,7 +228,8 @@ class LoginPage extends StatelessWidget {
),
SizedBox(
height: 10,
),Container(
),
Container(
margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22,
child: Column(
@ -244,7 +251,6 @@ class LoginPage extends StatelessWidget {
),
),
),
),
),
);
@ -257,10 +263,9 @@ class LoginPage extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
Navigator.push(
context, MaterialPageRoute(builder: (context) => DashboardScreen()));
Navigator.push(context,
MaterialPageRoute(builder: (context) => DashboardScreen()));
}
}
}
}

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

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

@ -14,7 +14,7 @@ class RootPage extends StatelessWidget {
Widget buildRoot(APP_STATUS status) {
switch (status) {
case APP_STATUS.UNAUTHENTICATED:
return LoginPage ();
return LoginPage();
break;
case APP_STATUS.AUTHENTICATED:
return DashboardScreen();

@ -39,7 +39,8 @@ class NumberTextInputFormatter extends TextInputFormatter {
final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget {
TextFields({Key key,
TextFields({
Key key,
this.type,
this.hintText,
this.suffixIcon,
@ -76,8 +77,9 @@ class TextFields extends StatefulWidget {
this.borderWidth = 1.5,
this.fieldTextColor,
this.textAlign = TextAlign.start,
this.borderRadius})
: super(key: key);
this.borderRadius,
this.obscureText,
}) : super(key: key);
final String hintText;
final String initialValue;
@ -116,6 +118,7 @@ class TextFields extends StatefulWidget {
final double borderWidth;
final Color fieldTextColor;
final TextAlign textAlign;
final bool obscureText;
@override
_TextFieldsState createState() => _TextFieldsState();
@ -156,23 +159,21 @@ class _TextFieldsState extends State<TextFields> {
padding: const EdgeInsets.only(right: 8.0),
child: view
? InkWell(
onTap: () {
this.setState(() {
view = false;
});
},
child: Icon(EvaIcons.eye,
size: 24.0, color: Theme
.of(context)
.primaryColor))
onTap: () {
this.setState(() {
view = false;
});
},
child: Icon(EvaIcons.eye,
size: 24.0, color: Theme.of(context).primaryColor))
: InkWell(
onTap: () {
this.setState(() {
view = true;
});
},
child: Icon(EvaIcons.eyeOff,
size: 24.0, color: Colors.grey[500])));
onTap: () {
this.setState(() {
view = true;
});
},
child: Icon(EvaIcons.eyeOff,
size: 24.0, color: Colors.grey[500])));
}
case "hourly":
return Align(
@ -212,15 +213,13 @@ class _TextFieldsState extends State<TextFields> {
decoration: widget.bare
? null
: BoxDecoration(boxShadow: [
BoxShadow(
color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
offset: Offset(0.0, 13.0),
blurRadius: focus ? 34.0 : 12.0)
]),
BoxShadow(
color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
offset: Offset(0.0, 13.0),
blurRadius: focus ? 34.0 : 12.0)
]),
child: TextFormField(
keyboardAppearance: Theme
.of(context)
.brightness,
keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate,
onTap: widget.onTap,
@ -228,10 +227,10 @@ class _TextFieldsState extends State<TextFields> {
textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null
? widget.onSubmit
: (val) {
_focusNode.nextFocus();
})
? widget.onSubmit
: (val) {
_focusNode.nextFocus();
})
: widget.onSubmit,
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
@ -248,19 +247,15 @@ class _TextFieldsState extends State<TextFields> {
autofocus: widget.autoFocus ?? false,
validator: widget.validator,
onSaved: widget.onSaved,
style: Theme
.of(context)
.textTheme
.body2
.copyWith(
style: Theme.of(context).textTheme.body2.copyWith(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: widget.color),
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter,
]
WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter,
]
: widget.inputFormatters,
decoration: InputDecoration(
counterText: "",
@ -268,35 +263,31 @@ class _TextFieldsState extends State<TextFields> {
hintStyle: TextStyle(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: Theme
.of(context)
.hintColor),
color: Theme.of(context).hintColor),
contentPadding: widget.padding != null
? widget.padding
: EdgeInsets.symmetric(
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0),
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0),
filled: true,
fillColor: widget.bare
? Colors.transparent
: widget.fieldTextColor != null
? widget.fieldTextColor
: Theme
.of(context)
.backgroundColor,
? widget.fieldTextColor
: Theme.of(context).backgroundColor,
suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.type != "search"
? widget.prefixIcon != null
? Padding(
padding: EdgeInsets.only(
left: 28.0, top: 14.0, bottom: 14.0, right: 0),
child: Text(
"\$",
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w800),
),
)
: null
? Padding(
padding: EdgeInsets.only(
left: 28.0, top: 14.0, bottom: 14.0, right: 0),
child: Text(
"\$",
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w800),
),
)
: null
: Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]),
errorStyle: TextStyle(
fontSize: 14.0,
@ -304,61 +295,50 @@ class _TextFieldsState extends State<TextFields> {
height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme
.of(context)
color: Theme.of(context)
.errorColor
.withOpacity(widget.bare ? 0.0 : 0.5),
width: widget.borderWidth),
borderRadius: widget.bare
? BorderRadius.circular(0.0)
: widget.borderRadius != null
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)),
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme
.of(context)
color: Theme.of(context)
.errorColor
.withOpacity(widget.bare ? 0.0 : 0.5),
width: widget.borderWidth),
borderRadius: widget.bare
? BorderRadius.circular(0.0)
: widget.borderRadius != null
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)),
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme
.of(context)
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)),
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue)),
disabledBorder:
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)),
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)),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme
.of(context)
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),
? widget.borderRadius
: BorderRadius.circular(widget.borderRadiusValue),
)),
),
));

Loading…
Cancel
Save