Skip to content

Commit 6ef9d7d

Browse files
authored
Merge pull request #46 from JDI-Group/pre_main_qa
Pre main qa
2 parents 11ec0de + fdfadeb commit 6ef9d7d

File tree

12 files changed

+102
-80
lines changed

12 files changed

+102
-80
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
echo "$(( ${{ secrets.DEV_ENV_FILE_CONTENT }} + 67 ))" > .env
2727
shell: bash
2828

29-
- uses: sheenhx/action-flutter-build-android@main
29+
- uses: reasje/action-flutter-build-android@main
3030
with:
3131
keystore-base64: ${{ secrets.ANDROID_RELEASE_KEY }}
3232
keystore-password: "${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}"

android/app/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ android {
6262
// You can update the following values to match your application needs.
6363
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
6464
minSdkVersion 21
65+
minSdk 21
66+
manifestPlaceholders = [
67+
minSdkVersion: "21",
68+
applicationName: "android.app.Application"
69+
]
6570
targetSdkVersion rootProject.ext.targetSdkVersion
6671
versionCode System.getenv('VERSION_CODE')?.hashCode()?.abs() ?: 404
6772
versionName flutterVersionName

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.2.1'
9+
classpath 'com.android.tools.build:gradle:8.4.0'
1010
// START: FlutterFire Configuration
1111
classpath 'com.google.gms:google-services:4.3.15'
1212
// END: FlutterFire Configuration

android/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
33
android.enableJetifier=true
4-
kotlin.jvm.target.validation.mode = IGNORE
4+
kotlin.jvm.target.validation.mode = IGNORE
5+
android.ndk.suppressMinSdkVersionError=21

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip

lib/app/app.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class MXCWallet extends HookConsumerWidget {
4747
for (final l in languageState.supportedLanguages) l.toLocale(),
4848
],
4949
navigatorKey: appNavigatorKey,
50+
scaffoldMessengerKey: RootScaffoldMessenger.key,
5051
onGenerateRoute: (_) => null,
5152
builder: (context, child) {
5253
child = Navigator(
@@ -95,3 +96,14 @@ class MXCWallet extends HookConsumerWidget {
9596
);
9697
}
9798
}
99+
100+
101+
// Global scaffold messenger utility
102+
class RootScaffoldMessenger {
103+
static final GlobalKey<ScaffoldMessengerState> key =
104+
GlobalKey<ScaffoldMessengerState>();
105+
106+
static void showSnackBar(SnackBar snackBar) {
107+
key.currentState?.showSnackBar(snackBar);
108+
}
109+
}

lib/common/components/snackbar/snackbar.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:moonchain_wallet/app/app.dart';
12
import 'package:moonchain_wallet/common/common.dart';
23
import 'package:flutter/material.dart';
34
import 'package:mxc_ui/mxc_ui.dart';
@@ -221,6 +222,7 @@ void showSnackBar({
221222
behavior: SnackBarBehavior.floating,
222223
);
223224

225+
RootScaffoldMessenger.key.currentState?.clearSnackBars();
224226
ScaffoldMessenger.of(context).clearSnackBars();
225-
ScaffoldMessenger.of(context).showSnackBar(snackBar);
227+
RootScaffoldMessenger.showSnackBar(snackBar);
226228
}

lib/common/layout/mxc_page.dart

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -272,44 +272,42 @@ abstract class MxcPage extends HookConsumerWidget {
272272
decoration: BoxDecoration(
273273
gradient: backgroundGradient,
274274
),
275-
child: ScaffoldMessenger(
276-
child: Scaffold(
277-
backgroundColor: resolveBackgroundColor(context),
278-
extendBodyBehindAppBar: extendBodyBehindAppBar,
279-
drawer: drawer,
280-
key: scaffoldKey,
281-
resizeToAvoidBottomInset: false,
282-
floatingActionButton: floatingActionButton,
283-
bottomNavigationBar: buildBottomNavigation(context, ref),
284-
floatingActionButtonLocation: floatingActionButtonLocation,
285-
body: PresenterHooks(
286-
presenter: presenter,
287-
child: paintBackground(
288-
context: context,
289-
splashBackgroundVisible: useSplashBackground,
290-
useBlackBackground: useBlackBackground,
291-
gradientBackgroundVisible: useGradientBackground,
292-
child: SafeArea(
293-
bottom: maintainBottomSafeArea,
294-
top: topSafeArea,
295-
child: Column(
296-
children: [
297-
buildAppBar(context, ref),
298-
Expanded(
299-
child: Padding(
300-
padding: childrenPadding ?? EdgeInsets.zero,
301-
child: content(context, ref),
302-
)),
303-
if (placeBottomInsetFiller)
304-
AnimatedSize(
305-
curve: Curves.easeOutQuad,
306-
duration: const Duration(milliseconds: 275),
307-
child: SizedBox(
308-
height: MediaQuery.of(context).viewInsets.bottom,
309-
),
275+
child: Scaffold(
276+
backgroundColor: resolveBackgroundColor(context),
277+
extendBodyBehindAppBar: extendBodyBehindAppBar,
278+
drawer: drawer,
279+
key: scaffoldKey,
280+
resizeToAvoidBottomInset: false,
281+
floatingActionButton: floatingActionButton,
282+
bottomNavigationBar: buildBottomNavigation(context, ref),
283+
floatingActionButtonLocation: floatingActionButtonLocation,
284+
body: PresenterHooks(
285+
presenter: presenter,
286+
child: paintBackground(
287+
context: context,
288+
splashBackgroundVisible: useSplashBackground,
289+
useBlackBackground: useBlackBackground,
290+
gradientBackgroundVisible: useGradientBackground,
291+
child: SafeArea(
292+
bottom: maintainBottomSafeArea,
293+
top: topSafeArea,
294+
child: Column(
295+
children: [
296+
buildAppBar(context, ref),
297+
Expanded(
298+
child: Padding(
299+
padding: childrenPadding ?? EdgeInsets.zero,
300+
child: content(context, ref),
301+
)),
302+
if (placeBottomInsetFiller)
303+
AnimatedSize(
304+
curve: Curves.easeOutQuad,
305+
duration: const Duration(milliseconds: 275),
306+
child: SizedBox(
307+
height: MediaQuery.of(context).viewInsets.bottom,
310308
),
311-
],
312-
),
309+
),
310+
],
313311
),
314312
),
315313
),

lib/common/layout/mxc_page_layer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ class MxcPageLayer extends MxcPage {
8484
return upperBackgroundColor!;
8585
}
8686
if (BottomFlowDialog.maybeOf(context) != null) {
87-
return ColorsTheme.of(context).darkBlue;
87+
return ColorsTheme.of(context).darkGray;
8888
}
89-
return ColorsTheme.of(context).darkBlue;
89+
return ColorsTheme.of(context).darkGray;
9090
}
9191

9292
@override

lib/features/common/app_nav_bar/app_nav_bar_presenter.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ class AppNavPresenter extends CompletePresenter<AppNavBarState> {
5757
addMessage(tip);
5858
}
5959

60-
void addNewAccount() async {
61-
notify(() => state.isLoading = true);
60+
Future<void> addNewAccount() async {
61+
if (loading) return;
62+
loading = true;
6263

6364
try {
6465
final index = _accountUseCase.findAccountsLastIndex();
@@ -67,8 +68,8 @@ class AppNavPresenter extends CompletePresenter<AppNavBarState> {
6768
_accountUseCase.addAccount(newAccount, index: index);
6869
loadCache();
6970

70-
notify(() => state.isLoading = false);
7171
navigator!.pop();
72+
loading = false;
7273
} catch (e, s) {
7374
addError(e, s);
7475
}

0 commit comments

Comments
 (0)