Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support full-screen cards #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions example/async_data/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:math';

import 'package:flutter/material.dart';

import 'package:flutter_tindercard/flutter_tindercard.dart';

void main() => runApp(MyApp());
Expand Down Expand Up @@ -110,20 +109,17 @@ class _AsyncDataExampleHomePageState extends State<AsyncDataExampleHomePage>
orientation: AmassOrientation.bottom,
totalNum: imageList.length,
stackNum: 4,
swipeEdge: 4.0,
maxWidth: MediaQuery.of(context).size.width * 0.9,
maxHeight: MediaQuery.of(context).size.width * 0.9,
minWidth: MediaQuery.of(context).size.width * 0.8,
minHeight: MediaQuery.of(context).size.width * 0.8,
cardBuilder: (context, index) => Card(
child: Image.asset('${imageList[index]}'),
),
cardController: controller = CardController(),
swipeUpdateCallback: (DragUpdateDetails details, Alignment align) {
swipeUpdateCallback: (DragUpdateDetails details, Offset offset) {
/// Get swiping card's alignment
if (align.x < 0) {
if (offset.dx < 0) {
//Card is LEFT swiping
} else if (align.x > 0) {
} else if (offset.dx > 0) {
//Card is RIGHT swiping
}
},
Expand Down
9 changes: 3 additions & 6 deletions example/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,17 @@ class _ExampleHomePageState extends State<ExampleHomePage>
orientation: AmassOrientation.bottom,
totalNum: welcomeImages.length,
stackNum: 3,
swipeEdge: 4.0,
maxWidth: MediaQuery.of(context).size.width * 0.9,
maxHeight: MediaQuery.of(context).size.width * 0.9,
minWidth: MediaQuery.of(context).size.width * 0.8,
minHeight: MediaQuery.of(context).size.width * 0.8,
cardBuilder: (context, index) => Card(
child: Image.asset('${welcomeImages[index]}'),
),
cardController: controller = CardController(),
swipeUpdateCallback: (DragUpdateDetails details, Alignment align) {
swipeUpdateCallback: (DragUpdateDetails details, Offset offset) {
/// Get swiping card's alignment
if (align.x < 0) {
if (offset.dx < 0) {
//Card is LEFT swiping
} else if (align.x > 0) {
} else if (offset.dx > 0) {
//Card is RIGHT swiping
}
},
Expand Down
Loading