floatingActionButtonLocation

floatingActionButtonLocation

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

açıklama

FloatingActionButton’un konumunun belirlenmesinden sorumludur.

konum

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

parametreler

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

örnek uygulama

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

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

class MainApp extends StatefulWidget {
  @override
  _MainAppState createState() => new _MainAppState();
}

class _MainAppState extends State {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Test',
      home: new Scaffold(
        body: new Container(
          color: Colors.purple,
        ),
        bottomNavigationBar: new BottomAppBar(
          hasNotch: true,
          color: Colors.grey,
          child: new Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              IconButton(icon: Icon(Icons.menu), onPressed: () {},),
              IconButton(icon: Icon(Icons.search), onPressed: () {},),
            ],
          ),
        ),
        floatingActionButton: new FloatingActionButton(
          onPressed: null,
          child: new Icon(Icons.add),
        ),
        floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      ),
    );
  }
}

Bir cevap yazın

KAPAT
%d blogcu bunu beğendi: