Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding other method in onPressed method #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/home/cedos/flutter"
export "FLUTTER_APPLICATION_PATH=/home/cedos/AndroidStudioProjects/packages_modified/kf_drawer/example"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/home/cedos/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
73 changes: 61 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.4.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
charcode:
dependency: transitive
description:
Expand All @@ -29,6 +43,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -46,48 +74,62 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
kf_drawer:
dependency: "direct main"
description:
name: kf_drawer
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "0.0.2"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.5"
version: "0.12.6"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.1.8"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.2"
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.5"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -120,7 +162,7 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "1.0.5"
term_glyph:
dependency: transitive
description:
Expand All @@ -134,7 +176,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
version: "0.2.11"
typed_data:
dependency: transitive
description:
Expand All @@ -149,5 +191,12 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
sdks:
dart: ">=2.2.0 <3.0.0"
dart: ">=2.4.0 <3.0.0"
46 changes: 25 additions & 21 deletions lib/kf_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ class _KFDrawerState extends State<KFDrawer> with TickerProviderStateMixin {
item.onPressed = () {
widget.controller.page = item.page;
widget.controller.close();
item.click();
};
}
item.page.onMenuPressed = _onMenuPressed;

return item;
}).toList();
}
Expand Down Expand Up @@ -351,39 +353,41 @@ class __KFDrawerState extends State<_KFDrawer> {
}

class KFDrawerItem extends StatelessWidget {
KFDrawerItem({this.onPressed, this.text, this.icon});

KFDrawerItem.initWithPage({this.onPressed, this.text, this.icon, this.alias, this.page});
KFDrawerItem({this.click,this.onPressed, this.text, this.icon});

KFDrawerItem.initWithPage({this.click,this.onPressed,this.text, this.icon, this.alias, this.page});
Function click;
Function onPressed;
Widget text;
Widget icon;

String alias;
KFDrawerContent page;

@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 2.0),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onPressed,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 16.0, right: 8.0),
child: icon,
),
text,
],
return new Container(

padding: EdgeInsets.symmetric(vertical: 2.0),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: onPressed,

child: Padding(
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 16.0, right: 8.0),
child: icon,
),
text,
],
),
),
),
),
),
);
);
}
}
Loading