diamond_fab 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 70

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:

dependencies:
  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.

example/lib/main.dart

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

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

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

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  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:


dependencies:
  diamond_fab: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.1 May 28, 2018 Go to the documentation of diamond_fab 0.1.1 Download diamond_fab 0.1.1 archive
0.1.0 May 28, 2018 Go to the documentation of diamond_fab 0.1.0 Download diamond_fab 0.1.0 archive
0.0.1 May 28, 2018 Go to the documentation of diamond_fab 0.0.1 Download diamond_fab 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

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 suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

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
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test