页面样式优化

This commit is contained in:
wanghongenpin
2023-09-18 19:14:49 +08:00
parent 69152ad974
commit 12d42bc000
7 changed files with 39 additions and 26 deletions

View File

@@ -97,7 +97,8 @@ void unSelect(EditableTextState editableTextState) {
);
}
Widget futureWidget<T>(Future<T> future, Widget Function(T data) toWidget) {
///Future
Widget futureWidget<T>(Future<T> future, Widget Function(T data) toWidget, {bool loading = false}) {
return FutureBuilder<T>(
future: future,
builder: (BuildContext context, AsyncSnapshot<T> snapshot) {
@@ -107,7 +108,8 @@ Widget futureWidget<T>(Future<T> future, Widget Function(T data) toWidget) {
}
return toWidget(snapshot.requireData);
}
return const SizedBox();
//加载效果
return loading ? const Center(child: CircularProgressIndicator()) : const SizedBox();
},
);
}
@@ -118,9 +120,9 @@ showContextMenu(BuildContext context, Offset offset, {required List<PopupMenuEnt
surfaceTintColor:
Brightness.dark == Theme.of(context).brightness ? null : Theme.of(context).colorScheme.primaryContainer,
position: RelativeRect.fromLTRB(
offset.dx,
offset.dx + 10,
offset.dy - 50,
offset.dx,
offset.dx + 10,
offset.dy - 50,
),
items: items);