Skip to content

Commit 29cc3b0

Browse files
update to flutter 3.16
1 parent 004ac12 commit 29cc3b0

File tree

8 files changed

+23
-25
lines changed

8 files changed

+23
-25
lines changed

analysis_options.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
include: package:flutter_lints/flutter.yaml
22

33
analyzer:
4-
strong-mode:
54
errors:
65
argument_type_not_assignable: error
76
invalid_assignment: error
@@ -12,7 +11,6 @@ analyzer:
1211
linter:
1312
rules:
1413
public_member_api_docs: false
15-
avoid_returning_null: false
1614
avoid_print: true
1715
avoid_empty_else: true
1816
annotate_overrides: true

example/ios/Runner.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
97C146E61CF9000F007C117D /* Project object */ = {
137137
isa = PBXProject;
138138
attributes = {
139-
LastUpgradeCheck = 1300;
139+
LastUpgradeCheck = 1430;
140140
ORGANIZATIONNAME = "The Chromium Authors";
141141
TargetAttributes = {
142142
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

lib/src/showcase.dart

+11-11
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ class _ShowcaseState extends State<Showcase> {
367367
position ??= GetPosition(
368368
key: widget.key,
369369
padding: widget.targetPadding,
370-
screenWidth: MediaQuery.of(context).size.width,
371-
screenHeight: MediaQuery.of(context).size.height,
370+
screenWidth: MediaQuery.sizeOf(context).width,
371+
screenHeight: MediaQuery.sizeOf(context).height,
372372
);
373373
showOverlay();
374374
}
@@ -410,7 +410,7 @@ class _ShowcaseState extends State<Showcase> {
410410
if (_enableShowcase) {
411411
return AnchoredOverlay(
412412
overlayBuilder: (context, rectBound, offset) {
413-
final size = MediaQuery.of(context).size;
413+
final size = MediaQuery.sizeOf(context);
414414
position = GetPosition(
415415
key: widget.key,
416416
padding: widget.targetPadding,
@@ -551,16 +551,16 @@ class _ShowcaseState extends State<Showcase> {
551551
? BackdropFilter(
552552
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
553553
child: Container(
554-
width: MediaQuery.of(context).size.width,
555-
height: MediaQuery.of(context).size.height,
554+
width: MediaQuery.sizeOf(context).width,
555+
height: MediaQuery.sizeOf(context).height,
556556
decoration: BoxDecoration(
557557
color: widget.overlayColor.withOpacity(widget.overlayOpacity),
558558
),
559559
),
560560
)
561561
: Container(
562-
width: MediaQuery.of(context).size.width,
563-
height: MediaQuery.of(context).size.height,
562+
width: MediaQuery.sizeOf(context).width,
563+
height: MediaQuery.sizeOf(context).height,
564564
decoration: BoxDecoration(
565565
color: widget.overlayColor.withOpacity(widget.overlayOpacity),
566566
),
@@ -584,16 +584,16 @@ class _ShowcaseState extends State<Showcase> {
584584
? BackdropFilter(
585585
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
586586
child: Container(
587-
width: MediaQuery.of(context).size.width,
588-
height: MediaQuery.of(context).size.height,
587+
width: MediaQuery.sizeOf(context).width,
588+
height: MediaQuery.sizeOf(context).height,
589589
decoration: BoxDecoration(
590590
color: widget.overlayColor.withOpacity(0.1),
591591
),
592592
),
593593
)
594594
: Container(
595-
width: MediaQuery.of(context).size.width,
596-
height: MediaQuery.of(context).size.height,
595+
width: MediaQuery.sizeOf(context).width,
596+
height: MediaQuery.sizeOf(context).height,
597597
decoration: BoxDecoration(
598598
color: widget.overlayColor.withOpacity(widget.overlayOpacity),
599599
),

lib/src/tooltip_widget.dart

+8-8
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
129129
final EdgeInsets viewInsets =
130130
EdgeInsets.fromViewPadding(View.of(context).viewInsets, View.of(context).devicePixelRatio);
131131
final double actualVisibleScreenHeight =
132-
(widget.screenSize?.height ?? MediaQuery.of(context).size.height) - viewInsets.bottom;
132+
(widget.screenSize?.height ?? MediaQuery.sizeOf(context).height) - viewInsets.bottom;
133133
final hasSpaceInBottom = (actualVisibleScreenHeight - bottomPosition) >= height;
134134
return widget.tooltipPosition ??
135135
(hasSpaceInTop && !hasSpaceInBottom ? TooltipPosition.top : TooltipPosition.bottom);
@@ -189,7 +189,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
189189
if (widget.position != null) {
190190
final width = widget.container != null ? _customContainerWidth.value : tooltipWidth;
191191
double leftPositionValue = widget.position!.getCenter() - (width * 0.5);
192-
if ((leftPositionValue + width) > MediaQuery.of(context).size.width) {
192+
if ((leftPositionValue + width) > MediaQuery.sizeOf(context).width) {
193193
return null;
194194
} else if ((leftPositionValue) < _kDefaultPaddingFromParent) {
195195
return _kDefaultPaddingFromParent;
@@ -205,10 +205,10 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
205205
final width = widget.container != null ? _customContainerWidth.value : tooltipWidth;
206206

207207
final left = _getLeft();
208-
if (left == null || (left + width) > MediaQuery.of(context).size.width) {
208+
if (left == null || (left + width) > MediaQuery.sizeOf(context).width) {
209209
final rightPosition = widget.position!.getCenter() + (width * 0.5);
210210

211-
return (rightPosition + width) > MediaQuery.of(context).size.width
211+
return (rightPosition + width) > MediaQuery.sizeOf(context).width
212212
? _kDefaultPaddingFromParent
213213
: null;
214214
} else {
@@ -232,7 +232,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
232232
final calculatedLeft = _getLeft();
233233
var left = calculatedLeft == null ? 0 : (widget.position!.getCenter() - calculatedLeft);
234234
var right = _getLeft() == null
235-
? (MediaQuery.of(context).size.width - widget.position!.getCenter()) - (_getRight() ?? 0)
235+
? (MediaQuery.sizeOf(context).width - widget.position!.getCenter()) - (_getRight() ?? 0)
236236
: 0;
237237
final containerWidth = widget.container != null ? _customContainerWidth.value : tooltipWidth;
238238

@@ -246,7 +246,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
246246
double _getAlignmentY() {
247247
var dy = isArrowUp
248248
? -1.0
249-
: (MediaQuery.of(context).size.height / 2) < widget.position!.getTop()
249+
: (MediaQuery.sizeOf(context).height / 2) < widget.position!.getTop()
250250
? -1.0
251251
: 1.0;
252252
return dy;
@@ -559,7 +559,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
559559
final textPainter = TextPainter(
560560
text: TextSpan(text: text, style: style),
561561
maxLines: 1,
562-
textScaleFactor: MediaQuery.of(context).textScaleFactor,
562+
textScaler: MediaQuery.textScalerOf(context),
563563
textDirection: TextDirection.ltr,
564564
)..layout();
565565
return textPainter.size;
@@ -573,7 +573,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
573573

574574
double? _getArrowRight(double arrowWidth) {
575575
if (_getLeft() != null) return null;
576-
return (MediaQuery.of(context).size.width - widget.position!.getCenter()) -
576+
return (MediaQuery.sizeOf(context).width - widget.position!.getCenter()) -
577577
(_getRight() ?? 0) -
578578
(arrowWidth / 2);
579579
}

preview/.DS_Store

6 KB
Binary file not shown.

preview/showcaseview.gif

-3.37 MB
Binary file not shown.

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: showcase_tutorial
22
description: A Flutter package to Showcase/Highlight widgets step by step.
3-
version: 1.0.2
3+
version: 1.0.3
44
homepage: https://github.com/abdelrahman-abied/showcase_tutorial
55
issue_tracker: https://github.com/abdelrahman-abied/showcase_tutorial/issues
66

@@ -15,7 +15,7 @@ dependencies:
1515
dev_dependencies:
1616
flutter_test:
1717
sdk: flutter
18-
flutter_lints: ^2.0.3
18+
flutter_lints: ^3.0.1
1919

2020
flutter:
2121

0 commit comments

Comments
 (0)