From 218ff31016196b30633f1e76f83acf544838eade Mon Sep 17 00:00:00 2001 From: Joey Boerwinkel Date: Thu, 4 Apr 2024 10:04:59 +0200 Subject: [PATCH] fix: call splash handler when no builder is provided The default splashscreen never proceeded to the next screen unless the splashHandler is being called --- .../flutter_start_userstory_navigator.dart | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/src/user_stories/flutter_start_userstory_navigator.dart b/lib/src/user_stories/flutter_start_userstory_navigator.dart index bf8b819..e3060c9 100644 --- a/lib/src/user_stories/flutter_start_userstory_navigator.dart +++ b/lib/src/user_stories/flutter_start_userstory_navigator.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_start/flutter_start.dart'; import 'package:flutter_start/src/services/killswitch_service.dart'; @@ -68,17 +70,23 @@ Widget _splashScreen( } } - return configuration.splashScreenBuilder?.call( - context, - splashHandler, - ) ?? - Scaffold( - backgroundColor: configuration.splashScreenBackgroundColor, - body: Center( - child: configuration.splashScreenCenterWidget?.call(context) ?? - const SizedBox.shrink(), - ), - ); + var builder = configuration.splashScreenBuilder; + + if (builder == null) { + unawaited(splashHandler()); + return Scaffold( + backgroundColor: configuration.splashScreenBackgroundColor, + body: Center( + child: configuration.splashScreenCenterWidget?.call(context) ?? + const SizedBox.shrink(), + ), + ); + } + + return builder.call( + context, + splashHandler, + ); } Widget _introduction(