2020-05-01 15:57:22 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
|
|
|
|
|
2020-05-04 20:12:36 +00:00
|
|
|
class AlertWithOneAction extends BaseAlertDialog {
|
|
|
|
AlertWithOneAction({
|
|
|
|
@required this.alertTitle,
|
|
|
|
@required this.alertContent,
|
|
|
|
@required this.buttonText,
|
|
|
|
@required this.buttonAction,
|
|
|
|
this.alertBarrierDismissible = true
|
2020-05-01 15:57:22 +00:00
|
|
|
});
|
|
|
|
|
2020-05-04 20:12:36 +00:00
|
|
|
final String alertTitle;
|
|
|
|
final String alertContent;
|
|
|
|
final String buttonText;
|
|
|
|
final VoidCallback buttonAction;
|
|
|
|
final bool alertBarrierDismissible;
|
2020-05-01 15:57:22 +00:00
|
|
|
|
|
|
|
@override
|
2020-05-04 20:12:36 +00:00
|
|
|
String get titleText => alertTitle;
|
2020-05-01 15:57:22 +00:00
|
|
|
|
|
|
|
@override
|
2020-05-04 20:12:36 +00:00
|
|
|
String get contentText => alertContent;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool get barrierDismissible => alertBarrierDismissible;
|
2020-05-01 15:57:22 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget actionButtons(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
width: 300,
|
|
|
|
height: 52,
|
|
|
|
padding: EdgeInsets.only(left: 12, right: 12),
|
2020-12-14 17:54:56 +00:00
|
|
|
color: Theme.of(context).accentTextTheme.body1.backgroundColor,
|
2020-05-01 15:57:22 +00:00
|
|
|
child: ButtonTheme(
|
|
|
|
minWidth: double.infinity,
|
|
|
|
child: FlatButton(
|
2020-05-04 20:12:36 +00:00
|
|
|
onPressed: buttonAction,
|
2020-05-01 15:57:22 +00:00
|
|
|
highlightColor: Colors.transparent,
|
|
|
|
splashColor: Colors.transparent,
|
|
|
|
child: Text(
|
2020-05-04 20:12:36 +00:00
|
|
|
buttonText,
|
2020-05-01 15:57:22 +00:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 15,
|
|
|
|
fontWeight: FontWeight.w600,
|
2020-12-14 17:54:56 +00:00
|
|
|
color: Theme.of(context).primaryTextTheme.body1
|
|
|
|
.backgroundColor,
|
2020-05-01 15:57:22 +00:00
|
|
|
decoration: TextDecoration.none,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|