浏览代码

More copy changes

vishnukvmd 3 年之前
父节点
当前提交
6d81d0698c
共有 2 个文件被更改,包括 16 次插入13 次删除
  1. 13 10
      lib/ui/common/dialogs.dart
  2. 3 3
      lib/utils/delete_file_util.dart

+ 13 - 10
lib/ui/common/dialogs.dart

@@ -1,10 +1,7 @@
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 
 
-enum DialogUserChoice {
-  firstChoice,
-  secondChoice
-}
+enum DialogUserChoice { firstChoice, secondChoice }
 
 
 enum ActionType {
 enum ActionType {
   confirm,
   confirm,
@@ -20,19 +17,25 @@ Future<T> showChoiceDialog<T>(
   ActionType actionType = ActionType.confirm,
   ActionType actionType = ActionType.confirm,
 }) {
 }) {
   AlertDialog alert = AlertDialog(
   AlertDialog alert = AlertDialog(
-    title: Text(title,
+    title: Text(
+      title,
       style: TextStyle(
       style: TextStyle(
-        color:
-            actionType == ActionType.critical ? Colors.red : Colors.white,
+        color: actionType == ActionType.critical ? Colors.red : Colors.white,
+      ),
+    ),
+    content: Text(
+      content,
+      style: TextStyle(
+        height: 1.4,
       ),
       ),
     ),
     ),
-    content: Text(content),
     actions: [
     actions: [
       TextButton(
       TextButton(
         child: Text(
         child: Text(
           firstAction,
           firstAction,
           style: TextStyle(
           style: TextStyle(
-            color: actionType == ActionType.critical ? Colors.red : Colors.white,
+            color:
+                actionType == ActionType.critical ? Colors.red : Colors.white,
           ),
           ),
         ),
         ),
         onPressed: () {
         onPressed: () {
@@ -62,4 +65,4 @@ Future<T> showChoiceDialog<T>(
     },
     },
     barrierColor: Colors.black87,
     barrierColor: Colors.black87,
   );
   );
-}
+}

+ 3 - 3
lib/utils/delete_file_util.dart

@@ -228,8 +228,8 @@ Future<bool> deleteFromTrash(BuildContext context, List<File> files) async {
 
 
 Future<bool> emptyTrash(BuildContext context) async {
 Future<bool> emptyTrash(BuildContext context) async {
   final result = await showChoiceDialog(context, "empty trash?",
   final result = await showChoiceDialog(context, "empty trash?",
-      "all files will be permanently removed from your ente account",
-      firstAction: "yes", actionType: ActionType.critical);
+      "these files will be permanently removed from your ente account",
+      firstAction: "empty", actionType: ActionType.critical);
   if (result != DialogUserChoice.firstChoice) {
   if (result != DialogUserChoice.firstChoice) {
     return false;
     return false;
   }
   }
@@ -237,7 +237,7 @@ Future<bool> emptyTrash(BuildContext context) async {
   await dialog.show();
   await dialog.show();
   try {
   try {
     await TrashSyncService.instance.emptyTrash();
     await TrashSyncService.instance.emptyTrash();
-    showToast("done");
+    showToast("trash emptied");
     await dialog.hide();
     await dialog.hide();
     Bus.instance
     Bus.instance
         .fire(FilesUpdatedEvent((List<File>.empty()), type: EventType.deleted));
         .fire(FilesUpdatedEvent((List<File>.empty()), type: EventType.deleted));