flutter_slider_indicator 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 81

Flutter Slider Indicator #

Slider Indicator Widget built in for flutter. Please press star in my repo if you like it. Thank you.

Usage #

SliderIndicator(
    length: YOUR_INDICATOR_LENGTH,
    activeIndex: YOUR_INDICATOR_ACTIVE_INDEX,
)

Example #

Please find example in here: Example

Available parameter #

ParameterRequiredDefault Value
int lengthtrue
int activeIndextrue
Widget indicatortrue
Widget activeIndicatortrue
Duration animationDurationfalseDuration(milliseconds: 250)

0.2.0 - 23/07/2019 #

  • Develop new parameter for the slider (Breaking)
  • Now the parameter accept child instead of icon

0.1.1 - 23/07/2019 #

  • Add more description

0.1.0 - 23/07/2019 #

  • Develop slider indicator

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Slider Indicator',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Slider Indicator'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  var _controller = PageController();
  double _currentIndex = 0;

  @override
  Widget build(BuildContext context) {
    _controller.addListener(() {
      setState(() {
        _currentIndex = _controller.page;
      });
    });
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: <Widget>[
          Expanded(
            child: PageView(
              controller: _controller,
              children: <Widget>[
                Center(child: Text("First Page")),
                Center(child: Text("Second Page")),
                Center(child: Text("Third Page")),
              ],
            ),
          ),
          SliderIndicator(
            length: 3,
            activeIndex: _currentIndex.round(),
            indicator: Icon(
              Icons.ac_unit,
              size: 50,
            ),
            activeIndicator: Icon(Icons.access_alarms),
          )
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.6.1
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.2

Dependencies

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