Closed johnfriend closed 3 years ago
I'm having the same problem, even with a new project:
`import 'package:flutter/material.dart'; import 'package:splashscreen/splashscreen.dart';
void main() { runApp(new MaterialApp( home: new MyApp(), )); }
class MyApp extends StatefulWidget { @override _MyAppState createState() => new _MyAppState(); }
class _MyAppState extends State
class AfterSplash extends StatelessWidget { @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text("Welcome In SplashScreen Package"), automaticallyImplyLeading: false), body: new Center( child: new Text( "Done!", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 30.0), ), ), ); } } `
════════ Exception caught by widgets library ═══════════════════════════════════ The following ArgumentError was thrown building MyApp(state: _MyAppState#1b99e): Invalid argument(s): widget.routeName must be a String beginning with forward slash (/)
The relevant error-causing widget was MyApp lib\main.dart:6 When the exception was thrown, this was the stack C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 216:49 throw packages/splashscreen/splashscreen.dart 87:80 initState packages/flutter/src/widgets/framework.dart 4812:57 [_firstBuild] packages/flutter/src/widgets/framework.dart 4649:5 mount packages/flutter/src/widgets/framework.dart 3615:13 inflateWidget ... ════════════════════════════════════════════════════════════════════════════════
Thanks for this report, I will check it and push a new version soon.
The if statement at line 83 should probably look something like this
if (widget.routeName != null && widget.routeName is String && "${widget.routeName[0]}" != "/") throw new ArgumentError("widget.routeName must be a String beginning with forward slash (/)");
The if statement at line 83 should probably look something like this
if (widget.routeName != null && widget.routeName is String && "${widget.routeName[0]}" != "/") throw new ArgumentError("widget.routeName must be a String beginning with forward slash (/)");
Thanks, for me solved the issue 👍
Please find below the error message that I have received when I used the example file
Invalid argument(s): widget.routeName must be a String beginning with forward slash (/)
The relevant error-causing widget was: LeviSplash file:///Users/**/Desktop/Flutter/*****/lib/main.dart:7:13 When the exception was thrown, this was the stack:
0 _SplashScreenState.initState (package:splashscreen/splashscreen.dart:86:7)
1 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4765:58)
2 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4601:5)
3 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3569:14)
4 Element.updateChild (package:flutter/src/widgets/framework.dart:3324:20)
What should i do ?
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.