Skip to content

Commit

Permalink
refactor: migrate to Flutter 3.16.2 (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
ookami-kb authored Dec 4, 2023
1 parent d9d8f9a commit 4ae565b
Show file tree
Hide file tree
Showing 123 changed files with 297 additions and 263 deletions.
4 changes: 2 additions & 2 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.13.6",
"flutterSdkVersion": "3.16.2",
"flavors": {}
}
}
11 changes: 3 additions & 8 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: true

env:
FLUTTER_VERSION: "3.13.6"
DART_VERSION: "3.1.3"
FLUTTER_VERSION: "3.16.2"
DART_VERSION: "3.2.2"

jobs:
formatting:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: "1.10.3"
version: "1.11.0"

- name: Activate utils
run: make activate_utils
Expand Down Expand Up @@ -73,11 +73,6 @@ jobs:
with:
sdk: ${{ env.DART_VERSION }}

- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"

- name: Install DCM
uses: CQLabs/setup-dcm@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true

env:
FLUTTER_VERSION: "3.13.6"
FLUTTER_VERSION: "3.16.2"

jobs:
e2e:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solana_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true

env:
FLUTTER_VERSION: "3.13.6"
FLUTTER_VERSION: "3.16.2"

jobs:
solana_coverage:
Expand Down
2 changes: 1 addition & 1 deletion codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workflows:
groups:
- common
- google_credentials
flutter: 3.13.6
flutter: 3.16.2
xcode: 15.0
cocoapods: 1.13.0
android_signing:
Expand Down
2 changes: 1 addition & 1 deletion packages/borsh/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ dependencies:

dev_dependencies:
build_runner: ^2.0.6
mews_pedantic: ^0.20.0
mews_pedantic: ^0.21.0
test: ^1.17.10
1 change: 1 addition & 0 deletions packages/borsh/test/structs_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:test/test.dart';

// ignore: match-lib-folder-structure, not in lib folder
import 'structs.dart';

void main() {
Expand Down
2 changes: 2 additions & 0 deletions packages/borsh_annotation/lib/src/binary_reader.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: prefer-typedefs-for-callbacks

import 'dart:convert';
import 'dart:typed_data';

Expand Down
2 changes: 2 additions & 0 deletions packages/borsh_annotation/lib/src/binary_writer.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: prefer-typedefs-for-callbacks

import 'dart:convert';
import 'dart:typed_data';

Expand Down
2 changes: 1 addition & 1 deletion packages/borsh_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ environment:
sdk: ">=2.13.0 <3.0.0"

dev_dependencies:
mews_pedantic: ^0.20.0
mews_pedantic: ^0.21.0
1 change: 1 addition & 0 deletions packages/espressocash_app/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dart_code_metrics:
avoid-nullable-interpolation:
exclude:
- test/**
prefer-correct-handler-name: false

rules-exclude:
- "**/*.gr.dart"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:dfunc/dfunc.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
import 'package:uni_links/uni_links.dart';
Expand All @@ -15,7 +16,7 @@ class DynamicLinksNotifier extends ChangeNotifier {

Uri? get link => _link;

void processLink(bool Function(Uri link) onLink) {
void processLink(Func1<Uri, bool> onLink) {
final link = _link;
if (link == null) return;

Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/data/db/db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import '../../features/payment_request/data/repository.dart';
import '../../features/popular_tokens/data/popular_token_cache.dart';
import '../../features/ramp/models/ramp_partner.dart';
import '../../features/swap/data/swap_repository.dart';
import '../../features/transactions/models/tx_sender.dart';
import '../../features/transactions/models/tx_results.dart';
import 'deprecated.dart';
import 'mixins.dart';
import 'open_connection.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/data/db/deprecated.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:drift/drift.dart';

import '../../features/transactions/models/tx_sender.dart';
import '../../features/transactions/models/tx_results.dart';
import 'mixins.dart';

class ITRows extends Table with EntityMixin {
Expand Down
2 changes: 1 addition & 1 deletion packages/espressocash_app/lib/data/db/mixins.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:drift/drift.dart';

import '../../features/transactions/models/tx_sender.dart';
import '../../features/transactions/models/tx_results.dart';

mixin AmountMixin on Table {
IntColumn get amount => integer()();
Expand Down
4 changes: 2 additions & 2 deletions packages/espressocash_app/lib/features/accounts/module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _SeedVaultListenerState extends SingleChildState<SeedVaultListener> {
super.dispose();
}

void _onUpdateAccount(MyAccount? account) {
void _handleUpdateAccount(MyAccount? account) {
_subscription?.cancel();

final sagaWallet =
Expand Down Expand Up @@ -106,7 +106,7 @@ class _SeedVaultListenerState extends SingleChildState<SeedVaultListener> {
Widget buildWithChild(BuildContext context, Widget? child) =>
BlocListener<AccountsBloc, AccountsState>(
listenWhen: (prev, cur) => prev.account != cur.account,
listener: (_, state) => _onUpdateAccount(state.account),
listener: (_, state) => _handleUpdateAccount(state.account),
child: child,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class TransactionRepository {

extension Q<Tbl extends HasResultSet, D> on ResultSetImplementation<Tbl, D> {
Stream<Activity?> findActivityOrNull({
required Expression<bool> Function(Tbl tbl) where,
required FutureOr<Activity> Function(D data) builder,
bool Function(D data) ignoreWhen = T,
required Func1<Tbl, Expression<bool>> where,
required Func1<D, FutureOr<Activity>> builder,
Func1<D, bool> ignoreWhen = T,
}) {
final query = select()
..where(where)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _AppLockEnableScreenState extends State<AppLockEnableScreen> {
String? _firstPass;
String? _secondPass;

void _onComplete(String value) {
void _handleComplete(String value) {
if (_firstPass == null) {
setState(() => _firstPass = value);
} else {
Expand All @@ -51,7 +51,7 @@ class _AppLockEnableScreenState extends State<AppLockEnableScreen> {
backgroundStyle: BackgroundStyle.dark,
child: PinInputDisplayWidget(
message: _instructions,
onCompleted: _onComplete,
onCompleted: _handleComplete,
),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AppLockScreen extends StatelessWidget {
const AppLockScreen({super.key});

@override
Widget build(BuildContext context) => WillPopScope(
onWillPop: () => Future.value(false),
Widget build(BuildContext context) => PopScope(
canPop: false,
child: BlocBuilder<AppLockBloc, AppLockState>(
builder: (context, state) => DecoratedWindow(
hasLogo: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PinKeypad extends StatelessWidget {
KeypadKey.number(number: 0),
];

void _manageKey(String key) {
void _handleKeyTapped(String key) {
String value = _controller.text;
if (key == '<') {
if (value.isNotEmpty) {
Expand Down Expand Up @@ -58,7 +58,7 @@ class PinKeypad extends StatelessWidget {
children: _keys
.map(
(KeypadKey child) => InkWell(
onTap: () => _manageKey(child.value),
onTap: () => _handleKeyTapped(child.value),
child: Center(
child: child,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PuzzleReminderMessageScreen extends StatelessWidget {

static const route = PuzzleReminderMessageRoute.new;

void _remindMeLater(BuildContext context) {
void _handleRemindPressed(BuildContext context) {
context.router.push(PuzzleReminderSetupScreen.route());
}

Expand Down Expand Up @@ -52,7 +52,7 @@ class PuzzleReminderMessageScreen extends StatelessWidget {
),
const SizedBox(height: 8),
TextButton(
onPressed: () => _remindMeLater(context),
onPressed: () => _handleRemindPressed(context),
child: Text(
context.l10n.remindMeLater,
style: const TextStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _PuzzleReminderSetupScreenState extends State<PuzzleReminderSetupScreen> {
}
}

void _setupReminder(BuildContext context) {
void _handleOkPressed(BuildContext context) {
context.read<PuzzleReminderBloc>().add(
PuzzleReminderEvent.postponed(postponedBy: _duration),
);
Expand Down Expand Up @@ -142,7 +142,7 @@ class _PuzzleReminderSetupScreenState extends State<PuzzleReminderSetupScreen> {
text: context.l10n.ok,
size: CpButtonSize.big,
minWidth: 300,
onPressed: _checked ? () => _setupReminder(context) : null,
onPressed: _checked ? () => _handleOkPressed(context) : null,
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class _MainTokenAccount {

extension SortedBalance on Map<Token, Amount> {
Iterable<MapEntry<Token, Amount>> _splitAndSort(
bool Function(MapEntry<Token, Amount> entry) test,
Func1<MapEntry<Token, Amount>, bool> test,
) =>
entries.where(test).toList()
..sort((e1, e2) => e2.value.value.compareTo(e1.value.value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
_isFavorite = sl<FavoriteTokenRepository>().isFavorite(widget.token);
}

Future<void> _onPressed({required bool isFavorite}) async {
Future<void> _handlePressed({required bool isFavorite}) async {
if (isFavorite) {
await sl<FavoriteTokenRepository>().remove(widget.token);
} else {
Expand Down Expand Up @@ -66,7 +66,7 @@ class _FavoriteButtonState extends State<FavoriteButton> {
return SizedBox.square(
dimension: 26,
child: IconButton(
onPressed: () => _onPressed(isFavorite: isFavorite),
onPressed: () => _handlePressed(isFavorite: isFavorite),
icon: icon,
padding: EdgeInsets.zero,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:solana/encoder.dart';
import '../../../core/escrow_private_key.dart';
import '../../../data/db/db.dart';
import '../../../data/db/mixins.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';
import '../models/incoming_link_payment.dart';

@injectable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:solana/encoder.dart';

import '../../../core/escrow_private_key.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';

part 'incoming_link_payment.freezed.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import '../../../di.dart';
import '../../../l10n/l10n.dart';
import '../../../routes.gr.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/widgets/transfer_error.dart';
import '../../transactions/widgets/transfer_progress.dart';
import '../../transactions/widgets/transfer_success.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../../../config.dart';
import '../../../core/escrow_private_key.dart';
import '../../../core/extensions.dart';
import '../../accounts/models/ec_wallet.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/services/resign_tx.dart';
import '../data/ilp_repository.dart';
import '../models/incoming_link_payment.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:injectable/injectable.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

import '../../../core/cancelable_job.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/services/tx_sender.dart';
import '../data/ilp_repository.dart';
import '../models/incoming_link_payment.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:injectable/injectable.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

import '../../../core/cancelable_job.dart';
import '../../transactions/models/tx_sender.dart';
import '../../transactions/models/tx_results.dart';
import '../../transactions/services/tx_sender.dart';
import '../data/ilp_repository.dart';
import '../models/incoming_link_payment.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MainScreen extends StatefulWidget {
}

class _MainScreenState extends State<MainScreen> {
Future<void> _onQrScanner() =>
Future<void> _handleScanPressed() =>
context.launchQrScannerFlow(cryptoCurrency: Currency.usdc);

@override
Expand Down Expand Up @@ -67,7 +67,7 @@ class _MainScreenState extends State<MainScreen> {
child: CpIconButton(
icon: Assets.icons.qrScanner.svg(),
variant: CpIconButtonVariant.black,
onPressed: _onQrScanner,
onPressed: _handleScanPressed,
),
),
shape: const Border(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InvestmentHeader extends StatefulWidget {
class _InvestmentHeaderState extends State<InvestmentHeader> {
bool _showMore = false;

void _toggleUsdcInfo() => setState(() => _showMore = !_showMore);
void _handleInfoPressed() => setState(() => _showMore = !_showMore);

@override
Widget build(BuildContext context) => DecoratedBox(
Expand All @@ -44,7 +44,7 @@ class _InvestmentHeaderState extends State<InvestmentHeader> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
_Headline(onInfo: _toggleUsdcInfo),
_Headline(onInfo: _handleInfoPressed),
const SizedBox(height: 4),
const _Amount(),
const SizedBox(height: 2),
Expand All @@ -54,7 +54,7 @@ class _InvestmentHeaderState extends State<InvestmentHeader> {
const _Buttons(),
],
),
second: _Info(onClose: _toggleUsdcInfo),
second: _Info(onClose: _handleInfoPressed),
showMore: _showMore,
),
);
Expand Down
Loading

0 comments on commit 4ae565b

Please sign in to comment.