Skip to content

Commit

Permalink
[skip-ci] Merge branch 'main' of https://github.com/cake-tech/cake_wa…
Browse files Browse the repository at this point in the history
…llet into mweb-checkbox
  • Loading branch information
fossephate committed Feb 13, 2025
2 parents d3b0a7d + 8291132 commit 718d0ed
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 60 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class AppState extends State<App> with SingleTickerProviderStateMixin {
final statusBarColor = Colors.transparent;
final authenticationStore = getIt.get<AuthenticationStore>();
final initialRoute = authenticationStore.state == AuthenticationState.uninitialized
? Routes.disclaimer
? Routes.welcome
: Routes.login;
final currentTheme = settingsStore.currentTheme;
final statusBarBrightness =
Expand Down
46 changes: 1 addition & 45 deletions lib/src/screens/disclaimer/disclaimer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class DisclaimerPageBody extends StatefulWidget {
}

class DisclaimerBodyState extends State<DisclaimerPageBody> {
static const changenowUrl = 'https://changenow.io/terms-of-use';

bool _checked = false;
String _fileText = '';
Expand All @@ -63,7 +62,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async => false,
onWillPop: () async => widget.isReadOnly,
child: Container(
color: Theme.of(context).colorScheme.background,
child: Column(
Expand Down Expand Up @@ -125,49 +124,6 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
SizedBox(
height: 16.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: Text(
'Other Terms and Conditions',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor),
),
)
],
),
SizedBox(
height: 16.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: GestureDetector(
onTap: () async {
final uri = Uri.parse(changenowUrl);
if (await canLaunchUrl(uri))
await launchUrl(uri, mode: LaunchMode.externalApplication);
},
child: Text(
changenowUrl,
textAlign: TextAlign.left,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 14.0,
fontWeight: FontWeight.normal,
decoration: TextDecoration.underline),
),
))
],
),
SizedBox(
height: 16.0,
)
],
),
),
Expand Down
54 changes: 40 additions & 14 deletions lib/src/screens/welcome/create_pin_welcome_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
Expand Down Expand Up @@ -68,7 +69,7 @@ class CreatePinWelcomePage extends BasePage {
alignment: Alignment.center,
child: ConstrainedBox(
constraints:
BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expand Down Expand Up @@ -122,19 +123,44 @@ class CreatePinWelcomePage extends BasePage {
),
),
),
bottomSection: Padding(
padding: EdgeInsets.only(top: 24),
child: PrimaryImageButton(
key: ValueKey('create_pin_welcome_page_create_a_pin_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.welcomeWallet),
image: newWalletImage,
text: isWalletPasswordDirectInput ? S.current.set_up_a_wallet : S.current.set_a_pin,
color: Theme.of(context)
.extension<WalletListTheme>()!
.createNewWalletButtonBackgroundColor,
textColor:
Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor,
),
bottomSection: Column(
children: [
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 14,
color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
),
children: [
TextSpan(text: 'By continuing, you agree to our '),
TextSpan(
text: 'Terms of Service',
style: TextStyle(
color: Theme.of(context).primaryColor,
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () => Navigator.pushNamed(context, Routes.readDisclaimer),
),
],
),
),
Padding(
padding: EdgeInsets.only(top: 24),
child: PrimaryImageButton(
key: ValueKey('create_pin_welcome_page_create_a_pin_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.welcomeWallet),
image: newWalletImage,
text: isWalletPasswordDirectInput ? S.current.set_up_a_wallet : S.current.set_a_pin,
color: Theme.of(context)
.extension<WalletListTheme>()!
.createNewWalletButtonBackgroundColor,
textColor:
Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor,
),
),
],
),
),
);
Expand Down

0 comments on commit 718d0ed

Please sign in to comment.