You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
993 B
Dart
35 lines
993 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_slider_drawer/src/slider_direction.dart';
|
|
|
|
///
|
|
/// Build and Align the Menu widget based on the slide open type
|
|
///
|
|
class SlideMenuBar extends StatelessWidget {
|
|
final SlideDirection slideDirection;
|
|
final double sliderMenuOpenSize;
|
|
final Widget sliderMenu;
|
|
|
|
const SlideMenuBar(
|
|
{Key key, this.slideDirection, this.sliderMenuOpenSize, this.sliderMenu})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var container = Container(
|
|
width: sliderMenuOpenSize,
|
|
child: sliderMenu,
|
|
);
|
|
switch (slideDirection) {
|
|
case SlideDirection.LEFT_TO_RIGHT:
|
|
return container;
|
|
break;
|
|
case SlideDirection.RIGHT_TO_LEFT:
|
|
return Positioned(right: 0, top: 0, bottom: 0, child: container);
|
|
case SlideDirection.TOP_TO_BOTTOM:
|
|
return Positioned(right: 0, left: 0, top: 0, child: container);
|
|
break;
|
|
}
|
|
return Container();
|
|
}
|
|
}
|