Skip to content

beiger/flutter_slide_up_panel

Repository files navigation

flutterslideuppanel

A new Flutter plugin.

capture

image

Getting Started

first, init PanelController:

PanelController({
		@required this.minHeight,  // double
		@required this.maxHeight, //double
		this.initialOpen = false,
		@required this.vsync // TickerProvider
	})

second, use SlideUpPanel:

SlideUpPanel({
		@required this.body, //Widget, 
		@required this.head, //Widget, the head of the panel
		@required this.panel, // Widget, the body of the panel, if the panel is scrollable, donot set ScrollController for the panel
		@required this.controller});

for example:

class ScrollableTestState extends State<ScrollableTest> with TickerProviderStateMixin {
	PanelController _controller;

	@override
	void initState() {
		super.initState();
		_controller = PanelController(
				minHeight: 56,
				maxHeight: 500,
				vsync: this
		);
	}

	@override
	void dispose() {
		super.dispose();
		_controller.dispose();
	}

	@override
	Widget build(BuildContext context) {
		return SlideUpPanel(
			body: Container(color: Colors.white),
			head: Container(height: 56, width: double.infinity, color: Colors.green),
			panel: _panel(),
			controller: _controller,
		);
	}

	Widget _panel() {
		return CustomScrollView(
			physics: BouncingScrollPhysics(),
			slivers: <Widget>[
				```
			],
		);
	}
}

About

slide_up_panel for Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published