Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 1.38 KB

README.md

File metadata and controls

71 lines (59 loc) · 1.38 KB

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>[
				```
			],
		);
	}
}