chore(project): rename the project to `swipeable_cards_stack`

This commit is contained in:
Ricardo Dalarme 2023-01-12 21:24:25 -03:00
parent a59d8e2def
commit 2b92e3577d
9 changed files with 30 additions and 46 deletions

View File

@ -1,28 +1,12 @@
## [0.0.5] - October 11, 2021 ## [1.0.0]
- Update Readme.md - Added `SwipeableCardsStack`
- Can add custom widgets to SwipeableCardsStack
## [0.0.4] - September 30, 2021
- Performance improvement
## [0.0.3] - September 24, 2021
- Null safety
## [0.0.2] - March 1, 2021
- Changed README.md demo gif
## [0.0.1] - February 19, 2021
- Added `SwipeableCardsSection`
- Can add custom widgets to SwipeableCardsSection
- Cards can be swiped horizontally and vertically - Cards can be swiped horizontally and vertically
- Can receive swipe events - Can receive swipe events
- Added `CardController` to automatically swipe cards: - Added `SwipeableCardsStackController` to automatically swipe cards:
- `_cardController.triggerSwipeLeft()` - `_SwipeableCardsStackController.triggerSwipeLeft()`
- `_cardController.triggerSwipeRight()` - `_SwipeableCardsStackController.triggerSwipeRight()`
- `_cardController.triggerSwipeUp()` - `_SwipeableCardsStackController.triggerSwipeUp()`
- `_cardController.triggerSwipeDown()` - `_SwipeableCardsStackController.triggerSwipeDown()`
- Added example (see `examples/` folder) - Added example (see `examples/` folder)

View File

@ -1,4 +1,4 @@
# stacked_cards # swipeable_cards_stack
**This is Tinder like swipeable cards package. You can add your own widgets to the stack, receive all four events, left, right, up and down. You can define your own business logic for each direction.** **This is Tinder like swipeable cards package. You can add your own widgets to the stack, receive all four events, left, right, up and down. You can define your own business logic for each direction.**
@ -7,7 +7,7 @@
## Documentation ## Documentation
### Installation ### Installation
Add `stacked_cards` to your `pubspec.yaml`: Add `swipeable_cards_stack` to your `pubspec.yaml`:
``` ```
dependencies: dependencies:
@ -15,16 +15,16 @@ dependencies:
sdk: flutter sdk: flutter
# added below # added below
stacked_cards: <latest version> swipeable_cards_stack: <latest version>
``` ```
### Adding to app ### Adding to app
Use the `SwipeableCardsSection` widget provided by the package Use the `SwipeableCardsStack` widget provided by the package
``` ```
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
//create a SwipeableCardSectionController //create a SwipeableCardsStackController
SwipeableCardSectionController _cardController = SwipeableCardSectionController(); SwipeableCardsStackController _cardController = SwipeableCardsStackController();
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
@ -33,7 +33,7 @@ Use the `SwipeableCardsSection` widget provided by the package
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SwipeableCardsSection( SwipeableCardsStack(
cardController: _cardController, cardController: _cardController,
context: context, context: context,
//add the first 3 cards (widgets) //add the first 3 cards (widgets)

View File

@ -1,6 +1,6 @@
import 'package:example/card_view.dart'; import 'package:example/card_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:stacked_cards/stacked_cards.dart'; import 'package:swipeable_cards_stack/swipeable_cards_stack.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
@ -31,7 +31,7 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
int counter = 4; int counter = 4;
final cardController = SwipeableCardSectionController(); final cardController = SwipeableCardsStackController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,7 +42,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SwipeableCardsSection( SwipeableCardsStack(
cardController: cardController, cardController: cardController,
context: context, context: context,
//add the first 3 cards //add the first 3 cards

View File

@ -39,7 +39,7 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.99"
stacked_cards: swipeable_cards_stack:
dependency: "direct main" dependency: "direct main"
description: description:
path: ".." path: ".."

View File

@ -11,7 +11,7 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
stacked_cards: swipeable_cards_stack:
path: ../ path: ../
flutter: flutter:

View File

@ -1,11 +1,11 @@
library stacked_cards; library swipeable_cards_stack;
import 'dart:math'; import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:stacked_cards/swipe_controller.dart'; import 'package:swipeable_cards_stack/swipeable_cards_stack_controller.dart';
export './swipe_controller.dart'; export 'swipeable_cards_stack_controller.dart';
const List<Alignment> cardsAlign = [ const List<Alignment> cardsAlign = [
Alignment(0.0, 1.0), Alignment(0.0, 1.0),
@ -14,8 +14,8 @@ const List<Alignment> cardsAlign = [
]; ];
final List<Size> cardsSize = List.filled(3, const Size(1, 1)); final List<Size> cardsSize = List.filled(3, const Size(1, 1));
class SwipeableCardsSection extends StatefulWidget { class SwipeableCardsStack extends StatefulWidget {
final SwipeableCardSectionController? cardController; final SwipeableCardsStackController? cardController;
//First 3 widgets //First 3 widgets
final List<Widget> items; final List<Widget> items;
@ -30,7 +30,7 @@ class SwipeableCardsSection extends StatefulWidget {
final bool enableSwipeUp; final bool enableSwipeUp;
final bool enableSwipeDown; final bool enableSwipeDown;
SwipeableCardsSection({ SwipeableCardsStack({
Key? key, Key? key,
this.cardController, this.cardController,
required BuildContext context, required BuildContext context,
@ -61,10 +61,10 @@ class SwipeableCardsSection extends StatefulWidget {
} }
@override @override
State<SwipeableCardsSection> createState() => _CardsSectionState(); State<SwipeableCardsStack> createState() => _SwipeableCardsStackState();
} }
class _CardsSectionState extends State<SwipeableCardsSection> class _SwipeableCardsStackState extends State<SwipeableCardsStack>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
int cardsCounter = 0; int cardsCounter = 0;
int index = 0; int index = 0;

View File

@ -4,7 +4,7 @@ typedef TriggerListener = void Function(Direction dir);
typedef AppendItem = void Function(Widget item); typedef AppendItem = void Function(Widget item);
typedef EnableSwipe = void Function(bool dir); typedef EnableSwipe = void Function(bool dir);
class SwipeableCardSectionController { class SwipeableCardsStackController {
late TriggerListener listener; late TriggerListener listener;
late AppendItem addItem; late AppendItem addItem;
late EnableSwipe enableSwipeListener; late EnableSwipe enableSwipeListener;

View File

@ -1,4 +1,4 @@
name: stacked_cards name: swipeable_cards_stack
description: This is Tinder like swipeable cards package. You can add your own widgets to the stack, receive all four events, left, right, up and down. You can define your own business logic for each direction. description: This is Tinder like swipeable cards package. You can add your own widgets to the stack, receive all four events, left, right, up and down. You can define your own business logic for each direction.
version: 1.0.0 version: 1.0.0
homepage: https://github.com/ricardodalarme/stacked-cards homepage: https://github.com/ricardodalarme/stacked-cards