Flutter質(zhì)感設(shè)計之模態(tài)底部面板
模態(tài)底部面板是菜單或?qū)υ捒虻奶娲桨?,可防止用戶與其他控件進(jìn)行互動,可以使用showModalBottomSheet函數(shù)創(chuàng)建和顯示模態(tài)底部面板。
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('底部面板')
),
body: new Center(
child: new RaisedButton(
child: new Text('顯示底部面板'),
onPressed: () {
// showModalBottomSheet<T>:顯示模態(tài)質(zhì)感設(shè)計底部面板
showModalBottomSheet<Null>(context:context, builder:(BuildContext context) {
return new Container(
child: new Padding(
padding: const EdgeInsets.all(32.0),
child: new Text(
'這是模態(tài)底部面板,點(diǎn)擊任意位置即可關(guān)閉',
textAlign: TextAlign.center,
style: new TextStyle(
color: Theme.of(context).accentColor,
fontSize: 24.0
)
)
)
);
});
}
)
)
);
}
}
void main() {
runApp(new MaterialApp(
title: 'Flutter Demo',
home: new MyApp()
));
}

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Android 模擬器(emulator-5554...)出現(xiàn)錯誤解決辦法
這篇文章主要介紹了Android 模擬器出現(xiàn)錯誤解決辦法的相關(guān)資料,如:Unable to get view server version from device,F(xiàn)ailed to install helloworld.apk on device 'emulator-5554': timeout,這種常見錯誤,解決辦法,需要的朋友可以參考下2016-11-11
Android中ListView Item布局優(yōu)化技巧
這篇文章主要介紹了Android中ListView Item布局優(yōu)化技巧,以實(shí)例形式分析了ListView Item布局的相關(guān)實(shí)現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10
Android中使用Service實(shí)現(xiàn)后臺發(fā)送郵件功能實(shí)例
這篇文章主要介紹了Android中使用Service實(shí)現(xiàn)后臺發(fā)送郵件功能的方法,結(jié)合實(shí)例形式分析了Service實(shí)現(xiàn)郵件的發(fā)送、接收及權(quán)限控制相關(guān)技巧,需要的朋友可以參考下2016-01-01
Android ActionBarActivity設(shè)置全屏無標(biāo)題實(shí)現(xiàn)方法總結(jié)
這篇文章主要介紹了Android ActionBarActivity設(shè)置全屏無標(biāo)題實(shí)現(xiàn)方法總結(jié)的相關(guān)資料,需要的朋友可以參考下2017-04-04
Android四大組件:Activity/Service/Broadcast/ContentProvider作用示例
Android是一種基于Linux,自由及開放源代碼的操作系統(tǒng),Android分為四個層,從高層到底層分別是應(yīng)用程序?qū)?、?yīng)用程序框架層、系統(tǒng)運(yùn)行庫層和Linux內(nèi)核層,Android有四大基本組件:Activity、Service服務(wù)、BroadcastReceiver廣播接收器、Content Provider內(nèi)容提供者2023-11-11
Android利用ZXing掃描二維碼的實(shí)例代碼解析
這篇文章主要介紹了Android利用ZXing掃描二維碼的實(shí)例解析,代碼簡單易懂,非常不錯,需要的朋友可以參考下2016-12-12
Android實(shí)現(xiàn)TCP斷點(diǎn)上傳 后臺C#服務(wù)接收
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)TCP斷點(diǎn)上傳,后臺C#服務(wù)實(shí)現(xiàn)接收,感興趣的小伙伴們可以參考一下2016-08-08
Android嵌套RecyclerView左右滑動替代自定義view
這篇文章主要介紹了Android嵌套RecyclerView左右滑動替代自定義view,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-06-06

