7/15/1
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:SEFER/constant/api_key.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:SEFER/views/auth/captin/invite_driver_screen.dart';
|
||||
import 'package:SEFER/views/notification/available_rides_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
@@ -72,6 +73,13 @@ class DrawerCaptain extends StatelessWidget {
|
||||
Get.to(() => HelpCaptain(), transition: Transition.size),
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildDrawerItem(
|
||||
icon: Icons.share_outlined,
|
||||
text: 'Share App'.tr,
|
||||
onTap: () =>
|
||||
Get.to(() => InviteDriverScreen(), transition: Transition.size),
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildDrawerItem(
|
||||
icon: Icons.settings,
|
||||
text: 'Settings'.tr,
|
||||
|
||||
@@ -34,6 +34,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
Get.put(HomeCaptainController());
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
checkForUpdate(context);
|
||||
_showFirstTimeOfferNotification(context);
|
||||
});
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@@ -276,7 +277,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox()
|
||||
: const SizedBox()
|
||||
// callPage(),
|
||||
|
||||
// Positioned(
|
||||
@@ -297,35 +298,131 @@ class HomeCaptain extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// class CameraContainer extends StatelessWidget {
|
||||
// TextMLGoogleRecognizerController controller =
|
||||
// Get.put(TextMLGoogleRecognizerController());
|
||||
void _showFirstTimeOfferNotification(BuildContext context) {
|
||||
bool isFirstTime = _checkIfFirstTime();
|
||||
|
||||
// CameraContainer({super.key});
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Stack(
|
||||
// children: [
|
||||
// // The camera preview
|
||||
// SizedBox(
|
||||
// height: Get.height * 0.3,
|
||||
// width: Get.width * 0.9,
|
||||
// child: CameraPreview(controller.imagePicker as CameraController),
|
||||
// ),
|
||||
if (isFirstTime) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
blurRadius: 10.0,
|
||||
offset: Offset(0.0, 10.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Welcome Offer!'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
'As a new driver, you\'re eligible for a special offer!'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.green,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Text(
|
||||
'3000 LE'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: -10,
|
||||
top: -10,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(5),
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.attach_money,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'for your first registration!'.tr,
|
||||
style: const TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.green,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
child: Text(
|
||||
"Get it Now!".tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 18, color: Colors.white),
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
_markAsNotFirstTime();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// // The lines on the side of the name and national number
|
||||
// const Positioned(
|
||||
// bottom: 0,
|
||||
// left: 0,
|
||||
// right: 0,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Text('Name'),
|
||||
// Text('National Number'),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
bool _checkIfFirstTime() {
|
||||
if (box.read(BoxName.isFirstTime) == null) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void _markAsNotFirstTime() {
|
||||
box.write(BoxName.isFirstTime, true);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// borderRadius: BorderRadius.circular(15)),
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// print(box.read(BoxName.rideStatus));
|
||||
// print(box.read(BoxName.tokenDriver));
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.grin_tears,
|
||||
|
||||
Reference in New Issue
Block a user