Flutter FloatingActionButton – mini button

Flutter – Small FloatingActionButton

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.

Example: Small FloatingActionButton

Create a basic Flutter Application and replace main.dart file with the following code.

main.dart

import 'package:flutter/material.dart';

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

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

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: new Text("Flutter Tutorial - googleflutter.com"),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: (){},
        child: Icon(Icons.refresh),
        mini: true,
      ),
    );
  }
}

Screenshot

Comparison of mini and regular sized FloatingActionButton.

Summary

In this Flutter Tutorial, we learned how to make the FloatingActionButton mini, with the help of well detailed example application.

Desclaimer: We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with the Google, Apple or Flutter, or any of its subsidiaries or its affiliates. The names Google, Apple and Flutter as well as related names, marks, emblems and images are registered trademarks of their respective owners. This site googleflutter.com covers tutorials related to Flutter developed by Google.