├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
├── pull_request_template.md
└── workflows
│ └── auto_tests.yml
├── .gitignore
├── .metadata
├── .travis.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── example
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle
├── assets
│ └── images
│ │ └── vinyl.png
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
├── lib
│ ├── examples
│ │ ├── left_button.dart
│ │ ├── right_button.dart
│ │ └── usecases
│ │ │ └── tagselector
│ │ │ ├── tagselector.dart
│ │ │ └── widgets
│ │ │ ├── generated_post_page.dart
│ │ │ ├── tag_button.dart
│ │ │ ├── tag_selecting_page.dart
│ │ │ └── widgets.dart
│ └── main.dart
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ └── MainMenu.xib
│ │ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── rep_files
│ ├── e1.gif
│ ├── e2.gif
│ ├── e3.gif
│ ├── e4.gif
│ └── old
│ │ ├── example1.gif
│ │ ├── example2.gif
│ │ ├── example3.gif
│ │ ├── example4.gif
│ │ ├── example5.gif
│ │ ├── example6.gif
│ │ └── examples
│ │ ├── left_button.gif
│ │ ├── main.gif
│ │ ├── right_button.gif
│ │ └── tasks_app.gif
├── web
│ ├── favicon.png
│ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
└── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── lib
├── bottom_bar_with_sheet.dart
└── src
│ ├── bottom_bar_with_sheet_base.dart
│ ├── models
│ ├── bottom_bar_with_sheet_item.dart
│ ├── models.dart
│ └── positions.dart
│ ├── src.dart
│ ├── theme
│ ├── bottom_bar_with_sheet_theme.dart
│ ├── defaults.dart
│ ├── main_action_button_theme.dart
│ └── theme.dart
│ ├── utils
│ ├── controller
│ │ └── controller.dart
│ ├── items_generator.dart
│ └── utils.dart
│ └── widgets
│ ├── bottom_bar_with_sheet_item.dart
│ ├── bottom_bar_with_sheet_item_controller.dart
│ └── main_action_button.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── utils
├── controller
└── controller_test.dart
└── items_generator_test.dart
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ### Thanks a lot for contributing!
2 | Provide a description of your changes below
3 |
--------------------------------------------------------------------------------
/.github/workflows/auto_tests.yml:
--------------------------------------------------------------------------------
1 | name: Auto Tests
2 | on:
3 | push:
4 | branches:
5 | - '**'
6 | pull_request:
7 | branches:
8 | - '**'
9 |
10 | jobs:
11 | flutter_test:
12 | name: Run flutter test and analyze
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v2
16 | - uses: actions/setup-java@v1
17 | with:
18 | java-version: "12.x"
19 | - uses: subosito/flutter-action@v1
20 | with:
21 | channel: "stable"
22 | - run: flutter pub get
23 | - run: flutter analyze
24 | - run: flutter test
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
76 |
--------------------------------------------------------------------------------
/.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: b041144f833e05cf463b8887fa12efdec9493488
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | env:
2 | - FLUTTER_GITHUB="https://github.com/flutter/flutter.git"
3 |
4 | language: dart
5 | dart:
6 | - stable
7 | dart_task:
8 | - dartfmt
9 | install:
10 | - git clone $FLUTTER_GITHUB -b stable
11 |
12 | script:
13 | - ./flutter/bin/flutter doctor
14 | - ./flutter/bin/flutter test
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 2.4.0
2 | - **BREAKING**: Remove **isOpened**, **selectedIndex**, **mainActionButton** fields
3 | - **BREAKING**: Remove outside position
4 | - **INFO**: Update examples and create new usecase example
5 | - **INFO**: Update README with thanks for [Nivin389](https://github.com/Nivin389)
6 |
7 | ## 2.3.1
8 | - **INFO**: Fix examples in example folder
9 |
10 | ## 2.3.0
11 | - **FEAT**: Add [mainActionButtonBuilder](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/lib/src/bottom_bar_with_sheet_base.dart#:~:text=final%20bool-,disableMainActionButton,-%3B) to build your custom main action button
12 | - **INFO**: Recreate example proj
13 |
14 | ## 2.2.0
15 | - **FEAT**: Add [openSheet](https://github.com/Frezyx/bottom_bar_with_sheet/blob/109ecfdc995e0e6942e41b02d95bf65c0099933b/lib/src/utils/controller/controller.dart#:~:text=void-,openSheet,-()%20%7B) method to open sheet by controller
16 | - **FEAT**: Add [closeSheet](https://github.com/Frezyx/bottom_bar_with_sheet/blob/109ecfdc995e0e6942e41b02d95bf65c0099933b/lib/src/utils/controller/controller.dart#:~:text=void-,closeSheet,-()%20%7B) method to close sheet by controller
17 | - **INFO**: Add comments for controller
18 | - **INFO**: Make small refactor
19 |
20 | ## 2.1.0
21 | - **FEAT**: Add [isVerticalItemLabel](https://github.com/Frezyx/bottom_bar_with_sheet/blob/master/lib/src/theme/bottom_bar_with_sheet_theme.dart#:~:text=final%20bool-,isVerticalItemLabel,-%3B) field
22 |
23 | Thanks for [coskuncay](https://github.com/coskuncay)
24 |
25 | ## 2.0.1
26 | - **FIX**: Fix tap zone of bar item
27 | - **FIX**: Fix icon size passing from custom theme
28 | ## 2.0.0
29 |
30 | - **BREAKING**: Implement BottomBarWithSheetController for working with items selection!
31 | - **BREAKING**: Delete iconOpened, itemWidth, selectedItemLabelColor, itemLabelColor,selectedItemBackgroundColor fields
32 | - **FEAT**: Refactor all old code base (shit code)! Now everything works faster and more convenient to upgrading
33 | - **FEAT**: Now BottomBarWithSheetItem is model to create widget
34 | - **FEAT**: MainActionButton now common Widget
35 | - **FIX**: Update theme of widget
36 | - **FIX**: Fix widgets tree scheme
37 |
38 | ## 1.1.1 - 25-04-2021
39 |
40 | * Fix analyser issues
41 | * Refactor provider naming
42 |
43 | ## 1.1.0 - 25-04-2021
44 |
45 | * Simplify package using with default themes
46 | * Make bottomBarTheme, mainActionButtonTheme optional
47 |
48 | ## 1.0.1 - 25-04-2021
49 |
50 | * Provide key value to super class in BottomBarWithSheet widget
51 |
52 | ## 1.0.0 - 12-04-2021
53 |
54 | * **Breaking change** migrated to null safety.
55 |
56 | ## 0.6.1 - 19-03-2021
57 |
58 | * Update all examples and README.md
59 |
60 | ## 0.6.0 - 14-03-2021
61 |
62 | * Add **autoClose** field then works to close automatically when clicked on BottomBarWithSheetItem
63 |
64 | ## 0.5.5+2 - 11-02-2021
65 |
66 | * Format code
67 |
68 | ## 0.5.5+1 - 11-02-2021
69 |
70 | * Fix pub.dev issues
71 |
72 | ## 0.5.5 - 11-02-2021
73 |
74 | * Refactor code on BottomBar and BarItem
75 | * Add pedantic dependency
76 | * Replace providing variables into BottomBarProvider
77 |
78 | ## 0.5.4 - 21-12-2020
79 |
80 | * Fix preview overload
81 |
82 | ## 0.5.3 - 4-12-2020
83 |
84 | * Added new usage examples
85 | * Update documentation
86 |
87 | ## 0.5.2 - 4-12-2020
88 |
89 | * Added selectedItemIconSize field in BottomBarTheme class
90 | * Remove ci/cd logic from travis to GithubActions
91 |
92 | ## 0.5.1 - 5-11-2020
93 |
94 | ### Created Widget tests
95 |
96 | ## 0.5.0 - 5-11-2020
97 |
98 | ### Implement custom mainActionButton
99 |
100 | ## 0.4.0 - 27-10-2020
101 |
102 | ### New UI way
103 |
104 | * Added ability to disable MainActionButton
105 | * Added ability to set 0 initial height of widget
106 | * Created [example](https://github.com/Frezyx/bottom_bar_with_sheet/example/lib/examples/fab_outside_bottom_bar.dart) of new usage way of package
107 |
108 | ## 0.3.2 - 10-10-2020
109 |
110 | * fix example images in repository README.md
111 |
112 | ## 0.3.1 - 10-10-2020
113 |
114 | * fix support the latest published version of included packages
115 |
116 |
117 | ## 0.3.0 - 09-10-2020
118 |
119 | ### Big package update
120 |
121 | * Remove theme fields in own classes
122 | * Fix bar auto closing when item pressed
123 | * Make working with fields easier then before
124 | * Add transform field for MainActionButton
125 | * Add decoration field for bar theme
126 | * etc
127 |
128 | ## 0.2.1 - 30-09-2020
129 |
130 | * Added the ability to set own margins (content paddings).
131 | In case to solve this [issue](https://github.com/Frezyx/bottom_bar_with_sheet/issues/5), for new ios devices.
132 |
133 | * Now the widget is not based on the standard BottomAppBar.
134 |
135 | ## 0.2.0 - 16-09-2020
136 |
137 | * Added ability to set center position of the main button
138 |
139 | ## 0.1.3 - 12-08-2020
140 |
141 | * Simplify example end README.md
142 |
143 | ## 0.1.2 - 06-08-2020
144 |
145 | * Fix typo in the name of the main file of usage documentation
146 | * Add gifs with usage examples
147 |
148 | ## 0.1.1 - 01-08-2020
149 |
150 | * Fast fix immutable
151 |
152 | ## 0.1.0 - 31-07-2020
153 |
154 | * Added the curve and mainButtonPosition field
155 | to create cool animations and the positioning of the open sheet button
156 |
157 | ## 0.0.1 - 20-06-2020
158 |
159 | * Initial functionality
160 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | We as members, contributors, and leaders pledge to make participation in our
6 | community a harassment-free experience for everyone, regardless of age, body
7 | size, visible or invisible disability, ethnicity, sex characteristics, gender
8 | identity and expression, level of experience, education, socio-economic status,
9 | nationality, personal appearance, race, religion, or sexual identity
10 | and orientation.
11 |
12 | We pledge to act and interact in ways that contribute to an open, welcoming,
13 | diverse, inclusive, and healthy community.
14 |
15 | ## Our Standards
16 |
17 | Examples of behavior that contributes to a positive environment for our
18 | community include:
19 |
20 | * Demonstrating empathy and kindness toward other people
21 | * Being respectful of differing opinions, viewpoints, and experiences
22 | * Giving and gracefully accepting constructive feedback
23 | * Accepting responsibility and apologizing to those affected by our mistakes,
24 | and learning from the experience
25 | * Focusing on what is best not just for us as individuals, but for the
26 | overall community
27 |
28 | Examples of unacceptable behavior include:
29 |
30 | * The use of sexualized language or imagery, and sexual attention or
31 | advances of any kind
32 | * Trolling, insulting or derogatory comments, and personal or political attacks
33 | * Public or private harassment
34 | * Publishing others' private information, such as a physical or email
35 | address, without their explicit permission
36 | * Other conduct which could reasonably be considered inappropriate in a
37 | professional setting
38 |
39 | ## Enforcement Responsibilities
40 |
41 | Community leaders are responsible for clarifying and enforcing our standards of
42 | acceptable behavior and will take appropriate and fair corrective action in
43 | response to any behavior that they deem inappropriate, threatening, offensive,
44 | or harmful.
45 |
46 | Community leaders have the right and responsibility to remove, edit, or reject
47 | comments, commits, code, wiki edits, issues, and other contributions that are
48 | not aligned to this Code of Conduct, and will communicate reasons for moderation
49 | decisions when appropriate.
50 |
51 | ## Scope
52 |
53 | This Code of Conduct applies within all community spaces, and also applies when
54 | an individual is officially representing the community in public spaces.
55 | Examples of representing our community include using an official e-mail address,
56 | posting via an official social media account, or acting as an appointed
57 | representative at an online or offline event.
58 |
59 | ## Enforcement
60 |
61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
62 | reported to the community leaders responsible for enforcement at
63 | youngfrezyx@gmail.com.
64 | All complaints will be reviewed and investigated promptly and fairly.
65 |
66 | All community leaders are obligated to respect the privacy and security of the
67 | reporter of any incident.
68 |
69 | ## Enforcement Guidelines
70 |
71 | Community leaders will follow these Community Impact Guidelines in determining
72 | the consequences for any action they deem in violation of this Code of Conduct:
73 |
74 | ### 1. Correction
75 |
76 | **Community Impact**: Use of inappropriate language or other behavior deemed
77 | unprofessional or unwelcome in the community.
78 |
79 | **Consequence**: A private, written warning from community leaders, providing
80 | clarity around the nature of the violation and an explanation of why the
81 | behavior was inappropriate. A public apology may be requested.
82 |
83 | ### 2. Warning
84 |
85 | **Community Impact**: A violation through a single incident or series
86 | of actions.
87 |
88 | **Consequence**: A warning with consequences for continued behavior. No
89 | interaction with the people involved, including unsolicited interaction with
90 | those enforcing the Code of Conduct, for a specified period of time. This
91 | includes avoiding interactions in community spaces as well as external channels
92 | like social media. Violating these terms may lead to a temporary or
93 | permanent ban.
94 |
95 | ### 3. Temporary Ban
96 |
97 | **Community Impact**: A serious violation of community standards, including
98 | sustained inappropriate behavior.
99 |
100 | **Consequence**: A temporary ban from any sort of interaction or public
101 | communication with the community for a specified period of time. No public or
102 | private interaction with the people involved, including unsolicited interaction
103 | with those enforcing the Code of Conduct, is allowed during this period.
104 | Violating these terms may lead to a permanent ban.
105 |
106 | ### 4. Permanent Ban
107 |
108 | **Community Impact**: Demonstrating a pattern of violation of community
109 | standards, including sustained inappropriate behavior, harassment of an
110 | individual, or aggression toward or disparagement of classes of individuals.
111 |
112 | **Consequence**: A permanent ban from any sort of public interaction within
113 | the community.
114 |
115 | ## Attribution
116 |
117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118 | version 2.0, available at
119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | [homepage]: https://www.contributor-covenant.org
125 |
126 | For answers to common questions about this code of conduct, see the FAQ at
127 | https://www.contributor-covenant.org/faq. Translations are available at
128 | https://www.contributor-covenant.org/translations.
129 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | When contributing to this repository, please first discuss the change you wish to make via issue,
4 | email, or any other method with the owners of this repository before making a change.
5 |
6 | Please note we have a code of conduct, please follow it in all your interactions with the project.
7 |
8 | ## Pull Request Process
9 |
10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11 | build.
12 | 2. Update the README.md with details of changes to the interface, this includes new environment
13 | variables, exposed ports, useful file locations and container parameters.
14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this
15 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17 | do not have permission to do that, you may request the second reviewer to merge it for you.
18 |
19 | ## Code of Conduct
20 |
21 | ### Our Pledge
22 |
23 | In the interest of fostering an open and welcoming environment, we as
24 | contributors and maintainers pledge to making participation in our project and
25 | our community a harassment-free experience for everyone, regardless of age, body
26 | size, disability, ethnicity, gender identity and expression, level of experience,
27 | nationality, personal appearance, race, religion, or sexual identity and
28 | orientation.
29 |
30 | ### Our Standards
31 |
32 | Examples of behavior that contributes to creating a positive environment
33 | include:
34 |
35 | * Using welcoming and inclusive language
36 | * Being respectful of differing viewpoints and experiences
37 | * Gracefully accepting constructive criticism
38 | * Focusing on what is best for the community
39 | * Showing empathy towards other community members
40 |
41 | Examples of unacceptable behavior by participants include:
42 |
43 | * The use of sexualized language or imagery and unwelcome sexual attention or
44 | advances
45 | * Trolling, insulting/derogatory comments, and personal or political attacks
46 | * Public or private harassment
47 | * Publishing others' private information, such as a physical or electronic
48 | address, without explicit permission
49 | * Other conduct which could reasonably be considered inappropriate in a
50 | professional setting
51 |
52 | ### Our Responsibilities
53 |
54 | Project maintainers are responsible for clarifying the standards of acceptable
55 | behavior and are expected to take appropriate and fair corrective action in
56 | response to any instances of unacceptable behavior.
57 |
58 | Project maintainers have the right and responsibility to remove, edit, or
59 | reject comments, commits, code, wiki edits, issues, and other contributions
60 | that are not aligned to this Code of Conduct, or to ban temporarily or
61 | permanently any contributor for other behaviors that they deem inappropriate,
62 | threatening, offensive, or harmful.
63 |
64 | ### Scope
65 |
66 | This Code of Conduct applies both within project spaces and in public spaces
67 | when an individual is representing the project or its community. Examples of
68 | representing a project or community include using an official project e-mail
69 | address, posting via an official social media account, or acting as an appointed
70 | representative at an online or offline event. Representation of a project may be
71 | further defined and clarified by project maintainers.
72 |
73 | ### Enforcement
74 |
75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
76 | reported by contacting the project team at youngfrezyx@gmail.com. All
77 | complaints will be reviewed and investigated and will result in a response that
78 | is deemed necessary and appropriate to the circumstances. The project team is
79 | obligated to maintain confidentiality with regard to the reporter of an incident.
80 | Further details of specific enforcement policies may be posted separately.
81 |
82 | Project maintainers who do not follow or enforce the Code of Conduct in good
83 | faith may face temporary or permanent repercussions as determined by other
84 | members of the project's leadership.
85 |
86 | ### Attribution
87 |
88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89 | available at [http://contributor-covenant.org/version/1/4][version]
90 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: publish
2 | publish:
3 | flutter packages pub publish
4 |
5 | .PHONY: analyze
6 | analyze:
7 | flutter analyze
8 |
9 | .PHONY: start
10 | start:
11 | flutter doctor
12 | fluttr clean
13 | flutter pub get
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Bottom bar with Sheet
2 |
3 |
4 |
5 | [](https://actions-badge.atrox.dev/Frezyx/bottom_bar_with_sheet/goto?ref=master) [](https://opensource.org/licenses/MIT) [](https://pub.dartlang.org/packages/bottom_bar_with_sheet)
6 | 
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | 💥Non-standard way to use more space of screens in your application💥
17 | 😳Custom bottom Sheet under Bottom Navigation Bar😳
18 | 😩Sounds sucks? 😉 First of all look at screens!
19 |
20 | |  |  |  |  |
21 | | :------------: | :------------: | :------------: | :------------: |
22 |
23 |
24 | ## Table of Content
25 |
26 | - [Getting Started](#getting-started)
27 | - [Attributes](#attributes)
28 | - [Attributes of BottomBarTheme](#attributes-of-bottombartheme)
29 | - [Attributes of MainActionButtonTheme](#attributes-of-mainactionbuttontheme)
30 |
31 | ---
32 |
33 | ## Getting Started
34 |
35 | ### Add dependency
36 |
37 | ```yaml
38 | dependencies:
39 | bottom_bar_with_sheet: ^2.4.0
40 | ```
41 |
42 | ### Add import package
43 |
44 | ```dart
45 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
46 | ```
47 |
48 | ### Easy to use
49 |
50 | Create a **Scaffold** widget and set **bottomNavigationBar** with **BottomBarWithSheet** like in the code below
51 |
52 | ```dart
53 | Scaffold(
54 | bottomNavigationBar: BottomBarWithSheet(
55 | controller: _bottomBarController,
56 | bottomBarTheme: const BottomBarTheme(
57 | decoration: BoxDecoration(color: Colors.white),
58 | itemIconColor: Colors.grey,
59 | ),
60 | items: const [
61 | BottomBarWithSheetItem(icon: Icons.people),
62 | BottomBarWithSheetItem(icon: Icons.favorite),
63 | ],
64 | ),
65 | );
66 | ```
67 |
68 | **More examples you can see** [here](https://github.com/Frezyx/bottom_bar_with_sheet/tree/master/example/lib)
69 |
70 | ---
71 |
72 | ## Attributes
73 |
74 | | Attribute | Type | Annotation |
75 | | ------------- | ------------- | ------------- |
76 | | autoClose | bool | If true the [BottomBarWithSheetItem]'s DO NOT automatically close the child sheet when pressed |
77 | | disableMainActionButton | bool | disable MainActionButton if true , enable if false |
78 | | sheetChild | Widget | that displayed on bottom of **BottomBarWithSheet** when **isOpened** == true |
79 | | items | List BottomBarWithSheetItem | navigation buttons of **BottomBarWithSheet** |
80 | | bottomBarTheme | BottomBarTheme | theme of **BottomBarWithSheet** |
81 | | mainActionButtonTheme | MainActionButtonTheme | theme of **Main Action Button** |
82 | | onSelectItem | Function | Callback **Function** works by clicking on one of **items** Return int **index** of selected button |
83 | | duration | Duration | animation time of closing / opening **BottomBarWithSheet** |
84 | | curve | Curve | the style of animation from the suggested ones of **Curve** |
85 | | bottomBarMainAxisAlignment | MainAxisAlignment | The direction in which the widget content will line up |
86 | | mainActionButtonBuilder | MainActionButton | Custom version of Main Action Button |
87 | ---
88 | ## Attributes of BottomBarTheme
89 |
90 | | Attribute | Type | Annotation |
91 | | ------------- | ------------- | ------------- |
92 | | height | double | **BottomBarWithSheet** icons line height |
93 | | heightOpened | double | **BottomBarWithSheet** height when **isOpened** == true |
94 | | heightClosed | double | **BottomBarWithSheet** height when **isOpened** == false |
95 | | decoration | BoxDecoration | decoration of **BottomBarWithSheet** |
96 | | contentPadding | EdgeInsets | create padding between content of widget and sides |
97 | | backgroundColor | Color | **BottomBarWithSheet** background color |
98 | | selectedItemIconColor | Color | selected item icon color |
99 | | itemIconColor | Color | unselected item icon color |
100 | | selectedItemTextStyle | Color | selected item text style |
101 | | itemTextStyle | Color | unselected item text style |
102 | | selectedItemIconSize | double | size of item icon when item is pressed |
103 | | mainButtonPosition | enum | filed that response for the position of MainActionButton position this field have 3 possible values: MainButtonPosition.left, MainButtonPosition.right , MainButtonPosition.Center |
104 | | isVerticalItemLabel | bool | makes the labels of the items appear vertically or horizontally |
105 |
106 | ---
107 |
108 | ## Attributes of MainActionButtonTheme
109 |
110 | | Attribute | Type | Annotation |
111 | | ------------- | ------------- | ------------- |
112 | | size | double | size of button |
113 | | icon | Widget | icon that displayed in center of MainActionButton |
114 | | color | Color | background color of widget circle |
115 | | splash | Color | splash color of widget circle |
116 | | margin | EdgeInsets | side paddings of **Main Action Button** |
117 | | transform | Matrix4 | This field can set transform location of **Main Action Button** |
118 |
119 | ---
120 | *For help getting started with Flutter, view our
121 | [online documentation](https://flutter.dev/docs), which offers tutorials,
122 | samples, guidance on mobile development, and a full API reference.*
123 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/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: 5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.example.example"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/example/assets/images/vinyl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/assets/images/vinyl.png
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | example
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/lib/examples/left_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(const LeftButtonExample());
5 |
6 | class LeftButtonExample extends StatelessWidget {
7 | const LeftButtonExample({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return const MaterialApp(
12 | debugShowCheckedModeBanner: false,
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | class MyHomePage extends StatefulWidget {
19 | const MyHomePage({Key? key}) : super(key: key);
20 |
21 | @override
22 | _MyHomePageState createState() => _MyHomePageState();
23 | }
24 |
25 | class _MyHomePageState extends State {
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | backgroundColor: const Color(0xFF111111),
30 | body: const Center(
31 | child: Text(
32 | "Place for your content",
33 | style: TextStyle(
34 | color: Colors.green,
35 | fontSize: 20,
36 | fontWeight: FontWeight.w900,
37 | ),
38 | ),
39 | ),
40 | bottomNavigationBar: BottomBarWithSheet(
41 | autoClose: false,
42 | sheetChild: Center(
43 | child: Text(
44 | "Another content",
45 | style: TextStyle(
46 | color: Colors.grey[600],
47 | fontSize: 20,
48 | fontWeight: FontWeight.w900,
49 | ),
50 | ),
51 | ),
52 | bottomBarTheme: BottomBarTheme(
53 | height: 70,
54 | heightClosed: 70,
55 | heightOpened: 300,
56 | mainButtonPosition: MainButtonPosition.left,
57 | selectedItemIconColor: Colors.green,
58 | itemIconColor: Colors.white,
59 | decoration: BoxDecoration(
60 | color: Colors.grey[900],
61 | borderRadius: const BorderRadius.only(
62 | topLeft: Radius.circular(30.0),
63 | ),
64 | ),
65 | ),
66 | mainActionButtonTheme: MainActionButtonTheme(
67 | size: 55,
68 | color: Colors.green,
69 | splash: Colors.green[800],
70 | icon: const Icon(
71 | Icons.add,
72 | color: Colors.white,
73 | size: 35,
74 | ),
75 | ),
76 | items: const [
77 | BottomBarWithSheetItem(icon: Icons.home_rounded),
78 | BottomBarWithSheetItem(icon: Icons.shopping_cart),
79 | BottomBarWithSheetItem(icon: Icons.settings),
80 | BottomBarWithSheetItem(icon: Icons.favorite),
81 | BottomBarWithSheetItem(icon: Icons.donut_large),
82 | BottomBarWithSheetItem(icon: Icons.bar_chart_sharp),
83 | BottomBarWithSheetItem(icon: Icons.backup_rounded),
84 | BottomBarWithSheetItem(icon: Icons.camera_alt),
85 | ],
86 | ),
87 | );
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/example/lib/examples/right_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(const RightButtonExample());
5 |
6 | class RightButtonExample extends StatelessWidget {
7 | const RightButtonExample({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return const MaterialApp(
12 | debugShowCheckedModeBanner: false,
13 | home: MyHomePage(),
14 | );
15 | }
16 | }
17 |
18 | class MyHomePage extends StatefulWidget {
19 | const MyHomePage({Key? key}) : super(key: key);
20 |
21 | @override
22 | _MyHomePageState createState() => _MyHomePageState();
23 | }
24 |
25 | class _MyHomePageState extends State {
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | backgroundColor: Colors.orange,
30 | body: const Center(
31 | child: Text(
32 | "Place for your content",
33 | style: TextStyle(
34 | color: Colors.white,
35 | fontSize: 20,
36 | fontWeight: FontWeight.w900,
37 | ),
38 | ),
39 | ),
40 | bottomNavigationBar: BottomBarWithSheet(
41 | autoClose: false,
42 | sheetChild: Center(
43 | child: Text(
44 | "Another content",
45 | style: TextStyle(
46 | color: Colors.grey[600],
47 | fontSize: 20,
48 | fontWeight: FontWeight.w900,
49 | ),
50 | ),
51 | ),
52 | duration: const Duration(milliseconds: 700),
53 | curve: Curves.fastOutSlowIn,
54 | bottomBarTheme: BottomBarTheme(
55 | height: 80,
56 | heightClosed: 80,
57 | heightOpened: 500,
58 | mainButtonPosition: MainButtonPosition.right,
59 | selectedItemIconColor: Colors.orange,
60 | itemIconColor: Colors.grey[500],
61 | decoration: const BoxDecoration(
62 | color: Colors.white,
63 | borderRadius: BorderRadius.only(
64 | topRight: Radius.circular(50.0),
65 | ),
66 | ),
67 | ),
68 | mainActionButtonTheme: MainActionButtonTheme(
69 | size: 65,
70 | color: Colors.orange,
71 | splash: Colors.orange[800],
72 | icon: const Icon(
73 | Icons.add,
74 | color: Colors.white,
75 | size: 35,
76 | ),
77 | ),
78 | items: const [
79 | BottomBarWithSheetItem(icon: Icons.home_rounded),
80 | BottomBarWithSheetItem(icon: Icons.settings),
81 | BottomBarWithSheetItem(icon: Icons.favorite),
82 | BottomBarWithSheetItem(icon: Icons.bar_chart_sharp),
83 | ],
84 | ),
85 | );
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/example/lib/examples/usecases/tagselector/tagselector.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:example/examples/usecases/tagselector/widgets/widgets.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class TagSelectorExample extends StatelessWidget {
6 | const TagSelectorExample({Key? key}) : super(key: key);
7 |
8 | @override
9 | Widget build(BuildContext context) {
10 | return MaterialApp(
11 | debugShowCheckedModeBanner: false,
12 | theme: ThemeData(
13 | primarySwatch: Colors.purple,
14 | iconTheme: const IconThemeData(
15 | color: Colors.purple,
16 | ),
17 | ),
18 | home: const MyHomePage(),
19 | );
20 | }
21 | }
22 |
23 | class MyHomePage extends StatefulWidget {
24 | const MyHomePage({Key? key}) : super(key: key);
25 |
26 | @override
27 | _MyHomePageState createState() => _MyHomePageState();
28 | }
29 |
30 | class _MyHomePageState extends State {
31 | final _pageController = PageController();
32 | final _bottomBarController = BottomBarWithSheetController(initialIndex: 0);
33 | final _selectedTags = [];
34 | final _unselectedTags = [
35 | '#food',
36 | '#yummy',
37 | '#foodstagram',
38 | '#foodlovers',
39 | '#foodgasm',
40 | '#eat',
41 | '#foodpics',
42 | '#love',
43 | '#foodblogger',
44 | '#hungry',
45 | '#foodgram',
46 | '#instafood',
47 | '#foodpic',
48 | '#cooking',
49 | '#chef',
50 | '#foodblog',
51 | '#foods',
52 | '#meal',
53 | '#instagood',
54 | '#healthy',
55 | '#delicious',
56 | '#foodphotography',
57 | '#foodie',
58 | '#sweet',
59 | '#foodlover',
60 | '#foodies',
61 | ];
62 |
63 | @override
64 | Widget build(BuildContext context) {
65 | return Scaffold(
66 | backgroundColor: Colors.grey[100],
67 | appBar: AppBar(
68 | backgroundColor: Colors.white,
69 | centerTitle: true,
70 | automaticallyImplyLeading: false,
71 | elevation: 0,
72 | title: const Text(
73 | 'Tag selector',
74 | style: TextStyle(color: Colors.black),
75 | ),
76 | ),
77 | body: PageView(
78 | controller: _pageController,
79 | children: [
80 | TagsSelectingPage(
81 | selectedTags: _selectedTags,
82 | onSelect: (tag) {
83 | _unselectedTags.remove(tag);
84 | _selectedTags.add(tag);
85 | setState(() {});
86 | },
87 | ),
88 | GeneratedPostPage(selectedTags: _selectedTags),
89 | ],
90 | ),
91 | bottomNavigationBar: BottomBarWithSheet(
92 | controller: _bottomBarController,
93 | bottomBarTheme: const BottomBarTheme(
94 | mainButtonPosition: MainButtonPosition.middle,
95 | decoration: BoxDecoration(
96 | color: Colors.white,
97 | borderRadius: BorderRadius.vertical(top: Radius.circular(25)),
98 | ),
99 | itemIconColor: Colors.grey,
100 | itemTextStyle: TextStyle(
101 | color: Colors.grey,
102 | fontSize: 10.0,
103 | ),
104 | selectedItemTextStyle: TextStyle(
105 | color: Colors.purple,
106 | fontSize: 10.0,
107 | ),
108 | ),
109 | onSelectItem: (index) => _pageController.jumpToPage(index),
110 | sheetChild: ListView(
111 | children: [
112 | Padding(
113 | padding: const EdgeInsets.all(10.0),
114 | child: Wrap(
115 | spacing: 10,
116 | children: _unselectedTags
117 | .map(
118 | (e) => TagButton(
119 | onTap: () {
120 | _unselectedTags.remove(e);
121 | _selectedTags.add(e);
122 | setState(() {});
123 | },
124 | title: e,
125 | ),
126 | )
127 | .toList(),
128 | ),
129 | ),
130 | ],
131 | ),
132 | items: const [
133 | BottomBarWithSheetItem(icon: Icons.tag_sharp),
134 | BottomBarWithSheetItem(icon: Icons.design_services),
135 | ],
136 | ),
137 | );
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/example/lib/examples/usecases/tagselector/widgets/generated_post_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class GeneratedPostPage extends StatelessWidget {
4 | const GeneratedPostPage({
5 | Key? key,
6 | required this.selectedTags,
7 | }) : super(key: key);
8 |
9 | final List selectedTags;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Container(
14 | margin: const EdgeInsets.all(20),
15 | padding: const EdgeInsets.all(20),
16 | decoration: BoxDecoration(
17 | color: Colors.white,
18 | borderRadius: BorderRadius.circular(10),
19 | ),
20 | child: ListView(
21 | children: [
22 | Column(
23 | children: [
24 | const Text(
25 | 'Britain is famous all over the world for its gardens, dogs, villages, buses, cars, private schools, the Queen, sports like football and cricket, Parliament. However, not so much has been written about the wonderful food that can be found in Britain. Read two texts about food and say what the English eat and what the British food is like. Is there any difference between the English and the British food? The texts are for beginners and for the upper-intermediate level.'),
26 | const SizedBox(height: 10),
27 | Text(selectedTags.join(' ')),
28 | ],
29 | ),
30 | ],
31 | ),
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/example/lib/examples/usecases/tagselector/widgets/tag_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class TagButton extends StatelessWidget {
4 | const TagButton({
5 | Key? key,
6 | required this.onTap,
7 | required this.title,
8 | }) : super(key: key);
9 |
10 | final String title;
11 | final VoidCallback onTap;
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | final theme = Theme.of(context);
16 | return ElevatedButton(
17 | onPressed: onTap,
18 | child: Text(title),
19 | style: ButtonStyle(
20 | backgroundColor: MaterialStateProperty.all(theme.primaryColor),
21 | shape: MaterialStateProperty.all(
22 | RoundedRectangleBorder(
23 | borderRadius: BorderRadius.circular(15.0),
24 | ),
25 | ),
26 | ),
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/example/lib/examples/usecases/tagselector/widgets/tag_selecting_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/examples/usecases/tagselector/widgets/widgets.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class TagsSelectingPage extends StatelessWidget {
5 | const TagsSelectingPage({
6 | Key? key,
7 | required this.selectedTags,
8 | required this.onSelect,
9 | }) : super(key: key);
10 |
11 | final List selectedTags;
12 | final Function(String tag) onSelect;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Padding(
17 | padding: const EdgeInsets.all(10.0),
18 | child: selectedTags.isEmpty
19 | ? Center(
20 | child: Text(
21 | 'Select tags',
22 | style: Theme.of(context).textTheme.headline5,
23 | ))
24 | : Wrap(
25 | spacing: 10,
26 | children: selectedTags
27 | .map((e) => TagButton(onTap: () => onSelect(e), title: e))
28 | .toList(),
29 | ),
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/example/lib/examples/usecases/tagselector/widgets/widgets.dart:
--------------------------------------------------------------------------------
1 | export 'generated_post_page.dart';
2 | export 'tag_button.dart';
3 | export 'tag_selecting_page.dart';
4 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | void main() => runApp(const BaseExample());
5 |
6 | class BaseExample extends StatelessWidget {
7 | const BaseExample({Key? key}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | debugShowCheckedModeBanner: false,
13 | theme: ThemeData(
14 | iconTheme: const IconThemeData(
15 | color: Colors.blue,
16 | ),
17 | ),
18 | home: const MyHomePage(),
19 | );
20 | }
21 | }
22 |
23 | class MyHomePage extends StatefulWidget {
24 | const MyHomePage({Key? key}) : super(key: key);
25 |
26 | @override
27 | _MyHomePageState createState() => _MyHomePageState();
28 | }
29 |
30 | class _MyHomePageState extends State {
31 | final _bottomBarController = BottomBarWithSheetController(initialIndex: 0);
32 |
33 | @override
34 | void initState() {
35 | _bottomBarController.stream.listen((opened) {
36 | debugPrint('Bottom bar ${opened ? 'opened' : 'closed'}');
37 | });
38 | super.initState();
39 | }
40 |
41 | @override
42 | Widget build(BuildContext context) {
43 | return Scaffold(
44 | backgroundColor: Colors.blue,
45 | appBar: AppBar(
46 | backgroundColor: Colors.white,
47 | centerTitle: true,
48 | automaticallyImplyLeading: false,
49 | title: Row(
50 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
51 | children: [
52 | ElevatedButton(
53 | onPressed: () => _bottomBarController.openSheet(),
54 | child: const Text('Open sheet'),
55 | ),
56 | ElevatedButton(
57 | onPressed: () => _bottomBarController.closeSheet(),
58 | child: const Text('Close sheet'),
59 | ),
60 | ElevatedButton(
61 | onPressed: () => _bottomBarController.toggleSheet(),
62 | child: const Text('Toggle sheet'),
63 | ),
64 | ],
65 | ),
66 | ),
67 | body: Center(
68 | child: Column(
69 | mainAxisAlignment: MainAxisAlignment.center,
70 | children: const [
71 | Text(
72 | "Place for your content",
73 | style: TextStyle(
74 | color: Colors.white,
75 | fontSize: 20,
76 | fontWeight: FontWeight.w900,
77 | ),
78 | ),
79 | ],
80 | ),
81 | ),
82 | bottomNavigationBar: BottomBarWithSheet(
83 | controller: _bottomBarController,
84 | bottomBarTheme: const BottomBarTheme(
85 | mainButtonPosition: MainButtonPosition.middle,
86 | decoration: BoxDecoration(
87 | color: Colors.white,
88 | borderRadius: BorderRadius.vertical(top: Radius.circular(25)),
89 | ),
90 | itemIconColor: Colors.grey,
91 | itemTextStyle: TextStyle(
92 | color: Colors.grey,
93 | fontSize: 10.0,
94 | ),
95 | selectedItemTextStyle: TextStyle(
96 | color: Colors.blue,
97 | fontSize: 10.0,
98 | ),
99 | ),
100 | onSelectItem: (index) => debugPrint('$index'),
101 | sheetChild: Center(
102 | child: Text(
103 | "Another content",
104 | style: TextStyle(
105 | color: Colors.grey[600],
106 | fontSize: 20,
107 | fontWeight: FontWeight.w900,
108 | ),
109 | ),
110 | ),
111 | items: const [
112 | BottomBarWithSheetItem(icon: Icons.people),
113 | BottomBarWithSheetItem(icon: Icons.shopping_cart),
114 | BottomBarWithSheetItem(icon: Icons.settings),
115 | BottomBarWithSheetItem(icon: Icons.favorite),
116 | ],
117 | ),
118 | );
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | bottom_bar_with_sheet:
19 | dependency: "direct main"
20 | description:
21 | path: ".."
22 | relative: true
23 | source: path
24 | version: "2.4.0"
25 | characters:
26 | dependency: transitive
27 | description:
28 | name: characters
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | charcode:
33 | dependency: transitive
34 | description:
35 | name: charcode
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.3.1"
39 | clock:
40 | dependency: transitive
41 | description:
42 | name: clock
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.1.0"
46 | collection:
47 | dependency: transitive
48 | description:
49 | name: collection
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.15.0"
53 | cupertino_icons:
54 | dependency: "direct main"
55 | description:
56 | name: cupertino_icons
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.0.4"
60 | fake_async:
61 | dependency: transitive
62 | description:
63 | name: fake_async
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.2.0"
67 | flutter:
68 | dependency: "direct main"
69 | description: flutter
70 | source: sdk
71 | version: "0.0.0"
72 | flutter_lints:
73 | dependency: "direct dev"
74 | description:
75 | name: flutter_lints
76 | url: "https://pub.dartlang.org"
77 | source: hosted
78 | version: "1.0.4"
79 | flutter_test:
80 | dependency: "direct dev"
81 | description: flutter
82 | source: sdk
83 | version: "0.0.0"
84 | lints:
85 | dependency: transitive
86 | description:
87 | name: lints
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.0.1"
91 | matcher:
92 | dependency: transitive
93 | description:
94 | name: matcher
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "0.12.11"
98 | material_color_utilities:
99 | dependency: transitive
100 | description:
101 | name: material_color_utilities
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "0.1.3"
105 | meta:
106 | dependency: transitive
107 | description:
108 | name: meta
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "1.7.0"
112 | path:
113 | dependency: transitive
114 | description:
115 | name: path
116 | url: "https://pub.dartlang.org"
117 | source: hosted
118 | version: "1.8.0"
119 | sky_engine:
120 | dependency: transitive
121 | description: flutter
122 | source: sdk
123 | version: "0.0.99"
124 | source_span:
125 | dependency: transitive
126 | description:
127 | name: source_span
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.8.1"
131 | stack_trace:
132 | dependency: transitive
133 | description:
134 | name: stack_trace
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.10.0"
138 | stream_channel:
139 | dependency: transitive
140 | description:
141 | name: stream_channel
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "2.1.0"
145 | string_scanner:
146 | dependency: transitive
147 | description:
148 | name: string_scanner
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.1.0"
152 | term_glyph:
153 | dependency: transitive
154 | description:
155 | name: term_glyph
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.2.0"
159 | test_api:
160 | dependency: transitive
161 | description:
162 | name: test_api
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "0.4.8"
166 | typed_data:
167 | dependency: transitive
168 | description:
169 | name: typed_data
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "1.3.0"
173 | vector_math:
174 | dependency: transitive
175 | description:
176 | name: vector_math
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "2.1.1"
180 | sdks:
181 | dart: ">=2.16.0 <3.0.0"
182 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.16.0 <3.0.0"
22 |
23 | dependencies:
24 | flutter:
25 | sdk: flutter
26 | bottom_bar_with_sheet:
27 | path: ../
28 |
29 |
30 | # The following adds the Cupertino Icons font to your application.
31 | # Use with the CupertinoIcons class for iOS style icons.
32 | cupertino_icons: ^1.0.2
33 |
34 | dev_dependencies:
35 | flutter_test:
36 | sdk: flutter
37 |
38 | # The "flutter_lints" package below contains a set of recommended lints to
39 | # encourage good coding practices. The lint set provided by the package is
40 | # activated in the `analysis_options.yaml` file located at the root of your
41 | # package. See that file for information about deactivating specific lint
42 | # rules and activating additional ones.
43 | flutter_lints: ^1.0.0
44 |
45 | # For information on the generic Dart part of this file, see the
46 | # following page: https://dart.dev/tools/pub/pubspec
47 |
48 | # The following section is specific to Flutter.
49 | flutter:
50 |
51 | # The following line ensures that the Material Icons font is
52 | # included with your application, so that you can use the icons in
53 | # the material Icons class.
54 | uses-material-design: true
55 | assets:
56 | - assets/images/vinyl.png
57 |
58 | # To add assets to your application, add an assets section, like this:
59 | # assets:
60 | # - images/a_dot_burr.jpeg
61 | # - images/a_dot_ham.jpeg
62 |
63 | # An image asset can refer to one or more resolution-specific "variants", see
64 | # https://flutter.dev/assets-and-images/#resolution-aware.
65 |
66 | # For details regarding adding assets from package dependencies, see
67 | # https://flutter.dev/assets-and-images/#from-packages
68 |
69 | # To add custom fonts to your application, add a fonts section here,
70 | # in this "flutter" section. Each entry in this list should have a
71 | # "family" key with the font family name, and a "fonts" key with a
72 | # list giving the asset and other descriptors for the font. For
73 | # example:
74 | # fonts:
75 | # - family: Schyler
76 | # fonts:
77 | # - asset: fonts/Schyler-Regular.ttf
78 | # - asset: fonts/Schyler-Italic.ttf
79 | # style: italic
80 | # - family: Trajan Pro
81 | # fonts:
82 | # - asset: fonts/TrajanPro.ttf
83 | # - asset: fonts/TrajanPro_Bold.ttf
84 | # weight: 700
85 | #
86 | # For details regarding fonts from package dependencies,
87 | # see https://flutter.dev/custom-fonts/#from-packages
88 |
--------------------------------------------------------------------------------
/example/rep_files/e1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/e1.gif
--------------------------------------------------------------------------------
/example/rep_files/e2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/e2.gif
--------------------------------------------------------------------------------
/example/rep_files/e3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/e3.gif
--------------------------------------------------------------------------------
/example/rep_files/e4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/e4.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example1.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example2.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example3.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example4.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example5.gif
--------------------------------------------------------------------------------
/example/rep_files/old/example6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/example6.gif
--------------------------------------------------------------------------------
/example/rep_files/old/examples/left_button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/examples/left_button.gif
--------------------------------------------------------------------------------
/example/rep_files/old/examples/main.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/examples/main.gif
--------------------------------------------------------------------------------
/example/rep_files/old/examples/right_button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/examples/right_button.gif
--------------------------------------------------------------------------------
/example/rep_files/old/examples/tasks_app.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/rep_files/old/examples/tasks_app.gif
--------------------------------------------------------------------------------
/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/web/favicon.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/example/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | example
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/example/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/example/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(example LANGUAGES CXX)
3 |
4 | set(BINARY_NAME "example")
5 |
6 | cmake_policy(SET CMP0063 NEW)
7 |
8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9 |
10 | # Configure build options.
11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12 | if(IS_MULTICONFIG)
13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14 | CACHE STRING "" FORCE)
15 | else()
16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17 | set(CMAKE_BUILD_TYPE "Debug" CACHE
18 | STRING "Flutter build mode" FORCE)
19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20 | "Debug" "Profile" "Release")
21 | endif()
22 | endif()
23 |
24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28 |
29 | # Use Unicode for all projects.
30 | add_definitions(-DUNICODE -D_UNICODE)
31 |
32 | # Compilation settings that should be applied to most targets.
33 | function(APPLY_STANDARD_SETTINGS TARGET)
34 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36 | target_compile_options(${TARGET} PRIVATE /EHsc)
37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
39 | endfunction()
40 |
41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42 |
43 | # Flutter library and tool build rules.
44 | add_subdirectory(${FLUTTER_MANAGED_DIR})
45 |
46 | # Application build
47 | add_subdirectory("runner")
48 |
49 | # Generated plugin build rules, which manage building the plugins and adding
50 | # them to the application.
51 | include(flutter/generated_plugins.cmake)
52 |
53 |
54 | # === Installation ===
55 | # Support files are copied into place next to the executable, so that it can
56 | # run in place. This is done instead of making a separate bundle (as on Linux)
57 | # so that building and running from within Visual Studio will work.
58 | set(BUILD_BUNDLE_DIR "$")
59 | # Make the "install" step default, as it's required to run.
60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63 | endif()
64 |
65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67 |
68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69 | COMPONENT Runtime)
70 |
71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72 | COMPONENT Runtime)
73 |
74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75 | COMPONENT Runtime)
76 |
77 | if(PLUGIN_BUNDLED_LIBRARIES)
78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80 | COMPONENT Runtime)
81 | endif()
82 |
83 | # Fully re-copy the assets directory on each build to avoid having stale files
84 | # from a previous install.
85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86 | install(CODE "
87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88 | " COMPONENT Runtime)
89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91 |
92 | # Install the AOT library on non-Debug builds only.
93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94 | CONFIGURATIONS Profile;Release
95 | COMPONENT Runtime)
96 |
--------------------------------------------------------------------------------
/example/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4 |
5 | # Configuration provided via flutter tool.
6 | include(${EPHEMERAL_DIR}/generated_config.cmake)
7 |
8 | # TODO: Move the rest of this into files in ephemeral. See
9 | # https://github.com/flutter/flutter/issues/57146.
10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11 |
12 | # === Flutter Library ===
13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14 |
15 | # Published to parent scope for install step.
16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20 |
21 | list(APPEND FLUTTER_LIBRARY_HEADERS
22 | "flutter_export.h"
23 | "flutter_windows.h"
24 | "flutter_messenger.h"
25 | "flutter_plugin_registrar.h"
26 | "flutter_texture_registrar.h"
27 | )
28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29 | add_library(flutter INTERFACE)
30 | target_include_directories(flutter INTERFACE
31 | "${EPHEMERAL_DIR}"
32 | )
33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34 | add_dependencies(flutter flutter_assemble)
35 |
36 | # === Wrapper ===
37 | list(APPEND CPP_WRAPPER_SOURCES_CORE
38 | "core_implementations.cc"
39 | "standard_codec.cc"
40 | )
41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43 | "plugin_registrar.cc"
44 | )
45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46 | list(APPEND CPP_WRAPPER_SOURCES_APP
47 | "flutter_engine.cc"
48 | "flutter_view_controller.cc"
49 | )
50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51 |
52 | # Wrapper sources needed for a plugin.
53 | add_library(flutter_wrapper_plugin STATIC
54 | ${CPP_WRAPPER_SOURCES_CORE}
55 | ${CPP_WRAPPER_SOURCES_PLUGIN}
56 | )
57 | apply_standard_settings(flutter_wrapper_plugin)
58 | set_target_properties(flutter_wrapper_plugin PROPERTIES
59 | POSITION_INDEPENDENT_CODE ON)
60 | set_target_properties(flutter_wrapper_plugin PROPERTIES
61 | CXX_VISIBILITY_PRESET hidden)
62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63 | target_include_directories(flutter_wrapper_plugin PUBLIC
64 | "${WRAPPER_ROOT}/include"
65 | )
66 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
67 |
68 | # Wrapper sources needed for the runner.
69 | add_library(flutter_wrapper_app STATIC
70 | ${CPP_WRAPPER_SOURCES_CORE}
71 | ${CPP_WRAPPER_SOURCES_APP}
72 | )
73 | apply_standard_settings(flutter_wrapper_app)
74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75 | target_include_directories(flutter_wrapper_app PUBLIC
76 | "${WRAPPER_ROOT}/include"
77 | )
78 | add_dependencies(flutter_wrapper_app flutter_assemble)
79 |
80 | # === Flutter tool backend ===
81 | # _phony_ is a non-existent file to force this command to run every time,
82 | # since currently there's no way to get a full input/output list from the
83 | # flutter tool.
84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86 | add_custom_command(
87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89 | ${CPP_WRAPPER_SOURCES_APP}
90 | ${PHONY_OUTPUT}
91 | COMMAND ${CMAKE_COMMAND} -E env
92 | ${FLUTTER_TOOL_ENVIRONMENT}
93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94 | windows-x64 $
95 | VERBATIM
96 | )
97 | add_custom_target(flutter_assemble DEPENDS
98 | "${FLUTTER_LIBRARY}"
99 | ${FLUTTER_LIBRARY_HEADERS}
100 | ${CPP_WRAPPER_SOURCES_CORE}
101 | ${CPP_WRAPPER_SOURCES_PLUGIN}
102 | ${CPP_WRAPPER_SOURCES_APP}
103 | )
104 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | set(PLUGIN_BUNDLED_LIBRARIES)
9 |
10 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
15 | endforeach(plugin)
16 |
--------------------------------------------------------------------------------
/example/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/example/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "example" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "example" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "example.exe" "\0"
98 | VALUE "ProductName", "example" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 | return true;
30 | }
31 |
32 | void FlutterWindow::OnDestroy() {
33 | if (flutter_controller_) {
34 | flutter_controller_ = nullptr;
35 | }
36 |
37 | Win32Window::OnDestroy();
38 | }
39 |
40 | LRESULT
41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
42 | WPARAM const wparam,
43 | LPARAM const lparam) noexcept {
44 | // Give Flutter, including plugins, an opportunity to handle window messages.
45 | if (flutter_controller_) {
46 | std::optional result =
47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
48 | lparam);
49 | if (result) {
50 | return *result;
51 | }
52 | }
53 |
54 | switch (message) {
55 | case WM_FONTCHANGE:
56 | flutter_controller_->engine()->ReloadSystemFonts();
57 | break;
58 | }
59 |
60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
61 | }
62 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/example/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.CreateAndShow(L"example", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/example/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Frezyx/bottom_bar_with_sheet/48a716415beddeab1a529886359ee56d8ef29443/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/example/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | if (target_length == 0) {
52 | return std::string();
53 | }
54 | std::string utf8_string;
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/example/windows/runner/win32_window.cpp:
--------------------------------------------------------------------------------
1 | #include "win32_window.h"
2 |
3 | #include
4 |
5 | #include "resource.h"
6 |
7 | namespace {
8 |
9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
10 |
11 | // The number of Win32Window objects that currently exist.
12 | static int g_active_window_count = 0;
13 |
14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd);
15 |
16 | // Scale helper to convert logical scaler values to physical using passed in
17 | // scale factor
18 | int Scale(int source, double scale_factor) {
19 | return static_cast(source * scale_factor);
20 | }
21 |
22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module.
23 | // This API is only needed for PerMonitor V1 awareness mode.
24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) {
25 | HMODULE user32_module = LoadLibraryA("User32.dll");
26 | if (!user32_module) {
27 | return;
28 | }
29 | auto enable_non_client_dpi_scaling =
30 | reinterpret_cast(
31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
32 | if (enable_non_client_dpi_scaling != nullptr) {
33 | enable_non_client_dpi_scaling(hwnd);
34 | FreeLibrary(user32_module);
35 | }
36 | }
37 |
38 | } // namespace
39 |
40 | // Manages the Win32Window's window class registration.
41 | class WindowClassRegistrar {
42 | public:
43 | ~WindowClassRegistrar() = default;
44 |
45 | // Returns the singleton registar instance.
46 | static WindowClassRegistrar* GetInstance() {
47 | if (!instance_) {
48 | instance_ = new WindowClassRegistrar();
49 | }
50 | return instance_;
51 | }
52 |
53 | // Returns the name of the window class, registering the class if it hasn't
54 | // previously been registered.
55 | const wchar_t* GetWindowClass();
56 |
57 | // Unregisters the window class. Should only be called if there are no
58 | // instances of the window.
59 | void UnregisterWindowClass();
60 |
61 | private:
62 | WindowClassRegistrar() = default;
63 |
64 | static WindowClassRegistrar* instance_;
65 |
66 | bool class_registered_ = false;
67 | };
68 |
69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr;
70 |
71 | const wchar_t* WindowClassRegistrar::GetWindowClass() {
72 | if (!class_registered_) {
73 | WNDCLASS window_class{};
74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW);
75 | window_class.lpszClassName = kWindowClassName;
76 | window_class.style = CS_HREDRAW | CS_VREDRAW;
77 | window_class.cbClsExtra = 0;
78 | window_class.cbWndExtra = 0;
79 | window_class.hInstance = GetModuleHandle(nullptr);
80 | window_class.hIcon =
81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON));
82 | window_class.hbrBackground = 0;
83 | window_class.lpszMenuName = nullptr;
84 | window_class.lpfnWndProc = Win32Window::WndProc;
85 | RegisterClass(&window_class);
86 | class_registered_ = true;
87 | }
88 | return kWindowClassName;
89 | }
90 |
91 | void WindowClassRegistrar::UnregisterWindowClass() {
92 | UnregisterClass(kWindowClassName, nullptr);
93 | class_registered_ = false;
94 | }
95 |
96 | Win32Window::Win32Window() {
97 | ++g_active_window_count;
98 | }
99 |
100 | Win32Window::~Win32Window() {
101 | --g_active_window_count;
102 | Destroy();
103 | }
104 |
105 | bool Win32Window::CreateAndShow(const std::wstring& title,
106 | const Point& origin,
107 | const Size& size) {
108 | Destroy();
109 |
110 | const wchar_t* window_class =
111 | WindowClassRegistrar::GetInstance()->GetWindowClass();
112 |
113 | const POINT target_point = {static_cast(origin.x),
114 | static_cast(origin.y)};
115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST);
116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor);
117 | double scale_factor = dpi / 96.0;
118 |
119 | HWND window = CreateWindow(
120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123 | nullptr, nullptr, GetModuleHandle(nullptr), this);
124 |
125 | if (!window) {
126 | return false;
127 | }
128 |
129 | return OnCreate();
130 | }
131 |
132 | // static
133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window,
134 | UINT const message,
135 | WPARAM const wparam,
136 | LPARAM const lparam) noexcept {
137 | if (message == WM_NCCREATE) {
138 | auto window_struct = reinterpret_cast(lparam);
139 | SetWindowLongPtr(window, GWLP_USERDATA,
140 | reinterpret_cast(window_struct->lpCreateParams));
141 |
142 | auto that = static_cast(window_struct->lpCreateParams);
143 | EnableFullDpiSupportIfAvailable(window);
144 | that->window_handle_ = window;
145 | } else if (Win32Window* that = GetThisFromHandle(window)) {
146 | return that->MessageHandler(window, message, wparam, lparam);
147 | }
148 |
149 | return DefWindowProc(window, message, wparam, lparam);
150 | }
151 |
152 | LRESULT
153 | Win32Window::MessageHandler(HWND hwnd,
154 | UINT const message,
155 | WPARAM const wparam,
156 | LPARAM const lparam) noexcept {
157 | switch (message) {
158 | case WM_DESTROY:
159 | window_handle_ = nullptr;
160 | Destroy();
161 | if (quit_on_close_) {
162 | PostQuitMessage(0);
163 | }
164 | return 0;
165 |
166 | case WM_DPICHANGED: {
167 | auto newRectSize = reinterpret_cast(lparam);
168 | LONG newWidth = newRectSize->right - newRectSize->left;
169 | LONG newHeight = newRectSize->bottom - newRectSize->top;
170 |
171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth,
172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
173 |
174 | return 0;
175 | }
176 | case WM_SIZE: {
177 | RECT rect = GetClientArea();
178 | if (child_content_ != nullptr) {
179 | // Size and position the child window.
180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left,
181 | rect.bottom - rect.top, TRUE);
182 | }
183 | return 0;
184 | }
185 |
186 | case WM_ACTIVATE:
187 | if (child_content_ != nullptr) {
188 | SetFocus(child_content_);
189 | }
190 | return 0;
191 | }
192 |
193 | return DefWindowProc(window_handle_, message, wparam, lparam);
194 | }
195 |
196 | void Win32Window::Destroy() {
197 | OnDestroy();
198 |
199 | if (window_handle_) {
200 | DestroyWindow(window_handle_);
201 | window_handle_ = nullptr;
202 | }
203 | if (g_active_window_count == 0) {
204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass();
205 | }
206 | }
207 |
208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept {
209 | return reinterpret_cast(
210 | GetWindowLongPtr(window, GWLP_USERDATA));
211 | }
212 |
213 | void Win32Window::SetChildContent(HWND content) {
214 | child_content_ = content;
215 | SetParent(content, window_handle_);
216 | RECT frame = GetClientArea();
217 |
218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left,
219 | frame.bottom - frame.top, true);
220 |
221 | SetFocus(child_content_);
222 | }
223 |
224 | RECT Win32Window::GetClientArea() {
225 | RECT frame;
226 | GetClientRect(window_handle_, &frame);
227 | return frame;
228 | }
229 |
230 | HWND Win32Window::GetHandle() {
231 | return window_handle_;
232 | }
233 |
234 | void Win32Window::SetQuitOnClose(bool quit_on_close) {
235 | quit_on_close_ = quit_on_close;
236 | }
237 |
238 | bool Win32Window::OnCreate() {
239 | // No-op; provided for subclasses.
240 | return true;
241 | }
242 |
243 | void Win32Window::OnDestroy() {
244 | // No-op; provided for subclasses.
245 | }
246 |
--------------------------------------------------------------------------------
/example/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates and shows a win32 window with |title| and position and size using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size to will treat the width height passed in to this function
35 | // as logical pixels and scale to appropriate for the default monitor. Returns
36 | // true if the window was created successfully.
37 | bool CreateAndShow(const std::wstring& title,
38 | const Point& origin,
39 | const Size& size);
40 |
41 | // Release OS resources associated with window.
42 | void Destroy();
43 |
44 | // Inserts |content| into the window tree.
45 | void SetChildContent(HWND content);
46 |
47 | // Returns the backing Window handle to enable clients to set icon and other
48 | // window properties. Returns nullptr if the window has been destroyed.
49 | HWND GetHandle();
50 |
51 | // If true, closing this window will quit the application.
52 | void SetQuitOnClose(bool quit_on_close);
53 |
54 | // Return a RECT representing the bounds of the current client area.
55 | RECT GetClientArea();
56 |
57 | protected:
58 | // Processes and route salient window messages for mouse handling,
59 | // size change and DPI. Delegates handling of these to member overloads that
60 | // inheriting classes can handle.
61 | virtual LRESULT MessageHandler(HWND window,
62 | UINT const message,
63 | WPARAM const wparam,
64 | LPARAM const lparam) noexcept;
65 |
66 | // Called when CreateAndShow is called, allowing subclass window-related
67 | // setup. Subclasses should return false if setup fails.
68 | virtual bool OnCreate();
69 |
70 | // Called when Destroy is called.
71 | virtual void OnDestroy();
72 |
73 | private:
74 | friend class WindowClassRegistrar;
75 |
76 | // OS callback called by message pump. Handles the WM_NCCREATE message which
77 | // is passed when the non-client area is being created and enables automatic
78 | // non-client DPI scaling so that the non-client area automatically
79 | // responsponds to changes in DPI. All other messages are handled by
80 | // MessageHandler.
81 | static LRESULT CALLBACK WndProc(HWND const window,
82 | UINT const message,
83 | WPARAM const wparam,
84 | LPARAM const lparam) noexcept;
85 |
86 | // Retrieves a class instance pointer for |window|
87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
88 |
89 | bool quit_on_close_ = false;
90 |
91 | // window handle for top level window.
92 | HWND window_handle_ = nullptr;
93 |
94 | // window handle for hosted content.
95 | HWND child_content_ = nullptr;
96 | };
97 |
98 | #endif // RUNNER_WIN32_WINDOW_H_
99 |
--------------------------------------------------------------------------------
/lib/bottom_bar_with_sheet.dart:
--------------------------------------------------------------------------------
1 | /// Hello !
2 | /// ----------------------------------------------------------------------
3 | /// You can check all widget annotations, examples and docs
4 | /// In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
5 | /// ----------------------------------------------------------------------
6 |
7 | export 'src/src.dart';
8 |
--------------------------------------------------------------------------------
/lib/src/bottom_bar_with_sheet_base.dart:
--------------------------------------------------------------------------------
1 | library bottom_bar_with_sheet;
2 |
3 | import 'dart:async';
4 |
5 | import 'package:bottom_bar_with_sheet/src/models/bottom_bar_with_sheet_item.dart';
6 | import 'package:bottom_bar_with_sheet/src/utils/utils.dart';
7 | import 'package:bottom_bar_with_sheet/src/widgets/bottom_bar_with_sheet_item_controller.dart';
8 | import 'package:bottom_bar_with_sheet/src/widgets/main_action_button.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:bottom_bar_with_sheet/src/theme/bottom_bar_with_sheet_theme.dart';
11 | import 'package:bottom_bar_with_sheet/src/theme/defaults.dart';
12 | import 'package:bottom_bar_with_sheet/src/theme/main_action_button_theme.dart';
13 |
14 | /// Hello !
15 | /// ----------------------------------------------------------------------
16 | /// You can check all widget annotations, examples and docs
17 | /// In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
18 | /// ----------------------------------------------------------------------
19 |
20 | // ignore: must_be_immutable
21 | class BottomBarWithSheet extends StatefulWidget {
22 | BottomBarWithSheet({
23 | Key? key,
24 | required this.items,
25 | this.sheetChild,
26 | this.bottomBarMainAxisAlignment = MainAxisAlignment.center,
27 | this.duration = defaultDuration,
28 | this.curve = defaultCurve,
29 | this.disableMainActionButton = false,
30 | this.mainActionButtonBuilder,
31 | this.bottomBarTheme = defaultBarTheme,
32 | this.mainActionButtonTheme = defaultMainActionButtonTheme,
33 | this.autoClose = true,
34 | this.onSelectItem,
35 | this.controller,
36 | }) : this._controller = (controller ??
37 | BottomBarWithSheetController(
38 | initialIndex: 0,
39 | sheetOpened: false,
40 | ))
41 | ..onItemSelect = onSelectItem,
42 | super(key: key) {
43 | assert(items.isEmpty || items.length >= 2);
44 | }
45 |
46 | /// navigation buttons of [BottomBarWithSheet]
47 | final List items;
48 |
49 | /// theme of [BottomBarWithSheet]
50 | final BottomBarTheme bottomBarTheme;
51 |
52 | /// theme of [MainActionButtonTheme]
53 | final MainActionButtonTheme mainActionButtonTheme;
54 |
55 | /// Callback [Function] works by clicking on one of [items]
56 | ///
57 | /// Return int [index] of selected button
58 | final Function(int)? onSelectItem;
59 |
60 | /// Widget that displayed on bottom of [BottomBarWithSheet]
61 | /// when [isOpened] == true
62 | final Widget? sheetChild;
63 |
64 | /// animation time of closing / opening [BottomBarWithSheet]
65 | final Duration duration;
66 |
67 | /// the style of animation from the suggested ones of [Curve]
68 | final Curve curve;
69 |
70 | /// The direction in which the widget content will line up
71 | final MainAxisAlignment bottomBarMainAxisAlignment;
72 |
73 | /// This field can replace mainActionButton
74 | final bool disableMainActionButton;
75 |
76 | /// [WidgetBuilder] to display custom mainActionButton
77 | final WidgetBuilder? mainActionButtonBuilder;
78 |
79 | /// If true the [BottomBarWithSheetItem]'s DO NOT automatically close the child sheet when pressed
80 | final bool autoClose;
81 |
82 | /// Controller for workin with widget state
83 | final BottomBarWithSheetController? controller;
84 |
85 | // ignore: todo
86 | //TODO: refactor
87 | late BottomBarWithSheetController _controller;
88 |
89 | @override
90 | _BottomBarWithSheetState createState() => _BottomBarWithSheetState();
91 | }
92 |
93 | class _BottomBarWithSheetState extends State
94 | with SingleTickerProviderStateMixin {
95 | late AnimationController _arrowAnimationController;
96 | late Animation _arrowAnimation;
97 | late bool _isOpened;
98 | late StreamSubscription _sub;
99 |
100 | @override
101 | void initState() {
102 | super.initState();
103 | _arrowAnimationController =
104 | AnimationController(vsync: this, duration: widget.duration);
105 | _arrowAnimation =
106 | Tween(begin: 0.0, end: 1.0).animate(_arrowAnimationController);
107 | _isOpened = widget._controller.isOpened;
108 | _configBottomControllerListener();
109 | super.initState();
110 | }
111 |
112 | @override
113 | Widget build(BuildContext context) {
114 | return AnimatedContainer(
115 | duration: widget.duration,
116 | curve: widget.curve,
117 | height: _bottomBarHeigth,
118 | padding: widget.bottomBarTheme.contentPadding,
119 | decoration: widget.bottomBarTheme.decoration,
120 | child: Column(
121 | children: [
122 | Row(
123 | crossAxisAlignment: CrossAxisAlignment.center,
124 | children: _generateItems(),
125 | ),
126 | _isOpened
127 | ? Expanded(child: widget.sheetChild ?? SizedBox())
128 | : SizedBox()
129 | ],
130 | ),
131 | );
132 | }
133 |
134 | void _configBottomControllerListener() {
135 | _sub = widget._controller.stream
136 | .listen((event) => setState(() => _isOpened = event));
137 | }
138 |
139 | List _generateItems() {
140 | return ItemsGenerator.generateByButtonPosition(
141 | mainActionButton: MainActionButton(
142 | onTap: () {
143 | _changeWidgetState();
144 | },
145 | button: widget.mainActionButtonBuilder?.call(context),
146 | mainActionButtonTheme: widget.mainActionButtonTheme,
147 | arrowAnimation: _arrowAnimation,
148 | arrowAnimationController: _arrowAnimationController,
149 | enable: !widget.disableMainActionButton,
150 | ),
151 | items: widget.items
152 | .asMap()
153 | .map(
154 | (i, e) => MapEntry(
155 | i,
156 | BottmBarItemController(
157 | index: i,
158 | model: e,
159 | controller: widget._controller,
160 | theme: widget.bottomBarTheme,
161 | ),
162 | ),
163 | )
164 | .values
165 | .toList(),
166 | position: widget.bottomBarTheme.mainButtonPosition,
167 | );
168 | }
169 |
170 | @override
171 | void dispose() {
172 | _arrowAnimationController.dispose();
173 | _sub.cancel();
174 | super.dispose();
175 | }
176 |
177 | void _changeWidgetState() {
178 | widget._controller.toggleSheet();
179 | if (_arrowAnimationController.isCompleted) {
180 | _arrowAnimationController.reverse();
181 | } else {
182 | _arrowAnimationController.forward();
183 | }
184 | }
185 |
186 | double get _bottomBarHeigth {
187 | final t = widget.bottomBarTheme;
188 | return _isOpened ? t.heightOpened : t.heightClosed;
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/src/models/bottom_bar_with_sheet_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | /// Hello !
4 | /// ----------------------------------------------------------------------
5 | /// You can check all widget annotations, examples and docs
6 | /// In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
7 | /// ----------------------------------------------------------------------
8 |
9 | // ignore: must_be_immutable
10 | class BottomBarWithSheetItem {
11 | const BottomBarWithSheetItem({
12 | Key? key,
13 | required this.icon,
14 | this.label,
15 | this.noSelectionState = false,
16 | });
17 |
18 | /// [IconData] icon of
19 | /// your [BottomBarWithSheetItem] navigation item
20 | final IconData icon;
21 |
22 | /// Text [String] label of
23 | /// your [BottomBarWithSheetItem] navigation item
24 | final String? label;
25 |
26 | /// If [noSelectionState] is true then no styling/state change happens when this item is pressed/selected
27 | final bool noSelectionState;
28 | }
29 |
--------------------------------------------------------------------------------
/lib/src/models/models.dart:
--------------------------------------------------------------------------------
1 | export 'bottom_bar_with_sheet_item.dart';
2 | export 'positions.dart';
3 |
--------------------------------------------------------------------------------
/lib/src/models/positions.dart:
--------------------------------------------------------------------------------
1 | /// Position of main action button in your bar
2 | enum MainButtonPosition { left, middle, right }
3 |
--------------------------------------------------------------------------------
/lib/src/src.dart:
--------------------------------------------------------------------------------
1 | export 'package:bottom_bar_with_sheet/src/theme/theme.dart';
2 | export 'package:bottom_bar_with_sheet/src/models/models.dart';
3 | export 'package:bottom_bar_with_sheet/src/utils/controller/controller.dart';
4 | export 'bottom_bar_with_sheet_base.dart';
5 |
--------------------------------------------------------------------------------
/lib/src/theme/bottom_bar_with_sheet_theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/src/models/positions.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | // Hello !
5 | // ----------------------------------------------------------------------
6 | // You can check all widget annotations, examples and docs
7 | // In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
8 | // ----------------------------------------------------------------------
9 |
10 | const _kDefaultContentPadding =
11 | EdgeInsets.only(left: 10, right: 10, bottom: 0.0);
12 |
13 | class BottomBarTheme {
14 | /// selected [BottomBarWithSheetItem] icon color
15 | final Color? selectedItemIconColor;
16 |
17 | /// selected [BottomBarWithSheetItem] text style
18 | final TextStyle? selectedItemTextStyle;
19 |
20 | /// UNselected [BottomBarWithSheetItem] icon color
21 | final Color? itemIconColor;
22 |
23 | /// UNselected [BottomBarWithSheetItem] text style
24 | final TextStyle? itemTextStyle;
25 |
26 | /// enum filed that response for the position of MainActionButton position
27 | /// this field have 3 possible values:
28 | ///
29 | /// [MainButtonPosition.left] - button displayed on left side
30 | /// [MainButtonPosition.right] - button displayed on right side
31 | /// [MainButtonPosition.Center] - button displayed on center side
32 | final MainButtonPosition mainButtonPosition;
33 |
34 | /// [BottomBarWithSheet] icons line height
35 | final double height;
36 |
37 | /// [BottomBarWithSheet] height when [_isOpened] == true
38 | final double heightOpened;
39 |
40 | /// [BottomBarWithSheet] height when [_isOpened] == false
41 | final double heightClosed;
42 |
43 | /// [BottomBarWithSheet] widget [BoxDecoration]
44 | final BoxDecoration? decoration;
45 |
46 | /// [EdgeInsets] to create padding between content of widget and sides
47 | final EdgeInsets contentPadding;
48 |
49 | /// [double] size of item icon when item is pressed
50 | final double selectedItemIconSize;
51 |
52 | /// [double] size of item icon when item is not selected
53 | final double itemIconSize;
54 |
55 | /// [bool] makes the labels of the items appear vertically or horizontally.
56 | final bool isVerticalItemLabel;
57 |
58 | const BottomBarTheme({
59 | this.contentPadding = _kDefaultContentPadding,
60 | this.height = 75,
61 | this.heightOpened = 400,
62 | this.heightClosed = 75,
63 | this.selectedItemIconColor,
64 | this.itemIconColor,
65 | this.selectedItemTextStyle,
66 | this.itemTextStyle,
67 | this.mainButtonPosition = MainButtonPosition.middle,
68 | this.decoration,
69 | this.itemIconSize = 22,
70 | this.selectedItemIconSize = 24,
71 | this.isVerticalItemLabel = true,
72 | });
73 | }
74 |
--------------------------------------------------------------------------------
/lib/src/theme/defaults.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/src/theme/bottom_bar_with_sheet_theme.dart';
2 | import 'package:bottom_bar_with_sheet/src/theme/main_action_button_theme.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | const defaultBarTheme = BottomBarTheme();
6 | const defaultMainActionButtonTheme = MainActionButtonTheme();
7 | const defaultMargin = EdgeInsets.all(5);
8 | const defaultCurve = Curves.linear;
9 | const defaultDuration = Duration(milliseconds: 500);
10 |
--------------------------------------------------------------------------------
/lib/src/theme/main_action_button_theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/src/theme/defaults.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | // Hello !
5 | // ----------------------------------------------------------------------
6 | // You can check all widget annotations, examples and docs
7 | // In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
8 | // ----------------------------------------------------------------------
9 |
10 | class MainActionButtonTheme {
11 | /// size of [MainActionButtonTheme]
12 | final double size;
13 |
14 | /// icon that displayed when the
15 | /// [BottomBarWithSheet] field [_isOpened] == false
16 | final Widget? icon;
17 |
18 | /// splash color of widget circle
19 | final Color? splash;
20 |
21 | /// background color of widget circle
22 | final Color? color;
23 |
24 | /// side paddings of [MainActionButton]
25 | final EdgeInsets margin;
26 |
27 | /// This field can set transform location of [MainActionButton]
28 | ///
29 | /// Check https://github.com/Frezyx/bottom_bar_with_sheet for understand more
30 | final Matrix4? transform;
31 |
32 | const MainActionButtonTheme({
33 | this.icon = const Icon(Icons.add, size: 40, color: Colors.white),
34 | this.size = 50,
35 | this.splash,
36 | this.color,
37 | this.margin = defaultMargin,
38 | this.transform,
39 | });
40 | }
41 |
--------------------------------------------------------------------------------
/lib/src/theme/theme.dart:
--------------------------------------------------------------------------------
1 | export 'bottom_bar_with_sheet_theme.dart';
2 | export 'main_action_button_theme.dart';
3 |
--------------------------------------------------------------------------------
/lib/src/utils/controller/controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | class BottomBarWithSheetController {
4 | BottomBarWithSheetController({
5 | required int initialIndex,
6 | bool sheetOpened = false,
7 | this.onItemSelect,
8 | }) : _selectedIndex = initialIndex,
9 | _sheetOpened = sheetOpened;
10 | final _itemsController = StreamController.broadcast();
11 | final _bottomSheetController = StreamController.broadcast();
12 |
13 | Function(int index)? onItemSelect;
14 | int _selectedIndex;
15 | bool _sheetOpened;
16 |
17 | /// Stream to check wich item now selected
18 | Stream get itemsStream => _itemsController.stream;
19 |
20 | /// Stream to check is bottom bar open or close
21 | Stream get stream => _bottomSheetController.stream;
22 |
23 | /// Current selected page (item) of [List] [items]
24 | int get selectedIndex => _selectedIndex;
25 |
26 | /// Is sheet opened
27 | bool get isOpened => _sheetOpened;
28 |
29 | /// Method to select one item of [List] [items]
30 | void selectItem(int val) {
31 | _selectedIndex = val;
32 | _itemsController.add(val);
33 | onItemSelect?.call(val);
34 | }
35 |
36 | /// Method to open / close sheet
37 | /// if [isOpened] == true -> closing sheet
38 | /// if [isOpened] == false -> opening sheet
39 | void toggleSheet() {
40 | _sheetOpened = !_sheetOpened;
41 | _bottomSheetController.add(_sheetOpened);
42 | }
43 |
44 | /// Method to open sheet
45 | void openSheet() {
46 | if (!_sheetOpened) {
47 | _sheetOpened = true;
48 | _bottomSheetController.add(_sheetOpened);
49 | }
50 | }
51 |
52 | /// Method to close sheet
53 | void closeSheet() {
54 | if (_sheetOpened) {
55 | _sheetOpened = false;
56 | _bottomSheetController.add(_sheetOpened);
57 | }
58 | }
59 |
60 | /// Close controller helpers - controllers
61 | /// before stop working with main [BottomBarWithSheetController] controller
62 | Future close() async {
63 | await _itemsController.close();
64 | await _bottomSheetController.close();
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/src/utils/items_generator.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | abstract class ItemsGenerator {
5 | static List generateByButtonPosition({
6 | required Widget mainActionButton,
7 | required List items,
8 | required MainButtonPosition position,
9 | }) {
10 | final _items = [];
11 |
12 | switch (position) {
13 | case MainButtonPosition.right:
14 | _items.addAll(items);
15 | _items.add(mainActionButton);
16 | break;
17 | case MainButtonPosition.left:
18 | _items.add(mainActionButton);
19 | _items.addAll(items);
20 | break;
21 | case MainButtonPosition.middle:
22 | default:
23 | final half = (items.length / 2).round();
24 | _items.addAll(items.getRange(0, half).toList());
25 | _items.add(mainActionButton);
26 | _items.addAll(items.getRange(half, items.length).toList());
27 |
28 | break;
29 | }
30 |
31 | return _items;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/src/utils/utils.dart:
--------------------------------------------------------------------------------
1 | export 'items_generator.dart';
2 | export 'controller/controller.dart';
3 |
--------------------------------------------------------------------------------
/lib/src/widgets/bottom_bar_with_sheet_item.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | /// Hello !
5 | /// ----------------------------------------------------------------------
6 | /// You can check all widget annotations, examples and docs
7 | /// In package repository: https://github.com/Frezyx/bottom_bar_with_sheet
8 | /// ----------------------------------------------------------------------
9 |
10 | class BottomBarWithSheetItemWidget extends StatelessWidget {
11 | const BottomBarWithSheetItemWidget({
12 | Key? key,
13 | required this.model,
14 | required this.isSelected,
15 | required this.noSelectionState,
16 | required this.theme,
17 | }) : super(key: key);
18 |
19 | final BottomBarWithSheetItem model;
20 | final bool isSelected;
21 | final BottomBarTheme theme;
22 |
23 | /// If [noSelectionState] is true then no styling/state change happens when this item is pressed/selected
24 | final bool noSelectionState;
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | final items = _generateItems(context);
29 | if (theme.isVerticalItemLabel) {
30 | return Column(
31 | crossAxisAlignment: CrossAxisAlignment.center,
32 | mainAxisAlignment: MainAxisAlignment.center,
33 | children: items,
34 | );
35 | }
36 | return Row(
37 | crossAxisAlignment: CrossAxisAlignment.center,
38 | children: items,
39 | );
40 | }
41 |
42 | List _generateItems(BuildContext context) {
43 | final items = [
44 | if (!theme.isVerticalItemLabel) Spacer(),
45 | Icon(
46 | model.icon,
47 | color: _getIconColor(context),
48 | size: isSelected ? theme.selectedItemIconSize : theme.itemIconSize,
49 | ),
50 | if (model.label != null)
51 | if (theme.isVerticalItemLabel) ...[
52 | SizedBox(height: 2),
53 | Text(model.label!, style: _getLabelStyle(context)),
54 | ] else ...[
55 | SizedBox(width: 2),
56 | Expanded(
57 | flex: 2,
58 | child: Text(model.label!, style: _getLabelStyle(context)),
59 | ),
60 | ],
61 | ];
62 | return items;
63 | }
64 |
65 | Color? _getIconColor(BuildContext context) {
66 | final bottomNavigationTheme = Theme.of(context).bottomNavigationBarTheme;
67 | return isSelected
68 | ? theme.selectedItemIconColor ?? bottomNavigationTheme.selectedItemColor
69 | : theme.itemIconColor ?? bottomNavigationTheme.unselectedItemColor;
70 | }
71 |
72 | TextStyle? _getLabelStyle(BuildContext context) {
73 | final bottomNavigationTheme = Theme.of(context).bottomNavigationBarTheme;
74 | return isSelected
75 | ? theme.selectedItemTextStyle ??
76 | bottomNavigationTheme.selectedLabelStyle
77 | : theme.itemTextStyle ?? bottomNavigationTheme.selectedLabelStyle;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/lib/src/widgets/bottom_bar_with_sheet_item_controller.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
4 | import 'package:bottom_bar_with_sheet/src/widgets/bottom_bar_with_sheet_item.dart';
5 | import 'package:flutter/material.dart';
6 |
7 | class BottmBarItemController extends StatefulWidget {
8 | const BottmBarItemController({
9 | Key? key,
10 | required this.model,
11 | required this.controller,
12 | required this.index,
13 | required this.theme,
14 | }) : super(key: key);
15 |
16 | final int index;
17 | final BottomBarWithSheetItem model;
18 | final BottomBarWithSheetController controller;
19 | final BottomBarTheme theme;
20 |
21 | @override
22 | _BottmBarItemControllerState createState() => _BottmBarItemControllerState();
23 | }
24 |
25 | class _BottmBarItemControllerState extends State {
26 | late int _selectedIndex;
27 | late StreamSubscription _sub;
28 |
29 | @override
30 | void initState() {
31 | _selectedIndex = widget.controller.selectedIndex;
32 | _sub = widget.controller.itemsStream
33 | .listen((i) => setState(() => _selectedIndex = i));
34 | super.initState();
35 | }
36 |
37 | @override
38 | void dispose() {
39 | _sub.cancel();
40 | super.dispose();
41 | }
42 |
43 | @override
44 | Widget build(BuildContext context) {
45 | return Expanded(
46 | child: InkWell(
47 | focusColor: Colors.transparent,
48 | hoverColor: Colors.transparent,
49 | splashColor: Colors.transparent,
50 | highlightColor: Colors.transparent,
51 | onTap: () => widget.controller.selectItem(widget.index),
52 | child: BottomBarWithSheetItemWidget(
53 | model: widget.model,
54 | theme: widget.theme,
55 | noSelectionState: widget.model.noSelectionState,
56 | isSelected: _selectedIndex == widget.index,
57 | ),
58 | ),
59 | );
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/src/widgets/main_action_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/bottom_bar_with_sheet.dart';
2 | import 'package:flutter/material.dart';
3 | import 'dart:math' as math;
4 |
5 | class MainActionButton extends StatelessWidget {
6 | const MainActionButton({
7 | Key? key,
8 | required this.onTap,
9 | required this.mainActionButtonTheme,
10 | required this.arrowAnimation,
11 | required this.arrowAnimationController,
12 | required this.enable,
13 | this.button,
14 | }) : super(key: key);
15 |
16 | final Function() onTap;
17 | final MainActionButtonTheme mainActionButtonTheme;
18 | final Widget? button;
19 | final AnimationController arrowAnimationController;
20 | final Animation arrowAnimation;
21 | final bool enable;
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | if (!enable) {
26 | return SizedBox();
27 | }
28 | return Container(
29 | color: Colors.transparent,
30 | transform: mainActionButtonTheme.transform ??
31 | Matrix4.translationValues(0.0, 0.0, 0.0),
32 | padding: mainActionButtonTheme.margin,
33 | child: button != null
34 | ? InkWell(
35 | child: button,
36 | onTap: onTap,
37 | )
38 | : ClipOval(
39 | child: Material(
40 | color: _getIconBGColor(context),
41 | child: InkWell(
42 | onTap: onTap,
43 | splashColor: mainActionButtonTheme.splash,
44 | child: AnimatedBuilder(
45 | animation: arrowAnimationController,
46 | builder: (BuildContext context, Widget? child) {
47 | return Transform.rotate(
48 | angle: (arrowAnimation.value * 2.0 * math.pi) as double,
49 | child: child,
50 | );
51 | },
52 | child: SizedBox(
53 | width: mainActionButtonTheme.size,
54 | height: mainActionButtonTheme.size,
55 | child: Opacity(
56 | opacity: 1.0,
57 | child: Center(
58 | child: mainActionButtonTheme.icon,
59 | ),
60 | ),
61 | ),
62 | ),
63 | ),
64 | ),
65 | ),
66 | );
67 | }
68 |
69 | Color? _getIconBGColor(BuildContext context) {
70 | return mainActionButtonTheme.color ?? Theme.of(context).iconTheme.color;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | fake_async:
47 | dependency: transitive
48 | description:
49 | name: fake_async
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.2.0"
53 | flutter:
54 | dependency: "direct main"
55 | description: flutter
56 | source: sdk
57 | version: "0.0.0"
58 | flutter_test:
59 | dependency: "direct dev"
60 | description: flutter
61 | source: sdk
62 | version: "0.0.0"
63 | matcher:
64 | dependency: transitive
65 | description:
66 | name: matcher
67 | url: "https://pub.dartlang.org"
68 | source: hosted
69 | version: "0.12.11"
70 | material_color_utilities:
71 | dependency: transitive
72 | description:
73 | name: material_color_utilities
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.1.3"
77 | meta:
78 | dependency: transitive
79 | description:
80 | name: meta
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "1.7.0"
84 | path:
85 | dependency: transitive
86 | description:
87 | name: path
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.8.0"
91 | sky_engine:
92 | dependency: transitive
93 | description: flutter
94 | source: sdk
95 | version: "0.0.99"
96 | source_span:
97 | dependency: transitive
98 | description:
99 | name: source_span
100 | url: "https://pub.dartlang.org"
101 | source: hosted
102 | version: "1.8.1"
103 | stack_trace:
104 | dependency: transitive
105 | description:
106 | name: stack_trace
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "1.10.0"
110 | stream_channel:
111 | dependency: transitive
112 | description:
113 | name: stream_channel
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "2.1.0"
117 | string_scanner:
118 | dependency: transitive
119 | description:
120 | name: string_scanner
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.1.0"
124 | term_glyph:
125 | dependency: transitive
126 | description:
127 | name: term_glyph
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.2.0"
131 | test_api:
132 | dependency: transitive
133 | description:
134 | name: test_api
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "0.4.8"
138 | typed_data:
139 | dependency: transitive
140 | description:
141 | name: typed_data
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.3.0"
145 | vector_math:
146 | dependency: transitive
147 | description:
148 | name: vector_math
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "2.1.1"
152 | sdks:
153 | dart: ">=2.14.0 <3.0.0"
154 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: bottom_bar_with_sheet
2 | description: This package help you to create bottom bar with FloatingActionButton which buld BottomSheet widget on every page.
3 | version: 2.4.0
4 | homepage: https://github.com/Frezyx/bottom_bar_with_sheet
5 |
6 | environment:
7 | sdk: '>=2.12.0 <3.0.0'
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 |
13 | dev_dependencies:
14 | flutter_test:
15 | sdk: flutter
16 |
17 | flutter:
18 |
19 |
--------------------------------------------------------------------------------
/test/utils/controller/controller_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/src/src.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 |
4 | void main() {
5 | group('BottomBarWithSheetController', () {
6 | late BottomBarWithSheetController _controller;
7 |
8 | setUp(() {
9 | _controller = BottomBarWithSheetController(initialIndex: 0);
10 | });
11 |
12 | test('selectItem', () {
13 | _controller.selectItem(2);
14 |
15 | expect(_controller.selectedIndex, isNotNull);
16 | expect(_controller.selectedIndex, 2);
17 | });
18 |
19 | test('openSheet', () {
20 | _testOpen(_controller);
21 | _testOpen(_controller);
22 | });
23 |
24 | test('openSheet closeSheet', () {
25 | _testOpen(_controller);
26 | _testOpen(_controller);
27 | });
28 |
29 | test('openSheet 2 times', () {
30 | _testOpen(_controller);
31 | _testOpen(_controller);
32 | });
33 |
34 | test('closeSheet', () {
35 | _testClose(_controller);
36 | _testClose(_controller);
37 | });
38 |
39 | test('closeSheet openSheet', () {
40 | _testClose(_controller);
41 | _testOpen(_controller);
42 | });
43 |
44 | test('closeSheet 2 times', () {
45 | _testClose(_controller);
46 | _testClose(_controller);
47 | });
48 |
49 | test('toggleSheet', () {
50 | _testToggle(_controller);
51 | });
52 | });
53 | }
54 |
55 | void _testToggle(BottomBarWithSheetController _controller) {
56 | _controller.toggleSheet();
57 |
58 | expect(_controller.isOpened, isNotNull);
59 | expect(_controller.isOpened, true);
60 |
61 | _controller.toggleSheet();
62 |
63 | expect(_controller.isOpened, isNotNull);
64 | expect(_controller.isOpened, false);
65 | }
66 |
67 | void _testClose(BottomBarWithSheetController _controller) {
68 | _controller.closeSheet();
69 |
70 | expect(_controller.isOpened, isNotNull);
71 | expect(_controller.isOpened, false);
72 | }
73 |
74 | void _testOpen(BottomBarWithSheetController _controller) {
75 | _controller.openSheet();
76 |
77 | expect(_controller.isOpened, isNotNull);
78 | expect(_controller.isOpened, true);
79 | }
80 |
--------------------------------------------------------------------------------
/test/utils/items_generator_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_bar_with_sheet/src/models/positions.dart';
2 | import 'package:bottom_bar_with_sheet/src/utils/utils.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_test/flutter_test.dart';
5 |
6 | void main() {
7 | group('Test_ItemsGenerator', () {
8 | final _mainActionButtonKey = GlobalKey(debugLabel: 'MainButton');
9 |
10 | final _firstItemKey = GlobalKey(debugLabel: 'first');
11 | final _secondItemKey = GlobalKey(debugLabel: 'second');
12 | final _thirdItemKey = GlobalKey(debugLabel: 'third');
13 | final _fourthItemKey = GlobalKey(debugLabel: 'fourth');
14 |
15 | late Widget iconButton;
16 | late List items;
17 |
18 | setUp(() {
19 | iconButton = TextFormField(
20 | key: _mainActionButtonKey,
21 | );
22 | items = [
23 | TextFormField(key: _firstItemKey),
24 | TextFormField(key: _secondItemKey),
25 | TextFormField(key: _thirdItemKey),
26 | TextFormField(key: _fourthItemKey),
27 | ];
28 | });
29 | test('LeftSide_Button', () async {
30 | final generatedItems = ItemsGenerator.generateByButtonPosition(
31 | mainActionButton: iconButton,
32 | items: items,
33 | position: MainButtonPosition.left,
34 | );
35 |
36 | expect(generatedItems, isNotNull);
37 | expect(generatedItems, isList);
38 | expect(generatedItems, isNotEmpty);
39 | expect(generatedItems.first.key, _mainActionButtonKey);
40 | expect(generatedItems[1].key, _firstItemKey);
41 | });
42 |
43 | test('RightSide_Button', () async {
44 | final generatedItems = ItemsGenerator.generateByButtonPosition(
45 | mainActionButton: iconButton,
46 | items: items,
47 | position: MainButtonPosition.right,
48 | );
49 |
50 | expect(generatedItems, isNotNull);
51 | expect(generatedItems, isList);
52 | expect(generatedItems, isNotEmpty);
53 | expect(generatedItems.last.key, _mainActionButtonKey);
54 | expect(generatedItems.first.key, _firstItemKey);
55 | });
56 |
57 | test('CenterSide_Button_Event', () async {
58 | final generatedItems = ItemsGenerator.generateByButtonPosition(
59 | mainActionButton: iconButton,
60 | items: items,
61 | position: MainButtonPosition.middle,
62 | );
63 |
64 | expect(generatedItems, isNotNull);
65 | expect(generatedItems, isList);
66 | expect(generatedItems, isNotEmpty);
67 | expect(generatedItems[2].key, _mainActionButtonKey);
68 | expect(generatedItems.first.key, _firstItemKey);
69 | expect(generatedItems.last.key, _fourthItemKey);
70 | });
71 |
72 | test('CenterSide_Button_NotEvent', () async {
73 | final generatedItems = ItemsGenerator.generateByButtonPosition(
74 | mainActionButton: iconButton,
75 | items: items..removeAt(0),
76 | position: MainButtonPosition.middle,
77 | );
78 |
79 | expect(generatedItems, isNotNull);
80 | expect(generatedItems, isList);
81 | expect(generatedItems, isNotEmpty);
82 | expect(generatedItems[0].key, _secondItemKey);
83 | expect(generatedItems[1].key, _thirdItemKey);
84 | expect(generatedItems[2].key, _mainActionButtonKey);
85 | expect(generatedItems.last.key, _fourthItemKey);
86 | });
87 | });
88 | }
89 |
--------------------------------------------------------------------------------