dev
dart 77 lines 2.06 KB
Raw
1 import 'package:flutter/material.dart';
2 import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
3
4 class AlertWithOneAction extends BaseAlertDialog {
5 AlertWithOneAction({
6 required this.alertTitle,
7 required this.alertContent,
8 required this.buttonText,
9 required this.buttonAction,
10 this.alertBarrierDismissible = true,
11 this.headerTitleText,
12 this.headerImageProfileUrl,
13 this.buttonKey,
14 Key? key,
15 });
16
17 final String alertTitle;
18 final String alertContent;
19 final String buttonText;
20 final VoidCallback buttonAction;
21 final bool alertBarrierDismissible;
22 final String? headerTitleText;
23 final String? headerImageProfileUrl;
24 final Key? buttonKey;
25
26 @override
27 String get titleText => alertTitle;
28
29 @override
30 String get contentText => alertContent;
31
32 @override
33 bool get barrierDismissible => alertBarrierDismissible;
34
35 @override
36 String? get headerImageUrl => headerImageProfileUrl;
37
38 @override
39 String? get headerText => headerTitleText;
40
41 @override
42 VoidCallback get actionRight => buttonAction;
43
44 @override
45 bool get showLeftButton => false;
46
47 @override
48 String get rightActionButtonText => buttonText;
49
50 // @override
51 // Widget actionButtons(BuildContext context) {
52 // return Container(
53 // padding: EdgeInsets.only(left: 12, right: 12),
54 // color: Theme.of(context).colorScheme.surface,
55 // child: ButtonTheme(
56 // minWidth: double.infinity,
57 // child: TextButton(
58 // key: buttonKey,
59 // onPressed: buttonAction,
60 // // FIX-ME: Style
61 // //highlightColor: Colors.transparent,
62 // //splashColor: Colors.transparent,
63 // child: Text(
64 // buttonText,
65 // textAlign: TextAlign.center,
66 // style: Theme.of(context).textTheme.bodyMedium!.copyWith(
67 // fontSize: 15,
68 // fontWeight: FontWeight.w600,
69 // color: Theme.of(context).colorScheme.primary,
70 // decoration: TextDecoration.none,
71 // ),
72 // ),
73 // ),
74 // ),
75 // );
76 // }
77 }