|
@@ -1,5 +1,6 @@
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:flyinsono/lab/color/lab_colors.dart';
|
|
|
import 'package:flyinsono/lab/components/lab_dialog.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
@@ -58,6 +59,7 @@ class VDialogDate extends StatelessWidget {
|
|
|
|
|
|
Widget _buildContent(BuildContext context, _VDialogDateValueCache cache) {
|
|
|
|
|
|
+ DateTime now = DateTime.now();
|
|
|
return Container(
|
|
|
margin: const EdgeInsets.all(10),
|
|
|
height: 216,
|
|
@@ -65,38 +67,20 @@ class VDialogDate extends StatelessWidget {
|
|
|
child: Stack(
|
|
|
children: [
|
|
|
Positioned.fill(
|
|
|
- child: VCustomCupertinoDatePicker(
|
|
|
- initialDateTime: cache.value,
|
|
|
- minimumYear: 1900,
|
|
|
- maximumYear: 2100,
|
|
|
- minimumDate: minimumDate,
|
|
|
- maximumDate: maxValue,
|
|
|
- backgroundColor: CupertinoColors.white,
|
|
|
- onDateTimeChanged: (date) {
|
|
|
- cache.value = date;
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
- top: 72,
|
|
|
- left: 0,
|
|
|
- right: 0,
|
|
|
- child: Divider(
|
|
|
- thickness: 1,
|
|
|
- color: Colors.black.withOpacity(0.2),
|
|
|
- indent: 12,
|
|
|
- endIndent: 12,
|
|
|
- ),
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
- top: 72 + 58,
|
|
|
- left: 0,
|
|
|
- right: 0,
|
|
|
- child: Divider(
|
|
|
- thickness: 1,
|
|
|
- color: Colors.black.withOpacity(0.2),
|
|
|
- indent: 12,
|
|
|
- endIndent: 12,
|
|
|
+ child: Theme(
|
|
|
+ data: ThemeData(
|
|
|
+ colorScheme: ColorScheme.light(
|
|
|
+ primary: LabColors.dialogHeaderColor,
|
|
|
+ onPrimary: LabColors.text100,
|
|
|
+ onSurface: LabColors.text100,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: CalendarDatePicker(
|
|
|
+ initialDate: cache.value,
|
|
|
+ firstDate: DateTime(now.year - 200, 1, 1),
|
|
|
+ lastDate: DateTime(now.year, 12, 31),
|
|
|
+ onDateChanged: (value) => cache.value = value,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
],
|