diff --git a/lib/screens/Update_inventorytask_screen.dart b/lib/screens/Update_inventorytask_screen.dart index f611507..b460e14 100644 --- a/lib/screens/Update_inventorytask_screen.dart +++ b/lib/screens/Update_inventorytask_screen.dart @@ -104,6 +104,7 @@ class _UpdateInventoryTaskScreenState extends State { MaterialPageRoute( builder: (context) => AddProductsScreen( distributorType: tasksList.addedFor!, + inventoryId: tasksList.sId!, tradeName: tasksList.tradeName??'', pdRdId: tasksList.sId!))); } diff --git a/lib/screens/daily_tasks_screen.dart b/lib/screens/daily_tasks_screen.dart index fe71576..67891a0 100644 --- a/lib/screens/daily_tasks_screen.dart +++ b/lib/screens/daily_tasks_screen.dart @@ -96,10 +96,10 @@ class _DailyTasksScreenState extends State { decoration: BoxDecoration( gradient: _selectedTabIndex == index ? const LinearGradient( - colors: [Color(0xff004791), Color(0xff1a73e8)], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ) + colors: [Color(0xff004791), Color(0xff1a73e8)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ) : null, color: _selectedTabIndex == index ? Colors.transparent @@ -158,33 +158,34 @@ class _DailyTasksScreenState extends State { } Widget _buildTaskList(int tabIndex) { - return Consumer( builder: (context, value, child) => value.isLoading ? const Center(child: CircularProgressIndicator()) : ListView.separated( - padding: const EdgeInsets.all(16), - itemCount: _selectedTabIndex == 0 - ? value.newTasksList.length - : _selectedTabIndex == 1 - ? value.pendingTasksList.length - : value.completedTasksList.length, - separatorBuilder: (context, index) => const SizedBox(height: 8), - itemBuilder: (context, index) { - final tasksList = tabIndex == 0 - ? value.newTasksList - : tabIndex == 1 - ? value.pendingTasksList - : value.completedTasksList; - return _buildTaskCard(tasksList[index]); - }, - ), + padding: const EdgeInsets.all(16), + itemCount: _selectedTabIndex == 0 + ? value.newTasksList.length + : _selectedTabIndex == 1 + ? value.pendingTasksList.length + : value.completedTasksList.length, + separatorBuilder: (context, index) => const SizedBox(height: 8), + itemBuilder: (context, index) { + final tasksList = tabIndex == 0 + ? value.newTasksList + : tabIndex == 1 + ? value.pendingTasksList + : value.completedTasksList; + return _buildTaskCard(tasksList[index]); + }, + ), ); } 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 { 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 { context, MaterialPageRoute( builder: (context) => VisitDealersScreen( - tradeName: tasksList.tradeName??'', + tradeName: tasksList.tradeName ?? '', + id: tasksList.sId, ))); } }, @@ -226,29 +229,32 @@ class _DailyTasksScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ ListTile( - leading: const Icon(Icons.task, color: Colors.blueAccent), - title: Text(tasksList.task ?? '', - style: const TextStyle( - color: Colors.black87, - fontWeight: FontWeight.w700, - fontSize: 16, - fontFamily: 'Anek')), - trailing: - const Icon(Icons.arrow_forward_ios, color: Colors.black87)), + leading: const Icon(Icons.task, color: Colors.blueAccent), + title: Text(tasksList.task ?? '', + style: const TextStyle( + color: Colors.black87, + fontWeight: FontWeight.w700, + fontSize: 16, + fontFamily: 'Anek')), + 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 { ); } } - diff --git a/lib/screens/display_sales_screen.dart b/lib/screens/display_sales_screen.dart index a41cb7e..8167bab 100644 --- a/lib/screens/display_sales_screen.dart +++ b/lib/screens/display_sales_screen.dart @@ -43,7 +43,7 @@ class DisplaySalesScreenState extends State { 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, diff --git a/lib/screens/forgot_password_screen.dart b/lib/screens/forgot_password_screen.dart index 9f0ad8d..00eeb07 100644 --- a/lib/screens/forgot_password_screen.dart +++ b/lib/screens/forgot_password_screen.dart @@ -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'; diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 37c0884..6448861 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -52,10 +52,6 @@ class _HomePageState extends State { 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', @@ -65,13 +61,13 @@ class _HomePageState extends State { fontWeight: FontWeight.w400)), Consumer( builder: (context, value, child) => - (value.profileResponse == null || - value.profileResponse!.myData == null || - value.profileResponse!.myData!.name == null) - ? const SizedBox() - : Text(value.profileResponse!.myData!.name ?? '', - style: const TextStyle( - color: Colors.black87, fontSize: 20))) + (value.profileResponse == null || + value.profileResponse!.myData == null || + value.profileResponse!.myData!.name == null) + ? const SizedBox() + : Text(value.profileResponse!.myData!.name ?? '', + style: const TextStyle( + color: Colors.black87, fontSize: 20))) ]) ]), backgroundColor: Colors.transparent, @@ -81,186 +77,185 @@ class _HomePageState extends State { body: SafeArea( child: Padding( padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: ListView( - children: [ - _buildCustomCard( - 'Mark Attendance', - 'Mark Attendance / On Leave', - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const MarkAttendanceScreen(), - )); - }, - ), - const SizedBox( - height: 5, - ), - _buildCustomCard('Daily Tasks', 'Dashboard', onTap: () { + 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 DailyTasksScreen(), - )); - }), - const SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: _buildCustomCard( - 'Display\nSales data', 'Quickly display Sales', - onTap: () { + context, + MaterialPageRoute( + builder: (context) => const MarkAttendanceScreen(), + ), + ); + }, + ), + const SizedBox(height: 5), + _buildCustomCard( + 'Daily Tasks', + 'Dashboard', + screenWidth, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const DailyTasksScreen(), + ), + ); + }, + ), + const SizedBox(height: 5), + Row( + children: [ + Expanded( + child: _buildCustomCard( + 'Update\nSales data', + 'Quickly display Sales', + buttonWidth, + onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const DisplaySalesScreen(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => + const DisplaySalesScreen(), + ), + ); + }, ), - const SizedBox( - width: 12, - ), - Expanded( - child: _buildCustomCard('Update Inventory Data', - 'Quickly Inventory Data', onTap: () { + ), + const SizedBox(width: 12), + Expanded( + child: _buildCustomCard( + 'Update Inventory Data', + 'Quickly Inventory Data', + buttonWidth, + onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const UpdateInventoryTaskScreen(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => + const UpdateInventoryTaskScreen(), + ), + ); + }, ), - ], - ), - const SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: - _buildCustomCard('Summary', '\n\n', onTap: () { + ), + ], + ), + const SizedBox(height: 5), + Row( + children: [ + Expanded( + child: _buildCustomCard( + 'Notifications', + 'Tasks & Alerts\n\n', + buttonWidth, + onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const SummaryScreen(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => + const NotificationScreen(), + ), + ); + }, ), - const SizedBox( - width: 12, - ), - Expanded( - child: _buildCustomCard( - 'Product\nSales Data Visibility', '', - onTap: () { + ), + const SizedBox(width: 12), + Expanded( + child: _buildCustomCard( + 'Product\nSales Data Visibility', + '', + buttonWidth, + onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const ProductSalesData(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => + const ProductSalesData(), + ), + ); + }, ), - ], - ), - const SizedBox(height: 5), - Row( - children: [ - Expanded( - child: _buildCustomCard('Collect \nKYC Data', - 'Scan and upload KYC Documents', onTap: () { + ), + ], + ), + 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 SelectTaskkycScreen(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => const CalendarScreen(), + ), + ); + }, ), - ], - ), - const SizedBox(height: 5), - Row( - children: [ - Expanded( - child: _buildCustomCard('Rejected Applications', - 'Re-upload Rejected Documents', onTap: () { + ), + const SizedBox(width: 12), + Expanded( + child: _buildCustomCard( + 'Products Manual', + 'Details of products', + buttonWidth, + onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const RejectedApplicationScreen(), - )); - }), + context, + MaterialPageRoute( + builder: (context) => + const ProductsManualScreen(), + ), + ); + }, ), - ], - ), - 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(), - )); - }, - ), - ), - ], - ), - const SizedBox(height: 5), - Row( - children: [ - Expanded( - child: _buildCustomCard( - 'Products Manual', 'details of products', - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const ProductsManualScreen(), - )); - }), - ), - ], - ), - ], - ), - ), - ], + ), + ], + ), + ], + ); + }, ), ), ), @@ -268,9 +263,10 @@ class _HomePageState extends State { ); } - 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 { borderRadius: BorderRadius.circular(10), ), child: ListTile( - // trailing: Image.asset('assets/forward_icon.png'), title: Text( title, style: const TextStyle( @@ -289,9 +284,9 @@ class _HomePageState extends State { ), subtitle: subtitle.isNotEmpty ? Text( - subtitle, - style: const TextStyle(color: Colors.white70, fontSize: 13), - ) + subtitle, + style: const TextStyle(color: Colors.white70, fontSize: 13), + ) : null, onTap: onTap, ), diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 3526459..4b9df96 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -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 ?? ''), diff --git a/lib/widgets/common_drawer.dart b/lib/widgets/common_drawer.dart index f3b1084..d1b0eb3 100644 --- a/lib/widgets/common_drawer.dart +++ b/lib/widgets/common_drawer.dart @@ -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))