donut_thumb_shape 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 55

donut_thumb_shape #

A widget for creating a donut thump shape easily on Sliders.

Usage #

Import the package #

To use this package, follow the instructions here. Then use it with SliderTheme, for example, the following code provides the following output:

SliderTheme(
          data: SliderThemeData(
              overlayColor: Colors.transparent,
              thumbColor: Colors.white,
              activeTrackColor: Color.fromRGBO(102, 0, 78, 1),
              inactiveTrackColor: Colors.white,
              tickMarkShape: SliderTickMarkShape.noTickMark,
              thumbShape: DonutThumbShape(
                  insideCircleRadius: 4,
                  outsideCircleRadius: 9,
                  outsideCircleColor: Colors.pinkAccent,
                  insideCircleColor: Colors.lightBlueAccent)),
          child: Slider(
            onChanged: (v) { },
            value: 2,
            min: 0,
            max: 10,
          ),
        ),

More examples here

Use the package #

import 'package:donut_thumb_shape/donut_thumb_shape.dart';

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.1.0] - Release #

  • Release with examples

[0.0.1] - Testing release #

  • Testing release

example/example.md

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

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  @override
  Widget build(BuildContext context) {
    return SliderTheme(
      data: SliderThemeData(
          overlayColor: Colors.transparent,
          thumbColor: Colors.white,
          activeTrackColor: Color.fromRGBO(102, 0, 78, 1),
          inactiveTrackColor: Colors.white,
          tickMarkShape: SliderTickMarkShape.noTickMark,
          thumbShape: DonutThumbShape(
              insideCircleRadius: 6,
              outsideCircleRadius: 8,
              outsideCircleColor: Colors.white,
              insideCircleColor: Color.fromRGBO(102, 0, 78, 1))),
      child: Slider(
        onChanged: (v) { },
        value: 2,
        min: 0,
        max: 10,
      ),
    );
  }
}

Output

Other example

Use this package as a library

1. Depend on it

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


dependencies:
  donut_thumb_shape: ^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:donut_thumb_shape/donut_thumb_shape.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
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]
55
Learn more about scoring.

We analyzed this package on Jul 14, 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:

  • donut_thumb_shape that is a package requiring null.

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
Dev dependencies
flutter_test