flutter_swipe_me 0.0.1 copy "flutter_swipe_me: ^0.0.1" to clipboard
flutter_swipe_me: ^0.0.1 copied to clipboard

Swipe Button With Controller.

example/main.dart

import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_swipe_me/swiper.dart';
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter  Swipe Page Demo'),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {


  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(

        title: Text(widget.title),
      ),
      body: Center(
       
        child: Column(
         
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
          // Swiping Button
           SwipingButton(
             validateOnScroll: ()=> true, // Validator If False You Cant Scroll
           text: "Swipe Me ", // Text
           turnOfAnimation:  false, // Turn Of The Text Animation
           size:const Size(400, 60),
           thumbWidth: 80,
            bgColor:     Colors.grey.shade200,
            textGradientColor: const[
              Colors.red,
              Colors.yellow
            ],
            boxShadow: [
                 BoxShadow(
             color: Colors.grey.shade200,
            offset: Offset(-3, -3),
            blurRadius: 8,
            spreadRadius: 8),
        BoxShadow(
               color:Colors.grey.shade200,
            offset: Offset(4, 4),
            blurRadius: 8,
            spreadRadius: 8)
            ],
            swipedBgColor: Colors.red,
           
           textStyle:const TextStyle().copyWith(
                   color: Colors.grey[400]!.withOpacity(.5),
                   
              ),
           swipingButtonController: (cont){
            //get the Controller
           },
           onSwipeComplete: (){
            print("Done");
           },
           )
          ],
        ),
      ),
    
    );
  }
}
1
likes
120
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

Swipe Button With Controller.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_swipe_me