-bug fixed

master
nikhil-concetto 5 years ago
parent aa2588ab07
commit 9c3aeea2d3

@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- fluttersliderdrawer (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- fluttersliderdrawer (from `.symlinks/plugins/fluttersliderdrawer/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
fluttersliderdrawer:
:path: ".symlinks/plugins/fluttersliderdrawer/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
fluttersliderdrawer: a3c3b17a7d7de2d709ca9544c33926fa1cf04599
PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
COCOAPODS: 1.9.1

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 46; objectVersion = 50;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -13,6 +13,7 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
E2DC772DA064DAD1218F1348 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A99782F0B462F8C4BEE73C68 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
@ -32,6 +33,8 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5D209B9DE3AFF206E65E105A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
69D4550086E09AA52FB25DFB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@ -42,6 +45,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A99782F0B462F8C4BEE73C68 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DBB75A7BE70B2C9041BB687E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -49,12 +54,32 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
E2DC772DA064DAD1218F1348 /* Pods_Runner.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
116E822471D12D67044264DC /* Pods */ = {
isa = PBXGroup;
children = (
69D4550086E09AA52FB25DFB /* Pods-Runner.debug.xcconfig */,
DBB75A7BE70B2C9041BB687E /* Pods-Runner.release.xcconfig */,
5D209B9DE3AFF206E65E105A /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
23100A4009331B2FFDC3A88B /* Frameworks */ = {
isa = PBXGroup;
children = (
A99782F0B462F8C4BEE73C68 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -72,6 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */, 9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
116E822471D12D67044264DC /* Pods */,
23100A4009331B2FFDC3A88B /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -113,12 +140,14 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
E29CE29F4567019763CC96D5 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
8EDAAD5A5B453CAFE29F0875 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -191,6 +220,23 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
8EDAAD5A5B453CAFE29F0875 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -205,6 +251,28 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
}; };
E29CE29F4567019763CC96D5 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
@ -303,7 +371,10 @@
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -418,7 +489,8 @@
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@ -431,18 +503,22 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = V8XSLU6QKH;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.fluttersliderdrawerExample; PRODUCT_BUNDLE_IDENTIFIER = com.concettolabs.test1;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -464,7 +540,10 @@
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",

@ -4,4 +4,7 @@
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "group:Runner.xcodeproj">
</FileRef> </FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace> </Workspace>

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:async'; import 'dart:async';
import 'package:fluttersliderdrawer/fluttersliderdrawer.dart'; import 'package:fluttersliderdrawer/flutter_slider_drawer.dart';
import 'package:fluttersliderdrawer_example/main_widget.dart'; import 'package:fluttersliderdrawer_example/main_widget.dart';
import 'package:fluttersliderdrawer_example/menu_widget.dart'; import 'package:fluttersliderdrawer_example/menu_widget.dart';
@ -17,25 +17,36 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
GlobalKey<SliderMenuContainerState> _key = GlobalKey<SliderMenuContainerState> _key =
new GlobalKey<SliderMenuContainerState>(); new GlobalKey<SliderMenuContainerState>();
String title;
@override @override
void initState() { void initState() {
title = "Home";
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold( home: Scaffold(
body: SliderMenuContainer( body: SliderMenuContainer(
appBarColor: Colors.white,
key: _key, key: _key,
appBarPadding: const EdgeInsets.only(top: 30), appBarPadding: const EdgeInsets.only(top: 20),
sliderMenuOffset: 250, sliderMenuOpenOffset: 250,
titleTextStyle: TextStyle( // sliderMenuCloseOffset: 50,
color: Colors.black, fontWeight: FontWeight.bold, fontSize: 20), appBarHeight: 60,
title: Text(
title,
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700),
),
sliderMenuWidget: MenuWidget( sliderMenuWidget: MenuWidget(
onItemClick: () { onItemClick: (title) {
_key.currentState.closeDrawer(); _key.currentState.closeDrawer();
setState(() {
this.title = title;
});
}, },
), ),
sliderMainWidget: MainWidget()), sliderMainWidget: MainWidget()),

@ -26,53 +26,57 @@ class _MainWidgetState extends State<MainWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.separated( return Container(
padding: const EdgeInsets.symmetric(horizontal: 10), child: ListView.separated(
itemBuilder: (buider, index) { padding: const EdgeInsets.symmetric(horizontal: 10),
return LimitedBox( itemBuilder: (buider, index) {
maxHeight: 150, return LimitedBox(
child: Container( maxHeight: 150,
decoration: new BoxDecoration( child: Container(
color: dataList[index].color, decoration: new BoxDecoration(
borderRadius: new BorderRadius.all( color: dataList[index].color,
const Radius.circular(10.0), borderRadius: new BorderRadius.all(
)), const Radius.circular(10.0),
child: Column( )),
mainAxisSize: MainAxisSize.min, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: <Widget>[
padding: const EdgeInsets.all(15), Padding(
child: Text( padding: const EdgeInsets.all(12),
dataList[index].name, child: Text(
style: TextStyle( dataList[index].name,
fontFamily: 'BalsamiqSans_Blod', style: TextStyle(
fontSize: 30, fontFamily: 'BalsamiqSans_Blod',
color: Colors.white), fontSize: 30,
color: Colors.white),
),
), ),
), Padding(
Padding( padding: const EdgeInsets.all(10),
padding: const EdgeInsets.all(15), child: Flexible(
child: Text( child: Text(
dataList[index].detail, dataList[index].detail,
style: TextStyle( style: TextStyle(
fontFamily: 'BalsamiqSans_Regular', fontFamily: 'BalsamiqSans_Regular',
fontSize: 20, fontSize: 15,
color: Colors.white), color: Colors.white),
), ),
) ),
], )
],
),
), ),
), );
); },
}, separatorBuilder: (builder, index) {
separatorBuilder: (builder, index) { return Divider(
return Divider( height: 10,
height: 10, thickness: 0,
thickness: 0, );
); },
}, itemCount: dataList.length),
itemCount: dataList.length); );
} }
} }

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MenuWidget extends StatelessWidget { class MenuWidget extends StatelessWidget {
final Function onItemClick; final Function(String) onItemClick;
const MenuWidget({Key key, this.onItemClick}) : super(key: key); const MenuWidget({Key key, this.onItemClick}) : super(key: key);
@ -59,5 +59,7 @@ class MenuWidget extends StatelessWidget {
icons, icons,
color: Colors.black, color: Colors.black,
), ),
onTap: onItemClick); onTap: () {
onItemClick(title);
});
} }

@ -0,0 +1 @@
export 'slider_drawer_widget.dart';

@ -1 +0,0 @@
export 'slider_drawe_widget.dart';

@ -4,12 +4,15 @@ class SliderMenuContainer extends StatefulWidget {
final Widget sliderMenuWidget; final Widget sliderMenuWidget;
final Widget sliderMainWidget; final Widget sliderMainWidget;
final int sliderAnimationTimeInMilliseconds; final int sliderAnimationTimeInMilliseconds;
final double sliderMenuOffset; final double sliderMenuOpenOffset;
final double sliderMenuCloseOffset;
/*final double sliderMainOffset;*/ /*final double sliderMainOffset;*/
final Color drawerIconColor; final Color drawerIconColor;
final Widget drawerIcon; final Widget drawerIcon;
final TextStyle titleTextStyle; final double drawerIconSize;
final double appBarHeight;
final Widget title;
final bool isTitleCenter; final bool isTitleCenter;
final Widget trailing; final Widget trailing;
final Color appBarColor; final Color appBarColor;
@ -20,14 +23,17 @@ class SliderMenuContainer extends StatefulWidget {
this.sliderMenuWidget, this.sliderMenuWidget,
this.sliderMainWidget, this.sliderMainWidget,
this.sliderAnimationTimeInMilliseconds = 200, this.sliderAnimationTimeInMilliseconds = 200,
this.sliderMenuOffset = 265, this.sliderMenuOpenOffset = 265,
this.drawerIconColor = Colors.black, this.drawerIconColor = Colors.black,
this.drawerIcon, this.drawerIcon,
this.titleTextStyle,
this.isTitleCenter = true, this.isTitleCenter = true,
this.trailing, this.trailing,
this.appBarColor = Colors.white, this.appBarColor = Colors.white,
this.appBarPadding, this.appBarPadding,
this.title,
this.drawerIconSize = 27,
this.appBarHeight,
this.sliderMenuCloseOffset = 0,
/* this.sliderMainOffset = 0*/ /* this.sliderMainOffset = 0*/
}) : assert(sliderMenuWidget != null), }) : assert(sliderMenuWidget != null),
assert(sliderMainWidget != null), assert(sliderMainWidget != null),
@ -43,19 +49,22 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
double _slideBarYOffset = 0; double _slideBarYOffset = 0;
bool _isSlideBarOpen = false; bool _isSlideBarOpen = false;
AnimationController _animationController; AnimationController _animationController;
double _pageScale = 1; double _pageScale = 1;
Widget drawerIcon; Widget drawerIcon;
double db = 0; double db = 0;
bool get isDrawerOpen => _isSlideBarOpen; bool get isDrawerOpen => _isSlideBarOpen;
Animation<double> _translationValues;
void toggle() { void toggle() {
setState(() { setState(() {
_isSlideBarOpen _isSlideBarOpen
? _animationController.forward() ? _animationController.forward()
: _animationController.reverse(); : _animationController.reverse();
_slideBarXOffset = _isSlideBarOpen ? widget.sliderMenuOffset : 0; _slideBarXOffset = _isSlideBarOpen
? widget.sliderMenuOpenOffset
: widget.sliderMenuCloseOffset;
// _slideBarYOffset = _isSlideBarOpen ? widget.sliderMainOffset : 0; // _slideBarYOffset = _isSlideBarOpen ? widget.sliderMainOffset : 0;
_pageScale = _isSlideBarOpen ? 0.8 : 1; _pageScale = _isSlideBarOpen ? 0.8 : 1;
}); });
@ -64,7 +73,7 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
void openDrawer() { void openDrawer() {
setState(() { setState(() {
_animationController.forward(); _animationController.forward();
_slideBarXOffset = widget.sliderMenuOffset; _slideBarXOffset = widget.sliderMenuOpenOffset;
// _slideBarYOffset = widget.sliderMainOffset; // _slideBarYOffset = widget.sliderMainOffset;
_pageScale = 0.8; _pageScale = 0.8;
}); });
@ -73,7 +82,7 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
void closeDrawer() { void closeDrawer() {
setState(() { setState(() {
_animationController.reverse(); _animationController.reverse();
_slideBarXOffset = 0; _slideBarXOffset = widget.sliderMenuCloseOffset;
_slideBarYOffset = 0; _slideBarYOffset = 0;
_pageScale = 1; _pageScale = 1;
}); });
@ -83,6 +92,7 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
void initState() { void initState() {
super.initState(); super.initState();
_animationController = AnimationController( _animationController = AnimationController(
vsync: this, vsync: this,
duration: duration:
@ -92,31 +102,36 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: Container( child: Stack(children: <Widget>[
child: Stack(children: <Widget>[ Container(
Container( width: widget.sliderMenuOpenOffset,
width: widget.sliderMenuOffset, child: widget.sliderMenuWidget,
child: widget.sliderMenuWidget, ),
), AnimatedContainer(
AnimatedContainer( duration:
padding: widget.appBarPadding ?? const EdgeInsets.only(top: 24), Duration(milliseconds: widget.sliderAnimationTimeInMilliseconds),
duration: Duration( curve: Curves.easeIn,
milliseconds: widget.sliderAnimationTimeInMilliseconds), width: double.infinity,
curve: Curves.easeIn, height: double.infinity,
width: double.infinity, color: Colors.white,
height: double.infinity, transform: Matrix4.translationValues(
transform: Matrix4.translationValues( _slideBarXOffset, _slideBarYOffset, 1.0),
_slideBarXOffset, _slideBarYOffset, 1.0), child: Column(
color: widget.appBarColor, children: <Widget>[
child: Column( Container(
children: <Widget>[ padding: widget.appBarPadding ?? const EdgeInsets.only(top: 24),
Row( color: widget.appBarColor,
child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(
height: widget.appBarHeight ?? 0,
),
widget.drawerIcon ?? widget.drawerIcon ??
IconButton( IconButton(
icon: AnimatedIcon( icon: AnimatedIcon(
icon: AnimatedIcons.menu_close, icon: AnimatedIcons.menu_close,
color: widget.drawerIconColor, color: widget.drawerIconColor,
size: widget.drawerIconSize,
progress: _animationController), progress: _animationController),
onPressed: () { onPressed: () {
_isSlideBarOpen = !_isSlideBarOpen; _isSlideBarOpen = !_isSlideBarOpen;
@ -125,9 +140,9 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
Expanded( Expanded(
child: widget.isTitleCenter child: widget.isTitleCenter
? Center( ? Center(
child: _titleWidget(), child: widget.title,
) )
: _titleWidget(), : widget.title,
), ),
widget.trailing ?? widget.trailing ??
SizedBox( SizedBox(
@ -135,11 +150,11 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
) )
], ],
), ),
Expanded(child: widget.sliderMainWidget), ),
], Expanded(child: widget.sliderMainWidget),
)), ],
])), )),
); ]));
} }
@override @override
@ -147,10 +162,4 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
super.dispose(); super.dispose();
_animationController.dispose(); _animationController.dispose();
} }
_titleWidget() => Text(
'Title',
textAlign: TextAlign.center,
style: widget.titleTextStyle ?? TextStyle(color: Colors.black),
);
} }

@ -1,6 +1,6 @@
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:fluttersliderdrawer/fluttersliderdrawer.dart'; import 'package:fluttersliderdrawer/flutter_slider_drawer.dart';
void main() { void main() {
const MethodChannel channel = MethodChannel('fluttersliderdrawer'); const MethodChannel channel = MethodChannel('fluttersliderdrawer');

Loading…
Cancel
Save