chore(project): rename the project to `swipeable_cards_stack`
This commit is contained in:
parent
a59d8e2def
commit
2b92e3577d
32
CHANGELOG.md
32
CHANGELOG.md
|
|
@ -1,28 +1,12 @@
|
|||
## [0.0.5] - October 11, 2021
|
||||
## [1.0.0]
|
||||
|
||||
- Update Readme.md
|
||||
|
||||
## [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
|
||||
- Added `SwipeableCardsStack`
|
||||
- Can add custom widgets to SwipeableCardsStack
|
||||
- Cards can be swiped horizontally and vertically
|
||||
- Can receive swipe events
|
||||
- Added `CardController` to automatically swipe cards:
|
||||
- `_cardController.triggerSwipeLeft()`
|
||||
- `_cardController.triggerSwipeRight()`
|
||||
- `_cardController.triggerSwipeUp()`
|
||||
- `_cardController.triggerSwipeDown()`
|
||||
- Added `SwipeableCardsStackController` to automatically swipe cards:
|
||||
- `_SwipeableCardsStackController.triggerSwipeLeft()`
|
||||
- `_SwipeableCardsStackController.triggerSwipeRight()`
|
||||
- `_SwipeableCardsStackController.triggerSwipeUp()`
|
||||
- `_SwipeableCardsStackController.triggerSwipeDown()`
|
||||
- Added example (see `examples/` folder)
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -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.**
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
## Documentation
|
||||
|
||||
### Installation
|
||||
Add `stacked_cards` to your `pubspec.yaml`:
|
||||
Add `swipeable_cards_stack` to your `pubspec.yaml`:
|
||||
|
||||
```
|
||||
dependencies:
|
||||
|
|
@ -15,16 +15,16 @@ dependencies:
|
|||
sdk: flutter
|
||||
|
||||
# added below
|
||||
stacked_cards: <latest version>
|
||||
swipeable_cards_stack: <latest version>
|
||||
```
|
||||
### Adding to app
|
||||
Use the `SwipeableCardsSection` widget provided by the package
|
||||
Use the `SwipeableCardsStack` widget provided by the package
|
||||
|
||||
```
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//create a SwipeableCardSectionController
|
||||
SwipeableCardSectionController _cardController = SwipeableCardSectionController();
|
||||
//create a SwipeableCardsStackController
|
||||
SwipeableCardsStackController _cardController = SwipeableCardsStackController();
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
@ -33,7 +33,7 @@ Use the `SwipeableCardsSection` widget provided by the package
|
|||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SwipeableCardsSection(
|
||||
SwipeableCardsStack(
|
||||
cardController: _cardController,
|
||||
context: context,
|
||||
//add the first 3 cards (widgets)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:example/card_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked_cards/stacked_cards.dart';
|
||||
import 'package:swipeable_cards_stack/swipeable_cards_stack.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
|
|
@ -31,7 +31,7 @@ class MyHomePage extends StatefulWidget {
|
|||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
int counter = 4;
|
||||
final cardController = SwipeableCardSectionController();
|
||||
final cardController = SwipeableCardsStackController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -42,7 +42,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SwipeableCardsSection(
|
||||
SwipeableCardsStack(
|
||||
cardController: cardController,
|
||||
context: context,
|
||||
//add the first 3 cards
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
stacked_cards:
|
||||
swipeable_cards_stack:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
stacked_cards:
|
||||
swipeable_cards_stack:
|
||||
path: ../
|
||||
|
||||
flutter:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
library stacked_cards;
|
||||
library swipeable_cards_stack;
|
||||
|
||||
import 'dart:math';
|
||||
|
||||
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 = [
|
||||
Alignment(0.0, 1.0),
|
||||
|
|
@ -14,8 +14,8 @@ const List<Alignment> cardsAlign = [
|
|||
];
|
||||
final List<Size> cardsSize = List.filled(3, const Size(1, 1));
|
||||
|
||||
class SwipeableCardsSection extends StatefulWidget {
|
||||
final SwipeableCardSectionController? cardController;
|
||||
class SwipeableCardsStack extends StatefulWidget {
|
||||
final SwipeableCardsStackController? cardController;
|
||||
|
||||
//First 3 widgets
|
||||
final List<Widget> items;
|
||||
|
|
@ -30,7 +30,7 @@ class SwipeableCardsSection extends StatefulWidget {
|
|||
final bool enableSwipeUp;
|
||||
final bool enableSwipeDown;
|
||||
|
||||
SwipeableCardsSection({
|
||||
SwipeableCardsStack({
|
||||
Key? key,
|
||||
this.cardController,
|
||||
required BuildContext context,
|
||||
|
|
@ -61,10 +61,10 @@ class SwipeableCardsSection extends StatefulWidget {
|
|||
}
|
||||
|
||||
@override
|
||||
State<SwipeableCardsSection> createState() => _CardsSectionState();
|
||||
State<SwipeableCardsStack> createState() => _SwipeableCardsStackState();
|
||||
}
|
||||
|
||||
class _CardsSectionState extends State<SwipeableCardsSection>
|
||||
class _SwipeableCardsStackState extends State<SwipeableCardsStack>
|
||||
with SingleTickerProviderStateMixin {
|
||||
int cardsCounter = 0;
|
||||
int index = 0;
|
||||
|
|
@ -4,7 +4,7 @@ typedef TriggerListener = void Function(Direction dir);
|
|||
typedef AppendItem = void Function(Widget item);
|
||||
typedef EnableSwipe = void Function(bool dir);
|
||||
|
||||
class SwipeableCardSectionController {
|
||||
class SwipeableCardsStackController {
|
||||
late TriggerListener listener;
|
||||
late AppendItem addItem;
|
||||
late EnableSwipe enableSwipeListener;
|
||||
|
|
@ -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.
|
||||
version: 1.0.0
|
||||
homepage: https://github.com/ricardodalarme/stacked-cards
|
||||
|
|
|
|||
Loading…
Reference in New Issue