change base Url
This commit is contained in:
parent
67ed0ce21c
commit
11b3b130d9
@ -64,7 +64,7 @@ class MarkLeaveProvider extends ChangeNotifier{
|
||||
"date": date,
|
||||
"time": time,
|
||||
"reason": reason,
|
||||
"leaveType":leaveType,
|
||||
"leaveType":'$leaveType Leave',
|
||||
});
|
||||
setLoading(false);
|
||||
if (response.statusCode == 200) {
|
||||
|
@ -30,7 +30,10 @@ class SelectTaskProvider extends ChangeNotifier {
|
||||
setLoading(false);
|
||||
if (response.statusCode == 200) {
|
||||
final data = SelectTaskKycResponse.fromJson(response.data);
|
||||
tasksList = data.tasks ?? [];
|
||||
tasksList = data!.tasks!
|
||||
.where(
|
||||
(element) => element.taskStatus!.toLowerCase() != "completed")
|
||||
.toList();
|
||||
notifyListeners();
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -15,12 +15,13 @@ class AddSalesProductScreen extends StatefulWidget {
|
||||
final String pdRdId;
|
||||
final String? inventoryId;
|
||||
|
||||
const AddSalesProductScreen(
|
||||
{super.key,
|
||||
const AddSalesProductScreen({
|
||||
super.key,
|
||||
required this.distributorType,
|
||||
required this.tradeName,
|
||||
required this.pdRdId,
|
||||
this.inventoryId});
|
||||
this.inventoryId,
|
||||
});
|
||||
|
||||
@override
|
||||
State<AddSalesProductScreen> createState() => _AddSalesProductScreenState();
|
||||
@ -34,34 +35,24 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
salesTaskProvider = Provider.of<AddSalesProvider>(context, listen: false);
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
dateController.text = DateFormat('dd/MM/yyyy').format(DateTime.now());
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
salesTaskProvider.getTask();
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchController.dispose();
|
||||
dateController.dispose();
|
||||
if (mounted) {
|
||||
salesTaskProvider.resetProducts();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
datePicker() async {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime(2101),
|
||||
);
|
||||
if (picked != null) {
|
||||
setState(
|
||||
() => dateController.text = DateFormat('dd/MM/yyyy').format(picked));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
@ -74,17 +65,22 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: Image.asset('assets/Back_attendance.png'),
|
||||
padding: const EdgeInsets.only(right: 20))
|
||||
padding: const EdgeInsets.only(right: 20),
|
||||
)
|
||||
],
|
||||
title: Text('${widget.distributorType}\n${widget.tradeName}',
|
||||
title: Text(
|
||||
'${widget.distributorType}\n${widget.tradeName}',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Anek')),
|
||||
fontFamily: 'Anek',
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0),
|
||||
elevation: 0,
|
||||
),
|
||||
drawer: const CommonDrawer(),
|
||||
bottomNavigationBar: Consumer<AddSalesProvider>(
|
||||
builder: (context, value, child) => Column(
|
||||
@ -100,140 +96,40 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.9),
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Consumer<AddSalesProvider>(
|
||||
builder:
|
||||
(context, value, child) =>
|
||||
StatefulBuilder(builder:
|
||||
(context,
|
||||
setState) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(
|
||||
18.0),
|
||||
child: TextField(
|
||||
controller: searchController,
|
||||
decoration: const InputDecoration(labelText: 'Search by name or SKU', border: OutlineInputBorder(), prefixIcon: Icon(Icons.search)),
|
||||
onChanged: (val) {
|
||||
value.filterProducts(
|
||||
val);
|
||||
setState(
|
||||
() {});
|
||||
})),
|
||||
Expanded(
|
||||
child: ListView
|
||||
.builder(
|
||||
itemCount: searchController.text.isEmpty
|
||||
? value.tasksList.length
|
||||
: value.searchList.length,
|
||||
itemBuilder: (context, index) {
|
||||
bool isAlreadySelected = value.selectedProducts.any((selectedProduct) => selectedProduct.SKU == value.tasksList[index].SKU);
|
||||
final data = searchController.text.isEmpty ? value.tasksList[index] : value.searchList[index];
|
||||
return Card(
|
||||
child: ListTile(
|
||||
title: Text(data.ProductName ?? '', style: TextStyle(color: isAlreadySelected ? Colors.grey : Colors.black)),
|
||||
subtitle: Text(data.SKU ?? '', style: TextStyle(color: isAlreadySelected ? Colors.grey : Colors.black)),
|
||||
onTap: isAlreadySelected
|
||||
? null
|
||||
: () {
|
||||
setState(() => value.selectedProducts.add(data));
|
||||
Navigator.pop(context);
|
||||
}));
|
||||
}))
|
||||
]);
|
||||
}));
|
||||
},
|
||||
).whenComplete(() => setState(() {}));
|
||||
},
|
||||
onPressed: () => _showProductSelectionBottomSheet(context),
|
||||
backgroundColor: Colors.white,
|
||||
icon: const Icon(Icons.add,
|
||||
color: Colors.black),
|
||||
label: const Text('Add Products',
|
||||
style:
|
||||
TextStyle(color: Colors.black))),
|
||||
icon: const Icon(Icons.add, color: Colors.black),
|
||||
label: const Text('Add Products', style: TextStyle(color: Colors.black)),
|
||||
),
|
||||
if (value.selectedProducts.isNotEmpty) ...[
|
||||
const SizedBox(height: 16.0),
|
||||
Consumer<AddSalesProvider>(
|
||||
builder: (context, value, child) =>
|
||||
CommonElevatedButton(
|
||||
borderRadius: 30,
|
||||
width: double.infinity,
|
||||
height: kToolbarHeight - 10,
|
||||
text: 'SUBMIT',
|
||||
backgroundColor:
|
||||
const Color(0xff004791),
|
||||
onPressed: () {
|
||||
if (formKey.currentState!
|
||||
.validate()) {
|
||||
if (value.selectedProducts
|
||||
.isNotEmpty &&
|
||||
value.selectedProducts.every((product) =>
|
||||
product.SKU!
|
||||
.isNotEmpty &&
|
||||
product.ProductName!
|
||||
.isNotEmpty &&
|
||||
product.SalesAmount !=
|
||||
null &&
|
||||
product.QuantitySold !=
|
||||
null)) {
|
||||
value.submitProducts(
|
||||
distributorType: widget
|
||||
.distributorType,
|
||||
pdRdId: widget.pdRdId,
|
||||
inventoryId:
|
||||
widget.inventoryId,
|
||||
date: dateController
|
||||
.text
|
||||
.trim(),
|
||||
tradeName:
|
||||
widget.tradeName);
|
||||
} else {
|
||||
ScaffoldMessenger.of(
|
||||
context)
|
||||
.showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Please fill out all product details, including sale and inventory.')),
|
||||
);
|
||||
}
|
||||
}
|
||||
}))
|
||||
]
|
||||
]))),
|
||||
backgroundColor: const Color(0xff004791),
|
||||
onPressed: () => _submitProducts(value),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
body:
|
||||
Consumer<AddSalesProvider>(builder: (context, value, child) {
|
||||
return Stack(children: [
|
||||
Column(children: [
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(),
|
||||
child: AbsorbPointer(
|
||||
child: Padding(
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Consumer<AddSalesProvider>(
|
||||
builder: (context, value, child) {
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Form(
|
||||
key: formKey,
|
||||
child: TextFormField(
|
||||
controller: dateController,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please select a date';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
readOnly: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Date',
|
||||
fillColor: Colors.white,
|
||||
@ -243,9 +139,6 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (value.selectedProducts.isNotEmpty)
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
@ -254,8 +147,7 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
return ProductBlock(
|
||||
onUpdate: (updatedProduct) {
|
||||
setState(() {
|
||||
value.selectedProducts[index] =
|
||||
updatedProduct;
|
||||
value.selectedProducts[index] = updatedProduct;
|
||||
});
|
||||
},
|
||||
onRemove: () {
|
||||
@ -263,21 +155,120 @@ class _AddSalesProductScreenState extends State<AddSalesProductScreen> {
|
||||
value.selectedProducts.removeAt(index);
|
||||
});
|
||||
},
|
||||
product: value.selectedProducts[index]);
|
||||
}))
|
||||
]),
|
||||
(value.isLoading)
|
||||
? Container(
|
||||
product: value.selectedProducts[index],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (value.isLoading)
|
||||
Container(
|
||||
color: Colors.black12,
|
||||
child:
|
||||
const Center(child: CircularProgressIndicator()))
|
||||
: const SizedBox()
|
||||
]);
|
||||
}))),
|
||||
child: const Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showProductSelectionBottomSheet(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Consumer<AddSalesProvider>(
|
||||
builder: (context, value, child) => StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(18.0),
|
||||
child: TextField(
|
||||
controller: searchController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Search by name or SKU',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.search),
|
||||
),
|
||||
onChanged: (val) {
|
||||
value.filterProducts(val);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: searchController.text.isEmpty
|
||||
? value.tasksList.length
|
||||
: value.searchList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final data = searchController.text.isEmpty
|
||||
? value.tasksList[index]
|
||||
: value.searchList[index];
|
||||
bool isAlreadySelected = value.selectedProducts
|
||||
.any((selectedProduct) => selectedProduct.SKU == data.SKU);
|
||||
return Card(
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
data.ProductName ?? '',
|
||||
style: TextStyle(color: isAlreadySelected ? Colors.grey : Colors.black),
|
||||
),
|
||||
subtitle: Text(
|
||||
data.SKU ?? '',
|
||||
style: TextStyle(color: isAlreadySelected ? Colors.grey : Colors.black),
|
||||
),
|
||||
onTap: isAlreadySelected
|
||||
? null
|
||||
: () {
|
||||
setState(() => value.selectedProducts.add(data));
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
).whenComplete(() => setState(() {}));
|
||||
}
|
||||
|
||||
void _submitProducts(AddSalesProvider value) {
|
||||
if (formKey.currentState!.validate()) {
|
||||
if (value.selectedProducts.isNotEmpty &&
|
||||
value.selectedProducts.every((product) =>
|
||||
product.SKU!.isNotEmpty &&
|
||||
product.ProductName!.isNotEmpty &&
|
||||
product.SalesAmount != null &&
|
||||
product.QuantitySold != null)) {
|
||||
value.submitProducts(
|
||||
distributorType: widget.distributorType,
|
||||
pdRdId: widget.pdRdId,
|
||||
inventoryId: widget.inventoryId,
|
||||
date: dateController.text.trim(),
|
||||
tradeName: widget.tradeName,
|
||||
);
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Please fill out all product details, including sale and inventory.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The ProductBlock class remains unchanged
|
||||
class ProductBlock extends StatefulWidget {
|
||||
final SalesProduct product;
|
||||
final ValueChanged<SalesProduct> onUpdate;
|
||||
@ -305,8 +296,7 @@ class _ProductBlockState extends State<ProductBlock> {
|
||||
super.initState();
|
||||
saleAmountController.text = (widget.product.SalesAmount ?? '').toString();
|
||||
commentController.text = (widget.product.comments ?? '').toString();
|
||||
quantitySoldController.text =
|
||||
(widget.product.QuantitySold ?? '').toString();
|
||||
quantitySoldController.text = (widget.product.QuantitySold ?? '').toString();
|
||||
}
|
||||
|
||||
void validateInput() {
|
||||
@ -346,17 +336,21 @@ class _ProductBlockState extends State<ProductBlock> {
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.all(8),
|
||||
child: Stack(children: [
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child:
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Product: ${widget.product.ProductName}',
|
||||
style: const TextStyle(fontSize: 16)),
|
||||
Text('SKU: ${widget.product.SKU}',
|
||||
style: const TextStyle(fontSize: 15)),
|
||||
const SizedBox(height: 8),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextField(
|
||||
controller: saleAmountController,
|
||||
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
||||
@ -365,10 +359,12 @@ class _ProductBlockState extends State<ProductBlock> {
|
||||
labelText: 'Sales amount',
|
||||
errorText: saleAmountController.text.isEmpty
|
||||
? 'Sales amount cannot be empty.'
|
||||
: null),
|
||||
: null,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
enabled: true,
|
||||
onChanged: (_) => validateInput()),
|
||||
onChanged: (_) => validateInput(),
|
||||
),
|
||||
TextField(
|
||||
controller: quantitySoldController,
|
||||
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
||||
@ -377,19 +373,25 @@ class _ProductBlockState extends State<ProductBlock> {
|
||||
labelText: 'Quantity sold',
|
||||
errorText: quantitySoldController.text.isEmpty
|
||||
? 'Quantity sold cannot be empty.'
|
||||
: null),
|
||||
: null,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
enabled: true,
|
||||
onChanged: (_) => validateInput()),
|
||||
onChanged: (_) => validateInput(),
|
||||
),
|
||||
TextField(
|
||||
controller: commentController,
|
||||
onTapOutside: (event) => FocusScope.of(context).unfocus(),
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Comments',),
|
||||
labelText: 'Comments',
|
||||
),
|
||||
enabled: true,
|
||||
onChanged: (_) => validateInput())
|
||||
]),
|
||||
]),
|
||||
onChanged: (_) => validateInput(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
@ -399,25 +401,19 @@ class _ProductBlockState extends State<ProductBlock> {
|
||||
Icons.delete_outlined,
|
||||
color: Colors.red,
|
||||
),
|
||||
onPressed: widget.onRemove)),
|
||||
]));
|
||||
}
|
||||
onPressed: widget.onRemove,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class ProductModel {
|
||||
final String sku;
|
||||
final String productName;
|
||||
final int? sale;
|
||||
final int? inventory;
|
||||
final String? comments;
|
||||
final String? date;
|
||||
|
||||
ProductModel({
|
||||
required this.sku,
|
||||
required this.productName,
|
||||
this.sale,
|
||||
this.inventory,
|
||||
this.comments,
|
||||
this.date,
|
||||
});
|
||||
@override
|
||||
void dispose() {
|
||||
saleAmountController.dispose();
|
||||
quantitySoldController.dispose();
|
||||
commentController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
import 'package:cheminova/provider/markleave_provider.dart';
|
||||
import 'package:cheminova/screens/Attendance_success.dart';
|
||||
import 'package:cheminova/widgets/common_drawer.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -7,6 +6,7 @@ import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../provider/markleave_provider.dart';
|
||||
import '../widgets/common_app_bar.dart';
|
||||
import '../widgets/common_elevated_button.dart';
|
||||
import '../widgets/common_text_form_field.dart';
|
||||
@ -22,7 +22,7 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
late MarkLeaveProvider _markLeaveProvider;
|
||||
|
||||
final dateController = TextEditingController(
|
||||
text: DateFormat('dd/MM/yyyy').format(DateTime.now()));
|
||||
text: DateFormat('yyyy/MM/dd').format(DateTime.now()));
|
||||
|
||||
final timeController =
|
||||
TextEditingController(text: DateFormat('hh:mm a').format(DateTime.now()));
|
||||
@ -43,7 +43,8 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => onLeaveTypeSelected(leaveType),
|
||||
child: Container(margin: const EdgeInsets.only(bottom: 10),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
width: 120,
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||
decoration: BoxDecoration(
|
||||
@ -62,6 +63,7 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -106,17 +108,17 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider<MarkLeaveProvider>(
|
||||
create: (_) => _markLeaveProvider,
|
||||
builder: (context, child) =>
|
||||
CommonBackground(
|
||||
child: Scaffold(backgroundColor: Colors.transparent,
|
||||
builder: (context, child) => CommonBackground(
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: CommonAppBar(
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: ()
|
||||
{
|
||||
onPressed: () {
|
||||
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('On Leave',
|
||||
@ -124,7 +126,9 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
fontSize: 28,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Anek')), backgroundColor: Colors.transparent, elevation: 0,
|
||||
fontFamily: 'Anek')),
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
),
|
||||
drawer: const CommonDrawer(),
|
||||
body: Padding(
|
||||
@ -137,8 +141,8 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.all(20.0).copyWith(top: 30, bottom: 30),
|
||||
padding: const EdgeInsets.all(20.0)
|
||||
.copyWith(top: 30, bottom: 30),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 30.0),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.white),
|
||||
@ -166,7 +170,8 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: 'Anek')),
|
||||
const SizedBox(height: 3),
|
||||
Wrap(direction: Axis.horizontal,
|
||||
Wrap(
|
||||
direction: Axis.horizontal,
|
||||
children: [
|
||||
buildLeaveTypeOption('Sick'),
|
||||
const SizedBox(width: 10),
|
||||
@ -186,25 +191,34 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Consumer<MarkLeaveProvider>(
|
||||
builder: (context, value, child) =>CommonElevatedButton(
|
||||
builder: (context, value, child) =>
|
||||
CommonElevatedButton(
|
||||
borderRadius: 30,
|
||||
width: double.infinity,
|
||||
height: kToolbarHeight - 10,
|
||||
text: 'ON LEAVE',
|
||||
backgroundColor: const Color(0xff00784C),
|
||||
backgroundColor:
|
||||
const Color(0xff00784C),
|
||||
onPressed: () {
|
||||
value
|
||||
.markLeave(
|
||||
dateController.text.trim(),
|
||||
timeController.text.trim(),
|
||||
locationController.text.trim(),
|
||||
notesController.text.trim(), selectedLeaveType)
|
||||
dateController.text
|
||||
.trim(),
|
||||
timeController.text
|
||||
.trim(),
|
||||
locationController.text
|
||||
.trim(),
|
||||
notesController.text
|
||||
.trim(),
|
||||
selectedLeaveType)
|
||||
.then(
|
||||
(result) {
|
||||
var (status, message) = result;
|
||||
var (status, message) =
|
||||
result;
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(SnackBar(
|
||||
content: Text(message)));
|
||||
content:
|
||||
Text(message)));
|
||||
if (status) {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
@ -217,17 +231,15 @@ class _OnLeaveScreenState extends State<OnLeaveScreen> {
|
||||
|
||||
// Navigator.push(context, MaterialPageRoute(builder:(context) => const AttendanceSuccess(),));
|
||||
}),
|
||||
)
|
||||
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),),
|
||||
)
|
||||
);
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -146,13 +146,13 @@ class VisitDealersScreenState extends State<VisitDealersScreen> {
|
||||
CommonTextFormField(
|
||||
title: 'Meeting Summary:',
|
||||
fillColor: Colors.white,
|
||||
maxLines: 4,
|
||||
maxLines: 3,
|
||||
controller: meetingSummaryController),
|
||||
const SizedBox(height: 15),
|
||||
CommonTextFormField(
|
||||
title: 'Follow-up Actions:',
|
||||
fillColor: Colors.white,
|
||||
maxLines: 4,
|
||||
maxLines: 3,
|
||||
controller: followUpActionsController),
|
||||
const SizedBox(height: 15),
|
||||
CommonTextFormField(
|
||||
|
@ -21,6 +21,6 @@ class ApiUrls {
|
||||
static const String kycSelectTaskUrl = '${baseUrl}task/task/type/Collect KYC';
|
||||
static const String updateTaskInventoryUrl = '${baseUrl}task/update-task-status/';
|
||||
static const String getProductsManual = '${baseUrl}productmanual/getall';
|
||||
static const String salesTaskUrl = '${baseUrl}product/getAll/user/?category=Bottle';
|
||||
static const String salesTaskUrl = '${baseUrl}product/getAll/user/';
|
||||
static const String postSalesTaskUrl = '${baseUrl}sales/add-SC';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user