swipe_widget 0.0.1+3 copy "swipe_widget: ^0.0.1+3" to clipboard
swipe_widget: ^0.0.1+3 copied to clipboard

outdated

Make a Widget swipe to the sides, adding different funcionalities.

example/lib/swipe_widget.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  int count = 0;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SwipeWidget(
            key: UniqueKey(),
            onSwipe: () => Future.delayed(
                const Duration(milliseconds: 300), () => setState(() {})),
            child: AlertDialog(
              title: const Text('SwipeWidget'),
              content: const Text(
                  'Wait! You can swipe me instead.\nIt\'s more fun.'),
              actions: <Widget>[
                TextButton(
                  child: const Text('OK'),
                  onPressed: () {},
                ),
              ],
            )),
      ),
    );
  }
}
10
likes
0
points
6
downloads

Publisher

verified publisherdrafakiller.com

Weekly Downloads

Make a Widget swipe to the sides, adding different funcionalities.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on swipe_widget