segmented_circle_border 2.0.1

  • Readme
  • Changelog
  • Installing
  • 60

segmented_circle_border #

A package for creating segmented circle borders in flutter.

Getting Started #

Add the package to your pubspec.yaml:

segmented_circle_border: ^2.0.1

Add it as a border:

import 'dart:math';

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

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

class SegmentedCircleBorderExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Material(
      shape: SegmentedCircleBorder(
          offset: -(112.5 * pi / 180),
          numberOfSegments: 8,
          sides: <BorderSide>[
            BorderSide(color: Color(0xFFFF0000), width: 10.0),
            BorderSide(color: Color(0xFF00FF00), width: 1.0),
            BorderSide(color: Color(0xFF0000FF), width: 2.0),
            BorderSide(color: Color(0xFFFF0000), width: 3.0),
            BorderSide(color: Color(0xFF00FF00), width: 4.0),
            BorderSide(color: Color(0xFF0000FF), width: 5.0),
            BorderSide(color: Color(0xFFFF00000), width: 6.0),
            BorderSide(color: Color(0xFF00FF00), width: 7.0),
          ]),
      child: Container(
        width: 100,
        height: 100,
      ));
}

[2.0.1] - Add Necessary Null Checks #

  • Adds null check assertions.

[2.0.0] - Support for Any Number of Segments #

  • Adds support for any number of segments by instead passing a list of BorderSides and argument for the number of segments.

[1.0.1] - Path Bugfix #

  • Fix clipping bug due to subpaths being created by addArc by using arcTo instead
  • Remove custom == operator

[1.0.0] - Initial Release #

  • Provides a segmented circle border which provides individual eighths of the circle, and offset to allow re-alignment of segments.

Use this package as a library

1. Depend on it

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


dependencies:
  segmented_circle_border: ^2.0.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:segmented_circle_border/segmented_circle_border.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
84
Overall:
Weighted score of the above. [more]
60
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:

  • segmented_circle_border that is a package requiring null.

Health suggestions

Format lib/segmented_circle_border.dart.

Run flutter format to format lib/segmented_circle_border.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and segmented_circle_border.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

The package description is too short. (-1 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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
Dev dependencies
flutter_test