From 9c3aeea2d39e5b01a0c7eaaa196256ace9332d39 Mon Sep 17 00:00:00 2001 From: nikhil-concetto Date: Sun, 31 May 2020 17:50:17 +0530 Subject: [PATCH] -bug fixed --- example/ios/Podfile.lock | 22 +++++ example/ios/Runner.xcodeproj/project.pbxproj | 91 ++++++++++++++++-- .../contents.xcworkspacedata | 3 + example/lib/main.dart | 23 +++-- example/lib/main_widget.dart | 94 ++++++++++--------- example/lib/menu_widget.dart | 6 +- lib/flutter_slider_drawer.dart | 1 + lib/fluttersliderdrawer.dart | 1 - ..._widget.dart => slider_drawer_widget.dart} | 89 ++++++++++-------- test/fluttersliderdrawer_test.dart | 2 +- 10 files changed, 231 insertions(+), 101 deletions(-) create mode 100644 example/ios/Podfile.lock create mode 100644 lib/flutter_slider_drawer.dart delete mode 100644 lib/fluttersliderdrawer.dart rename lib/{slider_drawe_widget.dart => slider_drawer_widget.dart} (64%) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock new file mode 100644 index 0000000..2311293 --- /dev/null +++ b/example/ios/Podfile.lock @@ -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 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 6475a4a..867bcec 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 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 */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,6 +33,8 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 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 = ""; }; + 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 = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -42,6 +45,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E2DC772DA064DAD1218F1348 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase 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 = ""; + }; + 23100A4009331B2FFDC3A88B /* Frameworks */ = { + isa = PBXGroup; + children = ( + A99782F0B462F8C4BEE73C68 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 116E822471D12D67044264DC /* Pods */, + 23100A4009331B2FFDC3A88B /* Frameworks */, ); sourceTree = ""; }; @@ -113,12 +140,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + E29CE29F4567019763CC96D5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 8EDAAD5A5B453CAFE29F0875 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -191,6 +220,23 @@ shellPath = /bin/sh; 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 */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -205,6 +251,28 @@ shellPath = /bin/sh; 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 */ /* Begin PBXSourcesBuildPhase section */ @@ -303,7 +371,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -418,7 +489,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -431,18 +503,22 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = V8XSLU6QKH; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.fluttersliderdrawerExample; + PRODUCT_BUNDLE_IDENTIFIER = com.concettolabs.test1; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -464,7 +540,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/example/lib/main.dart b/example/lib/main.dart index f81a8f5..ec7fad3 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; 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/menu_widget.dart'; @@ -17,25 +17,36 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { GlobalKey _key = new GlobalKey(); + String title; @override void initState() { + title = "Home"; super.initState(); } @override Widget build(BuildContext context) { return MaterialApp( + debugShowCheckedModeBanner: false, home: Scaffold( body: SliderMenuContainer( + appBarColor: Colors.white, key: _key, - appBarPadding: const EdgeInsets.only(top: 30), - sliderMenuOffset: 250, - titleTextStyle: TextStyle( - color: Colors.black, fontWeight: FontWeight.bold, fontSize: 20), + appBarPadding: const EdgeInsets.only(top: 20), + sliderMenuOpenOffset: 250, +// sliderMenuCloseOffset: 50, + appBarHeight: 60, + title: Text( + title, + style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700), + ), sliderMenuWidget: MenuWidget( - onItemClick: () { + onItemClick: (title) { _key.currentState.closeDrawer(); + setState(() { + this.title = title; + }); }, ), sliderMainWidget: MainWidget()), diff --git a/example/lib/main_widget.dart b/example/lib/main_widget.dart index 4bd2a38..0dd02d8 100644 --- a/example/lib/main_widget.dart +++ b/example/lib/main_widget.dart @@ -26,53 +26,57 @@ class _MainWidgetState extends State { @override Widget build(BuildContext context) { - return ListView.separated( - padding: const EdgeInsets.symmetric(horizontal: 10), - itemBuilder: (buider, index) { - return LimitedBox( - maxHeight: 150, - child: Container( - decoration: new BoxDecoration( - color: dataList[index].color, - borderRadius: new BorderRadius.all( - const Radius.circular(10.0), - )), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(15), - child: Text( - dataList[index].name, - style: TextStyle( - fontFamily: 'BalsamiqSans_Blod', - fontSize: 30, - color: Colors.white), + return Container( + child: ListView.separated( + padding: const EdgeInsets.symmetric(horizontal: 10), + itemBuilder: (buider, index) { + return LimitedBox( + maxHeight: 150, + child: Container( + decoration: new BoxDecoration( + color: dataList[index].color, + borderRadius: new BorderRadius.all( + const Radius.circular(10.0), + )), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(12), + child: Text( + dataList[index].name, + style: TextStyle( + fontFamily: 'BalsamiqSans_Blod', + fontSize: 30, + color: Colors.white), + ), ), - ), - Padding( - padding: const EdgeInsets.all(15), - child: Text( - dataList[index].detail, - style: TextStyle( - fontFamily: 'BalsamiqSans_Regular', - fontSize: 20, - color: Colors.white), - ), - ) - ], + Padding( + padding: const EdgeInsets.all(10), + child: Flexible( + child: Text( + dataList[index].detail, + style: TextStyle( + fontFamily: 'BalsamiqSans_Regular', + fontSize: 15, + color: Colors.white), + ), + ), + ) + ], + ), ), - ), - ); - }, - separatorBuilder: (builder, index) { - return Divider( - height: 10, - thickness: 0, - ); - }, - itemCount: dataList.length); + ); + }, + separatorBuilder: (builder, index) { + return Divider( + height: 10, + thickness: 0, + ); + }, + itemCount: dataList.length), + ); } } diff --git a/example/lib/menu_widget.dart b/example/lib/menu_widget.dart index be2ffb2..7b7805d 100644 --- a/example/lib/menu_widget.dart +++ b/example/lib/menu_widget.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class MenuWidget extends StatelessWidget { - final Function onItemClick; + final Function(String) onItemClick; const MenuWidget({Key key, this.onItemClick}) : super(key: key); @@ -59,5 +59,7 @@ class MenuWidget extends StatelessWidget { icons, color: Colors.black, ), - onTap: onItemClick); + onTap: () { + onItemClick(title); + }); } diff --git a/lib/flutter_slider_drawer.dart b/lib/flutter_slider_drawer.dart new file mode 100644 index 0000000..b00a2c4 --- /dev/null +++ b/lib/flutter_slider_drawer.dart @@ -0,0 +1 @@ +export 'slider_drawer_widget.dart'; diff --git a/lib/fluttersliderdrawer.dart b/lib/fluttersliderdrawer.dart deleted file mode 100644 index 011e948..0000000 --- a/lib/fluttersliderdrawer.dart +++ /dev/null @@ -1 +0,0 @@ -export 'slider_drawe_widget.dart'; diff --git a/lib/slider_drawe_widget.dart b/lib/slider_drawer_widget.dart similarity index 64% rename from lib/slider_drawe_widget.dart rename to lib/slider_drawer_widget.dart index 0c731b8..1958be3 100644 --- a/lib/slider_drawe_widget.dart +++ b/lib/slider_drawer_widget.dart @@ -4,12 +4,15 @@ class SliderMenuContainer extends StatefulWidget { final Widget sliderMenuWidget; final Widget sliderMainWidget; final int sliderAnimationTimeInMilliseconds; - final double sliderMenuOffset; + final double sliderMenuOpenOffset; + final double sliderMenuCloseOffset; /*final double sliderMainOffset;*/ final Color drawerIconColor; final Widget drawerIcon; - final TextStyle titleTextStyle; + final double drawerIconSize; + final double appBarHeight; + final Widget title; final bool isTitleCenter; final Widget trailing; final Color appBarColor; @@ -20,14 +23,17 @@ class SliderMenuContainer extends StatefulWidget { this.sliderMenuWidget, this.sliderMainWidget, this.sliderAnimationTimeInMilliseconds = 200, - this.sliderMenuOffset = 265, + this.sliderMenuOpenOffset = 265, this.drawerIconColor = Colors.black, this.drawerIcon, - this.titleTextStyle, this.isTitleCenter = true, this.trailing, this.appBarColor = Colors.white, this.appBarPadding, + this.title, + this.drawerIconSize = 27, + this.appBarHeight, + this.sliderMenuCloseOffset = 0, /* this.sliderMainOffset = 0*/ }) : assert(sliderMenuWidget != null), assert(sliderMainWidget != null), @@ -43,19 +49,22 @@ class SliderMenuContainerState extends State double _slideBarYOffset = 0; bool _isSlideBarOpen = false; AnimationController _animationController; - double _pageScale = 1; + double _pageScale = 1; Widget drawerIcon; double db = 0; bool get isDrawerOpen => _isSlideBarOpen; + Animation _translationValues; void toggle() { setState(() { _isSlideBarOpen ? _animationController.forward() : _animationController.reverse(); - _slideBarXOffset = _isSlideBarOpen ? widget.sliderMenuOffset : 0; + _slideBarXOffset = _isSlideBarOpen + ? widget.sliderMenuOpenOffset + : widget.sliderMenuCloseOffset; // _slideBarYOffset = _isSlideBarOpen ? widget.sliderMainOffset : 0; _pageScale = _isSlideBarOpen ? 0.8 : 1; }); @@ -64,7 +73,7 @@ class SliderMenuContainerState extends State void openDrawer() { setState(() { _animationController.forward(); - _slideBarXOffset = widget.sliderMenuOffset; + _slideBarXOffset = widget.sliderMenuOpenOffset; // _slideBarYOffset = widget.sliderMainOffset; _pageScale = 0.8; }); @@ -73,7 +82,7 @@ class SliderMenuContainerState extends State void closeDrawer() { setState(() { _animationController.reverse(); - _slideBarXOffset = 0; + _slideBarXOffset = widget.sliderMenuCloseOffset; _slideBarYOffset = 0; _pageScale = 1; }); @@ -83,6 +92,7 @@ class SliderMenuContainerState extends State void initState() { super.initState(); + _animationController = AnimationController( vsync: this, duration: @@ -92,31 +102,36 @@ class SliderMenuContainerState extends State @override Widget build(BuildContext context) { return Container( - child: Container( - child: Stack(children: [ - Container( - width: widget.sliderMenuOffset, - child: widget.sliderMenuWidget, - ), - AnimatedContainer( - padding: widget.appBarPadding ?? const EdgeInsets.only(top: 24), - duration: Duration( - milliseconds: widget.sliderAnimationTimeInMilliseconds), - curve: Curves.easeIn, - width: double.infinity, - height: double.infinity, - transform: Matrix4.translationValues( - _slideBarXOffset, _slideBarYOffset, 1.0), - color: widget.appBarColor, - child: Column( - children: [ - Row( + child: Stack(children: [ + Container( + width: widget.sliderMenuOpenOffset, + child: widget.sliderMenuWidget, + ), + AnimatedContainer( + duration: + Duration(milliseconds: widget.sliderAnimationTimeInMilliseconds), + curve: Curves.easeIn, + width: double.infinity, + height: double.infinity, + color: Colors.white, + transform: Matrix4.translationValues( + _slideBarXOffset, _slideBarYOffset, 1.0), + child: Column( + children: [ + Container( + padding: widget.appBarPadding ?? const EdgeInsets.only(top: 24), + color: widget.appBarColor, + child: Row( children: [ + SizedBox( + height: widget.appBarHeight ?? 0, + ), widget.drawerIcon ?? IconButton( icon: AnimatedIcon( icon: AnimatedIcons.menu_close, color: widget.drawerIconColor, + size: widget.drawerIconSize, progress: _animationController), onPressed: () { _isSlideBarOpen = !_isSlideBarOpen; @@ -125,9 +140,9 @@ class SliderMenuContainerState extends State Expanded( child: widget.isTitleCenter ? Center( - child: _titleWidget(), + child: widget.title, ) - : _titleWidget(), + : widget.title, ), widget.trailing ?? SizedBox( @@ -135,11 +150,11 @@ class SliderMenuContainerState extends State ) ], ), - Expanded(child: widget.sliderMainWidget), - ], - )), - ])), - ); + ), + Expanded(child: widget.sliderMainWidget), + ], + )), + ])); } @override @@ -147,10 +162,4 @@ class SliderMenuContainerState extends State super.dispose(); _animationController.dispose(); } - - _titleWidget() => Text( - 'Title', - textAlign: TextAlign.center, - style: widget.titleTextStyle ?? TextStyle(color: Colors.black), - ); } diff --git a/test/fluttersliderdrawer_test.dart b/test/fluttersliderdrawer_test.dart index 1f5e724..ce60c3d 100644 --- a/test/fluttersliderdrawer_test.dart +++ b/test/fluttersliderdrawer_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:fluttersliderdrawer/fluttersliderdrawer.dart'; +import 'package:fluttersliderdrawer/flutter_slider_drawer.dart'; void main() { const MethodChannel channel = MethodChannel('fluttersliderdrawer');