Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/loading animation layout fix #239

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:get/get.dart';
import 'package:get/get.dart' as Get;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird weird dependency conflict here. I had to name this import

import 'package:get_it/get_it.dart';
import 'package:hypha_wallet/core/crypto/seeds_esr/scan_qr_code_result_data.dart';
import 'package:hypha_wallet/core/error_handler/model/hypha_error.dart';
Expand Down Expand Up @@ -67,10 +67,18 @@ class HyphaAppView extends StatelessWidget {
LogHelper.d('Auth Bloc Listener unknown');
break;
case Authenticated _:
Get.offAll(() => const SplashPage());
Get.Get.offAll(
() => const SplashPage(),
duration: const Duration(milliseconds: 500),
transition: Get.Transition.fadeIn,
);
break;
case UnAuthenticated _:
Get.offAll(() => const SplashPage());
Get.Get.offAll(
() => const SplashPage(),
duration: const Duration(milliseconds: 500),
transition: Get.Transition.fadeIn,
);
break;
}
},
Expand All @@ -79,7 +87,7 @@ class HyphaAppView extends StatelessWidget {
listenWhen: (previous, current) => previous.command != current.command,
listener: (context, state) {
state.command?.when(
navigateToCreateAccount: () => Get.offAll(() => const OnboardingPageWithLink()),
navigateToCreateAccount: () => Get.Get.offAll(() => const OnboardingPageWithLink()),
navigateToSignTransaction: (ScanQrCodeResultData data) {
_showSignTransactionBottomSheet(data);
});
Expand Down Expand Up @@ -109,7 +117,7 @@ class HyphaAppView extends StatelessWidget {
words,
privateKey,
) async {
unawaited(Get.bottomSheet(
unawaited(Get.Get.bottomSheet(
FractionallySizedBox(
heightFactor: 0.95,
child: HyphaConfirmationPage(
Expand All @@ -118,13 +126,13 @@ class HyphaAppView extends StatelessWidget {
image: image,
rationale: rationale,
primaryButtonCallback: () {
Get.off(state.hasWords ? SaveWordsPage(words) : SaveKeyPage(privateKey));
Get.Get.off(state.hasWords ? SaveWordsPage(words) : SaveKeyPage(privateKey));
context.read<SettingsBloc>().add(const SettingsEvent.onSecureAccountTapped());
},
primaryButtonText: mainButtonText,
secondaryButtonText: 'Close',
secondaryButtonCallback: () {
Get.back();
Get.Get.back();
},
),
),
Expand All @@ -150,7 +158,7 @@ class HyphaAppView extends StatelessWidget {
/// NOTHING FOR NOW
},
showReLoginDialog: () {
Get.defaultDialog(
Get.Get.defaultDialog(
title: 'Something went wrong.',
middleText: 'Please authenticate again.',
cancel: const Text('Login'),
Expand All @@ -165,14 +173,14 @@ class HyphaAppView extends StatelessWidget {
// TODO(gguij): handle connection error
},
showErrorDialog: (HyphaError hyphaError) {
Get.defaultDialog(
Get.Get.defaultDialog(
title: hyphaError.message,
cancel: hyphaError.actionText?.let((it) => Text(it)),
onCancel: hyphaError.action?.call(),
);
},
showErrorMessage: (message) {
Get.showSnackbar(GetSnackBar(message: message, duration: const Duration(seconds: 3)));
Get.Get.showSnackbar(Get.GetSnackBar(message: message, duration: const Duration(seconds: 3)));
},
);

Expand All @@ -183,7 +191,7 @@ class HyphaAppView extends StatelessWidget {
child: BlocBuilder<SettingsBloc, SettingsState>(
buildWhen: (previous, current) => previous.themeMode != current.themeMode,
builder: (context, state) {
return GetMaterialApp(
return Get.GetMaterialApp(
title: 'Hypha Wallet',
darkTheme: HyphaTheme.darkTheme,
theme: HyphaTheme.lightTheme,
Expand All @@ -197,7 +205,7 @@ class HyphaAppView extends StatelessWidget {
}

void _showSignTransactionBottomSheet(ScanQrCodeResultData data) {
Get.bottomSheet(
Get.Get.bottomSheet(
FractionallySizedBox(
heightFactor: UIConstants.bottomSheetHeightFraction,
child: SignTransactionPage(qrCodeData: data),
Expand Down
1 change: 1 addition & 0 deletions lib/design/background/hypha_page_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class HyphaPageBackground extends StatelessWidget {

return DecoratedBox(
decoration: BoxDecoration(
color: const Color.fromRGBO(5, 15, 33, 1.0),
gradient: withGradient
? context.isDarkTheme
? HyphaColors.gradientBlack
Expand Down
12 changes: 10 additions & 2 deletions lib/ui/splash/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ class _SplashPageState extends State<SplashPage> with TickerProviderStateMixin {
final userAuthData = GetIt.I.get<AuthRepository>().currentAuthStatus;
if (userAuthData is Authenticated) {
if (Get.currentRoute != '/HyphaBottomNavigation') {
Get.offAll(() => const HyphaBottomNavigation());
Get.offAll(
() => const HyphaBottomNavigation(),
transition: Transition.downToUp,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

down to up animation like Luigi suggested

duration: const Duration(milliseconds: 500),
);
}
} else {
if (Get.currentRoute != '/OnboardingPage') {
Get.offAll(() => const OnboardingPage());
Get.offAll(
() => const OnboardingPage(),
transition: Transition.downToUp,
duration: const Duration(milliseconds: 500),
);
}
}
});
Expand Down
Loading