Skip to content

Commit 82934e7

Browse files
committedMay 21, 2024·
Fixes
1 parent 9c5fa96 commit 82934e7

File tree

7 files changed

+30
-33
lines changed

7 files changed

+30
-33
lines changed
 

‎lib/src/extensions/context_ext.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ extension VxContextExtensions on BuildContext {
223223
///
224224
/// A color that contrasts with the [primaryColor].
225225
///
226-
Color get backgroundColor => theme.colorScheme.background;
226+
Color get backgroundColor => theme.colorScheme.surface;
227227

228228
///
229229
/// The default color of [MaterialType.canvas] [Material].

‎lib/src/flutter/bottom_sheet.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ mixin VxBottomSheet {
2929
: null,
3030
isScrollControlled: true,
3131
isDismissible: isDismissible,
32-
backgroundColor:
33-
backgroundColor ?? Theme.of(context).colorScheme.background,
32+
backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.surface,
3433
builder: (BuildContext context) {
3534
return SafeArea(
3635
bottom: isSafeAreaFromBottom,
@@ -79,8 +78,7 @@ mixin VxBottomSheet {
7978
: null,
8079
isScrollControlled: true,
8180
isDismissible: isDismissible,
82-
backgroundColor:
83-
backgroundColor ?? Theme.of(context).colorScheme.background,
81+
backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.surface,
8482
builder: (BuildContext context) {
8583
return SafeArea(
8684
bottom: isSafeAreaFromBottom,

‎lib/src/flutter/dialog.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class _VxDialog extends StatelessWidget {
241241
child: Container(
242242
height: 42,
243243
decoration: BoxDecoration(
244-
color: cancelBgColor ?? Theme.of(context).colorScheme.background,
244+
color: cancelBgColor ?? Theme.of(context).colorScheme.surface,
245245
borderRadius: BorderRadius.vertical(
246246
bottom: Radius.circular(_circular),
247247
),
@@ -257,7 +257,7 @@ class _VxDialog extends StatelessWidget {
257257
onTap: () => onCancel(context),
258258
child: Container(
259259
decoration: BoxDecoration(
260-
color: cancelBgColor ?? Theme.of(context).colorScheme.background,
260+
color: cancelBgColor ?? Theme.of(context).colorScheme.surface,
261261
borderRadius: BorderRadius.only(
262262
bottomLeft: Radius.circular(_circular),
263263
),
@@ -277,7 +277,7 @@ class _VxDialog extends StatelessWidget {
277277
onTap: () => onConfirm(context),
278278
child: Container(
279279
decoration: BoxDecoration(
280-
color: confirmBgColor ?? Theme.of(context).colorScheme.background,
280+
color: confirmBgColor ?? Theme.of(context).colorScheme.surface,
281281
borderRadius:
282282
BorderRadius.only(bottomRight: Radius.circular(_circular)),
283283
),
@@ -365,7 +365,7 @@ class VxTimerButtonState extends State<VxTimerButton> {
365365
Widget child = Container(
366366
height: 42,
367367
decoration: BoxDecoration(
368-
color: widget.bgColor ?? Theme.of(context).colorScheme.background,
368+
color: widget.bgColor ?? Theme.of(context).colorScheme.surface,
369369
borderRadius: BorderRadius.vertical(
370370
bottom: Radius.circular(_circular),
371371
),

‎lib/src/flutter/drawer.dart

+17-18
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,33 @@ mixin VxDrawer {
6969

7070
VoidCallback? hide;
7171

72-
OverlayEntry? overlayEntry = OverlayEntry(
73-
builder: (BuildContext context) => _VxDrawer(
74-
key: key,
75-
type: type,
76-
maskTap: hide,
77-
showMask: showMask,
78-
child: child,
79-
),
80-
);
81-
overlayState.insert(overlayEntry);
72+
OverlayEntry? overlayEntry;
8273

83-
final ModalRoute? route = ModalRoute.of(context);
84-
Future<bool> backClose() {
74+
void backClose(bool shouldPop) {
8575
hide!();
86-
return Future.value(false);
8776
}
8877

89-
// TODO(iampawan): Not sure how to change it to use `PopEntry`
90-
route?.addScopedWillPopCallback(backClose);
91-
9278
hide = () async {
93-
// TODO(iampawan): Not sure how to change it to use `PopEntry`
94-
route?.removeScopedWillPopCallback(backClose);
9579
await key.currentState?.reverseAnimation();
9680
overlayEntry?.remove();
9781
overlayEntry = null;
9882
};
9983

84+
overlayEntry = OverlayEntry(
85+
builder: (BuildContext context) => PopScope(
86+
onPopInvoked: backClose,
87+
child: _VxDrawer(
88+
key: key,
89+
type: type,
90+
maskTap: hide,
91+
showMask: showMask,
92+
child: child,
93+
),
94+
),
95+
);
96+
97+
overlayState.insert(overlayEntry!);
98+
10099
if (autoHide) {
101100
Future.delayed(
102101
const Duration(milliseconds: 2000),

‎lib/src/flutter/hover.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class _HoverToggleState extends State<VxHoverToggle> with MaterialStateMixin {
2828
size: widget.size,
2929
child: MouseRegion(
3030
cursor: isHovered ? SystemMouseCursors.click : MouseCursor.defer,
31-
onEnter: (_) => setMaterialState(MaterialState.hovered, true),
32-
onExit: (_) => setMaterialState(MaterialState.hovered, false),
31+
onEnter: (_) => setMaterialState(WidgetState.hovered, true),
32+
onExit: (_) => setMaterialState(WidgetState.hovered, false),
3333
child: widget.mode == VxHoverMode.replace
3434
? _buildReplaceableChildren()
3535
: _buildChildrenStack(),

‎lib/src/flutter/timeline/timeline_widget.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class VxTimelineState extends State<VxTimeline>
7575
firstElement: index == 0,
7676
lastElement: widget.timelineList.length == index + 1,
7777
controller: controller,
78-
headingColor: widget.headingColor ??
79-
Theme.of(context).colorScheme.onBackground,
78+
headingColor:
79+
widget.headingColor ?? Theme.of(context).colorScheme.onSurface,
8080
descriptionColor: widget.descriptionColor ??
81-
Theme.of(context).colorScheme.onBackground,
81+
Theme.of(context).colorScheme.onSurface,
8282
hideLauncher: !widget.showTrailing,
8383
trailing: widget.customTrailing,
8484
),

‎lib/src/flutter/toast.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class _VxToastViewState extends State<_VxToastView>
241241
CircularProgressIndicator(
242242
strokeWidth: 3.0,
243243
valueColor: AlwaysStoppedAnimation(
244-
Theme.of(context).colorScheme.background,
244+
Theme.of(context).colorScheme.surface,
245245
),
246246
),
247247
const SizedBox(height: 8),

0 commit comments

Comments
 (0)
Please sign in to comment.