swipe_up 1.0.0 copy "swipe_up: ^1.0.0" to clipboard
swipe_up: ^1.0.0 copied to clipboard

A flutter widget that provides swipe up actions similar to Instagram's

example/example.dart

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

class SwipeUpExample extends StatefulWidget {
  @override
  _SwipeUpExampleState createState() => _SwipeUpExampleState();
}

class _SwipeUpExampleState extends State<SwipeUpExample> {
  @override
  Widget build(BuildContext context) {
    return SwipeUp(
        color: Colors.white,
        sensitivity: 0.5,
        onSwipe: () {
          Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => SecondPage()));
        },
        body: Material(
          color: Colors.lightBlueAccent,
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text('COOL',
                    style: TextStyle(color: Colors.white, fontSize: 94.0)),
                Text('NEW',
                    style: TextStyle(color: Colors.white, fontSize: 166.0)),
                Text('STUFF',
                    style: TextStyle(color: Colors.white, fontSize: 94.0))
              ],
            ),
          ),
        ),
        child: Material(
            color: Colors.transparent,
            child: Text('Swipe Up', style: TextStyle(color: Colors.white))));
  }
}

class SecondPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.greenAccent,
      child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text('UP',
                  style: TextStyle(color: Colors.white, fontSize: 94.0)),
              Text('YOU',
                  style: TextStyle(color: Colors.white, fontSize: 166.0)),
              Text('SWIPED!',
                  style: TextStyle(color: Colors.white, fontSize: 94.0))
            ],
          )
      ),
    );
  }
}
31
likes
30
pub points
2%
popularity

Publisher

unverified uploader

A flutter widget that provides swipe up actions similar to Instagram&#x27;s

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on swipe_up