Skip to content

Commit

Permalink
Fix/90 web support (#91)
Browse files Browse the repository at this point in the history
* [fix]: remove dart:io import and check platforms by Theme API

* bump version: 1.21.2

* Add changelog entry
  • Loading branch information
Rebar Ahmad committed Aug 31, 2024
1 parent c89ed5b commit 8c88be1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.21.2
- Observer Widget
- Fix web support by @Ahmadre in [#91](https://github.com/LinXunFeng/flutter_scrollview_observer/pull/91)

## 1.21.1
- ObserverCore
- improve the logic of `handleListObserve` and `handleGridObserve`.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/common/observer_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* @Date: 2022-08-08 00:20:03
*/
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -157,7 +156,8 @@ class ObserverWidgetState<
.contains(notification.runtimeType)) {
final isIgnoreInnerCanHandleObserve =
ScrollUpdateNotification != notification.runtimeType;
if (kIsWeb || Platform.isWindows || Platform.isMacOS) {
final platform = Theme.of(context).platform;
if (kIsWeb || platform == TargetPlatform.windows || platform == TargetPlatform.macOS) {
// Getting bad observation result because scrolling in Flutter Web
// with mouse wheel is not smooth.
// https://github.com/flutter/flutter/issues/78708
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: scrollview_observer
description: A widget for observing data related to the child widgets being displayed in a ScrollView.
version: 1.21.1
version: 1.21.2
homepage: https://github.com/fluttercandies/flutter_scrollview_observer

environment:
Expand Down

0 comments on commit 8c88be1

Please sign in to comment.