-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in null-safety mode #70
Comments
having the same problem after upgrading my project to Flutter2 null-safety. Haven't build a minimal example yet because i was of the impression that it has something to do with my client code. But after erasing almost all of my code i was left with an almost bare bones version of the flutter doctor:
pubspec.yaml entry runtime error message:
EDIT1: |
Sorry i don't know what exactly i did wrong in my first attempt to create a minimal example. Today i tried it a second time and i could fully recreate the problem and have a reproducible crash example. pubspec.yaml name: inner_drawer_flutter2_test
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_inner_drawer: ^1.0.0+1
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true main.dart import 'package:flutter/material.dart';
import 'package:flutter_inner_drawer/inner_drawer.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return InnerDrawer(
rightChild: Center(
child: Text(
"drawer",
style: TextStyle(color: Colors.white),
)),
scaffold: Scaffold(
body: Center(child: Text("body")),
));
}
} This is crashing immediately after the application starts with the error shown in my comment above. This is happening on my Pixel 4 with Android 11 but i don't think it matters. |
As i see it, there is a PR pending that is fixing this error. I was closing my PR in favor to the one that was already there and has an equivalent fix to mine (i just didn't look out for an existing PR because i thought i would be already merged by now) the PR in question: #69 |
I did a fix for this error. The pull request is in |
Hi @rafaelsetragni there are already multiple PRs for fixing this. I closed mine in favor for the PR that was already there #69 and i don't think the problem is a shortage of PRs to fix the problem. The main problem is merging and releasing the Fix that is already there. |
i have the same problem |
coming with same issue |
can you fix this issue ? |
I just downloaded all package source code and changed it as mentioned in the pull request. see there: |
I caught the same exception, but I see that you stopped discussing it in 2021. As a result, is there a solution? |
type 'List<Widget?>' is not a subtype of type 'List' in type cast
The relevant error-causing widget was:
InnerDrawer-[LabeledGlobalKey#e0d93]
When the exception was thrown, this was the stack:
#0 InnerDrawerState.build (package:flutter_inner_drawer/inner_drawer.dart:634:52)
#1 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)
#2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
#3 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4667:11)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5)
The text was updated successfully, but these errors were encountered: