Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flip_card/flip_card.dart';
- import 'package:flutter/material.dart';
- class WayToScreen extends StatelessWidget {
- GlobalKey<FlipCardState> cardKey = GlobalKey<FlipCardState>();
- @override
- Widget build(BuildContext context) {
- return Stack(
- children: [
- GestureDetector(
- onVerticalDragUpdate: (details) {
- int sensitivity = 8;
- if (details.delta.dy > sensitivity) {
- // Down Swipe
- // --
- cardKey.currentState!.toggleCard();
- } else if (details.delta.dy < -sensitivity) {
- // Up Swipe
- //++
- cardKey.currentState!.toggleCard();
- }
- },
- child: FlipCard(
- key: cardKey,
- flipOnTouch: false,
- direction: FlipDirection.VERTICAL,
- front: InkWell(
- // onTap: () {
- // cardKey.currentState!.toggleCard();
- // },
- child: Container(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height,
- color: Colors.green,
- ),
- ),
- back: InkWell(
- // onTap: () {
- // cardKey.currentState!.toggleCard();
- // },
- child: Container(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height,
- color: Colors.amber,
- ),
- ),
- ),
- ),
- Positioned(
- right: 10,
- bottom: 150,
- child: Column(
- children: [
- Icon(Icons.favorite),
- Icon(Icons.favorite),
- Icon(Icons.favorite),
- Icon(Icons.favorite),
- Icon(Icons.favorite),
- ],
- ),
- ),
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement