calendar Implemented

feature_dev_ankit
Ankit Sharma 2025-02-05 13:31:34 +05:30
parent 12f9306faa
commit 804a36482a
5 changed files with 71 additions and 35 deletions

View File

@ -183,13 +183,13 @@
},
{
"name": "syncfusion_flutter_core",
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.3",
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "syncfusion_flutter_datepicker",
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.3",
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4",
"packageUri": "lib/",
"languageVersion": "3.3"
},
@ -254,7 +254,7 @@
"languageVersion": "3.6"
}
],
"generated": "2025-02-04T11:31:00.239574Z",
"generated": "2025-02-05T07:53:21.908016Z",
"generator": "pub",
"generatorVersion": "3.6.1",
"flutterRoot": "file:///C:/src/flutter/flutter",

View File

@ -108,12 +108,12 @@ file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.3
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.3.0/lib/
syncfusion_flutter_core
3.3
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.3/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.3/lib/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4/lib/
syncfusion_flutter_datepicker
3.3
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.3/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.3/lib/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4/
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4/lib/
table_calendar
3.0
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/table_calendar-3.2.0/

View File

@ -6,6 +6,7 @@ import 'package:shayog/components/styles/app_colors.dart';
import 'package:shayog/components/styles/textStyles.dart';
import 'package:shayog/feature/presentation/widgets/text_view.dart';
import 'package:sizer/sizer.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
import '../../../../../../../components/common/common_btn.dart';
import '../../../../../../../components/common/custom_drop_down.dart';
@ -171,7 +172,7 @@ class GenerateFrightBill extends StatelessWidget {
],
),
Padding(
padding: const EdgeInsets.only(top: 16.0, left: 0, right: 8),
padding: const EdgeInsets.only(top: 0, left: 0, right: 8),
child: Row(
children: [
Expanded(
@ -180,32 +181,13 @@ class GenerateFrightBill extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextView(text: "MRN Date Range"),
Container(
margin: EdgeInsets.only(top: 8),
height: 35,
child: TextFormField(
key: controller.fromTextFieldKey,
controller: controller.fromController,
onTap: () async {
final pickedDate = await showWebDatePicker(
width: 20.w,
context: controller
.fromTextFieldKey.currentContext!,
initialDate: controller.fromSelectedDate,
firstDate: DateTime(2000),
lastDate: DateTime.now(),
);
if (pickedDate != null) {
controller.fromSelectedDate = pickedDate;
String formattedDate =
controller.getFormattedDate(pickedDate);
controller.fromController.text =
formattedDate;
controller.dateCheck.value = true;
}
await _showDateRangePicker(context);
},
decoration: InputDecoration(
fillColor: AppColors.clrD9,
@ -524,6 +506,59 @@ class GenerateFrightBill extends StatelessWidget {
],
);
}
Future<void> _showDateRangePicker(BuildContext context) async {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
height: 400, // Adjust the height as needed
child: Column(
children: [
// Display two date pickers horizontally
Row(
children: [
// First Date Picker
Expanded(
child: SfDateRangePicker(
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.range,
onSelectionChanged: (args) {
// Handle the date selection from the first calendar
print(args.value);
},
),
),
SizedBox(width: 16),
// Second Date Picker
Expanded(
child: SfDateRangePicker(
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.range,
onSelectionChanged: (args) {
// Handle the date selection from the second calendar
print(args.value);
},
),
),
],
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {
// You can extract the selected date range here
// Close the bottom sheet after selection
Navigator.pop(context);
},
child: Text('Done'),
),
],
),
);
},
);
}
}

View File

@ -236,18 +236,18 @@ packages:
dependency: transitive
description:
name: syncfusion_flutter_core
sha256: "213ada2c3b3555a73cb0eb1530d24d27dcf1a0a1555c0f00dd3e1486b01878ad"
sha256: "3c1876b0a245de23de3b17a19e3106fed57d88f4fd2c8dc9bc1976705b1c31d5"
url: "https://pub.dev"
source: hosted
version: "28.2.3"
version: "28.2.4"
syncfusion_flutter_datepicker:
dependency: "direct main"
description:
name: syncfusion_flutter_datepicker
sha256: "9d2694d618d081c9477402175ff027936f60ac053d0989ca02ee65b2e27a65c7"
sha256: "889b716d9de344852f651ecdcc726b6eeb9e326d95c1bb54df95631a5d7ead68"
url: "https://pub.dev"
source: hosted
version: "28.2.3"
version: "28.2.4"
table_calendar:
dependency: "direct main"
description:

View File

@ -41,7 +41,8 @@ dependencies:
intl: ^0.20.1
vph_web_date_picker: ^0.0.6
table_calendar: ^3.2.0
syncfusion_flutter_datepicker: ^28.2.3
syncfusion_flutter_datepicker: ^28.2.4
dev_dependencies: