Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecate #195

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/src/flutter/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ mixin VxDialog {
context: context,
barrierDismissible: barrierDismissible,
builder: (context) {
return WillPopScope(
onWillPop: () async => barrierDismissible,
return PopScope(
canPop: barrierDismissible,
child: AlertDialog(
contentPadding: EdgeInsets.zero,
content: _VxDialog(
Expand Down Expand Up @@ -73,8 +73,8 @@ mixin VxDialog {
context: context,
barrierDismissible: barrierDismissible,
builder: (context) {
return WillPopScope(
onWillPop: () async => barrierDismissible,
return PopScope(
canPop: barrierDismissible,
child: AlertDialog(
contentPadding: EdgeInsets.zero,
content: _VxDialog(
Expand Down Expand Up @@ -112,8 +112,8 @@ mixin VxDialog {
context: context,
barrierDismissible: barrierDismissible,
builder: (context) {
return WillPopScope(
onWillPop: () async => barrierDismissible,
return PopScope(
canPop: barrierDismissible,
child: AlertDialog(
contentPadding: EdgeInsets.zero,
content: _VxDialog(
Expand Down
2 changes: 2 additions & 0 deletions lib/src/flutter/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ mixin VxDrawer {
return Future.value(false);
}

// TODO(iampawan): Not sure how to change it to use `PopEntry`
route?.addScopedWillPopCallback(backClose);

hide = () async {
// TODO(iampawan): Not sure how to change it to use `PopEntry`
route?.removeScopedWillPopCallback(backClose);
await key.currentState?.reverseAnimation();
overlayEntry?.remove();
Expand Down
8 changes: 3 additions & 5 deletions lib/src/flutter/popup_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ class VxPopupMenuState extends State<VxPopupMenu> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () {
_hideMenu();
return Future.value(true);
},
return PopScope(
canPop: true,
onPopInvoked: (_) => _hideMenu(),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
child: widget.child,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/flutter/rich_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ class VxRichText extends VxWidgetBuilder<Widget>
key: key,
textAlign: _textAlign,
maxLines: _maxLines,
textScaleFactor: _scaleFactor,
textScaler:
_scaleFactor == null ? null : TextScaler.linear(_scaleFactor!),
softWrap: _softWrap ?? true,
overflow: _overflow ?? TextOverflow.clip,
strutStyle: _strutStyle,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/flutter/selectable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ class VxSelectableTextBuilder extends VxWidgetBuilder<SelectableText>
onTap: _onTap as void Function()?,
enableInteractiveSelection: true,
showCursor: _showCursor ?? false,
textScaleFactor: _scaleFactor,
textScaler:
_scaleFactor == null ? null : TextScaler.linear(_scaleFactor!),
style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts,
strutStyle: _strutStyle,
contextMenuBuilder: _contextMenuBuilder,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/flutter/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ class VxTextBuilder extends VxWidgetBuilder<Widget>
key: key,
textAlign: _textAlign,
maxLines: _maxLines,
textScaleFactor: _scaleFactor,
textScaler:
_scaleFactor == null ? null : TextScaler.linear(_scaleFactor!),
style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts,
softWrap: _softWrap ?? true,
overflow: _overflow ?? TextOverflow.clip,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/flutter/timeline/timeline_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class VxTimelineView extends StatelessWidget {
style: TextStyle(
color: descriptionColor ?? Colors.black,
),
textScaleFactor: 1.25,
textScaler: const TextScaler.linear(1.25),
),
)
],
Expand Down
Loading