[infra_ui][overlay] Change insert overlay method parameters to optional

This commit is contained in:
Jaylen Bian 2021-07-28 17:44:14 +08:00
parent cc17529977
commit a9c829b417
2 changed files with 6 additions and 1 deletions

View File

@ -49,6 +49,7 @@ class OverlayScreen extends StatelessWidget {
size: 200,
),
'overlay_flutter_logo',
null,
);
},
child: const Text('Show Overlay'),

View File

@ -110,7 +110,11 @@ class FlowyOverlay extends StatefulWidget {
class FlowyOverlayState extends State<FlowyOverlay> {
List<Tuple3<Widget, String, FlowyOverlayDelegate?>> _overlayList = [];
void insert(Widget widget, String identifier, FlowyOverlayDelegate? delegate) {
void insert({
required Widget widget,
required String identifier,
FlowyOverlayDelegate? delegate,
}) {
setState(() {
_overlayList.add(Tuple3(widget, identifier, delegate));
});