I have tried flutter clean, running FlutterError in the main method, running app in release mode, inserting internet permission in manifest file, changing compile and target sdks in the build.gradle file but no error is thrown and most of debug techniques but nothing works. Any help is welcome.
Below is my Splash Screen that loads initially
import 'dart:async';
import 'package:flyber/core/app_export.dart';
import 'package:flyber/presentation/onboarding_screen_seven_screen/onboarding_screen_seven_screen.dart';
import 'package:flyber/widgets/spacing.dart';
import 'package:flutter/material.dart';
class SplashScreensThreeScreen extends StatefulWidget {
@override
State<SplashScreensThreeScreen> createState() =>
_SplashScreensThreeScreenState();
}
class _SplashScreensThreeScreenState extends State<SplashScreensThreeScreen> {
void initState() {
// TODO: implement initState
super.initState();
Timer(Duration(seconds: 3), () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => OnboardingScreenSevenScreen()));
});
}
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
child: Scaffold(
backgroundColor: ColorConstant.primary,
body: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
VerticalSpace(height: 40),
Align(
alignment: Alignment.center,
child: Text(
Constants.appName,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: ColorConstant.whiteA700,
fontSize: getFontSize(
28,
),
fontFamily: 'Fira Sans',
fontWeight: FontWeight.w700,
letterSpacing: 1.12,
),
),
),
Container(
alignment: Alignment.center,
margin: getMargin(
bottom: 30,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: "Powered by",
style: TextStyle(
color: ColorConstant.whiteA700,
fontSize: getFontSize(
16,
),
fontFamily: 'Fira Sans',
fontWeight: FontWeight.w400,
letterSpacing: 0.64,
),
),
TextSpan(
text: " Flyber",
style: TextStyle(
color: ColorConstant.whiteA700,
fontSize: getFontSize(
16,
),
fontFamily: 'Fira Sans',
fontWeight: FontWeight.w700,
letterSpacing: 0.64,
),
),
],
),
textAlign: TextAlign.center,
),
),
],
),
),
);
}
}
2
Answers
Ensure you have the internet permission set in the AndroidManifest.xml file for both debug and release configurations.
I suggest you tried dhiwise post on Troubleshooting
especially Analyzing and Fixing persistent error:
Look for any exceptions or warnings indicating where the error occurs.
consider adding more detailed error handling throughout your code, for more clarity.
Sometimes, the white screen error might be related to specific widgets not being built as expected. To investigate, you can use debugPrint.
Have you inspect others widget, if any that might have usage on this screen?