├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .metadata ├── assets │ ├── images │ │ ├── aladdin.jpg │ │ ├── alient_covenant.jpg │ │ ├── avengers_endgame.jpg │ │ ├── blade_runner.jpg │ │ └── john_wick.jpg │ └── screenshots │ │ ├── middle.png │ │ └── right.png ├── lib │ ├── main.dart │ └── movie.dart ├── pubspec.yaml └── test │ └── widget_test.dart ├── lib ├── flutter_stack_card.dart └── src │ ├── flutter_stack_card.dart │ ├── indicator_model.dart │ ├── stack_dimension.dart │ └── stack_type.dart ├── pubspec.yaml └── test └── flutter_stack_card_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # Files and directories created by pub 13 | .dart_tool/ 14 | android/ 15 | build/ 16 | ios/ 17 | .packages 18 | 19 | # Remove the following pattern if you wish to check in your lock file 20 | pubspec.lock 21 | 22 | # IntelliJ related 23 | *.iml 24 | *.ipr 25 | *.iws 26 | .idea/ 27 | 28 | # Visual Studio Code related 29 | .vscode/ 30 | 31 | # Flutter/Dart/Pub related 32 | **/doc/api/ 33 | .dart_tool/ 34 | .flutter-plugins 35 | .packages 36 | .pub-cache/ 37 | .pub/ 38 | /build/ 39 | 40 | # Android related 41 | **/android/**/gradle-wrapper.jar 42 | **/android/.gradle 43 | **/android/captures/ 44 | **/android/gradlew 45 | **/android/gradlew.bat 46 | **/android/local.properties 47 | **/android/**/GeneratedPluginRegistrant.java 48 | 49 | # iOS/XCode related 50 | **/ios/**/*.mode1v3 51 | **/ios/**/*.mode2v3 52 | **/ios/**/*.moved-aside 53 | **/ios/**/*.pbxuser 54 | **/ios/**/*.perspectivev3 55 | **/ios/**/*sync/ 56 | **/ios/**/.sconsign.dblite 57 | **/ios/**/.tags* 58 | **/ios/**/.vagrant/ 59 | **/ios/**/DerivedData/ 60 | **/ios/**/Icon? 61 | **/ios/**/Pods/ 62 | **/ios/**/.symlinks/ 63 | **/ios/**/profile 64 | **/ios/**/xcuserdata 65 | **/ios/.generated/ 66 | **/ios/Flutter/App.framework 67 | **/ios/Flutter/Flutter.framework 68 | **/ios/Flutter/Generated.xcconfig 69 | **/ios/Flutter/app.flx 70 | **/ios/Flutter/app.zip 71 | **/ios/Flutter/flutter_assets/ 72 | **/ios/ServiceDefinitions.json 73 | **/ios/Runner/GeneratedPluginRegistrant.* 74 | 75 | # Exceptions to above rules. 76 | !**/ios/**/default.mode1v3 77 | !**/ios/**/default.mode2v3 78 | !**/ios/**/default.pbxuser 79 | !**/ios/**/default.perspectivev3 80 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b712a172f9694745f50505c93340883493b505e5 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.2.0+1 - 23/07/2019 2 | 3 | - Specify flutter_slider_indicator plugin 4 | 5 | ## 0.2.0 - 23/07/2019 6 | 7 | - Add custom indicator package 8 | - Move indicator styling to model (**Breaking**) 9 | 10 | ## 0.1.0 - 22/07/2019 11 | 12 | - Develop stack card builder 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Robby Rahmana 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Stack Card 2 | 3 | Stack Card Widget is fastest way to create swap card in flutter. 4 | 5 | ## Screenshots 6 | 7 | ![StackType.middle](example/assets/screenshots/middle.png?raw=true "StackType.middle") 8 | ![StackType.right](example/assets/screenshots/right.png?raw=true "StackType.right") 9 | 10 | ## Usage 11 | 12 | ```dart 13 | StackCard.builder( 14 | itemCount: /* Item Count */, 15 | displayIndicator: /* Flag to display the indicator */, 16 | displayIndicatorBuilder: /* Customize the indicator */, 17 | onSwap: (index) { 18 | /* listen for swapping */ 19 | }, 20 | itemBuilder: (context, index) { 21 | /* item builder */ 22 | } 23 | ) 24 | ``` 25 | 26 | ## Example 27 | 28 | Please find example in here: [Example](example/lib/main.dart) 29 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: b712a172f9694745f50505c93340883493b505e5 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/assets/images/aladdin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/images/aladdin.jpg -------------------------------------------------------------------------------- /example/assets/images/alient_covenant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/images/alient_covenant.jpg -------------------------------------------------------------------------------- /example/assets/images/avengers_endgame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/images/avengers_endgame.jpg -------------------------------------------------------------------------------- /example/assets/images/blade_runner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/images/blade_runner.jpg -------------------------------------------------------------------------------- /example/assets/images/john_wick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/images/john_wick.jpg -------------------------------------------------------------------------------- /example/assets/screenshots/middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/screenshots/middle.png -------------------------------------------------------------------------------- /example/assets/screenshots/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robbyrahmana/flutter_stack_card/0bd490a7550fc7aa4eedd4cba21644a93b9f39c5/example/assets/screenshots/right.png -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/movie.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_stack_card/flutter_stack_card.dart'; 4 | 5 | void main() => runApp(MyApp()); 6 | 7 | class MyApp extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | title: 'Flutter Stack Card', 12 | theme: ThemeData( 13 | primarySwatch: Colors.blue, 14 | ), 15 | home: MyHomePage(title: 'Flutter Stack Card'), 16 | ); 17 | } 18 | } 19 | 20 | class MyHomePage extends StatefulWidget { 21 | MyHomePage({Key key, this.title}) : super(key: key); 22 | final String title; 23 | 24 | @override 25 | _MyHomePageState createState() => _MyHomePageState(); 26 | } 27 | 28 | class _MyHomePageState extends State { 29 | List _movieData = Movie().movieData; 30 | var width, height; 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | height = MediaQuery.of(context).size.height; 35 | width = MediaQuery.of(context).size.width; 36 | 37 | return Scaffold( 38 | appBar: AppBar( 39 | title: Text(widget.title), 40 | ), 41 | body: Padding( 42 | padding: const EdgeInsets.only(top: 16.0), 43 | child: StackCard.builder( 44 | displayIndicator: true, 45 | displayIndicatorBuilder: 46 | IdicatorBuilder(displayIndicatorActiveColor: Colors.blue), 47 | itemCount: _movieData.length, 48 | onSwap: (index) { 49 | print("Page change to $index"); 50 | }, 51 | itemBuilder: (context, index) { 52 | Movie movie = _movieData[index]; 53 | return _itemBuilder(movie); 54 | }, 55 | ), 56 | ), 57 | ); 58 | } 59 | 60 | Widget _itemBuilder(Movie movie) { 61 | return Container( 62 | child: Stack(children: [ 63 | Container( 64 | decoration: BoxDecoration( 65 | borderRadius: BorderRadius.all(Radius.circular(12)), 66 | color: Colors.white), 67 | ), 68 | SingleChildScrollView( 69 | child: Column( 70 | children: [ 71 | Container( 72 | height: height * .3, 73 | decoration: BoxDecoration( 74 | borderRadius: BorderRadius.all(Radius.circular(12)), 75 | image: DecorationImage( 76 | image: ExactAssetImage(movie.image), 77 | fit: BoxFit.cover)), 78 | ), 79 | Container( 80 | height: height * .45, 81 | child: Padding( 82 | padding: 83 | const EdgeInsets.symmetric(horizontal: 16, vertical: 24), 84 | child: Column( 85 | crossAxisAlignment: CrossAxisAlignment.start, 86 | children: [ 87 | Row( 88 | crossAxisAlignment: CrossAxisAlignment.start, 89 | mainAxisSize: MainAxisSize.max, 90 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 91 | children: [ 92 | Container( 93 | width: 150, 94 | child: Text( 95 | movie.title, 96 | style: TextStyle( 97 | color: Colors.blueGrey, fontSize: 24), 98 | textAlign: TextAlign.left, 99 | ), 100 | ), 101 | Column( 102 | crossAxisAlignment: CrossAxisAlignment.end, 103 | children: [ 104 | SizedBox(height: 4), 105 | Text( 106 | movie.display, 107 | style: 108 | TextStyle(fontSize: 14, color: Colors.grey), 109 | textAlign: TextAlign.right, 110 | ), 111 | SizedBox(height: 12), 112 | Text( 113 | "IMDB: ${movie.imdb.toString()}", 114 | style: TextStyle( 115 | fontSize: 14, fontWeight: FontWeight.bold), 116 | textAlign: TextAlign.right, 117 | ) 118 | ], 119 | ), 120 | ], 121 | ), 122 | Padding( 123 | padding: const EdgeInsets.symmetric(vertical: 16), 124 | child: Text(movie.gendres, 125 | style: TextStyle(fontWeight: FontWeight.bold)), 126 | ), 127 | Expanded( 128 | child: Padding( 129 | padding: const EdgeInsets.only(bottom: 16, top: 8), 130 | child: Text(movie.desc, 131 | style: TextStyle(color: Colors.grey)), 132 | ), 133 | ), 134 | Center( 135 | child: IconButton( 136 | icon: Icon(Icons.drag_handle, color: Colors.grey), 137 | onPressed: () {}), 138 | ) 139 | ], 140 | ), 141 | ), 142 | ), 143 | ], 144 | ), 145 | ), 146 | ]), 147 | ); 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /example/lib/movie.dart: -------------------------------------------------------------------------------- 1 | class Movie { 2 | final int id; 3 | final String title; 4 | final String image; 5 | final String display; 6 | final double imdb; 7 | final String gendres; 8 | final String desc; 9 | 10 | Movie( 11 | {this.id, 12 | this.title, 13 | this.image, 14 | this.display, 15 | this.imdb, 16 | this.gendres, 17 | this.desc}); 18 | 19 | List get movieData => [ 20 | new Movie( 21 | id: 1, 22 | title: "Alien: Covenant", 23 | image: "assets/images/alient_covenant.jpg", 24 | display: "3D", 25 | imdb: 6.5, 26 | gendres: "Mystery, Sci-fi", 27 | desc: 28 | "Bound for a remote planet on the far side of the galaxy, members (Katherine Waterston, Billy Crudup) of the colony ship Covenant discover what they think to be an uncharted paradise."), 29 | new Movie( 30 | id: 2, 31 | title: "Blade Runner 2049", 32 | image: "assets/images/blade_runner.jpg", 33 | display: "3D", 34 | imdb: 8, 35 | gendres: "Mystery, Sci-fi", 36 | desc: 37 | "Officer K (Ryan Gosling), a new blade runner for the Los Angeles Police Department, unearths a long-buried secret that has the potential to plunge what's left of society into chaos."), 38 | new Movie( 39 | id: 3, 40 | title: "Aladdin", 41 | image: "assets/images/aladdin.jpg", 42 | display: "3D", 43 | imdb: 7.4, 44 | gendres: "Fantasy, Romance", 45 | desc: 46 | "Aladdin is a lovable street urchin who meets Princess Jasmine, the beautiful daughter of the sultan of Agrabah. While visiting her exotic palace, Aladdin stumbles upon a magic oil lamp."), 47 | new Movie( 48 | id: 4, 49 | title: "Avengers: Endgame", 50 | image: "assets/images/avengers_endgame.jpg", 51 | display: "3D", 52 | imdb: 8.7, 53 | gendres: "Fantasy, Sci-fi", 54 | desc: 55 | "Adrift in space with no food or water, Tony Stark sends a message to Pepper Potts as his oxygen supply starts to dwindle."), 56 | new Movie( 57 | id: 5, 58 | title: "John Wick: Parabellum", 59 | image: "assets/images/john_wick.jpg", 60 | display: "3D", 61 | imdb: 8, 62 | gendres: "Thriller, Mystery", 63 | desc: 64 | "After gunning down a member of the High Table -- the shadowy international assassin's guild -- legendary hit man John Wick finds himself stripped of the organization's protective services."), 65 | ]; 66 | } 67 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | version: 1.1.0 4 | author: Robby Rahmana 5 | homepage: https://github.com/robbyrahmana/flutter_stack_card 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_stack_card: 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | dependency_overrides: 20 | flutter_stack_card: 21 | path: ../ 22 | 23 | flutter: 24 | uses-material-design: true 25 | 26 | assets: 27 | - assets/images/alient_covenant.jpg 28 | - assets/images/blade_runner.jpg 29 | - assets/images/aladdin.jpg 30 | - assets/images/avengers_endgame.jpg 31 | - assets/images/john_wick.jpg 32 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/flutter_stack_card.dart: -------------------------------------------------------------------------------- 1 | library flutter_stack_card; 2 | 3 | export 'package:flutter_stack_card/src/flutter_stack_card.dart'; 4 | export 'package:flutter_stack_card/src/stack_dimension.dart'; 5 | export 'package:flutter_stack_card/src/stack_type.dart'; 6 | export 'package:flutter_stack_card/src/indicator_model.dart'; 7 | -------------------------------------------------------------------------------- /lib/src/flutter_stack_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/rendering.dart'; 3 | import 'package:flutter_slider_indicator/flutter_slider_indicator.dart'; 4 | import 'package:flutter_stack_card/flutter_stack_card.dart'; 5 | import 'package:flutter_stack_card/src/indicator_model.dart'; 6 | import 'package:flutter_stack_card/src/stack_dimension.dart'; 7 | 8 | class StackCard extends StatefulWidget { 9 | StackCard.builder( 10 | {this.stackType = StackType.middle, 11 | @required this.itemBuilder, 12 | @required this.itemCount, 13 | this.dimension, 14 | this.stackOffset = const Offset(15, 15), 15 | this.onSwap, 16 | this.displayIndicator = false, 17 | this.displayIndicatorBuilder}); 18 | 19 | final int itemCount; 20 | final IndexedWidgetBuilder itemBuilder; 21 | final ValueChanged onSwap; 22 | final bool displayIndicator; 23 | final IdicatorBuilder displayIndicatorBuilder; 24 | final StackDimension dimension; 25 | final StackType stackType; 26 | final Offset stackOffset; 27 | 28 | @override 29 | _StackCardState createState() => _StackCardState(); 30 | } 31 | 32 | class _StackCardState extends State { 33 | var _pageController = PageController(); 34 | var _currentPage = 0.0; 35 | var _width, _height; 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | _pageController.addListener(() { 40 | setState(() { 41 | _currentPage = _pageController.page; 42 | }); 43 | }); 44 | 45 | if (widget.dimension == null) { 46 | _height = MediaQuery.of(context).size.height; 47 | _width = MediaQuery.of(context).size.width; 48 | } else { 49 | assert(widget.dimension.width > 0); 50 | assert(widget.dimension.height > 0); 51 | _width = widget.dimension.width; 52 | _height = widget.dimension.height; 53 | } 54 | 55 | return Stack(fit: StackFit.expand, children: [ 56 | _cardStack(), 57 | widget.displayIndicator ? _cardIndicator() : Container(), 58 | PageView.builder( 59 | onPageChanged: widget.onSwap, 60 | physics: BouncingScrollPhysics(), 61 | controller: _pageController, 62 | itemCount: widget.itemCount, 63 | itemBuilder: (context, index) { 64 | return Container(); 65 | }, 66 | ) 67 | ]); 68 | } 69 | 70 | Widget _cardStack() { 71 | List _cards = []; 72 | 73 | for (int i = widget.itemCount - 1; i >= 0; i--) { 74 | var sizeOffsetx = 75 | (widget.stackOffset.dx * i) - (_currentPage * widget.stackOffset.dx); 76 | var sizeOffsety = 77 | (widget.stackOffset.dy * i) - (_currentPage * widget.stackOffset.dy); 78 | 79 | var leftOffset = 80 | (widget.stackOffset.dx * i) - (_currentPage * widget.stackOffset.dx); 81 | var topOffset = 82 | (widget.stackOffset.dy * i) - (_currentPage * widget.stackOffset.dy); 83 | 84 | _cards.add(Positioned.fill( 85 | child: _cardbuilder( 86 | i, 87 | widget.stackType == StackType.middle 88 | ? _width - sizeOffsetx 89 | : _width, 90 | _height - sizeOffsety), 91 | top: topOffset, 92 | left: widget.stackType == StackType.middle 93 | ? (_currentPage > (i) ? -(_currentPage - i) * (_width * 4) : 0) 94 | : (_currentPage > (i) 95 | ? -(_currentPage - i) * (_width * 4) 96 | : leftOffset), 97 | )); 98 | } 99 | 100 | return Stack(fit: StackFit.expand, children: _cards); 101 | } 102 | 103 | Widget _cardbuilder(int index, double width, double height) { 104 | return Align( 105 | alignment: Alignment.topCenter, 106 | child: Container( 107 | width: width * .8, 108 | height: height * .8, 109 | decoration: BoxDecoration(boxShadow: [ 110 | BoxShadow(color: Colors.black38, spreadRadius: 1, blurRadius: 2) 111 | ], borderRadius: BorderRadius.all(Radius.circular(12))), 112 | child: widget.itemBuilder(context, index))); 113 | } 114 | 115 | Widget _cardIndicator() { 116 | return Align( 117 | alignment: Alignment.bottomCenter, 118 | child: Padding( 119 | padding: const EdgeInsets.only(bottom: 24), 120 | child: SliderIndicator( 121 | length: widget.itemCount, 122 | activeIndex: _currentPage.round(), 123 | displayIndicatorIcon: 124 | widget.displayIndicatorBuilder.displayIndicatorIcon, 125 | displayIndicatorActiveIcon: 126 | widget.displayIndicatorBuilder.displayIndicatorActiveIcon, 127 | displayIndicatorColor: 128 | widget.displayIndicatorBuilder.displayIndicatorColor, 129 | displayIndicatorActiveColor: 130 | widget.displayIndicatorBuilder.displayIndicatorActiveColor, 131 | displayIndicatorSize: 132 | widget.displayIndicatorBuilder.displayIndicatorSize)), 133 | ); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /lib/src/indicator_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class IdicatorBuilder { 4 | final double displayIndicatorSize; 5 | final IconData displayIndicatorIcon; 6 | final IconData displayIndicatorActiveIcon; 7 | final Color displayIndicatorActiveColor; 8 | final Color displayIndicatorColor; 9 | 10 | IdicatorBuilder( 11 | {this.displayIndicatorSize = 24.0, 12 | this.displayIndicatorIcon, 13 | this.displayIndicatorActiveIcon, 14 | this.displayIndicatorColor, 15 | this.displayIndicatorActiveColor}); 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/stack_dimension.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class StackDimension { 4 | final double width; 5 | final double height; 6 | 7 | StackDimension({@required this.width, @required this.height}); 8 | } 9 | -------------------------------------------------------------------------------- /lib/src/stack_type.dart: -------------------------------------------------------------------------------- 1 | enum StackType { middle, right } 2 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_stack_card 2 | description: Stack Card Widget is fastest way to create swap card in flutter. 3 | version: 0.2.0+1 4 | author: Robby Rahmana 5 | homepage: https://github.com/robbyrahmana/flutter_stack_card 6 | 7 | environment: 8 | sdk: ">=2.1.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_slider_indicator: ^0.1.1 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | -------------------------------------------------------------------------------- /test/flutter_stack_card_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------