File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,22 @@ class FailureStateWidget extends StatelessWidget {
8
8
///
9
9
/// The [onRetry] is an optional callback to be called
10
10
/// when the retry button is pressed.
11
- const FailureStateWidget ({required this .message, super .key, this .onRetry});
11
+ const FailureStateWidget ({
12
+ required this .message,
13
+ super .key,
14
+ this .onRetry,
15
+ this .retryButtonText, // Optional custom text for the retry button
16
+ });
12
17
13
18
/// The error message to display.
14
19
final String message;
15
20
16
21
/// An optional callback to be called when the retry button is pressed.
17
22
final VoidCallback ? onRetry;
18
23
24
+ /// Optional custom text for the retry button. Defaults to "Retry".
25
+ final String ? retryButtonText;
26
+
19
27
@override
20
28
Widget build (BuildContext context) {
21
29
return Center (
@@ -33,7 +41,7 @@ class FailureStateWidget extends StatelessWidget {
33
41
padding: const EdgeInsets .only (top: 16 ),
34
42
child: ElevatedButton (
35
43
onPressed: onRetry,
36
- child: const Text ('Retry' ),
44
+ child: Text (retryButtonText ?? 'Retry' ), // Use custom text or default
37
45
),
38
46
),
39
47
],
You can’t perform that action at this time.
0 commit comments