В последней версии Flutter подразумевается BottomSheetTheme в ThemeData с самого верхнего уровня в MaterialApp.
После обновления флаттера у меня возникли проблемы с импортом класса.
Я пытался flutter upgrade
и запустите flutter pub get
.
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return InheritedDB(
child: MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Colors.transparent),
primaryColor: Colors.white,
primaryTextTheme: TextTheme(
title: TextStyle(
fontWeight: FontWeight.w600,
decoration: TextDecoration.none,
color: Colors.black,
fontSize: 50,
),
subtitle: TextStyle(
fontWeight: FontWeight.w100,
decoration: TextDecoration.none,
color: Colors.black87,
fontSize: 50,
),
headline: TextStyle(
fontWeight: FontWeight.w300,
decoration: TextDecoration.none,
color: Colors.black87,
fontSize: 50,
)),
),
home: HomePage(),
),
);
}
}
ошибка:
The named parameter 'bottomSheetTheme' isn't defined.
Try correcting the name to an existing named parameter, or defining a new parameter with this name.