last 16-10-2025
This commit is contained in:
commit
7546b7348c
269 files changed
+36404
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import 'dart:core';
|
||||
|
||||
class AppAssets {
|
||||
static const String flashscreen = 'assets/images/logo.jpeg';
|
||||
static const String welcome = 'assets/images/welcomepage.png';
|
||||
static const String login = 'assets/images/login.png';
|
||||
static const String history = 'assets/images/history.png';
|
||||
static const String categories = 'assets/images/categories.png';
|
||||
static const String package = 'assets/images/package.png';
|
||||
static const String home = 'assets/images/home.png';
|
||||
static const String menu = 'assets/images/menu.png';
|
||||
static const String banner = 'assets/images/banner.png';
|
||||
static const String free = 'assets/images/free.png';
|
||||
static const String paid = 'assets/images/paid.png';
|
||||
static const String clean = 'assets/images/clean.png';
|
||||
static const String subscription = 'assets/images/subscription.png';
|
||||
static const String cleaning = 'assets/images/cleaning.png';
|
||||
static const String arrowbutton = 'assets/images/arrowbutton.png';
|
||||
static const String drawer = 'assets/images/drawer.png';
|
||||
static const String background = 'assets/images/background.png';
|
||||
static const String subscriptionimage = 'assets/images/subscriptionimage.png';
|
||||
static const String allicon = 'assets/images/Allicon.png';
|
||||
static const String filtericon = 'assets/images/filtericon.png';
|
||||
static const String sucess = 'assets/images/sucess.png';
|
||||
static const String changepass = 'assets/images/changepass.png';
|
||||
static const String vendorwelcome = 'assets/images/vendorwelcome.png';
|
||||
static const String profile = 'assets/images/profileimage.png';
|
||||
static const String freeicon = 'assets/images/freeicon.png';
|
||||
static const String paidicon = 'assets/images/paidicon.png';
|
||||
static const String share = 'assets/images/share.png';
|
||||
static const String map = 'assets/images/map.png';
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../controllers/base_controller.dart';
|
||||
|
||||
class AppColors {
|
||||
bool darkTheme = false;
|
||||
|
||||
BaseController baseCtrl = Get.put(BaseController());
|
||||
|
||||
AppColors() {
|
||||
baseCtrl.isDarkModeEnabled.listen((value) {
|
||||
changeColors();
|
||||
});
|
||||
}
|
||||
|
||||
void changeColors() {
|
||||
if (darkTheme == true) {
|
||||
dark = Colors.white;
|
||||
} else {
|
||||
dark = Colors.black;
|
||||
}
|
||||
}
|
||||
|
||||
static Color dark = Colors.black;
|
||||
static const Color primary = Color(0xFF0066FF);
|
||||
static const Color secondprimary = Color(0xFFffffff);
|
||||
static const Color thridprimary = Color(0xFF000000);
|
||||
static const Color flitericoncolor = Color(0xFF625353);
|
||||
static const Color hittext = Color(0xFF5E5858);
|
||||
static const Color ratingstar = Color(0xFFF55B03);
|
||||
static const Color flashscreen = Color(0xFFFEFAF7);
|
||||
static const Color lightgray = Color(0xff555555);
|
||||
|
||||
static const Color lightGrey = Color(0xFFEBE9E9);
|
||||
static const Color lightWhite = Color(0xFFFAFAFA);
|
||||
static const Color lightBlue = Color(0xFFE8F5FF);
|
||||
static const Color purple = Color(0xFF9C34C2);
|
||||
static const Color red = Color(0xFFFF0000);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CommanButton extends StatelessWidget {
|
||||
final String text;
|
||||
final VoidCallback onPressed;
|
||||
final bool isPrimary;
|
||||
final Color backgroundColor;
|
||||
final Color borderColor;
|
||||
final Color textColor;
|
||||
final double width;
|
||||
final double height;
|
||||
final double borderRadius;
|
||||
final TextStyle? textStyle;
|
||||
|
||||
// ignore: use_super_parameters
|
||||
const CommanButton({
|
||||
Key? key,
|
||||
required this.text,
|
||||
required this.onPressed,
|
||||
this.isPrimary = true,
|
||||
this.backgroundColor = const Color(0xFF0066FF),
|
||||
this.borderColor = const Color(0xFFAAAAAA),
|
||||
this.textColor = Colors.white,
|
||||
this.width = 311.1557922363281,
|
||||
this.height = 64.22110748291016,
|
||||
this.borderRadius = 36.18,
|
||||
this.textStyle,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Color bgColor = isPrimary ? backgroundColor : Colors.white;
|
||||
final Color txtColor = isPrimary ? textColor : borderColor;
|
||||
|
||||
return SizedBox(
|
||||
width: width,
|
||||
height: height,
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 0,
|
||||
backgroundColor: bgColor,
|
||||
side: BorderSide(color: borderColor, width: 1),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: textStyle ?? TextStyle(color: txtColor, fontSize: 16),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CommonTextFormField extends StatelessWidget {
|
||||
final String? hintText;
|
||||
final TextEditingController? controller;
|
||||
final String? Function(String?)? validator;
|
||||
final bool obscureText;
|
||||
final Widget? prefixIcon;
|
||||
final Widget? suffixIcon;
|
||||
final TextInputType? keyboardType;
|
||||
final String? errorText;
|
||||
final void Function(String)? onChanged;
|
||||
final int? maxLines;
|
||||
final int? minLines;
|
||||
final bool expands;
|
||||
|
||||
const CommonTextFormField({
|
||||
super.key,
|
||||
this.hintText,
|
||||
this.controller,
|
||||
this.validator,
|
||||
this.obscureText = false,
|
||||
this.prefixIcon,
|
||||
this.suffixIcon,
|
||||
this.keyboardType,
|
||||
this.errorText,
|
||||
this.onChanged,
|
||||
this.maxLines,
|
||||
this.minLines,
|
||||
this.expands = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isMultiline = (maxLines != null && maxLines! > 1) || expands;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 360,
|
||||
height: isMultiline ? null : 57.89,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16.28),
|
||||
border: Border.all(
|
||||
color: errorText != null ? Colors.red : const Color(0xFFBDBCBC),
|
||||
width: 0.9,
|
||||
),
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: controller,
|
||||
validator: validator,
|
||||
obscureText: obscureText,
|
||||
keyboardType: keyboardType ??
|
||||
(isMultiline ? TextInputType.multiline : TextInputType.text),
|
||||
onChanged: onChanged,
|
||||
maxLines: expands ? null : maxLines ?? 1,
|
||||
minLines: expands ? null : minLines,
|
||||
expands: expands,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 18,
|
||||
),
|
||||
hintText: hintText,
|
||||
border: InputBorder.none,
|
||||
prefixIcon: prefixIcon,
|
||||
suffixIcon: suffixIcon,
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (errorText != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0, top: 4.0),
|
||||
child: Text(
|
||||
errorText!,
|
||||
style: const TextStyle(color: Colors.red, fontSize: 12),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
import 'package:bookmywages/routers/consts_router.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class DrawerMenu extends StatelessWidget {
|
||||
final String userName;
|
||||
final String userImage;
|
||||
|
||||
const DrawerMenu({
|
||||
super.key,
|
||||
required this.userName,
|
||||
required this.userImage,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// final indexController = InheritedIndexController.of(context);
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
height: 580,
|
||||
child: GestureDetector(
|
||||
// This captures horizontal drag gestures for the entire drawer
|
||||
onHorizontalDragEnd: (details) {
|
||||
if (details.primaryVelocity! < 0) {
|
||||
// Close drawer only when swiped left (negative velocity)
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
child: Drawer(
|
||||
backgroundColor: Colors.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(50),
|
||||
bottomRight: Radius.circular(50),
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
// User Profile Section
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundImage: NetworkImage(userImage),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
userName,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Gilroy-Bold',
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
// Menu Items - Completely removed Navigator.pop
|
||||
_buildMenuItem(
|
||||
icon: Icons.home,
|
||||
iconColor: Colors.orange,
|
||||
title: 'Dashboard',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.card_membership,
|
||||
iconColor: Colors.blue,
|
||||
title: 'Package/Subscription',
|
||||
onTap: () {
|
||||
Get.offAllNamed(RouterConts.packageList, arguments: 1);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.book,
|
||||
iconColor: Colors.deepPurple,
|
||||
title: 'Book Services',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.history,
|
||||
arguments: {
|
||||
'historyTab': 0, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.history,
|
||||
iconColor: Colors.pink,
|
||||
title: 'History',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.history,
|
||||
arguments: {
|
||||
'historyTab': 0, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.notifications,
|
||||
iconColor: Colors.amber[800]!,
|
||||
title: 'Notification',
|
||||
onTap: () {
|
||||
// Only handle navigation logic here
|
||||
// DO NOT close drawer
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.person,
|
||||
iconColor: Colors.green,
|
||||
title: 'My account',
|
||||
onTap: () {
|
||||
Get.offAllNamed(RouterConts.profilemainscreen);
|
||||
},
|
||||
),
|
||||
|
||||
const Spacer(),
|
||||
|
||||
// Sign Out
|
||||
_buildMenuItem(
|
||||
icon: Icons.exit_to_app,
|
||||
iconColor: Colors.indigo,
|
||||
title: 'Sign out',
|
||||
onTap: () async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove('userId');
|
||||
await prefs.remove('vendor_id');
|
||||
await prefs.remove('data');
|
||||
|
||||
// Using GetX navigation
|
||||
Get.offAllNamed(RouterConts.loginpage);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMenuItem({
|
||||
required IconData icon,
|
||||
required Color iconColor,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return ListTile(
|
||||
leading: Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: iconColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: iconColor, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Gilroy-Medium',
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: onTap,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
import 'package:bookmywages/consts_widgets/app_colors.dart';
|
||||
import 'package:bookmywages/routers/consts_router.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class DrawerMenuVendor extends StatelessWidget {
|
||||
final String userName;
|
||||
final String userImage;
|
||||
|
||||
const DrawerMenuVendor({
|
||||
super.key,
|
||||
required this.userName,
|
||||
required this.userImage,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// final indexController = InheritedIndex1Controller.of(context);
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
height: 600,
|
||||
child: GestureDetector(
|
||||
// This captures horizontal drag gestures for the entire drawer
|
||||
onHorizontalDragEnd: (details) {
|
||||
if (details.primaryVelocity! < 0) {
|
||||
// Close drawer only when swiped left (negative velocity)
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
child: Drawer(
|
||||
backgroundColor: Colors.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(50),
|
||||
bottomRight: Radius.circular(50),
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// User Profile Section
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 24,
|
||||
backgroundImage: NetworkImage(userImage),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Text(
|
||||
userName,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Gilroy-Bold',
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Menu Items - Fixed navigation logic
|
||||
_buildMenuItem(
|
||||
icon: Icons.home,
|
||||
iconColor: Colors.orange,
|
||||
title: 'Dashboard',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.card_membership,
|
||||
iconColor: Colors.blue,
|
||||
title: 'Package/Subscription',
|
||||
onTap: () {
|
||||
Get.offAllNamed(RouterConts.vendorpackage, arguments: 1);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.book,
|
||||
iconColor: Colors.deepPurple,
|
||||
title: 'Book Services',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.vendorhistory,
|
||||
arguments: {
|
||||
'historyTab': 0, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.payment,
|
||||
iconColor: Colors.pink,
|
||||
title: 'Payment',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.vendorhistory,
|
||||
arguments: {
|
||||
'historyTab': 2, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.person_add_alt_rounded,
|
||||
iconColor: Colors.amber[800]!,
|
||||
title: 'Service Management',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.vendorhistory,
|
||||
arguments: {
|
||||
'historyTab': 1, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.person,
|
||||
iconColor: AppColors.primary,
|
||||
title: 'Enquiry Management',
|
||||
onTap: () {
|
||||
Get.offAllNamed(
|
||||
RouterConts.vendorhistory,
|
||||
arguments: {
|
||||
'historyTab': 4, // Enquiry list tab
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.person,
|
||||
iconColor: Colors.green,
|
||||
title: 'My account',
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
Get.toNamed(RouterConts.profilemainvendor);
|
||||
},
|
||||
),
|
||||
|
||||
const Spacer(),
|
||||
|
||||
// Sign Out
|
||||
_buildMenuItem(
|
||||
icon: Icons.exit_to_app,
|
||||
iconColor: Colors.indigo,
|
||||
title: 'Sign out',
|
||||
onTap: () async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove('userId');
|
||||
await prefs.remove('vendor_id');
|
||||
await prefs.remove('data');
|
||||
|
||||
// Using GetX navigation
|
||||
Get.offAllNamed(RouterConts.loginpage);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMenuItem({
|
||||
required IconData icon,
|
||||
required Color iconColor,
|
||||
required String title,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return ListTile(
|
||||
leading: Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: iconColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(icon, color: iconColor, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'Gilroy-Medium',
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
onTap: onTap,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user