Skip to content

Commit

Permalink
Merge pull request #20 from shiburagi/Version-1.0.0
Browse files Browse the repository at this point in the history
Feat: 3D effect & elevation config
  • Loading branch information
shiburagi authored Jun 10, 2020
2 parents 76637b3 + 8d90086 commit 7ee7249
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 152 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.3
* Reuse controller when scaffold config update
* Add elevation & corner radius config on SideDrawer
* Add more example
* **Bug fixed**

# 1.0.2
* 3D-effect

Expand Down
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ https://github.com/matthew-carroll/flutter_ui_challenge_zoom_menu
### Todo
- [x] Radius Parameter
- [x] Right Menu View
- [ ] 3D effect
- [x] 3D effect
- [ ] Material design drawer's behavior

### NEW UPDATES
* Floating action button with location and animator
* Bottom navigation bar
* Extended body
* AndroidX support

---
**Version 1.0**
- Elevation Config
- 3D effect
- Multi-Drawer
- Right Drawer
---
**Version 0.0**
- Floating action button with location and animator
- Bottom navigation bar
- Extended body
- AndroidX support
---

## Table of contents
- [Usage](#usage)
Expand Down Expand Up @@ -205,9 +213,7 @@ DrawerScaffold(

## Preview

### Android

<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview-android-1.png?raw=true" width="400px"/>
<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview-ios-1.png?raw=true" width="400px"/>

```dart
new DrawerScaffold(
Expand All @@ -216,19 +222,19 @@ new DrawerScaffold(
percentage: 0.6,
...
)
] ...
]
...
);
```
---

<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview-android-2.png?raw=true" width="400px"/>
<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview_ios_scale_right.png?raw=true" width="400px"/>

```dart
new DrawerScaffold(
headerView: headerView(context),
drawers: [
SideDrawer(
percentage: 0.6,
direction:Direction.right
...
)
]
Expand All @@ -237,14 +243,13 @@ new DrawerScaffold(
```
---

### IOS
<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview-ios-1.png?raw=true" width="400px"/>
<img src="https://github.com/shiburagi/Drawer-Behavior-Flutter/blob/preview/preview_ios_3d.png?raw=true" width="400px"/>

```dart
new DrawerScaffold(
drawers: [
SideDrawer(
percentage: 0.6,
degree: 45,
...
)
]
Expand Down Expand Up @@ -304,17 +309,26 @@ new DrawerScaffold(
DrawerScaffoldController controller;
List<SideDrawer> drawers;
ScreenBuilder builder;
bool enableGestures;
bool enableGestures; // default: true
AppBar appBar;
double cornerRadius;
double cornerRadius; // default: 16
Widget floatingActionButton;
Widget bottomNavigationBar;
FloatingActionButtonLocation floatingActionButtonLocation;
FloatingActionButtonAnimator floatingActionButtonAnimator;
List<BoxShadow> contentShadow;
Widget bottomSheet;
bool extendBodyBehindAppBar;
List<Widget> persistentFooterButtons;
bool primary;
bool resizeToAvoidBottomInset;
bool resizeToAvoidBottomPadding;
```
*SideDrawer*
```dart
double percentage;
double percentage; // default: 0.8
double elevation; // default: 4
double cornerRadius;
double degree; // 15-45 degree
Menu menu;
String selectedItemId;
Expand Down
1 change: 0 additions & 1 deletion example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 0 additions & 1 deletion example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
87 changes: 0 additions & 87 deletions example/ios/Podfile

This file was deleted.

6 changes: 6 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:drawerbehavior_example/pages/drawer_3d.dart';
import 'package:drawerbehavior_example/pages/drawer_custom_item.dart';
import 'package:drawerbehavior_example/pages/drawer_scale.dart';
import 'package:drawerbehavior_example/pages/drawer_scale_icon.dart';
import 'package:drawerbehavior_example/pages/drawer_scale_left_3d_right_slide_.dart';
import 'package:drawerbehavior_example/pages/drawer_scale_left_right.dart';
import 'package:drawerbehavior_example/pages/drawer_scale_left_right_inverse.dart';
import 'package:drawerbehavior_example/pages/drawer_scale_no_animation.dart';
Expand Down Expand Up @@ -83,6 +84,10 @@ class _MyAppState extends State<MyApp> {
text: "Left & Right (Inverse)",
navigate: "/drawer11",
color: Theme.of(context).accentColor),
createButton(context,
text: "Left(3D) & Right(Slide)",
navigate: "/drawer13",
color: Theme.of(context).accentColor),
createButton(context,
text: "Right",
navigate: "/drawer10",
Expand Down Expand Up @@ -123,6 +128,7 @@ class _MyAppState extends State<MyApp> {
"/drawer10": (context) => DrawerRight(),
"/drawer11": (context) => DrawerLeftAndRightInverse(),
"/drawer12": (context) => Drawer3d(),
"/drawer13": (context) => DrawerLeft3DAndRightSlide(),

},
);
Expand Down
20 changes: 17 additions & 3 deletions example/lib/pages/drawer_3d.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ class _Drawer3dState extends State<Drawer3d> {
Widget build(BuildContext context) {
return DrawerScaffold(
appBar: AppBar(
title: Text("Drawer - Scale"),
title: Text("Drawer - 3D"),
actions: [IconButton(icon: Icon(Icons.add), onPressed: () {})]),
drawers: [
SideDrawer(
degree:180,
percentage: 0.8,
degree: 45,
menu: menu,
direction: Direction.left,
animation: true,
Expand All @@ -35,7 +36,20 @@ class _Drawer3dState extends State<Drawer3d> {
selectedMenuItemId = itemId;
});
},
)
),
SideDrawer(
degree: 45,
menu: menu,
direction: Direction.right,
animation: true,
color: Theme.of(context).primaryColor,
selectedItemId: selectedMenuItemId,
onMenuItemSelected: (itemId) {
setState(() {
selectedMenuItemId = itemId;
});
},
),
],
builder: (context, id) => IndexedStack(
index: id,
Expand Down
72 changes: 72 additions & 0 deletions example/lib/pages/drawer_scale_left_3d_right_slide_.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import 'package:drawerbehavior/drawerbehavior.dart';
import 'package:drawerbehavior_example/menus/main.dart';
import 'package:flutter/material.dart';

class DrawerLeft3DAndRightSlide extends StatefulWidget {
@override
_DrawerLeft3DAndRightSlideState createState() =>
_DrawerLeft3DAndRightSlideState();
}

class _DrawerLeft3DAndRightSlideState extends State<DrawerLeft3DAndRightSlide> {
int selectedMenuItemId;
DrawerScaffoldController controller = DrawerScaffoldController();
@override
void initState() {
selectedMenuItemId = menu.items[0].id;
super.initState();
}

@override
Widget build(BuildContext context) {
return DrawerScaffold(
controller: controller,
appBar: AppBar(title: Text("Drawer - Left(3D) & Right(Slide)"), actions: [
IconButton(
icon: Icon(Icons.notifications_none),
onPressed: () {
controller.toggle(Direction.right);
})
]),
drawers: [
SideDrawer(
percentage: 0.6,
degree: 45,
menu: menu,
direction: Direction.left,
animation: true,
color: Theme.of(context).primaryColor,
selectedItemId: selectedMenuItemId,
onMenuItemSelected: (itemId) {
setState(() {
selectedMenuItemId = itemId;
});
},
),
SideDrawer(
cornerRadius: 0,
menu: menu,
percentage: 1.0,
direction: Direction.right,
animation: true,
selectorColor: Colors.white,
color: Theme.of(context).accentColor,
selectedItemId: selectedMenuItemId,
onMenuItemSelected: (itemId) {
setState(() {
selectedMenuItemId = itemId;
});
},
),
],
builder: (context, id) => IndexedStack(
index: id,
children: menu.items
.map((e) => Center(
child: Text("Page~${e.title}"),
))
.toList(),
),
);
}
}
3 changes: 1 addition & 2 deletions example/lib/pages/drawer_scale_right.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class _DrawerRightState extends State<DrawerRight> {
menu: menu,
direction: Direction.right,
animation: true,
selectorColor: Colors.white,
color: Theme.of(context).accentColor,
color: Theme.of(context).primaryColor,
selectedItemId: selectedMenuItemId,
onMenuItemSelected: (itemId) {
setState(() {
Expand Down
Loading

0 comments on commit 7ee7249

Please sign in to comment.