-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eliot
committed
Dec 3, 2021
0 parents
commit 1c5b95d
Showing
12 changed files
with
1,846 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
build/ | ||
|
||
# Android related | ||
**/android/**/gradle-wrapper.jar | ||
**/android/.gradle | ||
**/android/captures/ | ||
**/android/gradlew | ||
**/android/gradlew.bat | ||
**/android/local.properties | ||
**/android/**/GeneratedPluginRegistrant.java | ||
|
||
# iOS/XCode related | ||
**/ios/**/*.mode1v3 | ||
**/ios/**/*.mode2v3 | ||
**/ios/**/*.moved-aside | ||
**/ios/**/*.pbxuser | ||
**/ios/**/*.perspectivev3 | ||
**/ios/**/*sync/ | ||
**/ios/**/.sconsign.dblite | ||
**/ios/**/.tags* | ||
**/ios/**/.vagrant/ | ||
**/ios/**/DerivedData/ | ||
**/ios/**/Icon? | ||
**/ios/**/Pods/ | ||
**/ios/**/.symlinks/ | ||
**/ios/**/profile | ||
**/ios/**/xcuserdata | ||
**/ios/.generated/ | ||
**/ios/Flutter/App.framework | ||
**/ios/Flutter/Flutter.framework | ||
**/ios/Flutter/Flutter.podspec | ||
**/ios/Flutter/Generated.xcconfig | ||
**/ios/Flutter/ephemeral | ||
**/ios/Flutter/app.flx | ||
**/ios/Flutter/app.zip | ||
**/ios/Flutter/flutter_assets/ | ||
**/ios/Flutter/flutter_export_environment.sh | ||
**/ios/ServiceDefinitions.json | ||
**/ios/Runner/GeneratedPluginRegistrant.* | ||
|
||
# Exceptions to above rules. | ||
!**/ios/**/default.mode1v3 | ||
!**/ios/**/default.mode2v3 | ||
!**/ios/**/default.pbxuser | ||
!**/ios/**/default.perspectivev3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 18116933e77adc82f80866c928266a5b4f1ed645 | ||
channel: stable | ||
|
||
project_type: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.0.1 | ||
|
||
Initial development release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Eliot Lew | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
A beautiful, animated, and customisable tab view widget. | ||
This widget is self-contained, so you can just pass in a list of children and a list of tabs and it will handle the rest. | ||
You can also use a controller, change the tab side, add color(s), and much more. | ||
|
||
> This package is in beta. Please [file any potential issues.](https://github.com/sourcemain/tab_container/issues) | ||
## Features | ||
|
||
![](https://media.giphy.com/media/cEkR19IlJ4My225oGg/giphy.gif) | ||
![](https://media.giphy.com/media/UlPs2jVLFEypV0KtwV/giphy.gif) | ||
![](https://media.giphy.com/media/pCMsQiashXbfc6VZDg/giphy.gif) | ||
|
||
Currently available parameters: | ||
```dart | ||
class TabContainer extends ImplicitlyAnimatedWidget { | ||
/// Changes tab selection from elsewhere in your app. | ||
/// | ||
/// If you provide one, you must dispose of it. | ||
final TabContainerController? controller; | ||
/// Sets the curve radius. | ||
/// | ||
/// Defaults to 12.0. | ||
final double radius; | ||
/// The list of children you want to tab through, in order. | ||
/// | ||
/// Must be equal in length to [tabs] and [colors] (if provided). | ||
final List<Widget> children; | ||
/// What will be displayed in each tab, in order. | ||
/// | ||
/// When providing something other than List<String>, set [usesTextWidget] to true. | ||
/// Must be equal in length to [children] and [colors] (if provided). | ||
final List<dynamic> tabs; | ||
/// Determines how much space the tabs take up. | ||
/// | ||
/// If the tabs are on the left/right then this will be the tab width, otherwise it will be the tab height. | ||
/// Defaults to 50.0. | ||
final double tabExtent; | ||
/// Determines which side the tabs will be on. | ||
/// | ||
/// Defaults to [TabEdge.top]. | ||
final TabEdge tabEdge; | ||
/// The background color of this widget. | ||
/// | ||
/// Must not set if [colors] is provided. | ||
final Color? color; | ||
/// The list of colors used for each tab, in order. | ||
/// | ||
/// The first color in the list will be the background color when tab 1 is selected and so on. | ||
/// Must not set if [color] is provided. | ||
final List<Color>? colors; | ||
/// Duration for the tab indicator to slide to a new index. | ||
/// | ||
/// Provide a duration of 0 to disable tab animation. | ||
/// Defaults to Duration(milliseconds: 300). | ||
final Duration tabDuration; | ||
/// The curve of the animation that controls tab indicator sliding. | ||
/// | ||
/// Defaults to Curves.easeInOut. | ||
final Curve tabCurve; | ||
/// Duration of the child transition animation when the tab selection changes. | ||
/// | ||
/// Defaults to [tabDuration]. | ||
final Duration? childDuration; | ||
/// The curve of the child transition animation when the tab selection changes. | ||
/// | ||
/// Defaults to [tabCurve]. | ||
final Curve? childCurve; | ||
/// Sets the child transition animation when the tab selection changes. | ||
/// | ||
/// Defaults to [AnimatedSwitcher.defaultTransitionBuilder]. | ||
final Widget Function(Widget, Animation<double>)? transitionBuilder; | ||
/// The [TextStyle] applied to the text of the currently selected tab if [usesTextWidget] is false. | ||
/// | ||
/// Defaults to Theme.of(context).textTheme.bodyText2. | ||
final TextStyle? selectedTextStyle; | ||
/// The [TextStyle] applied to the text of currently unselected tabs if [usesTextWidget] is false. | ||
/// | ||
/// Defaults to Theme.of(context).textTheme.bodyText2. | ||
final TextStyle? unselectedTextStyle; | ||
/// The [TextDirection] for tabs and semantics. | ||
/// | ||
/// Defaults to Directionality.of(context). | ||
final TextDirection? textDirection; | ||
/// Whether tab selection changes on tap. | ||
/// | ||
/// Defaults to true. | ||
final bool enabled; | ||
/// Set to true if the tabs property is not of type List<String>. | ||
final bool usesTextWidget; | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Check the `/example` folder for full examples of the above functionality. | ||
|
||
Minimal example: | ||
|
||
```dart | ||
import 'package:tab_container/tab_container.dart'; | ||
//... | ||
TabContainer( | ||
color: Theme.of(context).colorScheme.secondary, | ||
children: [ | ||
Container( | ||
child: Text('Child 1'), | ||
), | ||
Container( | ||
child: Text('Child 2'), | ||
), | ||
Container( | ||
child: Text('Child 3'), | ||
), | ||
], | ||
tabs: [ | ||
'Tab 1', | ||
'Tab 2', | ||
'Tab 3', | ||
], | ||
), | ||
``` | ||
|
||
## Additional information | ||
|
||
Icons used in the demo: [Ionicons](https://ionic.io/ionicons), [FontAwesome5](https://fontawesome.com/v5.15/icons?d=gallery&p=2&m=free) | ||
Car photos used in the demo: | ||
- [https://unsplash.com/photos/eqW1MPinEV4](https://unsplash.com/photos/eqW1MPinEV4) | ||
- [https://unsplash.com/photos/N9Pf2J656aQ](https://unsplash.com/photos/eqW1MPinEV4) | ||
- [https://unsplash.com/photos/2AovfzYV3rc](https://unsplash.com/photos/eqW1MPinEV4) | ||
|
||
This is a very new package. If you find any problems, please [file an issue](https://github.com/sourcemain/tab_container/issues) if one doesn't already exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
Oops, something went wrong.