mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 18:07:44 +00:00
86 lines
2.7 KiB
Dart
86 lines
2.7 KiB
Dart
|
import 'package:cake_wallet/src/widgets/alert_background.dart';
|
||
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||
|
import 'package:cake_wallet/typography.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class IoniaAlertModal extends StatelessWidget {
|
||
|
const IoniaAlertModal({
|
||
|
Key key,
|
||
|
@required this.title,
|
||
|
@required this.content,
|
||
|
@required this.actionTitle,
|
||
|
this.heightFactor = 0.4,
|
||
|
this.showCloseButton = true,
|
||
|
}) : super(key: key);
|
||
|
|
||
|
final String title;
|
||
|
final Widget content;
|
||
|
final String actionTitle;
|
||
|
final bool showCloseButton;
|
||
|
final double heightFactor;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return AlertBackground(
|
||
|
child: Material(
|
||
|
color: Colors.transparent,
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||
|
children: [
|
||
|
Spacer(),
|
||
|
Container(
|
||
|
padding: EdgeInsets.only(top: 24, left: 24, right: 24),
|
||
|
margin: EdgeInsets.all(24),
|
||
|
decoration: BoxDecoration(
|
||
|
color: Theme.of(context).backgroundColor,
|
||
|
borderRadius: BorderRadius.circular(30),
|
||
|
),
|
||
|
child: Column(
|
||
|
children: [
|
||
|
if (title.isNotEmpty)
|
||
|
Text(
|
||
|
title,
|
||
|
style: textLargeSemiBold(
|
||
|
color: Theme.of(context).textTheme.body1.color,
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * heightFactor),
|
||
|
child: ListView(
|
||
|
children: [
|
||
|
content,
|
||
|
SizedBox(height: 35),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
PrimaryButton(
|
||
|
onPressed: () => Navigator.pop(context),
|
||
|
text: actionTitle,
|
||
|
color: Theme.of(context).accentTextTheme.caption.color,
|
||
|
textColor: Theme.of(context).primaryTextTheme.title.color,
|
||
|
),
|
||
|
SizedBox(height: 21),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
Spacer(),
|
||
|
if(showCloseButton)
|
||
|
InkWell(
|
||
|
onTap: () => Navigator.pop(context),
|
||
|
child: Container(
|
||
|
margin: EdgeInsets.only(bottom: 40),
|
||
|
child: CircleAvatar(
|
||
|
child: Icon(
|
||
|
Icons.close,
|
||
|
color: Colors.black,
|
||
|
),
|
||
|
backgroundColor: Colors.white,
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|