simple_speed_dial 0.1.1 copy "simple_speed_dial: ^0.1.1" to clipboard
simple_speed_dial: ^0.1.1 copied to clipboard

outdated

A simple speed dial for Flutter. You can use as many speed dial options as you want. You can use labels next to the speed dial options. Colors of every fab can be set.

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,
      ),
    );
  }
}
79
likes
0
pub points
94%
popularity

Publisher

unverified uploader

A simple speed dial for Flutter. You can use as many speed dial options as you want. You can use labels next to the speed dial options. Colors of every fab can be set.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on simple_speed_dial