From c9450e7fd43d98fa9f2b834918b57ffcc55cf3f6 Mon Sep 17 00:00:00 2001 From: gsurrel <1993113+gsurrel@users.noreply.github.com> Date: Sat, 4 May 2024 10:46:32 +0200 Subject: [PATCH] Fix example app when targeting the web MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I tried to run the provided example targeting Chrome, and it fails running, with the following error: ``` ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following RangeError was thrown building Builder: max must be in range 0 < max ≤ 2^32, was 0 ``` The example runs fine when randomMax is lowered by 1.
If it's any useful, here is the Flutter Doctor's diagnostics flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale fr) [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✗] Xcode - develop for iOS and macOS ✗ Xcode installation is incomplete; a full installation is necessary for iOS and macOS development. Download at: https://developer.apple.com/xcode/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] Connected device (2 available) [✓] Network resources ! Doctor found issues in 2 categories.
--- packages/scrollable_positioned_list/example/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scrollable_positioned_list/example/lib/main.dart b/packages/scrollable_positioned_list/example/lib/main.dart index 8e41e2bc..87e12f51 100644 --- a/packages/scrollable_positioned_list/example/lib/main.dart +++ b/packages/scrollable_positioned_list/example/lib/main.dart @@ -11,7 +11,7 @@ const minItemHeight = 20.0; const maxItemHeight = 150.0; const scrollDuration = Duration(seconds: 2); -const randomMax = 1 << 32; +const randomMax = 1 << 32 - 1; void main() { runApp(ScrollablePositionedListExample());