Skip to content

ulisseshen/slide_done_nully

Repository files navigation

flutter_slide_done with null safety

Credits to xuelongqy

License Awesome Flutter Pub

English Version

SlideDone is inspired by sliding unlocking, which can be defined as a slide switch that can be unidirectional or bidirectional. You can customize the parameters of SlideDone to make it look what you want.

Features:

  • Support for sliding trigger events
  • Support for active trigger events
  • Support for custom styles
  • Support one-way and two-way, initialize the default location

Demo

Download APK-Demo

Project demonstration

Example
main.dart

Simple use case

1.Add a dependency in pubspec.yaml

//github way
dependencies:
  slide_done_nully:
    git:
      url: https://github.com/ulisseshen/slide_done_nully.git
      ref: master

// package way
dependencies:
  slide_done_nully: ^0.0.2

//don´t forget to run 
flutter pub get

2.Add SlideDone to the layout file

import 'package:slide_done_nully/slide_done.dart';
....
  GlobalKey<SlideDoneNSState> slideDoneKey = GlobalKey<SlideDoneNSState>();
....
  SlideDoneNS(
    key: slideDoneKey,
    onStart: () async {
      await Future.delayed(Duration(seconds: 2), (){});
    },
    onEnd: () async {
      await Future.delayed(Duration(seconds: 2), (){});
    },
  ),

3.Trigger action

  // If you don't need it, you don't need to set the key for SlideDone.
  slideDoneKey.currentState.callOnStart();
  slideDoneKey.currentState.callOnEnd();

4.Add custom icons

  SlideDoneNS(
    key: slideDoneKey,
    startIcon: Icon(Icons.keyboard_arrow_right),
    endIcon:Icon(Icons.keyboard_arrow_left),
    startedIcon: Icon(Icons.done),
    endedIcon:  Icon(Icons.done)
  ),

Donation

If you like my project, please in the upper right corner of the project "Star". Your support is my biggest encouragement! ^_^ You can also scan the qr code below or Donate to this project using Paypal, donation to Author.

If in donation message note name, will be record to the list if you are making open source authors, donation can leave when making project address or personal home page, a link will be added to the list have the effect of promoting each other (https://github.com/xuelongqy/donation/blob/master/DONATIONLIST.md)

QQ Group - 554981921

Into the group of instructions

The group is not only solve the problem of SlideDone, any Flutter related issues can be discussed. Just as its name, craigslist, as long as there is time, group of Lord will help you solve problems together.

Open source licenses

 
MIT License

Copyright (c) 2018 xuelongqy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.