shiburagi / Drawer-Behavior-Flutter

Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
MIT License
209 stars 36 forks source link

Missing kotlin-gradle-plugin #11

Closed allComputableThings closed 4 years ago

allComputableThings commented 4 years ago

When I add this project to pubspec.yaml and try the demo, Flutter gives me:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
project ':drawerbehavior' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 647ms
Finished with error: Gradle task assembleDebug failed with exit code 1

class Drawer4 extends StatefulWidget { @override _Drawer4State createState() => _Drawer4State(); }

class _Drawer4State extends State { final menu = new Menu( items: [ new MenuItem( id: 'restaurant', title: 'THE PADDOCK', ), new MenuItem( id: 'other1', title: 'THE HERO', ), new MenuItem( id: 'other2', title: 'HELP US GROW', ), new MenuItem( id: 'other3', title: 'SETTINGS', ), ], );

var selectedMenuItemId = 'restaurant'; var _widget = Text("1");

Widget headerView(BuildContext context) { return Column( children: [ Container( padding: EdgeInsets.fromLTRB(16, 12, 16, 0), child: Row( children: [ new Container( width: 48.0, height: 48.0, decoration: new BoxDecoration( shape: BoxShape.circle, image: new DecorationImage( fit: BoxFit.fill, image: AssetImage("assets/user1.jpg")))), Container( margin: EdgeInsets.only(left: 16), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "John Witch", style: Theme.of(context) .textTheme .subhead .copyWith(color: Colors.white), ), Text( "test123@gmail.com", style: Theme.of(context) .textTheme .subtitle .copyWith(color: Colors.white.withAlpha(200)), ) ], )) ], ), ), Divider( color: Colors.white.withAlpha(200), height: 16, ) ], ); }

@override Widget build(BuildContext context) { return new DrawerScaffold( percentage: 1, cornerRadius: 0, appBar: AppBarProps( title: Text("Drawer 4"), actions: [IconButton(icon: Icon(Icons.add), onPressed: () {})]), menuView: new MenuView( menu: menu, headerView: headerView(context), animation: false, // mainAxisAlignment: MainAxisAlignment.start, color: Theme.of(context).primaryColor, selectedItemId: selectedMenuItemId, onMenuItemSelected: (String itemId) { selectedMenuItemId = itemId; if (itemId == 'restaurant') { setState(() => _widget = Text("1")); } else { setState(() => _widget = Text("default")); } }, ), contentView: Screen( contentBuilder: (context) => Center(child: _widget), color: Colors.white, ), ); } }

hieugao commented 4 years ago

Seem like he's kind of busy to update the widget, just copy lib directory to your project and playing with it

shiburagi commented 4 years ago

17