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
979 B
Dart
35 lines
979 B
Dart
4 years ago
|
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
|
||
|
///
|
||
3 years ago
|
class SliderBar extends StatelessWidget {
|
||
4 years ago
|
final SlideDirection slideDirection;
|
||
|
final double sliderMenuOpenSize;
|
||
|
final Widget sliderMenu;
|
||
|
|
||
3 years ago
|
const SliderBar(
|
||
4 years ago
|
{Key? key,
|
||
|
required this.slideDirection,
|
||
|
required this.sliderMenuOpenSize,
|
||
|
required this.sliderMenu})
|
||
4 years ago
|
: super(key: key);
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
var container = Container(
|
||
|
width: sliderMenuOpenSize,
|
||
|
child: sliderMenu,
|
||
|
);
|
||
|
switch (slideDirection) {
|
||
|
case SlideDirection.LEFT_TO_RIGHT:
|
||
|
return container;
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|