dialog_spinner 0.1.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

dialog_spinner #

A Flutter package to make dialog mode of spinner in android available in flutter

Installing #

Example #

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

void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  final List<String> spinnerList = ["Item 1", "Item 2","Item 3", "Item 4", "Item 5"];

  @override
  State<StatefulWidget> createState() {
    return _MyAppState();
  }
}

class _MyAppState extends State<MyApp> {
  String currentItem;

  @override
  void initState() {
    super.initState();
    currentItem = widget.spinnerList[0];
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Dialog Spinner Example"),
      ),
      body: Column(
        children: <Widget>[
          DialogSpinner(
            spinnerList: widget.spinnerList,
            onValueChanged: (int index) {
              setState(() {
                currentItem = widget.spinnerList[index];
              });
            },
          ),
          Expanded(
            child: Center(
              child: Text(
                currentItem + " is selected.",
              ),
            ),
          )
        ],
      ),
    );
  }
}

[0.0.1] #

  • Initial Release

[0.1.0] #

  • Improved spinner styling features

[0.1.1] #

  • Added example in recomended format

[0.1.2] #

  • Updated README.md and example/README.md

[0.1.3] #

  • Updated link in README.md

example/lib/main.dart

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

void main() => runApp(MaterialApp(
      title: "Test App",
      home: MyApp(),
    ));

class MyApp extends StatefulWidget {
  final List<String> spinnerList = [
    "Item 1",
    "Item 2",
    "Item 3",
    "Item 4",
    "Item 5",
    "Item 6",
    "Item 7",
    "Item 8",
    "Item 9",
    "Item 10",
    "Item 11",
    "Item 12",
    "Item 13",
    "Item 14",
    "Item 15",
  ];

  @override
  State<StatefulWidget> createState() {
    return _MyAppState();
  }
}

class _MyAppState extends State<MyApp> {
  String currentItem;

  @override
  void initState() {
    super.initState();
    currentItem = widget.spinnerList[0];
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Test App"),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          DialogSpinner(
            spinnerList: widget.spinnerList,
            onValueChanged: (int index) {
              setState(() {
                currentItem = widget.spinnerList[index];
              });
            },
            width: 300,
            height: 50,
            margin: EdgeInsets.all(10.0),
            color: Colors.blue,
            dialogDecoration: BoxDecoration(
              color: Colors.blue,
            ),
            spinnerDecoration: BoxDecoration(
              color: Colors.white,
            ),
            style: TextStyle(
              color: Colors.white,
              fontSize: 20.0,
              fontWeight: FontWeight.bold,
            ),
            spinnerStyle: TextStyle(
              color: Colors.black,
              fontSize: 18.0,
              fontWeight: FontWeight.normal,
            ),
          ),
          Expanded(
            child: Center(
              child: Text(
                currentItem + " is selected.",
                style: TextStyle(
                  fontSize: 20.0,
                  fontWeight: FontWeight.bold,
                  color: Colors.black,
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  dialog_spinner: ^0.1.3

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

We analyzed this package on Jul 8, 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 [dialog_spinner] that is in a package requiring null.

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.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test