2020-05-01 15:57:22 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2020-05-12 17:46:42 +00:00
|
|
|
class TopPanel extends StatefulWidget {
|
|
|
|
TopPanel({
|
|
|
|
@required this.color,
|
|
|
|
@required this.widget,
|
|
|
|
this.edgeInsets = const EdgeInsets.all(24)
|
|
|
|
});
|
2020-05-01 15:57:22 +00:00
|
|
|
|
|
|
|
final Color color;
|
|
|
|
final Widget widget;
|
2020-05-12 17:46:42 +00:00
|
|
|
final EdgeInsets edgeInsets;
|
|
|
|
|
|
|
|
@override
|
|
|
|
TopPanelState createState() => TopPanelState(color, widget, edgeInsets);
|
|
|
|
}
|
|
|
|
|
|
|
|
class TopPanelState extends State<TopPanel> {
|
|
|
|
TopPanelState(this._color, this._widget, this._edgeInsets);
|
|
|
|
|
|
|
|
final Color _color;
|
|
|
|
final Widget _widget;
|
|
|
|
final EdgeInsets _edgeInsets;
|
2020-05-01 15:57:22 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
width: double.infinity,
|
2020-05-12 17:46:42 +00:00
|
|
|
padding: _edgeInsets,
|
2020-05-01 15:57:22 +00:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomLeft: Radius.circular(24),
|
|
|
|
bottomRight: Radius.circular(24)
|
|
|
|
),
|
2020-05-12 17:46:42 +00:00
|
|
|
color: _color
|
2020-05-01 15:57:22 +00:00
|
|
|
),
|
2020-05-12 17:46:42 +00:00
|
|
|
child: _widget,
|
2020-05-01 15:57:22 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|