Browse Source

Merge branch 'edit-time' of github.com:ente-io/frame into edit-time

Neeraj Gupta 3 years ago
parent
commit
7239e04cc0
2 changed files with 26 additions and 8 deletions
  1. 25 7
      lib/ui/fading_app_bar.dart
  2. 1 1
      lib/utils/magic_util.dart

+ 25 - 7
lib/ui/fading_app_bar.dart

@@ -243,16 +243,24 @@ class FadingAppBarState extends State<FadingAppBar> {
   }
 
   void _showDateTimePicker(File file) async {
-    final dateResult = await DatePicker.showDatePicker(context,
-        minTime: DateTime(1, 1, 1),
-        maxTime: DateTime.now(),
-        currentTime: DateTime.fromMicrosecondsSinceEpoch(file.creationTime),
-        locale: LocaleType.en);
+    final dateResult = await DatePicker.showDatePicker(
+      context,
+      minTime: DateTime(1, 1, 1),
+      maxTime: DateTime.now(),
+      currentTime: DateTime.fromMicrosecondsSinceEpoch(file.creationTime),
+      locale: LocaleType.en,
+      theme: kDatePickerTheme,
+    );
     if (dateResult == null) {
       return;
     }
-    final dateWithTimeResult = await DatePicker.showTime12hPicker(context,
-        showTitleActions: true, currentTime: dateResult, locale: LocaleType.en);
+    final dateWithTimeResult = await DatePicker.showTime12hPicker(
+      context,
+      showTitleActions: true,
+      currentTime: dateResult,
+      locale: LocaleType.en,
+      theme: kDatePickerTheme,
+    );
     if (dateWithTimeResult != null) {
       if (await editTime(context, List.of([widget.file]),
           dateWithTimeResult.microsecondsSinceEpoch)) {
@@ -353,3 +361,13 @@ class FadingAppBarState extends State<FadingAppBar> {
     }
   }
 }
+
+const kDatePickerTheme = DatePickerTheme(
+  backgroundColor: Colors.black,
+  itemStyle: TextStyle(
+    color: Colors.white,
+  ),
+  cancelStyle: TextStyle(
+    color: Colors.white,
+  ),
+);

+ 1 - 1
lib/utils/magic_util.dart

@@ -49,7 +49,7 @@ Future<void> _updatePublicMetadata(
   if (files.isEmpty) {
     return;
   }
-  final dialog = createProgressDialog(context, 'please wait');
+  final dialog = createProgressDialog(context, 'please wait...');
   await dialog.show();
   try {
     Map<String, dynamic> update = {key: value};