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),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomLeft: Radius.circular(24),
|
|
|
|
bottomRight: Radius.circular(24)
|
|
|
|
),
|
|
|
|
color: Colors.white
|
|
|
|
),
|
|
|
|
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,
|
|
|
|
color: Colors.blue,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|