Visit RD/PD and update sales task
This commit is contained in:
parent
ec339c48ba
commit
2d393a9885
@ -3,6 +3,8 @@ class UserModel {
|
|||||||
String name;
|
String name;
|
||||||
String email;
|
String email;
|
||||||
String uniqueId;
|
String uniqueId;
|
||||||
|
String mobileNumber;
|
||||||
|
String designation;
|
||||||
bool isVerified;
|
bool isVerified;
|
||||||
|
|
||||||
UserModel({
|
UserModel({
|
||||||
@ -10,6 +12,8 @@ class UserModel {
|
|||||||
required this.name,
|
required this.name,
|
||||||
required this.email,
|
required this.email,
|
||||||
required this.uniqueId,
|
required this.uniqueId,
|
||||||
|
required this.mobileNumber,
|
||||||
|
required this.designation,
|
||||||
required this.isVerified,
|
required this.isVerified,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -19,8 +23,9 @@ class UserModel {
|
|||||||
name: json['name'],
|
name: json['name'],
|
||||||
email: json['email'],
|
email: json['email'],
|
||||||
uniqueId: json['uniqueId'],
|
uniqueId: json['uniqueId'],
|
||||||
|
mobileNumber: json['mobileNumber'],
|
||||||
|
designation: json['designation'],
|
||||||
isVerified: json['isVerified'],
|
isVerified: json['isVerified'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,6 @@ class TaskProvider extends ChangeNotifier {
|
|||||||
String? selectedDistributorType,
|
String? selectedDistributorType,
|
||||||
}) async {
|
}) async {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
print("addedFff:$selectedDistributorType");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final data = {
|
final data = {
|
||||||
|
36
lib/provider/visit_pdrd_provider.dart
Normal file
36
lib/provider/visit_pdrd_provider.dart
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import 'package:cheminova/screens/data_submit_successfull.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../services/api_client.dart';
|
||||||
|
import '../services/api_urls.dart';
|
||||||
|
|
||||||
|
class VisitPdRdProvider with ChangeNotifier {
|
||||||
|
final _apiClient = ApiClient();
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
bool get isLoading => _isLoading;
|
||||||
|
|
||||||
|
void setLoading(bool loading) {
|
||||||
|
_isLoading = loading;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> submitVisitPdRd(BuildContext context, String id) async {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
Response response =
|
||||||
|
await _apiClient.put(ApiUrls.updateTaskInventoryUrl + id);
|
||||||
|
debugPrint('Response: $response');
|
||||||
|
setLoading(false);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const DataSubmitSuccessfull()));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setLoading(false);
|
||||||
|
debugPrint("Error: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,20 +1,25 @@
|
|||||||
|
import 'package:cheminova/provider/visit_pdrd_provider.dart';
|
||||||
import 'package:cheminova/widgets/common_drawer.dart';
|
import 'package:cheminova/widgets/common_drawer.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cheminova/widgets/common_background.dart';
|
import 'package:cheminova/widgets/common_background.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import '../widgets/common_app_bar.dart';
|
import '../widgets/common_app_bar.dart';
|
||||||
import '../widgets/common_elevated_button.dart';
|
import '../widgets/common_elevated_button.dart';
|
||||||
import '../widgets/common_text_form_field.dart';
|
import '../widgets/common_text_form_field.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
class VisitDealersScreen extends StatefulWidget {
|
class VisitDealersScreen extends StatefulWidget {
|
||||||
const VisitDealersScreen({super.key});
|
final String? tradeName;
|
||||||
|
final String? id;
|
||||||
|
const VisitDealersScreen({super.key, this.tradeName, this.id});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VisitDealersScreen> createState() => VisitDealersScreenState();
|
State<VisitDealersScreen> createState() => VisitDealersScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class VisitDealersScreenState extends State<VisitDealersScreen> {
|
class VisitDealersScreenState extends State<VisitDealersScreen> {
|
||||||
|
late VisitPdRdProvider _visitPdRdProvider;
|
||||||
final dateController = TextEditingController(
|
final dateController = TextEditingController(
|
||||||
text: DateFormat('dd/MM/yyyy').format(DateTime.now()));
|
text: DateFormat('dd/MM/yyyy').format(DateTime.now()));
|
||||||
|
|
||||||
@ -26,13 +31,10 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
|||||||
final meetingSummaryController = TextEditingController();
|
final meetingSummaryController = TextEditingController();
|
||||||
final followUpActionsController = TextEditingController();
|
final followUpActionsController = TextEditingController();
|
||||||
final nextVisitDateController = TextEditingController();
|
final nextVisitDateController = TextEditingController();
|
||||||
|
late TextEditingController retailerController = TextEditingController();
|
||||||
|
|
||||||
String selectedPurpose = 'Sales/Liquidation';
|
String selectedPurpose = 'Sales';
|
||||||
List<String> purposeOptions = [
|
List<String> purposeOptions = ['Sales', 'Dues collection', 'Others'];
|
||||||
'Sales/Liquidation',
|
|
||||||
'Dues collection',
|
|
||||||
'Others'
|
|
||||||
];
|
|
||||||
|
|
||||||
Future<void> _pickImage() async {
|
Future<void> _pickImage() async {
|
||||||
final ImagePicker picker = ImagePicker();
|
final ImagePicker picker = ImagePicker();
|
||||||
@ -40,34 +42,52 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
|||||||
// Handle the picked image
|
// Handle the picked image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_visitPdRdProvider = VisitPdRdProvider();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CommonBackground(
|
retailerController = TextEditingController(text: widget.tradeName);
|
||||||
child: Scaffold(
|
|
||||||
backgroundColor: Colors.transparent,
|
return ChangeNotifierProvider(
|
||||||
appBar: CommonAppBar(
|
create: (context) => _visitPdRdProvider,
|
||||||
actions: [
|
child: CommonBackground(
|
||||||
IconButton(
|
child: Scaffold(
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
icon: Image.asset('assets/Back_attendance.png'),
|
|
||||||
padding: const EdgeInsets.only(right: 20),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
title: const Text('Visit Retailers',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
fontFamily: 'Anek')),
|
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
elevation: 0,
|
appBar: CommonAppBar(
|
||||||
),
|
actions: [
|
||||||
drawer: const CommonDrawer(),
|
IconButton(
|
||||||
body: Padding(
|
onPressed: () {
|
||||||
padding: const EdgeInsets.all(16.0),
|
Navigator.pop(context);
|
||||||
child: SingleChildScrollView(
|
},
|
||||||
|
icon: Image.asset('assets/Back_attendance.png'),
|
||||||
|
padding: const EdgeInsets.only(right: 20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
title: Column(
|
||||||
|
children: [
|
||||||
|
const Text('Visit Retailers',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontFamily: 'Anek')),
|
||||||
|
Text(widget.tradeName ?? '',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontFamily: 'Anek')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
drawer: const CommonDrawer(),
|
||||||
|
body: SingleChildScrollView(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -77,7 +97,7 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
|||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(20.0).copyWith(top: 30, bottom: 30),
|
const EdgeInsets.all(20.0).copyWith(top: 30, bottom: 30),
|
||||||
// margin: const EdgeInsets.symmetric(horizontal: 30.0),
|
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.white),
|
border: Border.all(color: Colors.white),
|
||||||
color: const Color(0xffB4D1E5).withOpacity(0.9),
|
color: const Color(0xffB4D1E5).withOpacity(0.9),
|
||||||
@ -86,9 +106,10 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonTextFormField(
|
CommonTextFormField(
|
||||||
|
readOnly: true,
|
||||||
title: 'Select Retailer',
|
title: 'Select Retailer',
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
controller: dealerController),
|
controller: retailerController),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
CommonTextFormField(
|
CommonTextFormField(
|
||||||
title: 'Visit date',
|
title: 'Visit date',
|
||||||
@ -155,15 +176,19 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Align(
|
Consumer<VisitPdRdProvider>(
|
||||||
alignment: Alignment.center,
|
builder: (context, value, child) => Align(
|
||||||
child: CommonElevatedButton(
|
alignment: Alignment.center,
|
||||||
borderRadius: 30,
|
child: CommonElevatedButton(
|
||||||
width: double.infinity,
|
borderRadius: 30,
|
||||||
height: kToolbarHeight - 10,
|
width: double.infinity,
|
||||||
text: 'SUBMIT',
|
height: kToolbarHeight - 10,
|
||||||
backgroundColor: const Color(0xff004791),
|
text: 'SUBMIT',
|
||||||
onPressed: () {},
|
backgroundColor: const Color(0xff004791),
|
||||||
|
onPressed: () {
|
||||||
|
value.submitVisitPdRd(context, widget.id ?? '');
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -49,8 +49,7 @@ class _AssignTasksScreenState extends State<AssignTasksScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate Distributor
|
// Validate Distributor
|
||||||
if ((taskProvider.selectedTask == 'Update Inventory Data' ||
|
if ((taskProvider.selectedTask != 'Collect KYC') &&
|
||||||
taskProvider.selectedTask == 'Visit RD/PD') &&
|
|
||||||
(taskProvider.selectedDistributor == null ||
|
(taskProvider.selectedDistributor == null ||
|
||||||
selectedDistributorType == null)) {
|
selectedDistributorType == null)) {
|
||||||
_isDistributorValid = false;
|
_isDistributorValid = false;
|
||||||
@ -267,7 +266,7 @@ class _AssignTasksScreenState extends State<AssignTasksScreen> {
|
|||||||
taskProvider.setSelectedTask(value);
|
taskProvider.setSelectedTask(value);
|
||||||
},
|
},
|
||||||
title: const Text(
|
title: const Text(
|
||||||
"Update Sales Data",
|
"Update Sales Data Data",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -345,7 +344,8 @@ class _AssignTasksScreenState extends State<AssignTasksScreen> {
|
|||||||
},
|
},
|
||||||
if (taskProvider.selectedTask ==
|
if (taskProvider.selectedTask ==
|
||||||
'Update Inventory Data' ||
|
'Update Inventory Data' ||
|
||||||
taskProvider.selectedTask == 'Visit RD/PD') ...{
|
taskProvider.selectedTask == 'Visit RD/PD' ||
|
||||||
|
taskProvider.selectedTask == 'Update Sales Data') ...{
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 15.0,
|
horizontal: 15.0,
|
||||||
|
@ -165,8 +165,7 @@ class _ConfirmTaskScreenState extends State<ConfirmTaskScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
if (taskProvider.selectedTask == 'Update Inventory Data' ||
|
if (taskProvider.selectedTask != 'Collect KYC') ...{
|
||||||
taskProvider.selectedTask == 'Visit RD/PD') ...{
|
|
||||||
_customContainer(
|
_customContainer(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:cheminova/notification_service.dart';
|
import 'package:cheminova/notification_service.dart';
|
||||||
import 'package:cheminova/provider/user_provider.dart';
|
import 'package:cheminova/provider/user_provider.dart';
|
||||||
|
import 'package:cheminova/screens/Visit_Dealers_screen.dart';
|
||||||
import 'package:cheminova/screens/assign_task_dash_board_screen.dart';
|
import 'package:cheminova/screens/assign_task_dash_board_screen.dart';
|
||||||
import 'package:cheminova/screens/calendar_screen.dart';
|
import 'package:cheminova/screens/calendar_screen.dart';
|
||||||
import 'package:cheminova/screens/collect_kyc_screen.dart';
|
import 'package:cheminova/screens/collect_kyc_screen.dart';
|
||||||
@ -7,14 +8,12 @@ import 'package:cheminova/screens/mark_attendence_screen.dart';
|
|||||||
import 'package:cheminova/screens/notification_screen.dart';
|
import 'package:cheminova/screens/notification_screen.dart';
|
||||||
import 'package:cheminova/screens/products_manual_screen.dart';
|
import 'package:cheminova/screens/products_manual_screen.dart';
|
||||||
import 'package:cheminova/screens/rejected_application_screen.dart';
|
import 'package:cheminova/screens/rejected_application_screen.dart';
|
||||||
import 'package:cheminova/screens/summary_screen.dart';
|
|
||||||
import 'package:cheminova/screens/product_sales_data.dart';
|
import 'package:cheminova/screens/product_sales_data.dart';
|
||||||
import 'package:cheminova/screens/update_inventory_screen.dart';
|
import 'package:cheminova/screens/update_inventory_screen.dart';
|
||||||
import 'package:cheminova/screens/display_sales_screen.dart';
|
import 'package:cheminova/screens/display_sales_screen.dart';
|
||||||
import 'package:cheminova/widgets/common_drawer.dart';
|
import 'package:cheminova/widgets/common_drawer.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cheminova/widgets/common_background.dart';
|
import 'package:cheminova/widgets/common_background.dart';
|
||||||
import 'package:cheminova/screens/daily_tasks_screen.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class HomePage extends StatefulWidget {
|
class HomePage extends StatefulWidget {
|
||||||
@ -106,17 +105,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
_buildCustomCard('Daily Tasks', 'Dashboard', onTap: () {
|
_buildCustomCard('Assign Tasks', 'Dashboard', onTap: () {
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => const DailyTasksScreen(),
|
|
||||||
));
|
|
||||||
}),
|
|
||||||
const SizedBox(
|
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
_buildCustomCard('Assign Tasks', '', onTap: () {
|
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@ -130,9 +119,8 @@ class _HomePageState extends State<HomePage> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: _buildCustomCard(
|
child: _buildCustomCard('Display\nSales data',
|
||||||
'Display\nSales data', 'Quickly display Sales',
|
'Quickly display Sales\n', onTap: () {
|
||||||
onTap: () {
|
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@ -163,14 +151,19 @@ class _HomePageState extends State<HomePage> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child:
|
child: _buildCustomCard(
|
||||||
_buildCustomCard('Summary', '\n\n', onTap: () {
|
'Visit RD/PD',
|
||||||
Navigator.push(
|
'\n\n',
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => const SummaryScreen(),
|
builder: (context) =>
|
||||||
));
|
const VisitDealersScreen(),
|
||||||
}),
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 12,
|
width: 12,
|
||||||
|
@ -19,7 +19,7 @@ class ProductSalesDataState extends State<ProductSalesData> {
|
|||||||
text: DateFormat('dd/MM/yyyy').format(DateTime.now()));
|
text: DateFormat('dd/MM/yyyy').format(DateTime.now()));
|
||||||
|
|
||||||
final timeController =
|
final timeController =
|
||||||
TextEditingController(text: DateFormat('hh:mm a').format(DateTime.now()));
|
TextEditingController(text: DateFormat('hh:mm a').format(DateTime.now()));
|
||||||
|
|
||||||
final locationController = TextEditingController();
|
final locationController = TextEditingController();
|
||||||
final notesController = TextEditingController();
|
final notesController = TextEditingController();
|
||||||
@ -29,19 +29,19 @@ class ProductSalesDataState extends State<ProductSalesData> {
|
|||||||
final salesController = TextEditingController();
|
final salesController = TextEditingController();
|
||||||
final commentController = TextEditingController();
|
final commentController = TextEditingController();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CommonBackground(
|
return CommonBackground(
|
||||||
child: Scaffold(backgroundColor: Colors.transparent,
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
appBar: CommonAppBar(
|
appBar: CommonAppBar(
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: ()
|
onPressed: () {
|
||||||
{
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
icon: Image.asset('assets/Back_attendance.png'), padding: const EdgeInsets.only(right: 20),
|
icon: Image.asset('assets/Back_attendance.png'),
|
||||||
|
padding: const EdgeInsets.only(right: 20),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
title: const Text('Product Sales Data',
|
title: const Text('Product Sales Data',
|
||||||
@ -49,7 +49,9 @@ class ProductSalesDataState extends State<ProductSalesData> {
|
|||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
fontFamily: 'Anek')), backgroundColor: Colors.transparent, elevation: 0,
|
fontFamily: 'Anek')),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
elevation: 0,
|
||||||
),
|
),
|
||||||
drawer: const CommonDrawer(),
|
drawer: const CommonDrawer(),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
@ -63,7 +65,7 @@ class ProductSalesDataState extends State<ProductSalesData> {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(20.0).copyWith(top: 30, bottom: 30),
|
const EdgeInsets.all(20.0).copyWith(top: 30, bottom: 30),
|
||||||
// margin: const EdgeInsets.symmetric(horizontal: 30.0),
|
// margin: const EdgeInsets.symmetric(horizontal: 30.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.white),
|
border: Border.all(color: Colors.white),
|
||||||
@ -77,42 +79,42 @@ class ProductSalesDataState extends State<ProductSalesData> {
|
|||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
controller: dealercontroller),
|
controller: dealercontroller),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
|
|
||||||
CommonTextFormField(
|
CommonTextFormField(
|
||||||
title: 'Select Product: Product A',
|
title: 'Select Product: Product A',
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
controller: productController),
|
controller: productController),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
|
|
||||||
CommonTextFormField(
|
CommonTextFormField(
|
||||||
title: 'Date Range: 10-06 to 20-06',
|
title: 'Date Range: 10-06 to 20-06',
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
controller: dateController),
|
controller: dateController),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
|
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: CommonElevatedButton(
|
child: CommonElevatedButton(
|
||||||
borderRadius: 30,
|
borderRadius: 30,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: kToolbarHeight - 10,
|
height: kToolbarHeight - 10,
|
||||||
text: 'VIEW DATA',
|
text: 'VIEW DATA',
|
||||||
backgroundColor: const Color(0xff004791),
|
backgroundColor: const Color(0xff004791),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(context, MaterialPageRoute(builder: (context) => const DataSubmitSuccessfull(),));
|
Navigator.push(
|
||||||
},
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
)
|
builder: (context) =>
|
||||||
|
const DataSubmitSuccessfull(),
|
||||||
),
|
));
|
||||||
],
|
},
|
||||||
|
)),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
103
lib/screens/profile_screen.dart
Normal file
103
lib/screens/profile_screen.dart
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import 'package:cheminova/provider/user_provider.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:cheminova/widgets/common_app_bar.dart';
|
||||||
|
import 'package:cheminova/widgets/common_background.dart';
|
||||||
|
import 'package:cheminova/widgets/common_drawer.dart';
|
||||||
|
|
||||||
|
class ProfileScreen extends StatelessWidget {
|
||||||
|
const ProfileScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
CommonBackground(
|
||||||
|
isFullWidth: true,
|
||||||
|
child: Scaffold(
|
||||||
|
drawer: const CommonDrawer(),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
appBar: CommonAppBar(
|
||||||
|
title: const Text('Profile'),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
elevation: 0,
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
icon: Image.asset('assets/Back_attendance.png'),
|
||||||
|
padding: const EdgeInsets.only(right: 20),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Consumer<UserProvider>(
|
||||||
|
builder: (context, userProvider, child) {
|
||||||
|
final profileData = userProvider.user;
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(20.0)
|
||||||
|
.copyWith(top: 15, bottom: 30),
|
||||||
|
margin: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 30.0, vertical: 20.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.white),
|
||||||
|
color: const Color(0xffB4D1E5).withOpacity(0.9),
|
||||||
|
borderRadius: BorderRadius.circular(26.0),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
_buildProfileItem('Name', profileData?.name ?? ''),
|
||||||
|
_buildProfileItem('ID', profileData?.uniqueId ?? ''),
|
||||||
|
_buildProfileItem(
|
||||||
|
'Email ID', profileData?.email ?? ''),
|
||||||
|
_buildProfileItem('Mobile Number',
|
||||||
|
profileData?.mobileNumber ?? ''),
|
||||||
|
_buildProfileItem(
|
||||||
|
'Designation', profileData?.designation ?? ''),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildProfileItem(String label, String value) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
label,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Color(0xff004791),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Divider(color: Colors.grey),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ class TaskManagementScreen extends StatefulWidget {
|
|||||||
class _TaskManagementScreenState extends State<TaskManagementScreen> {
|
class _TaskManagementScreenState extends State<TaskManagementScreen> {
|
||||||
final TextEditingController _searchController = TextEditingController();
|
final TextEditingController _searchController = TextEditingController();
|
||||||
List<TaskModel> _filteredTaskList = [];
|
List<TaskModel> _filteredTaskList = [];
|
||||||
String? _selectedChip; // State to track the selected chip
|
String? _selectedChip = 'New'; // State to track the selected chip
|
||||||
|
|
||||||
void _filterTaskList(String query) {
|
void _filterTaskList(String query) {
|
||||||
if (query.isEmpty || query == '' || query == ' ') {
|
if (query.isEmpty || query == '' || query == ' ') {
|
||||||
@ -165,7 +165,11 @@ class _TaskManagementScreenState extends State<TaskManagementScreen> {
|
|||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
itemCount: _filteredTaskList.length,
|
itemCount: _filteredTaskList.length,
|
||||||
itemBuilder: (context, index) => _taskView(
|
itemBuilder: (context, index) => _taskView(
|
||||||
task: _filteredTaskList[index],
|
task: _filteredTaskList[
|
||||||
|
_selectedChip == 'Completed'
|
||||||
|
? index
|
||||||
|
: ((_filteredTaskList.length - 1) -
|
||||||
|
index)],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -19,4 +19,5 @@ class ApiUrls {
|
|||||||
static const String assignTask = 'task/assign-task';
|
static const String assignTask = 'task/assign-task';
|
||||||
static const String getProductsManual = 'productmanual/getall';
|
static const String getProductsManual = 'productmanual/getall';
|
||||||
static const String getAllTasks = 'task/alltasks/';
|
static const String getAllTasks = 'task/alltasks/';
|
||||||
|
static const String updateTaskInventoryUrl = '';
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import 'package:cheminova/provider/user_provider.dart';
|
|||||||
import 'package:cheminova/screens/change_password_screen.dart';
|
import 'package:cheminova/screens/change_password_screen.dart';
|
||||||
import 'package:cheminova/screens/home_screen.dart';
|
import 'package:cheminova/screens/home_screen.dart';
|
||||||
import 'package:cheminova/screens/login_screen.dart';
|
import 'package:cheminova/screens/login_screen.dart';
|
||||||
|
import 'package:cheminova/screens/profile_screen.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@ -72,7 +73,14 @@ class CommonDrawer extends StatelessWidget {
|
|||||||
leading: const Icon(Icons.account_circle),
|
leading: const Icon(Icons.account_circle),
|
||||||
title: const Text('Profile'),
|
title: const Text('Profile'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return const ProfileScreen();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
Loading…
Reference in New Issue
Block a user