|
@@ -1,5 +1,6 @@
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
+import 'package:flyinsono/lab/color/lab_colors.dart';
|
|
import 'package:flyinsono/lab/components/lab_dialog.dart';
|
|
import 'package:flyinsono/lab/components/lab_dialog.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
@@ -58,6 +59,7 @@ class VDialogDate extends StatelessWidget {
|
|
|
|
|
|
Widget _buildContent(BuildContext context, _VDialogDateValueCache cache) {
|
|
Widget _buildContent(BuildContext context, _VDialogDateValueCache cache) {
|
|
// 不保留时间部分
|
|
// 不保留时间部分
|
|
|
|
+ DateTime now = DateTime.now();
|
|
return Container(
|
|
return Container(
|
|
margin: const EdgeInsets.all(10),
|
|
margin: const EdgeInsets.all(10),
|
|
height: 216,
|
|
height: 216,
|
|
@@ -65,38 +67,20 @@ class VDialogDate extends StatelessWidget {
|
|
child: Stack(
|
|
child: Stack(
|
|
children: [
|
|
children: [
|
|
Positioned.fill(
|
|
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), // 200 年前
|
|
|
|
+ lastDate: DateTime(now.year, 12, 31), // 今年
|
|
|
|
+ onDateChanged: (value) => cache.value = value,
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
],
|