FloatingActionButton

FloatingActionButton

FloatingActionButton( onPressed: () {},tooltip, child, )

açıklama

Sayfanın üzerinde yüzen buton.

Parametreler

Scaffold( appBar, body,
    floatingActionButton: FloatingActionButton( // Scaffold parametrisi olan floatActionButton a atanır
      onPressed: _fonksiyonadi, // bir fonksiyon tetikler
      tooltip: 'Basılınca bir artır', // Düğmeye basıldığında gerçekleşecek eylemi açıklayan metin
      child: Icon(Icons.add), // floatingActionButton icon tipi
), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, //floatingActionButton buton sayfada nerde dursun
);

örnek uygulama

persistentFooterButtons-orn

import 'package:flutter/material.dart';

void main()
{
  runApp(MaterialApp(
    title: 'AndroidMonks',
    home: Scaffold(
      appBar: AppBar(
        title: Text('Androidmonks'),
        backgroundColor: Colors.orangeAccent,
      ),
      floatingActionButton: FloatingActionButton(backgroundColor: Colors.orangeAccent,onPressed: null,child: Text('Press'),),
      body: Container(child: ListView(children: [
        Text('Body Content 1',style: TextStyle(fontStyle: FontStyle.italic),),
        Text('Body Content 2',style: TextStyle(fontStyle: FontStyle.italic),)
      ],),),
      bottomNavigationBar:new BottomNavigationBar(fixedColor: Colors.orangeAccent,items: [
        new BottomNavigationBarItem(
          icon: new Icon(Icons.home),
          title: new Text("Home"),
        ),
        new BottomNavigationBarItem(
          icon: new Icon(Icons.comment),
          title: new Text("Comments"),
        )
      ]),
      persistentFooterButtons: [new Text('Sample Persistent Footer'),
      new Icon(Icons.airline_seat_flat),],
      drawer: Drawer(child: ListView(
        children: [
          new DrawerHeader(child: Icon(Icons.account_box,size: 90,),
          decoration: BoxDecoration(
            color: Colors.orangeAccent
              ),
            ),
          Text('Menu Item 1'),
          Text('Menu Item 2')
          ],
        ),
      ),
    ),
  ));
}

Bir cevap yazın

KAPAT
%d blogcu bunu beğendi: