Skip to content

Commit

Permalink
- Improve code document
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilVadoliya committed Nov 30, 2020
1 parent 9394467 commit d79e54f
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.2.1] - Release

* Improve code document

## [1.2.0] - Release

* Implement swipe to open feature for sliderDirection **LEFT_TO_RIGHT** and **RIGHT_TO_LEFT**.
Expand Down
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,24 @@ dependencies:
# Code
```
Scaffold(
body:SliderMenuContainer(
appBarColor: Colors.white,
key: _key,
sliderMenuOpenSize: 200,
title: Text(
title,
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
),
sliderMenu: MenuWidget(
onItemClick: (title) {
_key.currentState.closeDrawer();
setState(() {
this.title = title;
});
},
),
sliderMain: MainWidget()),
),
return SliderMenuContainer(
appBarColor: Colors.white,
key: _key,
sliderMenuOpenSize: 200,
title: Text(
title,
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
),
sliderMenu: MenuWidget(
onItemClick: (title) {
_key.currentState.closeDrawer();
setState(() {
this.title = title;
});
},
),
sliderMain: MainWidget());

```


Expand Down
109 changes: 107 additions & 2 deletions lib/src/slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,141 @@ import 'package:flutter_slider_drawer/src/menu_bar.dart';
import 'package:flutter_slider_drawer/src/helper/utils.dart';
import 'package:flutter_slider_drawer/src/slider_direction.dart';

/// SliderMenuContainer which have two [sliderMain] and [sliderMenu] parameter
///
///For Example :
///
/// SliderMenuContainer(
/// appBarColor: Colors.white,
/// sliderMenuOpenSize: 200,
/// title: Text(
/// title,
/// style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
/// ),
/// sliderMenu: MenuWidget(
/// onItemClick: (title) {
/// _key.currentState.closeDrawer();
/// setState(() {
/// this.title = title;
/// });
/// },
/// ),
/// sliderMain: MainWidget())
///
///
///
class SliderMenuContainer extends StatefulWidget {

/// [Widget] which display when user open drawer
///
final Widget sliderMenu;

/// [Widget] main screen widget
///
final Widget sliderMain;

/// [int] you can changes sliderDrawer open/close animation times with this [animationDuration]
/// parameter
///
final int animationDuration;

/// [double] you can change open drawer size by this parameter [sliderMenuOpenSize]
///
final double sliderMenuOpenSize;

///[double] you can change close drawer size by this parameter [sliderMenuCloseSize]
/// by Default it is 0. if you set 30 then drawer will not close full it will display 30 size of width always
///
final double sliderMenuCloseSize;

///[bool] if you set [false] then swipe to open feature disable.
///By Default it's true
///
final bool isDraggable;

///[bool] if you set [false] then it will not display app bar
///
final bool hasAppBar;

///[Color] you can change drawer icon by this parameter [drawerIconColor]
///
final Color drawerIconColor;

///[Widget] you can change drawer icon by this parameter [drawerIcon]
///
final Widget drawerIcon;

///[double] you can change drawer icon size by this parameter [drawerIconSize]
///
final double drawerIconSize;

/// The primary color of the button when the drawer button is in the down (pressed) state.
/// The splash is represented as a circular overlay that appears above the
/// [highlightColor] overlay. The splash overlay has a center point that matches
/// the hit point of the user touch event. The splash overlay will expand to
/// fill the button area if the touch is held for long enough time. If the splash
/// color has transparency then the highlight and drawer button color will show through.
///
/// Defaults to the Theme's splash color, [ThemeData.splashColor].
///
final Color splashColor;

/// [double] you can change appBar height by this parameter [appBarHeight]
///
final double appBarHeight;

/// [Widget] you can set appbar title by this parameter [title]
///
final Widget title;

///[bool] you can set title in center by this parameter
/// By default it's [true]
///
final bool isTitleCenter;

///[bool] you can enable shadow of [sliderMain] Widget by this parameter
///By default it's [false]
///
final bool isShadow;

///[Color] you can change shadow color by this parameter [shadowColor]
///
final Color shadowColor;

///[double] you can change blurRadius of shadow by this parameter [shadowBlurRadius]
///
final double shadowBlurRadius;

///[double] you can change spreadRadius of shadow by this parameter [shadowSpreadRadius]
///
final double shadowSpreadRadius;

///[Widget] you can set trailing of appbar by this parameter [trailing]
///
final Widget trailing;

///[Color] you can change appbar color by this parameter [appBarColor]
///
final Color appBarColor;

///[EdgeInsets] you can change appBarPadding by this parameter [appBarPadding]
///
final EdgeInsets appBarPadding;

///[slideDirection] you can change slide direction by this parameter [slideDirection]
///There are three type of [SlideDirection]
///[SlideDirection.RIGHT_TO_LEFT]
///[SlideDirection.LEFT_TO_RIGHT]
///[SlideDirection.TOP_TO_BOTTOM]
///
/// By default it's [SlideDirection.LEFT_TO_RIGHT]
///
final SlideDirection slideDirection;

const SliderMenuContainer({
Key key,
this.sliderMenu,
this.sliderMain,
@required this.sliderMenu,
@required this.sliderMain,
this.isDraggable = true,
this.animationDuration = 200,
this.sliderMenuOpenSize = 265,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_slider_drawer
description: A Flutter package with custom implementation of the Slider Drawer Menu
version: 1.2.0
version: 1.2.1
homepage: https://github.com/NikhilVadoliya/Flutter_slider_drawer

environment:
Expand Down

0 comments on commit d79e54f

Please sign in to comment.