Skip to content

Commit

Permalink
initial commit - v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
medyas committed Mar 29, 2020
0 parents commit 041b2fb
Show file tree
Hide file tree
Showing 71 changed files with 2,674 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
channel: stable

project_type: package
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# [0.0.1] - Initial release.

* Initial package release.
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Contributing to the Flutter Zoom Drawer package
=============================================

What you will need
------------------

* A Linux, Mac OS X, or Windows machine (note: to run and compile iOS specific parts you'll need access to a Mac OS X machine);
* git (used for source version control, installation instruction can be found [here](https://git-scm.com/));
* The Flutter SDK (installation instructions can be found [here](https://flutter.io/get-started/install/));
* A personal GitHub account (if you don't have one, you can sign-up for free [here](https://github.com/))

Setting up your development environment
---------------------------------------

* Fork `https://github.com/medyas/flutter_zoom_drawer` into your own GitHub account. If you already have a fork and moving to a new computer, make sure you update you fork.
* If you haven't configured your machine with an SSH key that's known to github, then
follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/)
to generate an SSH key.
* Clone your forked repo on your local development machine: `git clone [email protected]:<your_name_here>/flutter_zoom_drawer.git`
* Change into the `flutter_zoom_drawer` directory: `cd flutter_zoom_drawer`
* Add an upstream to the original repo, so that fetch from the master repository and not your clone: `git remote add upstream [email protected]:medyas/flutter_zoom_drawer.git`

Running the example project
---------------------------

* Change into the example directory: `cd example`
* Run the App: `flutter run`

Contribute
----------

We really appreciate contributions via GitHub pull requests. To contribute take the following steps:

* Make sure you are up to date with the latest code on the master:
* `git fetch upstream`
* `git checkout upstream/develop -b <name_of_your_branch>`
* Apply your changes
* Verify your changes and fix potential warnings/ errors:
* Check formatting: `flutter format .`
* Run static analyses: `flutter analyze`
* Run unit-tests: `flutter test`
* Commit your changes: `git commit -am "<your informative commit message>"`
* Push changes to your fork: `git push origin <name_of_your_branch>`

Send us your pull request:

* Go to `https://github.com/medyas/flutter_zoom_drawer` and click the "Compare & pull request" button.

Please make sure you solved all warnings and errors reported by the static code analyses and that you fill in the full pull request template. Failing to do so will result in us asking you to fix it.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 medyas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Flutter Zoom Drawer

[![pub package](https://img.shields.io/pub/v/flutter_zoom_drawer.svg)](https://pub.dev/packages/flutter_zoom_drawer) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A Flutter package with custom implementation of the Drawer

## Getting Started

To start using this package, add `flutter_zoom_drawer` dependency to your `pubspec.yaml`

```yaml
dependencies:
flutter_zoom_drawer: '<latest_release>'
```
## Features
* Simple sliding drawer
* Sliding drawer with rotation
* Sliding drawer with rotation and shadows
* Support both LTR & RTL
## Documentation
```dart
ZoomDrawer(
controller: ZoomDrawerController,
menuScreen: MENU_SCREEN,
mainScreen: MAIN_SCREEN,
borderRadius: 24.0,
showShadow: true,
angle: -12.0,
backgroundColor: Colors.grey[300],
slideWidth: MediaQuery.of(context).size.width*.65,
)
```

| Parameters | Value | Required | Docs |
| ------------------ |----------------------- | :-------: | --------------------------------------------------------------------------- |
| `controller` | `ZoomDrawerController` | No | Controller to have access to the open/close/toggle function of the drawer |
| `mainScreen` | `Widget` | Yes | Screen containing the menu/bottom screen |
| `menuScreen` | `Widget` | Yes | Screen containing the main content to display |
| `slideWidth` | `double` | No | Sliding width of the drawer - defaults to 275.0 |
| `borderRadius` | `double` | No | Border radius of the slided content - defaults to 16.0 |
| `angle` | `double` | No | Rotation angle of the drawer - defaults to -12.0 - should be 0.0 to -30.0 |
| `backgroundColor` | `Color` | No | Background color of the drawer shadows - defaults to white |
| `showShadow` | `bool` | No | Boolean, whether to show the drawer shadows - defaults to false |


### Controlling the drawer

To get access to the drawer, and be able to control it, there are 2 ways:

* Using a `ZoomDrawerController` inside the main widget where ou have the `ZoomDrawer` widget and providing it to the widget, which will allow you to trigger the open/close/toggle methods.
```dart
final _drawerController = ZoomDrawerController();
_drawerController.open();
_drawerController.close();
_drawerController.toggle();
```

* Using the static method inside ancestor widgets to get access to the `ZoomDrawer`.
```dart
ZoomDrawer.of(context).open();
ZoomDrawer.of(context).close();
ZoomDrawer.of(context).toggle();
```

## Screens

![Example app Demo](https://drive.google.com/uc?export=view&id=1xc6XwVVtpl0RK9IJEdheagM4d1ychQms)

* Drawer Sliding
![Drawer Sliding](https://drive.google.com/uc?export=view&id=1axuT4Geh08s_QjmED9VTZiwZ9dC_C17C)
* Drawer Sliding with rotation
![GPS Disabled](https://drive.google.com/uc?export=view&id=1xVYoZHnS9BFi5KicZtP3DY1vEiwZ4FyH)
* Drawer Sliding with rotation and shadows
![Qiblah with maps](https://drive.google.com/uc?export=view&id=1b-U25tIY36ka75Ju2jQT9BIUVHv-oNe6)

## Issues

Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/medyas/flutter_zoom_drawer/issues) page.

## Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](CONTRIBUTING.md) and send us your [pull request](https://github.com/medyas/flutter_zoom_drawer/pulls).

## Credits

Credits goes to [pedromassango](https://github.com/pedromassango/flutter_delivery) as most of this package comes from his implementation.
37 changes: 37 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
channel: stable

project_type: app
52 changes: 52 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Flutter Zoom Drawer example

A new Flutter project demonstrating the use of Flutter Zoom Drawer package.

## Getting Started

The checkout the full example :memo: [Example Code](https://github.com/medyas/flutter_zoom_drawer/tree/master/example/)

```dart
class HomeScreen extends StatefulWidget {
static const List<MenuItem> MAIN_MENU = [
MenuItem("Payment", Icons.payment, 0),
MenuItem("Promos", Icons.card_giftcard, 1),
MenuItem("Notification", Icons.notifications, 2),
MenuItem("Help", Icons.help, 3),
MenuItem("About Us", Icons.info_outline, 4),
MenuItem("Rate Us", Icons.star_border, 5),
];
@override
_HomeScreenState createState() => new _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
final _drawerController = ZoomDrawerController();
int _currentPage = 0;
@override
Widget build(BuildContext context) {
return ZoomDrawer(
controller: _drawerController,
menuScreen: MenuScreen(
HomeScreen.MAIN_MENU,
callback: _updatePage,
current: _currentPage,
),
mainScreen: MainScreen(),
borderRadius: 24.0,
showShadow: false,
angle: 0.0,
);
}
void _updatePage(index) {
Provider.of<MenuProvider>(context, listen: false).updateCurrentPage(index);
_drawerController.toggle();
}
}
```

7 changes: 7 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
Loading

0 comments on commit 041b2fb

Please sign in to comment.