push notification of tasks
This commit is contained in:
parent
b4bf13214a
commit
b29af415a4
@ -104,6 +104,7 @@ class _UpdateInventoryTaskScreenState extends State<UpdateInventoryTaskScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AddProductsScreen(
|
||||
distributorType: tasksList.addedFor!,
|
||||
inventoryId: tasksList.sId!,
|
||||
tradeName: tasksList.tradeName??'',
|
||||
pdRdId: tasksList.sId!)));
|
||||
}
|
||||
|
@ -158,7 +158,6 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
}
|
||||
|
||||
Widget _buildTaskList(int tabIndex) {
|
||||
|
||||
return Consumer<DailyTaskProvider>(
|
||||
builder: (context, value, child) => value.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
@ -184,7 +183,9 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
|
||||
Widget _buildTaskCard(Tasks tasksList) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
onTap: _selectedTabIndex == 2
|
||||
? null // Disable click when on the "COMPLETED" tab
|
||||
: () {
|
||||
if (tasksList.task == 'Collect KYC') {
|
||||
Navigator.push(
|
||||
context,
|
||||
@ -203,8 +204,9 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AddProductsScreen(
|
||||
distributorType: tasksList.addedFor!,
|
||||
tradeName: tasksList.tradeName?? '',
|
||||
pdRdId: tasksList.addedForId!, inventoryId:tasksList.sId)));
|
||||
tradeName: tasksList.tradeName ?? '',
|
||||
pdRdId: tasksList.addedForId!,
|
||||
inventoryId: tasksList.sId)));
|
||||
} else if (tasksList.task == 'Update Sales Data') {
|
||||
Navigator.push(
|
||||
context,
|
||||
@ -215,7 +217,8 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => VisitDealersScreen(
|
||||
tradeName: tasksList.tradeName??'',
|
||||
tradeName: tasksList.tradeName ?? '',
|
||||
id: tasksList.sId,
|
||||
)));
|
||||
}
|
||||
},
|
||||
@ -233,22 +236,25 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Anek')),
|
||||
trailing:
|
||||
const Icon(Icons.arrow_forward_ios, color: Colors.black87)),
|
||||
trailing: _selectedTabIndex == 2
|
||||
? null // Remove arrow icon in "COMPLETED" tab
|
||||
: const Icon(Icons.arrow_forward_ios, color: Colors.black87),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (tasksList.note != null)
|
||||
Text('Note: ${tasksList.note}'),
|
||||
if(tasksList.addedFor != null)
|
||||
if (tasksList.note != null) Text('Note: ${tasksList.note}'),
|
||||
if (tasksList.addedFor != null)
|
||||
Text('Distributor: ${tasksList.addedFor ?? ""}'),
|
||||
if(tasksList.tradeName != null) Text('Trade Name: ${tasksList.tradeName ?? ""}'),
|
||||
if(tasksList.taskDueDate != null) Text('Due Date: ${DateFormat('dd/MM/yyyy').format(DateTime.parse(tasksList.taskDueDate!))}'),
|
||||
if(
|
||||
tasksList.taskPriority != null
|
||||
)Text('Priority: ${tasksList.taskPriority}'),
|
||||
if (tasksList.tradeName != null)
|
||||
Text('Trade Name: ${tasksList.tradeName ?? ""}'),
|
||||
if (tasksList.taskDueDate != null)
|
||||
Text(
|
||||
'Due Date: ${DateFormat('dd/MM/yyyy').format(DateTime.parse(tasksList.taskDueDate!))}'),
|
||||
if (tasksList.taskPriority != null)
|
||||
Text('Priority: ${tasksList.taskPriority}'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -258,4 +264,3 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ class DisplaySalesScreenState extends State<DisplaySalesScreen> {
|
||||
icon: Image.asset('assets/Back_attendance.png'), padding: const EdgeInsets.only(right: 20),
|
||||
),
|
||||
],
|
||||
title: const Text('Display Sales',
|
||||
title: const Text('Update Sales Data',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.black,
|
||||
|
@ -1,5 +1,8 @@
|
||||
import 'package:cheminova/provider/forgot_password_provider.dart';
|
||||
import 'package:cheminova/screens/change_password_screen.dart';
|
||||
import 'package:cheminova/screens/login_screen.dart';
|
||||
import 'package:cheminova/screens/password_change_screen.dart';
|
||||
import 'package:cheminova/screens/verify_code_screen.dart';
|
||||
import 'package:cheminova/widgets/common_background.dart';
|
||||
import 'package:cheminova/widgets/common_elevated_button.dart';
|
||||
import 'package:cheminova/widgets/common_text_form_field.dart';
|
||||
|
@ -52,10 +52,6 @@ class _HomePageState extends State<HomePage> {
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: CommonAppBar(
|
||||
title: Row(children: [
|
||||
// CircleAvatar(
|
||||
// backgroundImage: AssetImage(
|
||||
// 'assets/profile.png'), // Replace with actual user image
|
||||
// ),
|
||||
const SizedBox(width: 10),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
const Text('Welcome',
|
||||
@ -81,160 +77,73 @@ class _HomePageState extends State<HomePage> {
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
double screenWidth = constraints.maxWidth;
|
||||
double buttonWidth = screenWidth / 2 - 18; // Adjust button width
|
||||
|
||||
return ListView(
|
||||
children: [
|
||||
_buildCustomCard(
|
||||
'Mark Attendance',
|
||||
'Mark Attendance / On Leave',
|
||||
screenWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const MarkAttendanceScreen(),
|
||||
));
|
||||
builder: (context) => const MarkAttendanceScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
_buildCustomCard('Daily Tasks', 'Dashboard', onTap: () {
|
||||
const SizedBox(height: 5),
|
||||
_buildCustomCard(
|
||||
'Daily Tasks',
|
||||
'Dashboard',
|
||||
screenWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const DailyTasksScreen(),
|
||||
));
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Display\nSales data', 'Quickly display Sales',
|
||||
'Update\nSales data',
|
||||
'Quickly display Sales',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const DisplaySalesScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildCustomCard('Update Inventory Data',
|
||||
'Quickly Inventory Data', onTap: () {
|
||||
child: _buildCustomCard(
|
||||
'Update Inventory Data',
|
||||
'Quickly Inventory Data',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const UpdateInventoryTaskScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
_buildCustomCard('Summary', '\n\n', onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const SummaryScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Product\nSales Data Visibility', '',
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ProductSalesData(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard('Collect \nKYC Data',
|
||||
'Scan and upload KYC Documents', onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const SelectTaskkycScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard('Rejected Applications',
|
||||
'Re-upload Rejected Documents', onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const RejectedApplicationScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Notifications', 'Tasks & Alerts\n\n',
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const NotificationScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Calendar',
|
||||
' Upcoming Appointments & Deadlines',
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const CalendarScreen(),
|
||||
));
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -245,22 +154,108 @@ class _HomePageState extends State<HomePage> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Products Manual', 'details of products',
|
||||
'Notifications',
|
||||
'Tasks & Alerts\n\n',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const NotificationScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Product\nSales Data Visibility',
|
||||
'',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ProductSalesData(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
_buildCustomCard(
|
||||
'Collect \nKYC Data',
|
||||
'Scan and upload KYC Documents',
|
||||
screenWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const SelectTaskkycScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
_buildCustomCard(
|
||||
'Rejected Applications',
|
||||
'Re-upload Rejected Documents',
|
||||
screenWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const RejectedApplicationScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Calendar',
|
||||
'Appointments & Deadlines',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const CalendarScreen(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildCustomCard(
|
||||
'Products Manual',
|
||||
'Details of products',
|
||||
buttonWidth,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ProductsManualScreen(),
|
||||
));
|
||||
}),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -268,9 +263,10 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCustomCard(String title, String subtitle,
|
||||
Widget _buildCustomCard(String title, String subtitle, double width,
|
||||
{void Function()? onTap}) {
|
||||
return Container(
|
||||
width: width,
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.indigo,
|
||||
@ -278,7 +274,6 @@ class _HomePageState extends State<HomePage> {
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: ListTile(
|
||||
// trailing: Image.asset('assets/forward_icon.png'),
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
|
@ -49,7 +49,7 @@ class ProfileScreen extends StatelessWidget {
|
||||
children: [
|
||||
SizedBox(height: 20),
|
||||
_buildProfileItem('Name', profileData?.name ?? ''),
|
||||
_buildProfileItem('ID', profileData?.sId ?? ''),
|
||||
_buildProfileItem('ID', profileData?.uniqueId ?? ''),
|
||||
_buildProfileItem('Email ID', profileData?.email ?? ''),
|
||||
_buildProfileItem('Mobile Number', profileData?.mobileNumber ?? ''),
|
||||
_buildProfileItem('Designation', profileData?.designation ?? ''),
|
||||
|
@ -36,7 +36,7 @@ class CommonDrawer extends StatelessWidget {
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18)),
|
||||
Text(value.profileResponse!.myData!.sId!,
|
||||
Text(value.profileResponse!.myData!.uniqueId!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15))
|
||||
|
Loading…
Reference in New Issue
Block a user