I wrap the app in a scrollconfiguration to remove the scrollglow. This always worked but it has been quite a time since i used flutter so i created a new project but it gives this error.
ProviderScope(
child: MaterialApp(
title: 'testing',
themeMode: ThemeMode.light,
darkTheme: darkTheme(),
theme: lightTheme(),
onGenerateRoute: RouteGenerator.generateRoute,
initialRoute: '/',
builder: (context, child) {
return ScrollConfiguration(
behavior: RemoveScrollGlow(),
child: child,
);
},
)
)
The probleme is child: child. I have no idea how to fix this.
class RemoveScrollGlow extends ScrollBehavior {
@override
Widget buildOverscrollIndicator(
BuildContext context, Widget child, ScrollableDetails details) {
return child;
}
}
If you are sure the value will never be null, you can cast it to the non-nullable type, ie. Widget
explicitly. Or simply add an !
suffix, like this: child!
.
You would have updated the dart SDK version and hence null safety is included in your project.
It's pretty simple to solve just go to your pubspec.yaml file and under environment variable, you will find the dart SDK range which should be something like this sdk: ">=2.12.0 <3.0.0".
Now you just have to change it from 2.12.0 to 2.7.0 which will enable your project to run without null safety and will make your project error-free. So the updated sdk version should look like sdk: ">=2.7.0 <3.0.0".
Hope it will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With