mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 18:39:25 +00:00
Update based on Review
This commit is contained in:
parent
d7b69b81c3
commit
379c2ea147
17 changed files with 274 additions and 177 deletions
|
@ -98,9 +98,6 @@ PODS:
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_secure_storage (3.3.1):
|
- flutter_secure_storage (3.3.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FMDB (2.7.5):
|
|
||||||
- FMDB/standard (= 2.7.5)
|
|
||||||
- FMDB/standard (2.7.5)
|
|
||||||
- local_auth (0.0.1):
|
- local_auth (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- MTBBarcodeScanner (5.0.11)
|
- MTBBarcodeScanner (5.0.11)
|
||||||
|
@ -118,9 +115,6 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
- shared_preferences (0.0.1):
|
- shared_preferences (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- sqflite (0.0.2):
|
|
||||||
- Flutter
|
|
||||||
- FMDB (>= 2.7.5)
|
|
||||||
- SwiftProtobuf (1.12.0)
|
- SwiftProtobuf (1.12.0)
|
||||||
- SwiftyGif (5.3.0)
|
- SwiftyGif (5.3.0)
|
||||||
- uni_links (0.0.1):
|
- uni_links (0.0.1):
|
||||||
|
@ -151,7 +145,6 @@ DEPENDENCIES:
|
||||||
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
|
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
|
||||||
- share (from `.symlinks/plugins/share/ios`)
|
- share (from `.symlinks/plugins/share/ios`)
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
|
||||||
- uni_links (from `.symlinks/plugins/uni_links/ios`)
|
- uni_links (from `.symlinks/plugins/uni_links/ios`)
|
||||||
- UnstoppableDomainsResolution (~> 4.0.0)
|
- UnstoppableDomainsResolution (~> 4.0.0)
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
|
@ -163,7 +156,6 @@ SPEC REPOS:
|
||||||
- CryptoSwift
|
- CryptoSwift
|
||||||
- DKImagePickerController
|
- DKImagePickerController
|
||||||
- DKPhotoGallery
|
- DKPhotoGallery
|
||||||
- FMDB
|
|
||||||
- MTBBarcodeScanner
|
- MTBBarcodeScanner
|
||||||
- Reachability
|
- Reachability
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
|
@ -204,8 +196,6 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/share/ios"
|
:path: ".symlinks/plugins/share/ios"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||||
sqflite:
|
|
||||||
:path: ".symlinks/plugins/sqflite/ios"
|
|
||||||
uni_links:
|
uni_links:
|
||||||
:path: ".symlinks/plugins/uni_links/ios"
|
:path: ".symlinks/plugins/uni_links/ios"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
|
@ -228,7 +218,6 @@ SPEC CHECKSUMS:
|
||||||
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
|
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
|
||||||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||||
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
||||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
|
||||||
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
|
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
|
||||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||||
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
||||||
|
@ -238,7 +227,6 @@ SPEC CHECKSUMS:
|
||||||
SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
|
SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
|
||||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||||
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
|
||||||
SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699
|
SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699
|
||||||
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
|
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
|
||||||
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
||||||
|
@ -248,4 +236,4 @@ SPEC CHECKSUMS:
|
||||||
|
|
||||||
PODFILE CHECKSUM: ae71bdf0eb731a1ffc399c122f6aa4dea0cb5f6f
|
PODFILE CHECKSUM: ae71bdf0eb731a1ffc399c122f6aa4dea0cb5f6f
|
||||||
|
|
||||||
COCOAPODS: 1.11.3
|
COCOAPODS: 1.11.2
|
||||||
|
|
|
@ -14,8 +14,6 @@ import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
class IoniaCreateAccountPage extends BasePage {
|
class IoniaCreateAccountPage extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
|
|
||||||
IoniaCreateAccountPage(this._ioniaViewModel)
|
IoniaCreateAccountPage(this._ioniaViewModel)
|
||||||
: _emailFocus = FocusNode(),
|
: _emailFocus = FocusNode(),
|
||||||
_emailController = TextEditingController(),
|
_emailController = TextEditingController(),
|
||||||
|
@ -24,6 +22,8 @@ class IoniaCreateAccountPage extends BasePage {
|
||||||
_emailController.addListener(() => _ioniaViewModel.email = _emailController.text);
|
_emailController.addListener(() => _ioniaViewModel.email = _emailController.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
final GlobalKey<FormState> _formKey;
|
final GlobalKey<FormState> _formKey;
|
||||||
|
|
||||||
final FocusNode _emailFocus;
|
final FocusNode _emailFocus;
|
||||||
|
@ -36,6 +36,7 @@ class IoniaCreateAccountPage extends BasePage {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
|
color: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -111,7 +112,7 @@ class IoniaCreateAccountPage extends BasePage {
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextSpan(text: ' by CakePay'),
|
TextSpan(text: ' ${S.of(context).by_cake_pay}'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:cake_wallet/core/email_validator.dart';
|
import 'package:cake_wallet/core/email_validator.dart';
|
||||||
import 'package:cake_wallet/ionia/ionia_create_state.dart';
|
import 'package:cake_wallet/ionia/ionia_create_state.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||||
|
@ -15,20 +14,20 @@ import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
class IoniaLoginPage extends BasePage {
|
class IoniaLoginPage extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
IoniaLoginPage(this._ioniaViewModel)
|
IoniaLoginPage(this._ioniaViewModel)
|
||||||
: _formKey = GlobalKey<FormState>(),
|
: _formKey = GlobalKey<FormState>(),
|
||||||
_emailFocus = FocusNode(),
|
|
||||||
_emailController = TextEditingController() {
|
_emailController = TextEditingController() {
|
||||||
_emailController.text = _ioniaViewModel.email;
|
_emailController.text = _ioniaViewModel.email;
|
||||||
_emailController.addListener(() => _ioniaViewModel.email = _emailController.text);
|
_emailController.addListener(() => _ioniaViewModel.email = _emailController.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
final GlobalKey<FormState> _formKey;
|
final GlobalKey<FormState> _formKey;
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Color get titleColor => Colors.black;
|
Color get titleColor => Colors.black;
|
||||||
|
|
||||||
final FocusNode _emailFocus;
|
|
||||||
final TextEditingController _emailController;
|
final TextEditingController _emailController;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -15,8 +15,6 @@ import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
class IoniaVerifyIoniaOtp extends BasePage {
|
class IoniaVerifyIoniaOtp extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
final String _email;
|
|
||||||
|
|
||||||
IoniaVerifyIoniaOtp(this._ioniaViewModel, this._email)
|
IoniaVerifyIoniaOtp(this._ioniaViewModel, this._email)
|
||||||
: _codeController = TextEditingController(),
|
: _codeController = TextEditingController(),
|
||||||
|
@ -32,6 +30,10 @@ class IoniaVerifyIoniaOtp extends BasePage {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
|
final String _email;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget middle(BuildContext context) {
|
Widget middle(BuildContext context) {
|
||||||
return Text(
|
return Text(
|
||||||
|
@ -39,6 +41,7 @@ class IoniaVerifyIoniaOtp extends BasePage {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
|
color: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,13 +9,8 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
class IoniaWelcomePage extends BasePage {
|
class IoniaWelcomePage extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
|
|
||||||
IoniaWelcomePage(this._ioniaViewModel);
|
IoniaWelcomePage(this._ioniaViewModel);
|
||||||
|
|
||||||
@override
|
|
||||||
Color get titleColor => Colors.black;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget middle(BuildContext context) {
|
Widget middle(BuildContext context) {
|
||||||
return Text(
|
return Text(
|
||||||
|
@ -23,11 +18,14 @@ class IoniaWelcomePage extends BasePage {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
|
color: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
reaction((_) => _ioniaViewModel.isLoggedIn, (bool state) {
|
reaction((_) => _ioniaViewModel.isLoggedIn, (bool state) {
|
||||||
|
|
|
@ -12,16 +12,18 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
class IoniaActivateDebitCardPage extends BasePage {
|
class IoniaActivateDebitCardPage extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
|
|
||||||
IoniaActivateDebitCardPage(this._ioniaViewModel);
|
IoniaActivateDebitCardPage(this._ioniaViewModel);
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget middle(BuildContext context) {
|
Widget middle(BuildContext context) {
|
||||||
return Text(
|
return Text(
|
||||||
S.current.debit_card,
|
S.current.debit_card,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
|
color: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:cake_wallet/di.dart';
|
import 'package:cake_wallet/di.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/src/screens/ionia/widgets/confirm_modal.dart';
|
||||||
import 'package:cake_wallet/src/screens/ionia/widgets/text_icon_button.dart';
|
import 'package:cake_wallet/src/screens/ionia/widgets/text_icon_button.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||||
import 'package:cake_wallet/src/widgets/discount_badge.dart';
|
import 'package:cake_wallet/src/widgets/discount_badge.dart';
|
||||||
|
@ -11,7 +11,6 @@ import 'package:cake_wallet/themes/theme_base.dart';
|
||||||
import 'package:cake_wallet/typography.dart';
|
import 'package:cake_wallet/typography.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/src/widgets/framework.dart';
|
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
|
@ -95,7 +94,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Gift Card Amount',
|
S.of(context).gift_card_amount,
|
||||||
style: textSmall(),
|
style: textSmall(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
|
@ -113,7 +112,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Bill Amount',
|
S.of(context).bill_amount,
|
||||||
style: textSmall(),
|
style: textSmall(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
|
@ -127,7 +126,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Tip',
|
S.of(context).tip,
|
||||||
style: textSmall(),
|
style: textSmall(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
|
@ -144,7 +143,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
Divider(),
|
Divider(),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
'You Pay',
|
S.of(context).you_pay,
|
||||||
style: textSmall(),
|
style: textSmall(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
|
@ -161,7 +160,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Tip:',
|
S.of(context).tip,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).primaryTextTheme.title.color,
|
color: Theme.of(context).primaryTextTheme.title.color,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
@ -205,25 +204,27 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void purchaseCard(BuildContext context) {
|
void purchaseCard(BuildContext context) {
|
||||||
showPopUp<void>(
|
showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (dialogContext) {
|
builder: (_) {
|
||||||
return AlertWithTwoActions(
|
return IoniaConfirmModal(
|
||||||
alertTitle: S.of(context).save_backup_password_alert,
|
alertTitle: S.of(context).confirm_sending,
|
||||||
alertContent: S.of(context).change_backup_password_alert,
|
alertContent: SizedBox(
|
||||||
rightButtonText: S.of(context).ok,
|
//Todo:: substitute this widget with modal content
|
||||||
leftButtonText: S.of(context).cancel,
|
height: 200,
|
||||||
leftActionColor: Color(0xffFF6600),
|
),
|
||||||
isDividerExist: true,
|
rightButtonText: S.of(context).ok,
|
||||||
rightActionColor: Theme.of(context).accentTextTheme.body2.color,
|
leftButtonText: S.of(context).cancel,
|
||||||
actionRightButton: () async {
|
leftActionColor: Color(0xffFF6600),
|
||||||
Navigator.of(dialogContext)..pop()..pop();
|
rightActionColor: Theme.of(context).accentTextTheme.body2.color,
|
||||||
},
|
actionRightButton: () async {
|
||||||
actionLeftButton: () => Navigator.of(dialogContext).pop());
|
Navigator.of(context).pop();
|
||||||
});
|
},
|
||||||
|
actionLeftButton: () => Navigator.of(context).pop());
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TipButtonGroup extends StatefulWidget {
|
class TipButtonGroup extends StatefulWidget {
|
||||||
|
@ -264,7 +265,7 @@ class _TipButtonGroupState extends State<TipButtonGroup> {
|
||||||
SizedBox(width: 4),
|
SizedBox(width: 4),
|
||||||
TipButton(
|
TipButton(
|
||||||
isSelected: _isSelected('299'),
|
isSelected: _isSelected('299'),
|
||||||
caption: 'Custom',
|
caption: S.of(context).custom,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart';
|
||||||
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
|
||||||
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
|
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
|
||||||
import 'package:cake_wallet/src/widgets/market_place_item.dart';
|
|
||||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||||
import 'package:cake_wallet/themes/theme_base.dart';
|
import 'package:cake_wallet/themes/theme_base.dart';
|
||||||
|
@ -126,12 +126,10 @@ class IoniaBuyGiftCardPage extends BasePage {
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(24.0),
|
padding: const EdgeInsets.all(24.0),
|
||||||
child: MarketPlaceItem(
|
child: CardItem(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
title: 'Applebee’s',
|
title: 'Applebee’s',
|
||||||
hasDiscount: true,
|
hasDiscount: true,
|
||||||
isWhiteBackground: true,
|
|
||||||
padding: EdgeInsets.all(12),
|
|
||||||
subTitle: 'subTitle',
|
subTitle: 'subTitle',
|
||||||
logoUrl: '',
|
logoUrl: '',
|
||||||
),
|
),
|
||||||
|
|
|
@ -25,6 +25,7 @@ class IoniaDebitCardPage extends BasePage {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
|
color: Theme.of(context).accentTextTheme.display4.backgroundColor,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -43,12 +44,8 @@ class IoniaDebitCardPage extends BasePage {
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: Padding(
|
content: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: _IoniaDebitCard(
|
||||||
children: [
|
cardInfo: cardState.card,
|
||||||
_IoniaDebitCard(
|
|
||||||
cardInfo: cardState.card,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomSection: Column(
|
bottomSection: Column(
|
||||||
|
@ -252,10 +249,12 @@ class _IoniaDebitCardState extends State<_IoniaDebitCard> {
|
||||||
return pan.replaceAllMapped(RegExp(r'.{4}'), (match) => '${match.group(0)} ');
|
return pan.replaceAllMapped(RegExp(r'.{4}'), (match) => '${match.group(0)} ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get _getLast4 => widget.isCardSample ? '0000' : widget.cardInfo.pan.substring(widget.cardInfo.pan.length - 5);
|
||||||
|
|
||||||
|
String get _getSpendLimit => widget.isCardSample ? '10000' : widget.cardInfo.spendLimit.toStringAsFixed(2);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final last4 = widget.isCardSample ? '0000' : widget.cardInfo.pan.substring(widget.cardInfo.pan.length - 5);
|
|
||||||
final spendLimit = widget.isCardSample ? '10000' : widget.cardInfo.spendLimit.toStringAsFixed(2);
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 19),
|
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 19),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -288,12 +287,12 @@ class _IoniaDebitCardState extends State<_IoniaDebitCard> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
widget.isCardSample ? S.of(context).upto(spendLimit) : '\$$spendLimit',
|
widget.isCardSample ? S.of(context).upto(_getSpendLimit) : '\$$_getSpendLimit',
|
||||||
style: textXLargeSemiBold(),
|
style: textXLargeSemiBold(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
_showDetails ? _formatPan(widget.cardInfo.pan) : '**** **** **** $last4',
|
_showDetails ? _formatPan(widget.cardInfo.pan) : '**** **** **** $_getLast4',
|
||||||
style: textMediumSemiBold(),
|
style: textMediumSemiBold(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 32),
|
SizedBox(height: 32),
|
||||||
|
@ -323,12 +322,12 @@ class _IoniaDebitCardState extends State<_IoniaDebitCard> {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Expires',
|
S.of(context).expires,
|
||||||
style: textXSmallSemiBold(),
|
style: textXSmallSemiBold(),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
'${widget.cardInfo.expirationMonth ?? 'MM'}/${widget.cardInfo.expirationYear ?? 'YY'}',
|
'${widget.cardInfo.expirationMonth ?? S.of(context).mm}/${widget.cardInfo.expirationYear ?? S.of(context).yy}',
|
||||||
style: textMediumSemiBold(),
|
style: textMediumSemiBold(),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart';
|
||||||
import 'package:cake_wallet/src/screens/ionia/widgets/card_menu.dart';
|
import 'package:cake_wallet/src/screens/ionia/widgets/card_menu.dart';
|
||||||
import 'package:cake_wallet/src/widgets/market_place_item.dart';
|
import 'package:cake_wallet/src/widgets/market_place_item.dart';
|
||||||
import 'package:cake_wallet/themes/theme_base.dart';
|
import 'package:cake_wallet/themes/theme_base.dart';
|
||||||
|
@ -9,10 +10,10 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
class IoniaManageCardsPage extends BasePage {
|
class IoniaManageCardsPage extends BasePage {
|
||||||
final IoniaViewModel _ioniaViewModel;
|
|
||||||
|
|
||||||
IoniaManageCardsPage(this._ioniaViewModel);
|
IoniaManageCardsPage(this._ioniaViewModel);
|
||||||
|
|
||||||
|
final IoniaViewModel _ioniaViewModel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Color get backgroundLightColor => currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white;
|
Color get backgroundLightColor => currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white;
|
||||||
|
|
||||||
|
@ -152,8 +153,7 @@ class IoniaManageCardsPage extends BasePage {
|
||||||
itemCount: 20,
|
itemCount: 20,
|
||||||
separatorBuilder: (_, __) => SizedBox(height: 4),
|
separatorBuilder: (_, __) => SizedBox(height: 4),
|
||||||
itemBuilder: (_, index) {
|
itemBuilder: (_, index) {
|
||||||
return MarketPlaceItem(
|
return CardItem(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
||||||
logoUrl: '',
|
logoUrl: '',
|
||||||
onTap: () => Navigator.of(context).pushNamed(Routes.ioniaBuyGiftCardPage),
|
onTap: () => Navigator.of(context).pushNamed(Routes.ioniaBuyGiftCardPage),
|
||||||
title: 'Amazon',
|
title: 'Amazon',
|
||||||
|
|
122
lib/src/screens/ionia/widgets/card_item.dart
Normal file
122
lib/src/screens/ionia/widgets/card_item.dart
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
import 'package:cake_wallet/palette.dart';
|
||||||
|
import 'package:cake_wallet/src/widgets/discount_badge.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CardItem extends StatelessWidget {
|
||||||
|
|
||||||
|
CardItem({
|
||||||
|
@required this.onTap,
|
||||||
|
@required this.title,
|
||||||
|
@required this.subTitle,
|
||||||
|
this.logoUrl,
|
||||||
|
this.hasDiscount = false,
|
||||||
|
});
|
||||||
|
|
||||||
|
final VoidCallback onTap;
|
||||||
|
final String title;
|
||||||
|
final String subTitle;
|
||||||
|
final String logoUrl;
|
||||||
|
final bool hasDiscount;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black.withOpacity(0.1),
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.white.withOpacity(0.20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
if (logoUrl != null) ...[
|
||||||
|
ClipOval(
|
||||||
|
child: Image.network(
|
||||||
|
logoUrl,
|
||||||
|
width: 42.0,
|
||||||
|
height: 42.0,
|
||||||
|
loadingBuilder: (BuildContext _, Widget child, ImageChunkEvent loadingProgress) {
|
||||||
|
if (loadingProgress == null) {
|
||||||
|
return child;
|
||||||
|
} else {
|
||||||
|
return _PlaceholderContainer(text: 'Logo');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
errorBuilder: (_, __, ___) => _PlaceholderContainer(text: '!'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
],
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Palette.stateGray,
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
subTitle,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Palette.niagara ,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontFamily: 'Lato'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (hasDiscount)
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topRight,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 20.0),
|
||||||
|
child: DiscountBadge(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PlaceholderContainer extends StatelessWidget {
|
||||||
|
|
||||||
|
const _PlaceholderContainer({@required this.text});
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: 42,
|
||||||
|
width: 42,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(100),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,8 +3,8 @@ import 'dart:ui';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ConfirmModal extends StatelessWidget {
|
class IoniaConfirmModal extends StatelessWidget {
|
||||||
ConfirmModal({
|
IoniaConfirmModal({
|
||||||
@required this.alertTitle,
|
@required this.alertTitle,
|
||||||
@required this.alertContent,
|
@required this.alertContent,
|
||||||
@required this.leftButtonText,
|
@required this.leftButtonText,
|
||||||
|
@ -28,7 +28,7 @@ class ConfirmModal extends StatelessWidget {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ActionButton(
|
IoniaActionButton(
|
||||||
buttonText: leftButtonText,
|
buttonText: leftButtonText,
|
||||||
action: actionLeftButton,
|
action: actionLeftButton,
|
||||||
backgoundColor: leftActionColor,
|
backgoundColor: leftActionColor,
|
||||||
|
@ -38,7 +38,7 @@ class ConfirmModal extends StatelessWidget {
|
||||||
height: 52,
|
height: 52,
|
||||||
color: Theme.of(context).dividerColor,
|
color: Theme.of(context).dividerColor,
|
||||||
),
|
),
|
||||||
ActionButton(
|
IoniaActionButton(
|
||||||
buttonText: rightButtonText,
|
buttonText: rightButtonText,
|
||||||
action: actionRightButton,
|
action: actionRightButton,
|
||||||
backgoundColor: rightActionColor,
|
backgoundColor: rightActionColor,
|
||||||
|
@ -47,6 +47,20 @@ class ConfirmModal extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget title(BuildContext context) {
|
||||||
|
return Text(
|
||||||
|
alertTitle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontFamily: 'Lato',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Theme.of(context).primaryTextTheme.title.color,
|
||||||
|
decoration: TextDecoration.none,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
|
@ -61,7 +75,27 @@ class ConfirmModal extends StatelessWidget {
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 300, color: Theme.of(context).accentTextTheme.title.decorationColor, child: alertContent),
|
width: 327,
|
||||||
|
color: Theme.of(context).accentTextTheme.title.decorationColor,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(24, 20, 24, 0),
|
||||||
|
child: title(context),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 16, bottom: 8),
|
||||||
|
child: Container(
|
||||||
|
height: 1,
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alertContent,
|
||||||
|
actionButtons(context),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -71,8 +105,8 @@ class ConfirmModal extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ActionButton extends StatelessWidget {
|
class IoniaActionButton extends StatelessWidget {
|
||||||
const ActionButton({
|
const IoniaActionButton({
|
||||||
@required this.buttonText,
|
@required this.buttonText,
|
||||||
@required this.action,
|
@required this.action,
|
||||||
this.backgoundColor,
|
this.backgoundColor,
|
||||||
|
|
|
@ -3,17 +3,13 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
|
|
||||||
class BaseAlertDialog extends StatelessWidget {
|
class BaseAlertDialog extends StatelessWidget {
|
||||||
String get titleText => '';
|
String get titleText => '';
|
||||||
String get contentText => '';
|
String get contentText => '';
|
||||||
String get leftActionButtonText => '';
|
String get leftActionButtonText => '';
|
||||||
String get rightActionButtonText => '';
|
String get rightActionButtonText => '';
|
||||||
bool get isDividerExists => false;
|
bool get isDividerExists => false;
|
||||||
VoidCallback get actionLeft => () {};
|
VoidCallback get actionLeft => () {};
|
||||||
VoidCallback get actionRight => () {};
|
VoidCallback get actionRight => () {};
|
||||||
EdgeInsets get actionButtonPadding => EdgeInsets.only(left: 6, right: 6);
|
|
||||||
Color get rightButtonColor => Colors.transparent;
|
|
||||||
Color get leftButtonColor => Colors.transparent;
|
|
||||||
|
|
||||||
bool get barrierDismissible => true;
|
bool get barrierDismissible => true;
|
||||||
|
|
||||||
Widget title(BuildContext context) {
|
Widget title(BuildContext context) {
|
||||||
|
@ -51,8 +47,8 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 52,
|
height: 52,
|
||||||
padding: actionButtonPadding,
|
padding: EdgeInsets.only(left: 6, right: 6),
|
||||||
color: leftButtonColor ?? Theme.of(context).accentTextTheme.body2.decorationColor,
|
color: Theme.of(context).accentTextTheme.body2.decorationColor,
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
minWidth: double.infinity,
|
minWidth: double.infinity,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
|
@ -66,7 +62,7 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: leftButtonColor != null ? Colors.white : Theme.of(context).primaryTextTheme.body2.backgroundColor,
|
color: Theme.of(context).primaryTextTheme.body2.backgroundColor,
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
@ -80,8 +76,8 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 52,
|
height: 52,
|
||||||
padding: actionButtonPadding,
|
padding: EdgeInsets.only(left: 6, right: 6),
|
||||||
color: rightButtonColor ?? Theme.of(context).accentTextTheme.body1.backgroundColor,
|
color: Theme.of(context).accentTextTheme.body1.backgroundColor,
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
minWidth: double.infinity,
|
minWidth: double.infinity,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
|
@ -95,7 +91,7 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: rightButtonColor != null ? Colors.white : Theme.of(context).primaryTextTheme.body1.backgroundColor,
|
color: Theme.of(context).primaryTextTheme.body1.backgroundColor,
|
||||||
decoration: TextDecoration.none,
|
decoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
@ -108,9 +104,7 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => barrierDismissible
|
onTap: () => barrierDismissible ? Navigator.of(context).pop() : null,
|
||||||
? Navigator.of(context).pop()
|
|
||||||
: null,
|
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
|
@ -136,14 +130,14 @@ class BaseAlertDialog extends StatelessWidget {
|
||||||
child: title(context),
|
child: title(context),
|
||||||
),
|
),
|
||||||
isDividerExists
|
isDividerExists
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: EdgeInsets.only(top: 16, bottom: 8),
|
padding: EdgeInsets.only(top: 16, bottom: 8),
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: Theme.of(context).dividerColor,
|
color: Theme.of(context).dividerColor,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Offstage(),
|
: Offstage(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.fromLTRB(24, 8, 24, 32),
|
padding: EdgeInsets.fromLTRB(24, 8, 24, 32),
|
||||||
child: content(context),
|
child: content(context),
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
|
|
||||||
class DiscountBadge extends StatelessWidget {
|
class DiscountBadge extends StatelessWidget {
|
||||||
const DiscountBadge({
|
const DiscountBadge({
|
||||||
|
@ -14,7 +16,7 @@ class DiscountBadge extends StatelessWidget {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: 10.0),
|
padding: const EdgeInsets.only(right: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Save 20%',
|
S.of(context).discount('20'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|
|
@ -1,27 +1,18 @@
|
||||||
import 'package:cake_wallet/palette.dart';
|
|
||||||
import 'package:cake_wallet/src/widgets/discount_badge.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
|
|
||||||
class MarketPlaceItem extends StatelessWidget {
|
class MarketPlaceItem extends StatelessWidget {
|
||||||
final VoidCallback onTap;
|
|
||||||
final String title;
|
|
||||||
final String subTitle;
|
|
||||||
final String logoUrl;
|
|
||||||
final EdgeInsets padding;
|
|
||||||
final bool hasDiscount;
|
|
||||||
final bool isWhiteBackground;
|
|
||||||
|
|
||||||
MarketPlaceItem({
|
MarketPlaceItem({
|
||||||
@required this.onTap,
|
@required this.onTap,
|
||||||
@required this.title,
|
@required this.title,
|
||||||
@required this.subTitle,
|
@required this.subTitle,
|
||||||
this.logoUrl,
|
|
||||||
this.padding,
|
|
||||||
this.hasDiscount = false,
|
|
||||||
this.isWhiteBackground = false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final VoidCallback onTap;
|
||||||
|
final String title;
|
||||||
|
final String subTitle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
|
@ -29,36 +20,26 @@ class MarketPlaceItem extends StatelessWidget {
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: padding ?? EdgeInsets.all(20),
|
padding: EdgeInsets.all(20),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isWhiteBackground ? Colors.black.withOpacity(0.1) : Colors.white.withOpacity(0.20),
|
color: Theme.of(context).textTheme.title.backgroundColor,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Colors.white.withOpacity(0.20),
|
color: Colors.white.withOpacity(0.20),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child:
|
||||||
children: [
|
|
||||||
if (logoUrl != null) ...[
|
|
||||||
ClipOval(
|
|
||||||
child: CachedNetworkImage(
|
|
||||||
width: 42.0,
|
|
||||||
height: 42.0,
|
|
||||||
imageUrl: logoUrl,
|
|
||||||
placeholder: (context, url) => _PlaceholderContainer(text: 'Logo'),
|
|
||||||
errorWidget: (context, url, error) => _PlaceholderContainer(text: '!'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5),
|
|
||||||
],
|
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isWhiteBackground ? Palette.stateGray : Colors.white,
|
color: Theme.of(context)
|
||||||
|
.accentTextTheme
|
||||||
|
.display3
|
||||||
|
.backgroundColor,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
),
|
),
|
||||||
|
@ -67,53 +48,19 @@ class MarketPlaceItem extends StatelessWidget {
|
||||||
Text(
|
Text(
|
||||||
subTitle,
|
subTitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isWhiteBackground ? Palette.niagara : Colors.white,
|
color: Theme.of(context)
|
||||||
|
.accentTextTheme
|
||||||
|
.display3
|
||||||
|
.backgroundColor,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontFamily: 'Lato'),
|
fontFamily: 'Lato'),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (hasDiscount)
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 20.0),
|
|
||||||
child: DiscountBadge(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PlaceholderContainer extends StatelessWidget {
|
|
||||||
final String text;
|
|
||||||
|
|
||||||
const _PlaceholderContainer({@required this.text});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
height: 42,
|
|
||||||
width: 42,
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
text,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.w900,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(100),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ dependencies:
|
||||||
flushbar: ^1.10.4
|
flushbar: ^1.10.4
|
||||||
archive: ^2.0.13
|
archive: ^2.0.13
|
||||||
cryptography: ^1.4.0
|
cryptography: ^1.4.0
|
||||||
cached_network_image: ^2.0.0
|
|
||||||
file_picker: ^3.0.0-nullsafety.2
|
file_picker: ^3.0.0-nullsafety.2
|
||||||
unorm_dart: ^0.2.0
|
unorm_dart: ^0.2.0
|
||||||
permission_handler: ^5.0.1+1
|
permission_handler: ^5.0.1+1
|
||||||
|
|
|
@ -584,5 +584,15 @@
|
||||||
"optionally_order_card": "Optionally order a physical card.",
|
"optionally_order_card": "Optionally order a physical card.",
|
||||||
"hide_details" : "Hide Details",
|
"hide_details" : "Hide Details",
|
||||||
"show_details" : "Show Details",
|
"show_details" : "Show Details",
|
||||||
"upto": "up to ${value}"
|
"upto": "up to ${value}",
|
||||||
|
"discount": "Save ${value}%",
|
||||||
|
"gift_card_amount": "Gift Card Amount",
|
||||||
|
"bill_amount": "Bill amount",
|
||||||
|
"you_pay": "You pay",
|
||||||
|
"tip": "Tip:",
|
||||||
|
"custom": "custom",
|
||||||
|
"by_cake_pay": "by CakePay",
|
||||||
|
"expires": "Expires",
|
||||||
|
"mm": "MM",
|
||||||
|
"yy": "YY"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue