bottomSheet

bottomSheet

MaterialApp({ title,theme, home: Scaffold({ appBar, body, floatingActionButton, floatingActionButtonLocation, floatingActionButtonAnimator, persistentFooterButtons, drawer, endDrawer, bottomNavigationBar, bottomSheet, backgroundColor, resizeToAvoidBottomPadding, resizeToAvoidBottomInset }), })

açıklama

Kalıcı bir alt sayfa, uygulamanın birincil içeriğini tamamlayan bilgileri gösterir. Kalıcı bir alt sayfa, kullanıcı uygulamanın diğer bölümleriyle etkileşime girdiğinde bile görünmeye devam eder.

konum

MaterialApp({ title,theme, home: Scaffold({ appBar, body, bottomSheet,...}), })

parametreler

MaterialApp({ 
				title,
				theme,
				home: Scaffold({ 
									appBar,
									body, 
									floatingActionButton,
									floatingActionButtonLocation,
									floatingActionButtonAnimator,
									persistentFooterButtons,
									drawer,
									endDrawer,
									bottomNavigationBar,
									bottomSheet,
									backgroundColor,
									resizeToAvoidBottomPadding,
									resizeToAvoidBottomInset..
							    }),
			})

örnek uygulama

bottomsheet-orn
 
import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Bottom sheet'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State {

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: (){
          _settingModalBottomSheet(context);
        },
        child: new Icon(Icons.add),
      ),
    );
  }
}


void _settingModalBottomSheet(context){
    showModalBottomSheet(
      context: context,
      builder: (BuildContext bc){
          return Container(
            child: new Wrap(
            children: [
new ListTile(
            leading: new Icon(Icons.music_note),
            title: new Text('Music'),
            onTap: () => {}          
          ),
          new ListTile(
            leading: new Icon(Icons.videocam),
            title: new Text('Video'),
            onTap: () => {},          
          ),
            ],
          ),
          );
      }
    );
}

Bir cevap yazın

KAPAT
%d blogcu bunu beğendi: