mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 09:57:46 +00:00
55 lines
No EOL
1.5 KiB
Dart
55 lines
No EOL
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
|
|
|
|
class AlertWithOneAction extends BaseAlertDialog {
|
|
AlertWithOneAction({
|
|
@required this.alertTitle,
|
|
@required this.alertContent,
|
|
@required this.buttonText,
|
|
@required this.buttonAction,
|
|
this.alertBarrierDismissible = true
|
|
});
|
|
|
|
final String alertTitle;
|
|
final String alertContent;
|
|
final String buttonText;
|
|
final VoidCallback buttonAction;
|
|
final bool alertBarrierDismissible;
|
|
|
|
@override
|
|
String get titleText => alertTitle;
|
|
|
|
@override
|
|
String get contentText => alertContent;
|
|
|
|
@override
|
|
bool get barrierDismissible => alertBarrierDismissible;
|
|
|
|
@override
|
|
Widget actionButtons(BuildContext context) {
|
|
return Container(
|
|
width: 300,
|
|
height: 52,
|
|
padding: EdgeInsets.only(left: 12, right: 12),
|
|
color: Theme.of(context).accentTextTheme.body1.backgroundColor,
|
|
child: ButtonTheme(
|
|
minWidth: double.infinity,
|
|
child: FlatButton(
|
|
onPressed: buttonAction,
|
|
highlightColor: Colors.transparent,
|
|
splashColor: Colors.transparent,
|
|
child: Text(
|
|
buttonText,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
color: Theme.of(context).primaryTextTheme.body1
|
|
.backgroundColor,
|
|
decoration: TextDecoration.none,
|
|
),
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
} |