mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
improve pop_up_widget and side_bar in dark mode
This commit is contained in:
@@ -22,8 +22,15 @@ class PopUpWidget<T> extends PopupRoute<T> {
|
|||||||
Widget body = PopupIndicatorWidget(
|
Widget body = PopupIndicatorWidget(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: showPopUp
|
decoration: showPopUp
|
||||||
? const BoxDecoration(
|
? BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
|
boxShadow: context.brightness == ui.Brightness.dark ? [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.white.withAlpha(50),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: Offset(0, 2),
|
||||||
|
),
|
||||||
|
] : null,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
clipBehavior: showPopUp ? Clip.antiAlias : Clip.none,
|
clipBehavior: showPopUp ? Clip.antiAlias : Clip.none,
|
||||||
@@ -86,7 +93,8 @@ class PopupIndicatorWidget extends InheritedWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<T> showPopUpWidget<T>(BuildContext context, Widget widget) async {
|
Future<T> showPopUpWidget<T>(BuildContext context, Widget widget) async {
|
||||||
return await Navigator.of(context, rootNavigator: true).push(PopUpWidget(widget));
|
return await Navigator.of(context, rootNavigator: true)
|
||||||
|
.push(PopUpWidget(widget));
|
||||||
}
|
}
|
||||||
|
|
||||||
class PopUpWidgetScaffold extends StatefulWidget {
|
class PopUpWidgetScaffold extends StatefulWidget {
|
||||||
@@ -127,9 +135,8 @@ class _PopUpWidgetScaffoldState extends State<PopUpWidgetScaffold> {
|
|||||||
message: "Back".tl,
|
message: "Back".tl,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back_sharp),
|
icon: const Icon(Icons.arrow_back_sharp),
|
||||||
onPressed: () => context.canPop()
|
onPressed: () =>
|
||||||
? context.pop()
|
context.canPop() ? context.pop() : App.pop(),
|
||||||
: App.pop(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
@@ -57,10 +57,18 @@ class SideBarRoute<T> extends PopupRoute<T> {
|
|||||||
|
|
||||||
body = Container(
|
body = Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: showSideBar
|
borderRadius: showSideBar
|
||||||
? const BorderRadius.horizontal(left: Radius.circular(16))
|
? const BorderRadius.horizontal(left: Radius.circular(16))
|
||||||
: null,
|
: null,
|
||||||
color: Theme.of(context).colorScheme.surfaceTint),
|
color: Theme.of(context).colorScheme.surfaceTint,
|
||||||
|
boxShadow: context.brightness == ui.Brightness.dark ? [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.white.withAlpha(50),
|
||||||
|
blurRadius: 10,
|
||||||
|
offset: Offset(0, 2),
|
||||||
|
),
|
||||||
|
] : null,
|
||||||
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
constraints: BoxConstraints(maxWidth: sideBarWidth),
|
constraints: BoxConstraints(maxWidth: sideBarWidth),
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
|
Reference in New Issue
Block a user