Questions tagged «scaffold»

10
在不包含Scaffold的上下文中调用Scaffold.of()
如您所见,我的按钮在Scaffold的体内。但是我得到这个异常: 在不包含Scaffold的上下文中调用Scaffold.of()。 import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: HomePage(), ); } } class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('SnackBar Playground'), …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.