Small Floting Action Button Using Flutter Android App

admin_img Posted By Bajarangi soft , Posted On 06-11-2020

If you want to reduce the size of FloatingActionButton in your Flutter Application, you can do so, by setting mini property of the the floatingActionButton to true as shown in the below example.we learned how to make the FloatingActionButton mini, with the help of well detailed example application.

Small Floting Action Button Using Flutter Android App

Small Floting Action Button
Complete Code For Small Floting Action Button In Flutter
main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    home: MyApp(),
  ));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.green,
        title: new Text("Small Floting Action Button"),
      ),
      floatingActionButton: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          FloatingActionButton(
            backgroundColor: Colors.green,
            onPressed: (){},
            child: Icon(Icons.sentiment_very_satisfied),
          ),
          FloatingActionButton(
            backgroundColor: Colors.green,
            onPressed: (){},
            child: Icon(Icons.sentiment_very_satisfied),
            mini: true,
          ),
        ],
      ),
    );
  }
}

Related Post