Skip to content

Commit

Permalink
Fixed issues : Dn-a#30 and Dn-a#33
Browse files Browse the repository at this point in the history
  • Loading branch information
Dn-a committed Apr 28, 2020
1 parent 9a5a749 commit 7ec2e4b
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 136 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.5.5+1] - 2020-04-28.

* Fixed issues : #30 and #33.

## [0.5.5] - 2020-03-07.

* Update Documentation.
Expand Down Expand Up @@ -32,7 +36,7 @@
*
* Added `proportionalChildArea`. if == true dynamically sets the width based on the selected offset, otherwise it leaves the width at 100% of the screen.
* Possibility to set `boxShadow` also for linear animation.
* When `borderSide` > 0, `boxShadow` did not work, fixed.
* When `borderSide` > 0, `boxShadow` did not work.
* Cleaning code.
* Update Readme.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_inner_drawer
[![pub package](https://img.shields.io/badge/pub-0.5.5-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
[![pub package](https://img.shields.io/badge/pub-0.5.5+1-orange.svg)](https://pub.dartlang.org/packages/flutter_inner_drawer)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter#drawers)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/dnag88)

Expand All @@ -10,7 +10,7 @@ Inner Drawer is an easy way to create an internal side section (left/right) wher
Add this to your package's pubspec.yaml file:
```dart
dependencies:
flutter_inner_drawer: "^0.5.5"
flutter_inner_drawer: "^0.5.5+1"
```
## Demo
<div align="center">
Expand Down
Binary file not shown.
Binary file modified example/android/.gradle/5.6.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified example/android/.gradle/5.6.2/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified example/android/.gradle/5.6.2/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified example/android/.gradle/5.6.2/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified example/android/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
213 changes: 109 additions & 104 deletions example/lib/example_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,117 +224,122 @@ class _ExampleOneState extends State<ExampleOne>
rightChild: Material(
child: SafeArea(
//top: false,
right: false,
left: false,
child: Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(width: 1, color: Colors.grey[200]),
right: BorderSide(width: 1, color: Colors.grey[200])),
),
child: Stack(
children: <Widget>[
ListView(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 12, bottom: 4, left: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration(
border: Border(
left: BorderSide(width: 1, color: Colors.grey[200]),
right: BorderSide(width: 1, color: Colors.grey[200])),
),
child: Stack(
children: <Widget>[
ListView(
children: <Widget>[
Row(
children: <Widget>[
SizedBox(
width: 15,
height: 15,
child: CircleAvatar(
child: Icon(Icons.person,
color: Colors.white, size: 12),
backgroundColor: Colors.grey,
),
),
Text(
" Guest",
style: TextStyle(
fontWeight: FontWeight.w600, height: 1.2),
),
],
),
Padding(
padding: EdgeInsets.only(top: 2, right: 25),
child: GestureDetector(
child: Icon(
_position
? Icons.arrow_back
: Icons.arrow_forward,
size: 18,
),
onTap: () {
_innerDrawerKey.currentState.toggle();
},
padding:
EdgeInsets.only(top: 12, bottom: 4, left: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
SizedBox(
width: 15,
height: 15,
child: CircleAvatar(
child: Icon(Icons.person,
color: Colors.white, size: 12),
backgroundColor: Colors.grey,
),
),
Text(
" Guest",
style: TextStyle(
fontWeight: FontWeight.w600,
height: 1.2),
),
],
),
Padding(
padding: EdgeInsets.only(top: 2, right: 25),
child: GestureDetector(
child: Icon(
_position
? Icons.arrow_back
: Icons.arrow_forward,
size: 18,
),
onTap: () {
_innerDrawerKey.currentState.toggle();
},
),
),
],
)),
Divider(),
ListTile(
title: Text("Statistics"),
leading: Icon(Icons.show_chart),
),
ListTile(
title: Text("Activity"),
leading: Icon(Icons.access_time),
),
ListTile(
title: Text("Nametag"),
leading: Icon(Icons.rounded_corner),
),
ListTile(
title: Text("Favorite"),
leading: Icon(Icons.bookmark_border),
),
ListTile(
title: Text("Close Friends"),
leading: Icon(Icons.list),
),
ListTile(
title: Text("Suggested People"),
leading: Icon(Icons.person_add),
),
ListTile(
title: Text("Open Facebook"),
leading: Icon(
Env.facebook_icon,
size: 18,
),
),
Container(
alignment: Alignment.bottomLeft,
margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.symmetric(
vertical: 15, horizontal: 25),
//width: double.maxFinite,
decoration: BoxDecoration(
//color: Colors.grey,
border: Border(
top: BorderSide(
color: Colors.grey[300],
))),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(
Icons.settings,
size: 18,
),
Text(
" Settings",
style: TextStyle(fontSize: 16),
),
],
),
)
],
)),
Divider(),
ListTile(
title: Text("Statistics"),
leading: Icon(Icons.show_chart),
),
ListTile(
title: Text("Activity"),
leading: Icon(Icons.access_time),
),
ListTile(
title: Text("Nametag"),
leading: Icon(Icons.rounded_corner),
),
ListTile(
title: Text("Favorite"),
leading: Icon(Icons.bookmark_border),
),
ListTile(
title: Text("Close Friends"),
leading: Icon(Icons.list),
),
ListTile(
title: Text("Suggested People"),
leading: Icon(Icons.person_add),
),
ListTile(
title: Text("Open Facebook"),
leading: Icon(
Env.facebook_icon,
size: 18,
),
),
],
),
Container(
alignment: Alignment.bottomLeft,
margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.symmetric(vertical: 15, horizontal: 25),
//width: double.maxFinite,
decoration: BoxDecoration(
//color: Colors.grey,
border: Border(
top: BorderSide(
color: Colors.grey[300],
))),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(
Icons.settings,
size: 18,
),
Text(
" Settings",
style: TextStyle(fontSize: 16),
),
],
),
)
],
),
],
),
))),
))),

scaffold: Container(
decoration: BoxDecoration(
Expand Down
133 changes: 133 additions & 0 deletions example/lib/example_3.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import 'dart:math';

import 'package:example/env.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_inner_drawer/inner_drawer.dart';

import 'package:flutter_colorpicker/flutter_colorpicker.dart';

class ExampleThree extends StatefulWidget {
ExampleThree({Key key}) : super(key: key);

@override
_ExampleThreeState createState() => _ExampleThreeState();
}

class _ExampleThreeState extends State<ExampleThree> {
final GlobalKey<InnerDrawerState> _innerDrawerKey =
GlobalKey<InnerDrawerState>();

GlobalKey _keyRed = GlobalKey();
double _width = 10;

double _borderRadius = 50;

AnimationController _animationController;
Animation<Color> _bkgColor;

String _title = "Three";

@override
void initState() {
_getwidthContainer();
myFocusNode = FocusNode();
myFocusNode2 = FocusNode();
super.initState();
}

@override
void dispose() {
myFocusNode.dispose();
myFocusNode2.dispose();
super.dispose();
}

Color currentColor = Colors.black54;

void _getwidthContainer() {
WidgetsBinding.instance.addPostFrameCallback((_) {
final keyContext = _keyRed.currentContext;
if (keyContext != null) {
final RenderBox box = keyContext.findRenderObject();
final size = box.size;
setState(() {
_width = size.width;
});
}
});
}

FocusNode myFocusNode;
FocusNode myFocusNode2;

@override
Widget build(BuildContext context) {
return InnerDrawer(
key: _innerDrawerKey,
onTapClose: true,
//tapScaffoldEnabled: true,
borderRadius: _borderRadius,
leftAnimationType: InnerDrawerAnimation.quadratic,
leftChild: Material(
color: Theme.of(context).backgroundColor,
child: Center(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"Left Child",
style: TextStyle(fontSize: 18),
),
TextField(
focusNode: myFocusNode2,
)
],
)),
)),
scaffold: Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 30),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomLeft,
//stops: [0.1, 0.5,0.5, 0.7, 0.9],
colors: [
Colors.green[200],
Colors.green[500],
],
),
),
child: SafeArea(
child: Material(
color: Colors.transparent,
child: Container(
height: double.infinity,
padding: EdgeInsets.all(15),
child: Column(
children: <Widget>[
TextField(
focusNode: myFocusNode,
),
TextField(
// focusNode: myFocusNode,
),
],
)),
),
),
),
onDragUpdate: (a, b) {
print(a);
if (a == 1) {
myFocusNode2.requestFocus();
} else if (a < 0.1) {
myFocusNode.requestFocus();
}
},
);
}
}
Loading

0 comments on commit 7ec2e4b

Please sign in to comment.