Cleanup intro, remove button handler on final screen.
This commit is contained in:
parent
7f54f4fab6
commit
15e1892589
@ -24,7 +24,7 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
|
||||
late final PageController _pageController = PageController()..addListener(_handlePageChanged);
|
||||
final ValueNotifier<int> _currentPage = ValueNotifier(0);
|
||||
|
||||
bool get _isOnLastPage => _currentPage.value.round() == pageData.length - 1;
|
||||
@override
|
||||
void dispose() {
|
||||
_pageController.dispose();
|
||||
@ -50,6 +50,7 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
|
||||
void _handleNavTextDoubleTapped() {
|
||||
final int current = _pageController.page!.round();
|
||||
if (_isOnLastPage) return;
|
||||
_pageController.animateToPage(current + 1, duration: 250.ms, curve: Curves.easeIn);
|
||||
}
|
||||
|
||||
@ -66,10 +67,19 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
// However, we only want the title / description to actually swipe,
|
||||
// so we stack a PageView with that content over top of all the other
|
||||
// content, and line up their layouts.
|
||||
|
||||
final List<Widget> pages = pageData.map((e) => _Page(data: e)).toList();
|
||||
|
||||
final Widget content = Stack(children: [
|
||||
/// Return resulting widget tree
|
||||
return DefaultTextColor(
|
||||
color: $styles.colors.offWhite,
|
||||
child: Container(
|
||||
color: $styles.colors.black,
|
||||
child: SafeArea(
|
||||
child: Animate(
|
||||
delay: 500.ms,
|
||||
effects: const [FadeEffect()],
|
||||
child: Stack(
|
||||
children: [
|
||||
// page view with title & description:
|
||||
MergeSemantics(
|
||||
child: Semantics(
|
||||
@ -123,8 +133,8 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
Container(
|
||||
height: _pageIndicatorHeight,
|
||||
alignment: Alignment(0.0, -0.75),
|
||||
child:
|
||||
AppPageIndicator(count: pageData.length, controller: _pageController, color: $styles.colors.offWhite),
|
||||
child: AppPageIndicator(
|
||||
count: pageData.length, controller: _pageController, color: $styles.colors.offWhite),
|
||||
),
|
||||
|
||||
Spacer(flex: 2),
|
||||
@ -149,13 +159,10 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
child: _buildNavText(context),
|
||||
),
|
||||
),
|
||||
]);
|
||||
|
||||
return DefaultTextColor(
|
||||
color: $styles.colors.offWhite,
|
||||
child: Container(
|
||||
color: $styles.colors.black,
|
||||
child: SafeArea(child: content.animate().fadeIn(delay: 500.ms)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -208,7 +215,7 @@ class _IntroScreenState extends State<IntroScreen> {
|
||||
duration: $styles.times.fast,
|
||||
child: Semantics(
|
||||
onTapHint: $strings.introSemanticNavigate,
|
||||
onTap: _handleNavTextDoubleTapped,
|
||||
onTap: _isOnLastPage ? null : _handleNavTextDoubleTapped,
|
||||
child: Text($strings.introSemanticSwipeLeft, style: $styles.text.bodySmall),
|
||||
),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user