slide_to_confirm 0.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

slide_to_confirm #

A customizable slider that will activate a callback when the user slides it to 100%.

Installation #

In the dependencies: section of your pubspec.yaml, add the following line:

  slide_to_confirm: <latest_version>

Usage #

import 'package:slide_to_confirm/slide_to_confirm.dart';

class MyWidget extends StatelessWidget {

    void confirmed(){
        print('Slider confirmed!');
    }

    Widget build(BuildContext context) {
        return ConfirmationSlider(
            onConfirmation: () => confirmed(),
        );
    }
}

Properties #

  • height double: Height of the slider. Defaults to 70.
  • width double: Width of the slider. Defaults to 300.
  • backgroundColor Color: The color of the background of the slider. Defaults to Colors.white.
  • foregroundColor Color: The color of the moving element of the slider. Defaults to Colors.blueAccent.
  • iconColor Color: The color of the icon on the moving element. Defaults to Colors.white.
  • icon IconData: The icon used on the moving element of the slider. Defaults to Icons.chevron_right.
  • shadow BoxShadow: The shadow below the slider. Defaults to BoxShadow(color: Colors.black38, offset: Offset(0, 2),blurRadius: 2,spreadRadius: 0,).
  • text String: The text showed below the foreground. Used to specify the functionality to the user. Defaults to "Slide to confirm".
  • textStyle TextStyle: The style of the text. Defaults to TextStyle(color: Colors.black26, fontWeight: FontWeight.bold,).
  • onConfirmation VoidCallback: The callback when slider is completed. This is the only required field.

Example #

View the Flutter app in the example directory to see a working example of how to use and implement the slider.

Screenshots #

Slider Gif

Slider Gif

Slider Gif

Slider Gif

Slider Gif

Contributors #

Gustav Friis-Hansen: https://github.com/Friiiis?tab=repositories

Changelog #

[0.0.5] - 08/09-2019

  • Added foregroundShape and backgroundShape that lets you specify the BorderRadius of both elements.

[0.0.4] - 02/09-2019

  • Updated example app.

[0.0.3] - 31/08-2019

  • Updates screenshots.

[0.0.2] - 31/08-2019

  • Updates images and link to repo.

[0.0.1] - 31/08-2019

  • Initial release.

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  slide_to_confirm: ^0.0.5

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:slide_to_confirm/slide_to_confirm.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/slide_to_confirm.dart.

Run flutter format to format lib/slide_to_confirm.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

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