mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-18 18:13:45 +02:00
fix: call splash handler when no builder is provided
The default splashscreen never proceeded to the next screen unless the splashHandler is being called
This commit is contained in:
parent
6ecc2f0992
commit
218ff31016
1 changed files with 19 additions and 11 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_start/flutter_start.dart';
|
import 'package:flutter_start/flutter_start.dart';
|
||||||
import 'package:flutter_start/src/services/killswitch_service.dart';
|
import 'package:flutter_start/src/services/killswitch_service.dart';
|
||||||
|
@ -68,11 +70,11 @@ Widget _splashScreen(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return configuration.splashScreenBuilder?.call(
|
var builder = configuration.splashScreenBuilder;
|
||||||
context,
|
|
||||||
splashHandler,
|
if (builder == null) {
|
||||||
) ??
|
unawaited(splashHandler());
|
||||||
Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: configuration.splashScreenBackgroundColor,
|
backgroundColor: configuration.splashScreenBackgroundColor,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: configuration.splashScreenCenterWidget?.call(context) ??
|
child: configuration.splashScreenCenterWidget?.call(context) ??
|
||||||
|
@ -81,6 +83,12 @@ Widget _splashScreen(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return builder.call(
|
||||||
|
context,
|
||||||
|
splashHandler,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _introduction(
|
Widget _introduction(
|
||||||
StartUserStoryConfiguration configuration,
|
StartUserStoryConfiguration configuration,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
|
|
Loading…
Reference in a new issue