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

Support for null-safety. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 18 additions & 7 deletions lib/foldable_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ enum FSBStatus {

class FoldableSidebarBuilder extends StatelessWidget {
final FSBStatus status;
final Color drawerBackgroundColor;
final Color? drawerBackgroundColor;
final Widget drawer;
final Widget screenContents;

const FoldableSidebarBuilder({Key key, @required this.status, @required this.drawer, @required this.screenContents, this.drawerBackgroundColor}) : super(key: key);
const FoldableSidebarBuilder(
{Key? key,
required this.status,
required this.drawer,
required this.screenContents,
this.drawerBackgroundColor})
: super(key: key);

Tween<double> getTween() {
switch (status) {
Expand All @@ -28,7 +34,7 @@ class FoldableSidebarBuilder extends StatelessWidget {

@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context,constraints) {
return LayoutBuilder(builder: (context, constraints) {
return TweenAnimationBuilder<double>(
curve: Curves.fastOutSlowIn,
tween: getTween(),
Expand Down Expand Up @@ -68,7 +74,8 @@ class FoldableSidebarBuilder extends StatelessWidget {
..setEntry(3, 0, perspective)
..rotateY(portionAngle),
alignment: Alignment.centerLeft,
child: AbsorbPointer(absorbing: true, child: drawerContainer)),
child: AbsorbPointer(
absorbing: true, child: drawerContainer)),
),
),
),
Expand All @@ -84,7 +91,8 @@ class FoldableSidebarBuilder extends StatelessWidget {
..setEntry(3, 0, -perspective)
..rotateY(portionAngle),
alignment: Alignment.centerRight,
child: AbsorbPointer(absorbing: true, child: drawerContainer)),
child: AbsorbPointer(
absorbing: true, child: drawerContainer)),
),
),
),
Expand All @@ -94,9 +102,12 @@ class FoldableSidebarBuilder extends StatelessWidget {
top: height * 0.25,
left: drawerWidth / 2,
child: Opacity(
opacity: 1-data,
opacity: 1 - data,
child: Container(
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.black, blurRadius: 10)]),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.black, blurRadius: 10)
]),
width: 2,
height: height * 0.75,
),
Expand Down