Flutter 提供两个主要的设计系统作为 widget 集合:Material(Google 的 Material Design,Android 风格)和 Cupertino(iOS 风格)。它们让你能够构建与每个平台设计语言相匹配的 UI,或者呈现一致的自定义外观。
Material widgets (Material Design)
// Material widgets follow Google's Material Design (Android look, but usable anywhere)
MaterialApp( // the app root for Material apps
home: Scaffold( // Material page structure
appBar: AppBar(title: Text('Material')),
body: Center(
child: ElevatedButton( // Material button
onPressed: () {},
child: Text('Material Button'),
),
),
floatingActionButton: FloatingActionButton(onPressed: () {}),
),
)
// Material widgets: Scaffold, AppBar, ElevatedButton, Card, FloatingActionButton, etc.
