|
| 1 | +import 'package:flutter/material.dart'; |
1 | 2 | import 'package:intl/intl.dart'; |
| 3 | +import 'package:taskwarrior/config/app_settings.dart'; |
| 4 | +import 'package:taskwarrior/config/taskwarriorcolors.dart'; |
2 | 5 |
|
3 | 6 | class Utils { |
4 | 7 | static String getWeekNumber(DateTime? date) { |
@@ -48,4 +51,65 @@ class Utils { |
48 | 51 | return ''; |
49 | 52 | } |
50 | 53 | } |
| 54 | + |
| 55 | + static AlertDialog showAlertDialog({ |
| 56 | + Key? key, |
| 57 | + Widget? icon, |
| 58 | + EdgeInsetsGeometry? iconPadding, |
| 59 | + Color? iconColor, |
| 60 | + Widget? title, |
| 61 | + EdgeInsetsGeometry? titlePadding, |
| 62 | + TextStyle? titleTextStyle, |
| 63 | + Widget? content, |
| 64 | + EdgeInsetsGeometry? contentPadding, |
| 65 | + TextStyle? contentTextStyle, |
| 66 | + List<Widget>? actions, |
| 67 | + EdgeInsetsGeometry? actionsPadding, |
| 68 | + MainAxisAlignment? actionsAlignment, |
| 69 | + OverflowBarAlignment? actionsOverflowAlignment, |
| 70 | + VerticalDirection? actionsOverflowDirection, |
| 71 | + double? actionsOverflowButtonSpacing, |
| 72 | + EdgeInsetsGeometry? buttonPadding, |
| 73 | + Color? backgroundColor, |
| 74 | + double? elevation, |
| 75 | + Color? shadowColor, |
| 76 | + Color? surfaceTintColor, |
| 77 | + String? semanticLabel, |
| 78 | + Clip clipBehavior = Clip.none, |
| 79 | + ShapeBorder? shape, |
| 80 | + AlignmentGeometry? alignment, |
| 81 | + bool scrollable = false, |
| 82 | + }) { |
| 83 | + return AlertDialog( |
| 84 | + surfaceTintColor: AppSettings.isDarkMode |
| 85 | + ? TaskWarriorColors.kdialogBackGroundColor |
| 86 | + : TaskWarriorColors.kLightDialogBackGroundColor, |
| 87 | + shadowColor: AppSettings.isDarkMode |
| 88 | + ? TaskWarriorColors.kdialogBackGroundColor |
| 89 | + : TaskWarriorColors.kLightDialogBackGroundColor, |
| 90 | + backgroundColor: AppSettings.isDarkMode |
| 91 | + ? TaskWarriorColors.kdialogBackGroundColor |
| 92 | + : TaskWarriorColors.kLightDialogBackGroundColor, |
| 93 | + key: key, |
| 94 | + title: title, |
| 95 | + titlePadding: titlePadding, |
| 96 | + titleTextStyle: titleTextStyle, |
| 97 | + content: content, |
| 98 | + contentPadding: contentPadding, |
| 99 | + contentTextStyle: contentTextStyle, |
| 100 | + actions: actions, |
| 101 | + actionsPadding: actionsPadding, |
| 102 | + actionsAlignment: actionsAlignment, |
| 103 | + actionsOverflowAlignment: actionsOverflowAlignment, |
| 104 | + actionsOverflowDirection: actionsOverflowDirection, |
| 105 | + actionsOverflowButtonSpacing: actionsOverflowButtonSpacing, |
| 106 | + buttonPadding: buttonPadding, |
| 107 | + elevation: elevation, |
| 108 | + semanticLabel: semanticLabel, |
| 109 | + clipBehavior: clipBehavior, |
| 110 | + shape: shape, |
| 111 | + alignment: alignment, |
| 112 | + scrollable: scrollable, |
| 113 | + ); |
| 114 | + } |
51 | 115 | } |
0 commit comments