fearture_request#18 : done

- Provide customer app support
master
NikhilVadoliya 3 years ago
parent 650953b04e
commit f239fb39bb

@ -4,10 +4,8 @@ import 'package:flutter_slider_drawer/src/helper/slider_app_bar.dart';
import 'package:flutter_slider_drawer/src/slider_direction.dart';
class SAppBar extends StatelessWidget {
final Widget? drawerIcon;
final Color splashColor;
final Color drawerIconColor;
final double drawerIconSize;
final AnimationController animationController;
final VoidCallback onTap;
final SlideDirection slideDirection;
@ -16,10 +14,7 @@ class SAppBar extends StatelessWidget {
const SAppBar(
{Key? key,
this.drawerIcon,
this.splashColor = Colors.black,
this.drawerIconColor = Colors.black87,
this.drawerIconSize = 27,
required this.animationController,
required this.onTap,
required this.slideDirection,
@ -40,13 +35,13 @@ class SAppBar extends StatelessWidget {
List<Widget> appBar() {
List<Widget> list = [
drawerIcon ??
sliderAppBar.drawerIcon ??
IconButton(
splashColor: splashColor,
icon: AnimatedIcon(
icon: AnimatedIcons.menu_close,
color: drawerIconColor,
size: drawerIconSize,
color: sliderAppBar.drawerIconColor,
size: sliderAppBar.drawerIconSize,
progress: animationController),
onPressed: () => onTap()),
Expanded(

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
class SliderAppBar {
class SliderAppBar extends StatelessWidget {
/// [double] you can change appBar height by this parameter [appBarHeight]
///
final double appBarHeight;
@ -40,7 +40,10 @@ class SliderAppBar {
const SliderAppBar({
this.appBarHeight = 70,
this.title = const Text('AppBar'),
this.title = const Text(
'AppBar',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 20),
),
this.isTitleCenter = true,
this.appBarColor = Colors.white,
this.appBarPadding = const EdgeInsets.only(top: 24),
@ -49,4 +52,9 @@ class SliderAppBar {
this.drawerIcon,
this.drawerIconSize = 27,
});
@override
Widget build(BuildContext context) {
return Offstage();
}
}

@ -62,7 +62,7 @@ class SliderDrawer extends StatefulWidget {
///[appBar] if you set [null] then it will not display app bar
///
final SliderAppBar? appBar;
final Widget? appBar;
/// 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
@ -153,6 +153,10 @@ class SliderDrawerState extends State<SliderDrawer>
@override
Widget build(BuildContext context) {
Color appBarColor = Colors.white;
if (widget.appBar is SliderAppBar) {
appBarColor = (widget.appBar as SliderAppBar).appBarColor;
}
return LayoutBuilder(builder: (context, constrain) {
return Container(
child: Stack(children: <Widget>[
@ -193,20 +197,19 @@ class SliderDrawerState extends State<SliderDrawer>
child: Container(
width: double.infinity,
height: double.infinity,
color: widget.appBar?.appBarColor ?? Colors.transparent,
color: appBarColor,
child: Column(
children: <Widget>[
if (widget.appBar != null)
if (widget.appBar != null && widget.appBar is SliderAppBar)
SAppBar(
slideDirection: widget.slideDirection,
onTap: () => toggle(),
animationController: _animationDrawerController!,
drawerIcon: widget.appBar!.drawerIcon,
drawerIconColor: widget.appBar!.drawerIconColor,
drawerIconSize: widget.appBar!.drawerIconSize,
splashColor: widget.splashColor,
sliderAppBar: widget.appBar!,
sliderAppBar: widget.appBar as SliderAppBar,
),
if (widget.appBar != null && widget.appBar is! SliderAppBar)
widget.appBar!,
Expanded(child: widget.child),
],
),
@ -296,7 +299,6 @@ class SliderDrawerState extends State<SliderDrawer>
move(double percent) {
_percent = percent;
_animationDrawerController!.value = percent;
//_animationDrawerController!.notifyListeners();
}
openOrClose() {

Loading…
Cancel
Save