Skip to content

Commit

Permalink
Flutter update (#1048)
Browse files Browse the repository at this point in the history
* Update Flutter
Update packages

* Fix localization issues
Fix UI issues
Update old packages
Update workflow
Update how to build guide

* Additional UI fixes for merged conflicts
  • Loading branch information
OmarHatem28 authored Aug 18, 2023
1 parent 09c9425 commit 9ddab2b
Show file tree
Hide file tree
Showing 27 changed files with 309 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cache_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Flutter action
uses: subosito/flutter-action@v1
with:
flutter-version: '3.3.x'
flutter-version: '3.10.x'
channel: stable

- name: Install package dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Flutter action
uses: subosito/flutter-action@v1
with:
flutter-version: '3.7.x'
flutter-version: '3.10.x'
channel: stable

- name: Install package dependencies
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
6 changes: 3 additions & 3 deletions cw_bitcoin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ dependencies:
flutter:
sdk: flutter
path_provider: ^2.0.11
http: ^0.13.4
http: ^1.1.0
mobx: ^2.0.7+4
flutter_mobx: ^2.0.6+1
intl: ^0.17.0
intl: ^0.18.0
cw_core:
path: ../cw_core
bitcoin_flutter:
git:
url: https://github.com/cake-tech/bitcoin_flutter.git
ref: cake-update-v2
ref: cake-update-v3
rxdart: ^0.27.5
unorm_dart: ^0.2.0
cryptography: ^2.0.5
Expand Down
4 changes: 2 additions & 2 deletions cw_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ environment:
dependencies:
flutter:
sdk: flutter
http: ^0.13.4
http: ^1.1.0
file: ^6.1.4
path_provider: ^2.0.11
mobx: ^2.0.7+4
flutter_mobx: ^2.0.6+1
intl: ^0.17.0
intl: ^0.18.0
encrypt: ^5.0.1

dev_dependencies:
Expand Down
10 changes: 5 additions & 5 deletions cw_ethereum/lib/ethereum_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:cw_ethereum/pending_ethereum_transaction.dart';
import 'package:flutter/services.dart';
import 'package:http/http.dart';
import 'package:web3dart/web3dart.dart';
import 'package:web3dart/contracts/erc20.dart';
import 'package:erc20/erc20.dart';
import 'package:cw_core/node.dart';
import 'package:cw_ethereum/ethereum_transaction_priority.dart';
import 'package:cw_ethereum/.secrets.g.dart' as secrets;
Expand Down Expand Up @@ -72,7 +72,7 @@ class EthereumClient {
to: EthereumAddress.fromHex(toAddress),
maxGas: gas,
gasPrice: price,
maxPriorityFeePerGas: EtherAmount.fromUnitAndValue(EtherUnit.gwei, priority.tip),
maxPriorityFeePerGas: EtherAmount.fromInt(EtherUnit.gwei, priority.tip),
value: _isEthereum ? EtherAmount.inWei(BigInt.parse(amount)) : EtherAmount.zero(),
);

Expand All @@ -83,7 +83,7 @@ class EthereumClient {
if (_isEthereum) {
_sendTransaction = () async => await sendTransaction(signedTransaction);
} else {
final erc20 = Erc20(
final erc20 = ERC20(
client: _client!,
address: EthereumAddress.fromHex(contractAddress!),
);
Expand Down Expand Up @@ -153,7 +153,7 @@ I/flutter ( 4474): Gas Used: 53000

Future<ERC20Balance> fetchERC20Balances(
EthereumAddress userAddress, String contractAddress) async {
final erc20 = Erc20(address: EthereumAddress.fromHex(contractAddress), client: _client!);
final erc20 = ERC20(address: EthereumAddress.fromHex(contractAddress), client: _client!);
final balance = await erc20.balanceOf(userAddress);

int exponent = (await erc20.decimals()).toInt();
Expand All @@ -163,7 +163,7 @@ I/flutter ( 4474): Gas Used: 53000

Future<Erc20Token?> getErc20Token(String contractAddress) async {
try {
final erc20 = Erc20(address: EthereumAddress.fromHex(contractAddress), client: _client!);
final erc20 = ERC20(address: EthereumAddress.fromHex(contractAddress), client: _client!);
final name = await erc20.name();
final symbol = await erc20.symbol();
final decimal = await erc20.decimals();
Expand Down
5 changes: 3 additions & 2 deletions cw_ethereum/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ environment:
dependencies:
flutter:
sdk: flutter
web3dart: 2.3.5
web3dart: ^2.7.1
erc20: ^1.0.1
mobx: ^2.0.7+4
bip39: ^1.0.6
bip32: ^2.0.0
ed25519_hd_key: ^2.2.0
hex: ^0.2.0
http: ^0.13.4
http: ^1.1.0
shared_preferences: ^2.0.15
cw_core:
path: ../cw_core
Expand Down
4 changes: 2 additions & 2 deletions cw_haven/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ dependencies:
flutter:
sdk: flutter
ffi: ^2.0.1
http: ^0.13.4
http: ^1.1.0
path_provider: ^2.0.11
mobx: ^2.0.7+4
flutter_mobx: ^2.0.6+1
intl: ^0.17.0
intl: ^0.18.0
cw_core:
path: ../cw_core

Expand Down
4 changes: 2 additions & 2 deletions cw_monero/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ dependencies:
flutter:
sdk: flutter
ffi: ^2.0.1
http: ^0.13.4
http: ^1.1.0
path_provider: ^2.0.11
mobx: ^2.0.7+4
flutter_mobx: ^2.0.6+1
intl: ^0.17.0
intl: ^0.18.0
encrypt: ^5.0.1
cw_core:
path: ../cw_core
Expand Down
2 changes: 1 addition & 1 deletion cw_shared_external/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author: Cake Walelt
homepage: https://cakewallet.com

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"

dependencies:
Expand Down
6 changes: 3 additions & 3 deletions howto-build-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
The following are the system requirements to build CakeWallet for your Android device.

```
Ubuntu >= 16.04
Ubuntu >= 20.04
Android SDK 29 or higher (better to have the latest one 33)
Android NDK 17c
Flutter 3.7.x
Flutter 3.10.x or earlier
```

## Building CakeWallet on Android
Expand Down Expand Up @@ -66,7 +66,7 @@ Verify that the Android toolchain, Flutter, and Android Studio have been correct
The output of this command will appear like this, indicating successful installations. If there are problems with your installation, they **must** be corrected before proceeding.
```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.x, on Linux, locale en_US.UTF-8)
[✓] Flutter (Channel stable, 3.10.x, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29 or higher)
[✓] Android Studio (version 4.0 or higher)
```
Expand Down
1 change: 0 additions & 1 deletion lib/core/generate_wallet_password.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:uuid/uuid.dart';
import 'package:cw_core/key.dart';

String generateWalletPassword() {
Expand Down
18 changes: 18 additions & 0 deletions lib/locales/hausa_intl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,21 @@ class HaMaterialLocalizations extends GlobalMaterialLocalizations {

@override
String get keyboardKeySpace => 'Space';

@override
String get bottomSheetLabel => "Bottom Sheet";

@override
String get currentDateLabel => "Current Date";

@override
String get keyboardKeyShift => "Shift";

@override
String get scrimLabel => "Scrim";

@override
String get scrimOnTapHintRaw => "Scrip on Tap";
}

/// Cupertino Support
Expand Down Expand Up @@ -937,4 +952,7 @@ class HaCupertinoLocalizations extends GlobalCupertinoLocalizations {

static const LocalizationsDelegate<CupertinoLocalizations> delegate =
_HaCupertinoLocalizationsDelegate();

@override
String get noSpellCheckReplacementsLabel => "";
}
18 changes: 18 additions & 0 deletions lib/locales/yoruba_intl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,21 @@ String get keyboardKeyMetaWindows => 'Windows';

@override
String get keyboardKeySpace => 'Space';

@override
String get bottomSheetLabel => "Bottom Sheet";

@override
String get currentDateLabel => "Current Date";

@override
String get keyboardKeyShift => "Shift";

@override
String get scrimLabel => "Scrim";

@override
String get scrimOnTapHintRaw => "Scrip on Tap";
}

/// Cupertino Support
Expand Down Expand Up @@ -937,4 +952,7 @@ String get todayLabel => 'Oyọ';

static const LocalizationsDelegate<CupertinoLocalizations> delegate =
_YoCupertinoLocalizationsDelegate();

@override
String get noSpellCheckReplacementsLabel => "";
}
4 changes: 2 additions & 2 deletions lib/src/screens/dashboard/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/yat_emoji_id.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -109,7 +108,7 @@ class _DashboardPageView extends BasePage {
Widget trailing(BuildContext context) {
final menuButton = Image.asset(
'assets/images/menu.png',
color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor,
color: Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
);

return Container(
Expand All @@ -128,6 +127,7 @@ class _DashboardPageView extends BasePage {

final DashboardViewModel dashboardViewModel;
final WalletAddressListViewModel addressListViewModel;

int get initialPage => dashboardViewModel.shouldShowMarketPlaceInDashboard ? 1 : 0;
ObservableList<Widget> pages = ObservableList<Widget>();
bool _isEffectsInstalled = false;
Expand Down
19 changes: 3 additions & 16 deletions lib/src/screens/dashboard/widgets/address_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cake_wallet/anonpay/anonpay_donation_link_info.dart';
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/entities/receive_page_option.dart';
Expand Down Expand Up @@ -64,14 +63,6 @@ class AddressPage extends BasePage {

@override
Widget? leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!,
size: 16,
);
final _closeButton =
currentTheme.type == ThemeType.dark ? closeButtonImageDarkTheme : closeButtonImage;

bool isMobileView = ResponsiveLayoutUtil.instance.isMobile;

return MergeSemantics(
Expand Down Expand Up @@ -119,11 +110,7 @@ class AddressPage extends BasePage {
context: context,
);
},
icon: Icon(
Icons.share,
size: 20,
color: Theme.of(context).accentTextTheme.displayMedium!.backgroundColor!,
),
icon: Icon(Icons.share, size: 20, color: pageIconColor(context)),
),
);
}
Expand Down Expand Up @@ -160,10 +147,10 @@ class AddressPage extends BasePage {
return KeyboardActions(
autoScroll: false,
disableScroll: true,
tapOutsideToDismiss: true,
tapOutsideBehavior: TapOutsideBehavior.translucentDismiss,
config: KeyboardActionsConfig(
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
keyboardBarColor: Theme.of(context).accentTextTheme.bodyLarge!.backgroundColor!,
keyboardBarColor: Theme.of(context).extension<KeyboardTheme>()!.keyboardBarColor,
nextFocus: false,
actions: [
KeyboardActionsItem(
Expand Down
3 changes: 1 addition & 2 deletions lib/src/screens/exchange/exchange_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/desktop_exchange_cards_section.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_section.dart';
import 'package:cake_wallet/src/widgets/add_template_button.dart';
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/debounce.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
Expand Down Expand Up @@ -250,7 +249,7 @@ class ExchangePage extends BasePage {
}
}
},
color: Theme.of(context).accentTextTheme.bodyLarge!.color!,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: exchangeViewModel.selectedProviders.isEmpty,
isLoading: exchangeViewModel.tradeState is TradeIsCreating)),
Expand Down
25 changes: 12 additions & 13 deletions lib/src/screens/restore/widgets/restore_button.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';

Expand All @@ -24,7 +25,7 @@ class RestoreButton extends StatelessWidget {
alignment: Alignment.topLeft,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12)),
color: Theme.of(context).accentTextTheme.bodySmall!.color!,
color: Theme.of(context).cardColor,
),
child: Row(
mainAxisSize: MainAxisSize.max,
Expand All @@ -43,24 +44,22 @@ class RestoreButton extends StatelessWidget {
Text(
title,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.primaryTextTheme
.titleLarge!
.color!),
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
),
),
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
description,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.primaryTextTheme
.labelSmall!
.color!),
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.extension<TransactionTradeTheme>()!
.detailsTitlesColor,
),
),
)
],
Expand Down
Loading

0 comments on commit 9ddab2b

Please sign in to comment.