refactor remote menubar with MenuBar for submenu

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-02-23 14:30:29 +08:00
parent 5b8e51d6b9
commit 4338451f6f
36 changed files with 1582 additions and 1325 deletions

View File

@@ -1814,3 +1814,19 @@ class DraggableNeverScrollableScrollPhysics extends ScrollPhysics {
@override
bool get allowImplicitScrolling => false;
}
Widget futureBuilder(
{required Future? future, required Widget Function(dynamic data) hasData}) {
return FutureBuilder(
future: future,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
return hasData(snapshot.data!);
} else {
if (snapshot.hasError) {
debugPrint(snapshot.error.toString());
}
return Container();
}
});
}