From 8c3ae3eafcfad8c4adce72ff3cc995bcba760db1 Mon Sep 17 00:00:00 2001 From: invertedx Date: Wed, 24 Apr 2024 12:20:00 +0200 Subject: [PATCH 1/3] passport tou page margins and scrollview fade. --- lib/ui/pages/legal/passport_tou.dart | 55 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/lib/ui/pages/legal/passport_tou.dart b/lib/ui/pages/legal/passport_tou.dart index 076db9507..c4d305e5a 100644 --- a/lib/ui/pages/legal/passport_tou.dart +++ b/lib/ui/pages/legal/passport_tou.dart @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: GPL-3.0-or-later +import 'package:envoy/ui/fading_edge_scroll_view.dart'; +import 'package:envoy/util/build_context_extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:envoy/ui/onboard/onboarding_page.dart'; @@ -11,7 +13,14 @@ import 'package:flutter_html/flutter_html.dart'; import 'package:envoy/ui/onboard/onboard_page_wrapper.dart'; import 'package:envoy/ui/theme/envoy_spacing.dart'; -class TouPage extends StatelessWidget { +class TouPage extends StatefulWidget { + @override + State createState() => _TouPageState(); +} + +class _TouPageState extends State { + + ScrollController _scrollController = ScrollController(); @override Widget build(BuildContext context) { //ignore:unused_local_variable @@ -59,29 +68,37 @@ class TouPage extends StatelessWidget { style: Theme.of(context).textTheme.titleLarge, ), Flexible( - child: SingleChildScrollView( - padding: EdgeInsets.all(4.0), - scrollDirection: Axis.vertical, - child: FutureBuilder( - future: rootBundle.loadString('assets/passport_tou.html'), - builder: (context, snapshot) { - if (snapshot.hasData) { - return DefaultTextStyle( - style: Theme.of(context).textTheme.bodySmall!, - child: Html( - data: snapshot.data, - ), - ); - } else { - return SizedBox.shrink(); - } + child: FadingEdgeScrollView.fromScrollView( + scrollController: _scrollController, + child: StatefulBuilder( + builder: (context, setState) { + return SingleChildScrollView( + controller: _scrollController, + padding: EdgeInsets.all(4.0), + scrollDirection: Axis.vertical, + child: FutureBuilder( + future: rootBundle.loadString('assets/passport_tou.html'), + builder: (context, snapshot) { + if (snapshot.hasData) { + return DefaultTextStyle( + style: Theme.of(context).textTheme.bodySmall!, + child: Html( + data: snapshot.data, + ), + ); + } else { + return SizedBox.shrink(); + } + }, + ), + ); }, ), ), ), Padding( - padding: const EdgeInsets.only( - top: EnvoySpacing.small, + padding: EdgeInsets.only( + top: context.isSmallScreen ? EnvoySpacing.medium1 : EnvoySpacing.medium3, bottom: EnvoySpacing.medium1, left: EnvoySpacing.small, right: EnvoySpacing.small), From 283581b99139599206484df272e23e15156a2611 Mon Sep 17 00:00:00 2001 From: invertedx Date: Wed, 24 Apr 2024 12:20:31 +0200 Subject: [PATCH 2/3] fix formatting --- lib/ui/pages/legal/passport_tou.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ui/pages/legal/passport_tou.dart b/lib/ui/pages/legal/passport_tou.dart index c4d305e5a..612bbd56a 100644 --- a/lib/ui/pages/legal/passport_tou.dart +++ b/lib/ui/pages/legal/passport_tou.dart @@ -19,7 +19,6 @@ class TouPage extends StatefulWidget { } class _TouPageState extends State { - ScrollController _scrollController = ScrollController(); @override Widget build(BuildContext context) { @@ -72,12 +71,13 @@ class _TouPageState extends State { scrollController: _scrollController, child: StatefulBuilder( builder: (context, setState) { - return SingleChildScrollView( + return SingleChildScrollView( controller: _scrollController, padding: EdgeInsets.all(4.0), scrollDirection: Axis.vertical, child: FutureBuilder( - future: rootBundle.loadString('assets/passport_tou.html'), + future: + rootBundle.loadString('assets/passport_tou.html'), builder: (context, snapshot) { if (snapshot.hasData) { return DefaultTextStyle( @@ -97,8 +97,10 @@ class _TouPageState extends State { ), ), Padding( - padding: EdgeInsets.only( - top: context.isSmallScreen ? EnvoySpacing.medium1 : EnvoySpacing.medium3, + padding: EdgeInsets.only( + top: context.isSmallScreen + ? EnvoySpacing.medium1 + : EnvoySpacing.medium3, bottom: EnvoySpacing.medium1, left: EnvoySpacing.small, right: EnvoySpacing.small), From b6d0b106288bcda04690905e3818b625059c7aec Mon Sep 17 00:00:00 2001 From: invertedx Date: Wed, 24 Apr 2024 12:21:32 +0200 Subject: [PATCH 3/3] mnemonic grid indicator spacing --- lib/ui/onboard/manual/widgets/mnemonic_grid_widget.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ui/onboard/manual/widgets/mnemonic_grid_widget.dart b/lib/ui/onboard/manual/widgets/mnemonic_grid_widget.dart index c1f3e9638..9031a8bc5 100644 --- a/lib/ui/onboard/manual/widgets/mnemonic_grid_widget.dart +++ b/lib/ui/onboard/manual/widgets/mnemonic_grid_widget.dart @@ -4,6 +4,8 @@ import 'package:envoy/ui/envoy_colors.dart'; import 'package:envoy/ui/onboard/manual/widgets/wordlist.dart'; +import 'package:envoy/ui/theme/envoy_spacing.dart'; +import 'package:envoy/util/build_context_extension.dart'; import 'package:flutter/material.dart'; enum SeedLength { @@ -88,7 +90,11 @@ class MnemonicEntryGridState extends State ), ), Container( - margin: EdgeInsets.only(top: 8), + margin: EdgeInsets.symmetric( + vertical: context.isSmallScreen + ? EnvoySpacing.medium1 + : EnvoySpacing.medium3, + ), child: DotsIndicator( totalPages: 2, pageController: _pageController,