You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
13 KiB
Dart
1 line
13 KiB
Dart
import 'package:driverapp/app-icons/driver_app_icons.dart';
|
|
import 'package:driverapp/config/config.dart';
|
|
import 'package:driverapp/core/viewModels/orders_view_model.dart';
|
|
import 'package:driverapp/pages/base/base_view.dart';
|
|
import 'package:driverapp/root_page.dart';
|
|
import 'package:driverapp/uitl/utils.dart';
|
|
import 'package:driverapp/widgets/bottom_sheet/action_sheet_button.dart';
|
|
import 'package:driverapp/widgets/buttons/secondary_button.dart';
|
|
import 'package:driverapp/widgets/data_display/text.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
import 'package:location/location.dart';
|
|
|
|
import '../../uitl/translations_delegate_base.dart';
|
|
import '../../widgets/others/app_scaffold_widget.dart';
|
|
|
|
class RequestPermissionPage extends StatelessWidget {
|
|
RequestPermissionPage();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
showDeliveryOptions(OrdersViewModel model) {
|
|
showModalBottomSheet(
|
|
backgroundColor: Colors.white,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(50.0),
|
|
topRight: Radius.circular(50.0),
|
|
),
|
|
),
|
|
context: context,
|
|
builder: (BuildContext bc) {
|
|
return ListView(
|
|
children: <Widget>[
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(50.0),
|
|
topRight: Radius.circular(50.0),
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Center(
|
|
child: Texts(
|
|
TranslationBase.of(context).selectAction,
|
|
color: Colors.black,
|
|
fontSize: 22,
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
FractionallySizedBox(
|
|
widthFactor: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? 0.9
|
|
: 0.98,
|
|
child: Container(
|
|
height: MediaQuery.of(context).size.height * 0.45,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(50.0),
|
|
topRight: Radius.circular(50.0),
|
|
),
|
|
),
|
|
width: double.infinity,
|
|
child: ListView(
|
|
children: <Widget>[
|
|
Column(
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 3,
|
|
child: Container(
|
|
color: Hexcolor("#D5D5D5"),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 15,
|
|
),
|
|
ActionSheetButton(
|
|
label:
|
|
TranslationBase.of(context).delivered,
|
|
icon: DriverApp.deliverd_icon,
|
|
onTap: () {},
|
|
),
|
|
SizedBox(height: 15),
|
|
ActionSheetButton(
|
|
label: TranslationBase.of(context)
|
|
.deliveredAccepted,
|
|
icon: DriverApp.not_available,
|
|
onTap: () {},
|
|
),
|
|
SizedBox(height: 15),
|
|
ActionSheetButton(
|
|
label: TranslationBase.of(context)
|
|
.deliveredRejected,
|
|
icon: DriverApp.rejected_icon,
|
|
onTap: () {},
|
|
),
|
|
SizedBox(height: 15),
|
|
ActionSheetButton(
|
|
label: TranslationBase.of(context).canceled,
|
|
icon: DriverApp.not_reachable_icon,
|
|
onTap: () {},
|
|
),
|
|
SizedBox(height: 15),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
});
|
|
}
|
|
|
|
return BaseView<OrdersViewModel>(
|
|
builder: (_, model, w) => AppScaffold(
|
|
isShowAppBar: true,
|
|
appBarColor: Color(0xff49C1BC),
|
|
arrowColor: Colors.white,
|
|
titleColor: Colors.white,
|
|
appBarTitle: "request Permissions",
|
|
isAppBarGradient: true,
|
|
body: Container(
|
|
child: Container(
|
|
decoration: BoxDecoration(gradient: LINEAR_GRADIENT),
|
|
child: ListView(
|
|
children: <Widget>[
|
|
Column(
|
|
children: <Widget>[
|
|
Stack(
|
|
children: <Widget>[
|
|
// Container(
|
|
// width: MediaQuery.of(context).size.width,
|
|
// height: MediaQuery.of(context).size.width,
|
|
// ),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 75.0),
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width * 1.0,
|
|
height: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? MediaQuery.of(context).size.height * 0.70
|
|
: MediaQuery.of(context).size.height * 1.7,
|
|
margin: EdgeInsets.only(
|
|
top: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? MediaQuery.of(context).size.width * 0.23
|
|
: MediaQuery.of(context).size.width * 0.13),
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(45),
|
|
topRight: Radius.circular(45)),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? MediaQuery.of(context).size.height *
|
|
0.05
|
|
: MediaQuery.of(context).size.height *
|
|
0.29,
|
|
//MediaQuery.of(context).size.width * 0.005,
|
|
),
|
|
Padding(
|
|
padding: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? EdgeInsets.only(top: 60.0)
|
|
: EdgeInsets.only(top: 15.0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: <Widget>[
|
|
Text("Delivery app need permission")
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
height:
|
|
MediaQuery.of(context).size.width * 0.08,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(
|
|
left: MediaQuery.of(context).size.width *
|
|
0.05,
|
|
right: MediaQuery.of(context).size.width *
|
|
0.05,
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment:
|
|
CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 8),
|
|
child: Text(
|
|
TranslationBase.of(context)
|
|
.packageContent,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w900,
|
|
fontSize: 20),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height:
|
|
MediaQuery.of(context).size.width *
|
|
0.05,
|
|
),
|
|
Padding(
|
|
padding:
|
|
const EdgeInsets.only(left: 10),
|
|
child: Column(),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
height:
|
|
MediaQuery.of(context).size.width * 0.1,
|
|
),
|
|
Container(
|
|
margin: MediaQuery.of(context).orientation ==
|
|
Orientation.portrait
|
|
? EdgeInsets.all(8.0)
|
|
: EdgeInsets.symmetric(horizontal: 12.0),
|
|
child: SecondaryButton(
|
|
label: "Give permission",
|
|
onTap: () async {
|
|
Location location = new Location();
|
|
await location.requestPermission();
|
|
Utils.getLocationPermission()
|
|
.then((value) {
|
|
if (value == PermissionStatus.granted) {
|
|
Navigator.pushReplacement(
|
|
AppGlobal.context,
|
|
MaterialPageRoute(
|
|
builder: (context) => RootPage(),
|
|
),
|
|
);
|
|
}
|
|
});
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
// CustomerBriefCard(
|
|
// itemId: 11,
|
|
// customerFirstName: "item.firstName",
|
|
// customerLastName: "item.lastName",
|
|
// mobileNo: "item.mobileNumber",
|
|
// totalPayment: "item.amount",
|
|
// deliveryTime: "item.orderCreatedOn",
|
|
// ),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|