radial_button 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

Buy Me A Coffee

radial_button #

A new Radial Button

Start #

A Flutter plugin for iOS and Android for generating radial buttons for floating action buttons and other parts.

Feedback and Pull Requests are most welcome!

Installation #

Add to pubspec.yaml.

dependencies:
  ...
  radial_button: ^0.1.1

Usage Example #

import circle_floating_button.dart

import 'package:radial_button/widget/circle_floating_button.dart';

Samples #

    var itemsActionBar = [
        FloatingActionButton(
        backgroundColor: Colors.greenAccent,
        onPressed: () {},
        child: Icon(Icons.add),
        ),
        FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: () {},
        child: Icon(Icons.camera),
        ),
        FloatingActionButton(
        backgroundColor: Colors.orangeAccent,
        onPressed: () {},
        child: Icon(Icons.card_giftcard),
        ),
    ];
    
    //....

    CircleFloatingButton.floatingActionButton(
    items: itemsActionBar,
    color: Colors.redAccent,
    icon: Icons.ac_unit,
    duration: Duration(milliseconds: 1000),
    curveAnim: Curves.ease)

    //......

    CircleFloatingButton.completeCircle(
        items: itemsToBody,
        color: Colors.red,
        duration: Duration(milliseconds: 1000),
    curveAnim: Curves.elasticOut)

    //........

    CircleFloatingButton.semiCircle(
        items: itemsToBody,
        color: Colors.red,
        duration: Duration(milliseconds: 1000),
    curveAnim: Curves.elasticOut)

[version: 0.1.4] - Contributions of Stephen Felt: Correct offset and Inkwell needs material wrapper or else it complains

[version: 0.1.3] - Add option to inform ur own widget to center of radial

[version: 0.1.2] - Fix HeroTag problem

[version: 0.1.1] - Add option to close, and update the Sample

[version: 0.1.0] - First Stable Version, with functional Sample

[version: 0.0.6] - Add Sample

[version: 0.0.6-pre-v0.1] - Thing to be better positioned

[0.0.4] - Add Images

[0.0.3] - Add Authors

[0.0.2] - Add image and Sample in the README.mb

[0.0.1] - First Release .

First release, i hope u enjoy =)

example/README.md

radial_button_sample #

Buy Me A Coffee

Sample #

    class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  List<Widget> itemsActionBar;
  List<Widget> itemsToBody;
  List<Widget> itemsToBodyComplete;

  GlobalKey<CircleFloatingButtonState> key01 =
      GlobalKey<CircleFloatingButtonState>();
  GlobalKey<CircleFloatingButtonState> key02 =
      GlobalKey<CircleFloatingButtonState>();
  GlobalKey<CircleFloatingButtonState> key03 =
      GlobalKey<CircleFloatingButtonState>();

  fechar() {
    key01.currentState.close();
  }

  @override
  void initState() {
    itemsActionBar = [
      FloatingActionButton(
        backgroundColor: Colors.greenAccent,
        onPressed: fechar,
        child: Icon(Icons.add),
      ),
      FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: fechar,
        child: Icon(Icons.camera),
      ),
      FloatingActionButton(
        backgroundColor: Colors.orangeAccent,
        onPressed: fechar,
        child: Icon(Icons.card_giftcard),
      ),
    ];

    itemsToBody = [
      FloatingActionButton(
        backgroundColor: Colors.greenAccent,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.add),
      ),
      FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
      FloatingActionButton(
        backgroundColor: Colors.orangeAccent,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.card_giftcard),
      ),
      FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.accessibility_new),
      ),
      FloatingActionButton(
        backgroundColor: Colors.white70,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
      FloatingActionButton(
        backgroundColor: Colors.black,
        onPressed: () {
          key02.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
    ];

    itemsToBodyComplete = [
      FloatingActionButton(
        backgroundColor: Colors.redAccent,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.add),
      ),
      FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
      FloatingActionButton(
        backgroundColor: Colors.blueAccent,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.card_giftcard),
      ),
      FloatingActionButton(
        backgroundColor: Colors.indigoAccent,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.accessibility_new),
      ),
      FloatingActionButton(
        backgroundColor: Colors.cyanAccent,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
      FloatingActionButton(
        backgroundColor: Colors.brown,
        onPressed: () {
          key03.currentState.close();
        },
        child: Icon(Icons.camera),
      ),
    ];
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Sample"),
        centerTitle: true,
      ),
      body: Container(
        child: Stack(
          children: <Widget>[
            Container(
              child: CircleFloatingButton.semiCircle(
                key: key02,
                items: itemsToBody,
                color: Colors.red,
                icon: Icons.adb,
                duration: Duration(milliseconds: 1000),
                curveAnim: Curves.elasticOut,
              ),
            ),
            Positioned(
              bottom: 100,
              right: 10,
              child: Container(
                height: 300,
                width: 300,
                child: CircleFloatingButton.completeCircle(
                  key: key03,
                  items: itemsToBodyComplete,
                  color: Colors.blue,
                  icon: Icons.adb,
                  duration: Duration(milliseconds: 1000),
                  curveAnim: Curves.elasticOut,
                ),
              ),
            ),
          ],
        ),
      ),
      floatingActionButton: CircleFloatingButton.floatingActionButton(
        key: key01,
        items: itemsActionBar,
        color: Colors.redAccent,
        icon: Icons.ac_unit,
        duration: Duration(milliseconds: 1000),
        curveAnim: Curves.ease,
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  radial_button: ^0.1.4

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:radial_button/animation/circle_button_animation.dart';
import 'package:radial_button/bloc/bloc_controller.dart';
import 'package:radial_button/widget/circle_button.dart';
import 'package:radial_button/widget/circle_floating_button.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
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]
90
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/widget/circle_floating_button.dart.

Run flutter format to format lib/widget/circle_floating_button.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
rxdart ^0.22.0 0.22.6
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test