fl_radial_menu 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

fl_radial_menu #

A simple and easy to use radial menu widget for Flutter that supports fanout direction.

screem ca[tire]

install #

dependencies:
  fl_radial_menu: <version>

Usage #

  • create a list of RadialMenuItem
  final items = [
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.red,
        () => print('red')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.green,
        () => print('green')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.blue,
        () => print('blue')),
  ];
  • Instantiate RadialMenu with the items and some parameters.
RadialMenu(mainItems)
  • RadialMenu supports some parameters like isClockwise, fanout.

  • Change the direction of the menu items

RadialMenu(mainItems, isClockwise: false)
  • Specify the direction to fanout the menu items.
// enum Fanout {
//   topLeft,
//   topRight,
//   bottomLeft,
//   bottomRight,
//   top,
//   bottom,
//   left,
//   right,
//   circle,
// }
RadialMenu(mainItems, fanout: fanout: Fanout.topLeft,)

[0.1.0] - Fix layout issues. #

[0.0.2+2] - Update documents. #

[0.0.2+1] - Update readme. #

[0.0.2] - Fix layout issues. #

[0.0.1] - Initial release. #

example/lib/main.dart

import 'package:fl_radial_menu/fl_radial_menu.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  final items = [
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.red,
        () => print('red')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.green,
        () => print('green')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.blue,
        () => print('blue')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.yellow,
        () => print('yellow')),
    RadialMenuItem(Icon(FontAwesome.glass, color: Colors.white), Colors.purple,
        () => print('purple')),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: ListView(
          children: [
          RadialMenu(items, fanout: Fanout.bottomRight),
          Divider(),
          RadialMenu(items, fanout: Fanout.bottom),
          Divider(),
          RadialMenu(items, fanout: Fanout.bottomLeft),
          Divider(),
          RadialMenu(items, fanout: Fanout.right),
          Divider(),
          RadialMenu(items),
          Divider(),
          RadialMenu(items, fanout: Fanout.left),
          Divider(),
          RadialMenu(items, fanout: Fanout.topRight),
          Divider(),
          RadialMenu(items, fanout: Fanout.top),
          Divider(),
          RadialMenu(items, fanout: Fanout.topLeft),
        ]),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  fl_radial_menu: ^0.1.0

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:fl_radial_menu/fl_radial_menu.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
44
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]
72
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [fl_radial_menu] that is in a package requiring null.

Health suggestions

Format lib/src/radial_menu.dart.

Run flutter format to format lib/src/radial_menu.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.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test