Skip to content

peterweb2005/swipe_button

 
 

Repository files navigation

swipe_button package for Flutter

pub package

A Flutter package for iOS and Android for picking location and images.

Demo

Installation

First, add swipe_button as a dependency in your pubspec.yaml file.

iOS

No configuration required - the plugin should work out of the box.

Android

No configuration required - the plugin should work out of the box.

Code for the swipe_button widget

import 'package:swipe_button/swipe_button.dart';

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

 
  @override
  Widget build(BuildContext context) {
    return Container(
                         alignment: Alignment.center,
                         child: Padding(
                           padding: const EdgeInsets.all(24.0),
                           child: SwipeButton(
                             thumb: Row(
                               mainAxisAlignment: MainAxisAlignment.center,
                               children: <Widget>[
                                 Align(
                                     widthFactor: 0.90,
                                     child: Icon(
                                       Icons.chevron_right,
                                       size: 60.0,
                                       color: Colors.white,
                                     )),
                               ],
                             ),
                             content: Center(
                               child: Text(
                                 buttonTitle,
                                 style: TextStyle(color: Colors.white),
                               ),
                             ),
                             onChanged: (result) {
                               if (result == SwipePosition.SwipeRight) {
                                 Navigator.pushNamed(context, pageRoute);
                               } else {}
                             },
                           ),
                         ),
                       );
  }
  
}

Code for the Full page swipe_button widget

import 'package:swipe_button/swipe_button_demo.dart';

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SwipeHomeWidget(
        pageRought: "/second",
      ),
    );
  }
}

About

swipe_button package for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%