Merge pull request #791 from cake-tech/fix-desktop-colors-addressbook

Fix desktop background color and address book view issues
This commit is contained in:
Omar Hatem 2023-02-23 21:56:50 +02:00 committed by GitHub
commit f8acc1c007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 54 deletions

View file

@ -32,7 +32,9 @@ class DesktopDashboardPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
_setEffects(context); _setEffects(context);
return Row( return Container(
color: Theme.of(context).backgroundColor,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
@ -55,6 +57,7 @@ class DesktopDashboardPage extends StatelessWidget {
), ),
), ),
], ],
),
); );
} }

View file

@ -119,6 +119,7 @@ class DesktopSidebarWrapper extends BasePage {
children: [ children: [
child, child,
Container( Container(
color: Theme.of(context).backgroundColor,
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Navigator( child: Navigator(
initialRoute: Routes.support, initialRoute: Routes.support,

View file

@ -431,10 +431,8 @@ class ExchangeCardState extends State<ExchangeCard> {
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
final contact = final contact =
await Navigator.of(context, await Navigator.of(context)
rootNavigator: true) .pushNamed(Routes.pickerAddressBook);
.pushNamed(Routes
.pickerAddressBook);
if (contact is ContactBase && if (contact is ContactBase &&
contact.address != null) { contact.address != null) {

View file

@ -6,6 +6,7 @@ import 'package:cake_wallet/src/widgets/keyboard_done_button.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';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart'; import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -44,7 +45,6 @@ class IoniaBuyGiftCardPage extends BasePage {
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
final _width = MediaQuery.of(context).size.width;
final merchant = ioniaBuyCardViewModel.ioniaMerchant; final merchant = ioniaBuyCardViewModel.ioniaMerchant;
return KeyboardActions( return KeyboardActions(
disableScroll: true, disableScroll: true,
@ -67,7 +67,10 @@ class IoniaBuyGiftCardPage extends BasePage {
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 25), padding: EdgeInsets.symmetric(horizontal: 25),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)), borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
gradient: LinearGradient(colors: [ gradient: LinearGradient(colors: [
Theme.of(context).primaryTextTheme!.subtitle1!.color!, Theme.of(context).primaryTextTheme!.subtitle1!.color!,
Theme.of(context).primaryTextTheme!.subtitle1!.decorationColor!, Theme.of(context).primaryTextTheme!.subtitle1!.decorationColor!,
@ -75,35 +78,28 @@ class IoniaBuyGiftCardPage extends BasePage {
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox(height: 150), SizedBox(height: 150),
BaseTextFormField( SizedBox(
width: 200,
child: BaseTextFormField(
controller: _amountController, controller: _amountController,
focusNode: _amountFieldFocus, focusNode: _amountFieldFocus,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.deny(RegExp('[\-|\ ]')), FilteringTextInputFormatter.deny(RegExp('[\-|\ ]')),
FilteringTextInputFormatter.allow(RegExp(r'^\d+(\.|\,)?\d{0,2}'))], FilteringTextInputFormatter.allow(
RegExp(r'^\d+(\.|\,)?\d{0,2}'),
),
],
hintText: '1000', hintText: '1000',
placeholderTextStyle: TextStyle( placeholderTextStyle: TextStyle(
color: Theme.of(context).primaryTextTheme!.headline5!.color!, color: Theme.of(context).primaryTextTheme.headline5!.color!,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 36, fontSize: 36,
), ),
borderColor: Theme.of(context).primaryTextTheme!.headline5!.color!, prefixIcon: Text(
textColor: Colors.white,
textStyle: TextStyle(
color: Colors.white,
fontSize: 36,
),
prefixIcon: Padding(
padding: EdgeInsets.only(
top: 5.0,
left: _width / 4,
),
child: Text(
'USD: ', 'USD: ',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -111,8 +107,17 @@ class IoniaBuyGiftCardPage extends BasePage {
fontSize: 36, fontSize: 36,
), ),
), ),
textColor: Colors.white,
textStyle: TextStyle(
color: Colors.white,
fontSize: 36,
), ),
), ),
),
Divider(
color: Theme.of(context).primaryTextTheme.headline5!.color!,
height: 1,
),
SizedBox(height: 8), SizedBox(height: 8),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -140,7 +145,11 @@ class IoniaBuyGiftCardPage extends BasePage {
padding: const EdgeInsets.all(24.0), padding: const EdgeInsets.all(24.0),
child: CardItem( child: CardItem(
title: merchant.legalName, title: merchant.legalName,
backgroundColor: Theme.of(context).accentTextTheme!.headline1!.backgroundColor!.withOpacity(0.1), backgroundColor: Theme.of(context)
.accentTextTheme!
.headline1!
.backgroundColor!
.withOpacity(0.1),
discount: merchant.discount, discount: merchant.discount,
titleColor: Theme.of(context).accentTextTheme!.headline1!.backgroundColor!, titleColor: Theme.of(context).accentTextTheme!.headline1!.backgroundColor!,
subtitleColor: Theme.of(context).hintColor, subtitleColor: Theme.of(context).hintColor,

View file

@ -208,7 +208,7 @@ class AddressTextField extends StatelessWidget {
} }
Future<void> _presetAddressBookPicker(BuildContext context) async { Future<void> _presetAddressBookPicker(BuildContext context) async {
final contact = await Navigator.of(context, rootNavigator: true) final contact = await Navigator.of(context)
.pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency); .pushNamed(Routes.pickerAddressBook,arguments: selectedCurrency);
if (contact is ContactBase && contact.address != null) { if (contact is ContactBase && contact.address != null) {