Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 01ba4e2

Browse files
authored
visibility_detector: Fix analysis issues with Flutter 3.1.0 (#419)
* Replace deprecated API usage. * Fix the Flutter SDK version dependency to depend on Flutter 3.1.0. Analysis previously failed with Flutter 3.0.5.
1 parent eaa59c7 commit 01ba4e2

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

packages/visibility_detector/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 0.4.0+1
4+
5+
* Correct Flutter SDK version dependency to 3.1.0.
6+
* Replace use of deprecated APIs in the example for compatibility with Flutter v3.1.0.
7+
38
## 0.4.0
49

510
* Refactor to avoid forcing composition in the layer/render trees.

packages/visibility_detector/example/lib/main.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ class DemoPageCell extends StatelessWidget {
368368
alignment: Alignment.center,
369369
child: FittedBox(
370370
fit: BoxFit.scaleDown,
371-
child: Text(_cellName, style: Theme.of(context).textTheme.headline4),
371+
child: Text(
372+
_cellName,
373+
style: Theme.of(context).textTheme.headlineMedium,
374+
),
372375
),
373376
);
374377

@@ -411,7 +414,7 @@ class VisibilityReport extends StatelessWidget {
411414
@override
412415
Widget build(BuildContext context) {
413416
final headingTextStyle =
414-
Theme.of(context).textTheme.headline6!.copyWith(color: Colors.white);
417+
Theme.of(context).textTheme.titleLarge?.copyWith(color: Colors.white);
415418

416419
final heading = Container(
417420
padding: const EdgeInsets.all(_reportPadding),

packages/visibility_detector/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: visibility_detector
2-
version: 0.4.0
2+
version: 0.4.0+1
33
description: >
44
A widget that detects the visibility of its child and notifies a callback.
55
repository: https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector
66

77
environment:
88
sdk: '>=2.12.0 <3.0.0'
9-
flutter: '>=2.12.0'
9+
flutter: '>=3.1.0-0'
1010

1111
dependencies:
1212
flutter:

0 commit comments

Comments
 (0)