simple_speed_dial 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 86

simple_speed_dial #

A simple speed dial widget for Flutter.

Demonstration:

Usage:

Scaffold(
  floatingActionButton: SpeedDial(
    child: Icon(Icons.add),
    closedForegroundColor: Colors.black,
    openForegroundColor: Colors.white,
    closedBackgroundColor: Colors.white,
    openBackgroundColor: Colors.black,
    labelsStyle: /* Your label TextStyle goes here */,
    controller: /* Your custom animation controller goes here */,
    speedDialChildren: <SpeedDialChild>[
      SpeedDialChild(
        child: Icon(Icons.directions_run),
        foregroundColor: Colors.white,
        backgroundColor: Colors.red,
        label: 'Let\'s start a run!',
        onPressed: () {
          setState(() {
            _text = 'You pressed \"Let\'s start a run!\"';
          });
        },
        closeSpeedDialOnPressed: false,
      ),
      SpeedDialChild(
        child: Icon(Icons.directions_walk),
        foregroundColor: Colors.black,
        backgroundColor: Colors.yellow,
        label: 'Let\'s go for a walk!',
        onPressed: () {
          setState(() {
            _text = 'You pressed \"Let\'s go for a walk!\"';
          });
        },
      ),
      //  Your other SpeeDialChildren go here.        
    ],
  ),
);

[0.0.1] - 2020-05-14 #

  • A simple speed dial

[0.0.2] - 2020-05-14 #

  • Added a changelog

[0.1.0] - 2020-05-14 #

  • Fixed some package quality issues.

[0.1.1] - 2020-06-21 #

  • Fixed a typo.
  • Added a code example to the README.md.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Speed dial example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _text = '';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(child: Text(_text)),
      floatingActionButton: SpeedDial(
        child: Icon(Icons.add),
        speedDialChildren: <SpeedDialChild>[
          SpeedDialChild(
            child: Icon(Icons.directions_run),
            foregroundColor: Colors.white,
            backgroundColor: Colors.red,
            label: 'Let\'s start a run!',
            onPressed: () {
              setState(() {
                _text = 'You pressed \"Let\'s start a run!\"';
              });
            },
          ),
          SpeedDialChild(
            child: Icon(Icons.directions_walk),
            foregroundColor: Colors.black,
            backgroundColor: Colors.yellow,
            label: 'Let\'s go for a walk!',
            onPressed: () {
              setState(() {
                _text = 'You pressed \"Let\'s go for a walk!\"';
              });
            },
          ),
          SpeedDialChild(
            child: Icon(Icons.directions_bike),
            foregroundColor: Colors.white,
            backgroundColor: Colors.green,
            label: 'Let\'s go cycling!',
            onPressed: () {
              setState(() {
                _text = 'You pressed \"Let\'s go cycling!\"';
              });
            },
          ),
        ],
        closedForegroundColor: Colors.black,
        openForegroundColor: Colors.white,
        closedBackgroundColor: Colors.white,
        openBackgroundColor: Colors.black,
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  simple_speed_dial: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:simple_speed_dial/simple_speed_dial.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
72
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
86
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • simple_speed_dial that is a package requiring null.

Health suggestions

Format lib/src/simple_speed_dial.dart.

Run flutter format to format lib/src/simple_speed_dial.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety