diamond_fab 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 46

diamond_fab #

A simple package for adding a Diamond Floating Action Button or FAB to a flutter application. This FAB also allows for a notch to be made inside of the Bottom Application Bar or Bottom Navigation Bar based on the positioning.

FAB code is based on the original Floating Action Button Source code and the Material Design specification.

Getting Started #

Add this to your package's pubspec.yaml file:

  diamond_fab: "^0.1.0"

Screenshots #

Center docked with wider margin Center Float with normal margin End docked with narrow margin

[0.0.1] - First Release. #

[0.1.0] - Updated properties and button drawing method #

Added new properties for foreground color, background color, heroTag, highlightElevation, mini (miniMode), and tooltip. Added more documentation (again based on the original Floating Action Button code).

[0.1.1] - Changed normal size based on Material design Spec #

Diamond Shaped FAB is 68 logical pixels in size on the material design spec compared to the normal 56.0 logical pixels. Also changed mini size to 52 rather then 40.


import 'package:flutter/material.dart';
import 'package:diamond_fab/diamond_fab.dart';

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

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData.dark(),
      home: MyHomePage(),

class MyHomePage extends StatefulWidget {
  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Diamond Fab Example'),
      body: Container(),
      floatingActionButton: DiamondFab(
        child: Icon(Icons.home),
        onPressed: () {},
        mini: true,
        tooltip: 'Testing on long press',
        notchMargin: 20.0,
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: BottomAppBar(
        child: Container(
          height: 60.0,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  diamond_fab: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:diamond_fab/diamond_fab.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Fix lib/diamond_fab.dart. (-25 points)

Analysis of lib/diamond_fab.dart failed with 1 error:

line 203 col 18: The method 'setFloatingActionButtonNotchFor' isn't defined for the class 'Scaffold'.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Package is getting outdated. (-83.29 points)

The package was last published 95 weeks ago.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies