Api integrated of Sales Task

This commit is contained in:
Vaibhav 2024-09-06 13:20:22 +05:30
parent 03813b5e83
commit 59b758a7b5
3 changed files with 16 additions and 2 deletions

View File

@ -150,7 +150,8 @@ class CollectKycProvider extends ChangeNotifier {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Trade Name is required')), const SnackBar(content: Text('Trade Name is required')),
); );
} else if (nameController.text.trim().isEmpty) { } else
if (nameController.text.trim().isEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Name is required')), const SnackBar(content: Text('Name is required')),
); );
@ -318,6 +319,7 @@ class CollectKycProvider extends ChangeNotifier {
String? inventoryId; String? inventoryId;
void setId(String id) { void setId(String id) {
print('inventory id: $id');
inventoryId = id; inventoryId = id;
notifyListeners(); notifyListeners();
} }

View File

@ -185,12 +185,13 @@ class _DailyTasksScreenState extends State<DailyTasksScreen> {
onTap: _selectedTabIndex == 2 onTap: _selectedTabIndex == 2
? null // Disable click when on the "COMPLETED" tab ? null // Disable click when on the "COMPLETED" tab
: () { : () {
print('Task: ${tasksList.toJson()}');
if (tasksList.task == 'Collect KYC') { if (tasksList.task == 'Collect KYC') {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
CollectKycScreen(id: tasksList.taskId ?? ''))); CollectKycScreen(id: tasksList.sId ?? '')));
} else if (tasksList.task == 'REUPLOAD') { } else if (tasksList.task == 'REUPLOAD') {
Navigator.push( Navigator.push(
context, context,

View File

@ -46,6 +46,17 @@ class RetailerDetailsScreenState extends State<RetailerDetailsScreen> {
Column( Column(
children: [ children: [
const SizedBox(height: 15), const SizedBox(height: 15),
CommonTextFormField(
title: 'Trade Name',
fillColor: Colors.white,
validator: (String? value) {
if (value!.isEmpty) {
return 'Trade Name cannot be empty';
}
return null;
},
controller: value.tradeNameController),
const SizedBox(height: 15),
CommonTextFormField( CommonTextFormField(
title: 'Name', title: 'Name',
fillColor: Colors.white, fillColor: Colors.white,