cake_wallet/lib/src/widgets/base_alert_dialog.dart
mkyq 418c9563fe
Ionia (#437)
* Initial ionia service

* Ionia manage card UI (#374)

* design ui for cakepay

* Add manage cards page ui

* create auth ui for ionia

* add authentication logic

* implement user create card

* Add ionia merchant sevic

* Add anypay. Add purschase gift card.

* display virtual card (#385)

* display virtual card

* fix formatting

* Remove IoniaMerchantService from IoniaViewModel

* Add hex and txKey for monero pending transaction.

* Changed monero version and monero repo to cake tech.

* Add anypay payment. Add filter by search for ionia, add get purchased items for ionia.

* Fix for get transactions for hidden addresses for electrum wallet

* Add ionia categories.

* Add anypay commited info for payments.

* Update UI with new fixes (#400)

* Change ionia base url. Add exception throwing for error messaging for some of ionia calls.

* CW-102 fix logic for ionia issues (#403)

* refactor tips (#406)

* refactor tips

* refactor ionia tips implementation

* Cw 115 implement gift cards list for ionia (#405)

* Implement show purchased cards

* fix padding

* Fixes for getting of purchased gift cards.

* Implement gift card details screen (#408)

* Implement gift card details screen

* Add redeem for ionia gift cards

* Fix navigation after ionia opt redirection.

* Fix update gift cards list.

* Add payment status update for ionia.

* Add usage instruction to gift card.

* Add copy for ionia gift card info.

* Change version for Cake Wallet ios.

* Add localisation (#414)

* Fixes for fiat amounts for ionia.

* CW-128 marketplace screen text changes (#416)

* Change text on marketplace

* fix build issues

* fix build

* UI fixes for ionia.

* UI fixes for ionia. (#421)

* CW-129 ionia welcome screen text changes (#418)

* update welcome text

* Update localization

* Cw 133 (#422)

* UI fixes for ionia.

* Fixes for display card item on gift cards screen.

* Fix signup page (#419)

* Changed tips for ionia.

* Cw 132 (#425)

* UI fixes for ionia.

* Changed tips for ionia.

* Cw 131 (#426)

* UI fixes for ionia.

* Changed tips for ionia.

* Fixes for IoniaBuyGiftCardDetailPage screen. Renamed 'Manage Cards' to 'Gift Cards'. Hide discount badge label for 0 discount.

* Change ionia heading font style (#427)

* Fix for AddressResolver in di

* Changed build number for Cake Wallet ios.

* fix currency format for card details and routing for mark as redeemed (#431)

* fix terms and condition overflow in ionia (#430)

* fix terms and condition scroll

* fix color issues

* reuse

* refactor  widget

* Remove IoniaTokenService

* Change api for ionia to staging

* Update versions for Cake Wallet for android and ios.

* Fixes for instructions. Remove diplay error on payment status screen.

* Change build versions for Cake Wallet

* Add ionia sign in.

* Update for discounts and statuses for ionia merch.

* Fixes for qr/barcode on ionia gift card screen.

* Fixed formatting for display ionia discounts.

* Fix merchant.discount.toStringAsFixed issue

* Add savingsPercentage to ionia merch discount.

* Change build number for Cake Wallet ios and android.

* Disable ionia for haven (#440)

Co-authored-by: Godwin Asuquo <41484542+godilite@users.noreply.github.com>
2022-07-28 18:03:16 +01:00

163 lines
5.5 KiB
Dart

import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
class BaseAlertDialog extends StatelessWidget {
String get titleText => '';
String get contentText => '';
String get leftActionButtonText => '';
String get rightActionButtonText => '';
bool get isDividerExists => false;
VoidCallback get actionLeft => () {};
VoidCallback get actionRight => () {};
bool get barrierDismissible => true;
Widget title(BuildContext context) {
return Text(
titleText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.title.color,
decoration: TextDecoration.none,
),
);
}
Widget content(BuildContext context) {
return Text(
contentText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.normal,
fontFamily: 'Lato',
color: Theme.of(context).primaryTextTheme.title.color,
decoration: TextDecoration.none,
),
);
}
Widget actionButtons(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flexible(
child: Container(
height: 52,
padding: EdgeInsets.only(left: 6, right: 6),
color: Theme.of(context).accentTextTheme.body2.decorationColor,
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
onPressed: actionLeft,
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Text(
leftActionButtonText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.body2.backgroundColor,
decoration: TextDecoration.none,
),
)),
),
)),
Container(
width: 1,
height: 52,
color: Theme.of(context).dividerColor,
),
Flexible(
child: Container(
height: 52,
padding: EdgeInsets.only(left: 6, right: 6),
color: Theme.of(context).accentTextTheme.body1.backgroundColor,
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
onPressed: actionRight,
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
child: Text(
rightActionButtonText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryTextTheme.body1.backgroundColor,
decoration: TextDecoration.none,
),
)),
),
)),
],
);
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => barrierDismissible ? Navigator.of(context).pop() : null,
child: Container(
color: Colors.transparent,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0),
child: Container(
decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)),
child: Center(
child: GestureDetector(
onTap: () => null,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Container(
width: 300,
color: Theme.of(context).accentTextTheme.title.decorationColor,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.fromLTRB(24, 20, 24, 0),
child: title(context),
),
isDividerExists
? Padding(
padding: EdgeInsets.only(top: 16, bottom: 8),
child: Container(
height: 1,
color: Theme.of(context).dividerColor,
),
)
: Offstage(),
Padding(
padding: EdgeInsets.fromLTRB(24, 8, 24, 32),
child: content(context),
)
],
),
Container(
height: 1,
color: Theme.of(context).dividerColor,
),
actionButtons(context)
],
),
),
),
),
),
),
),
),
);
}
}