Fix sample code crash, add test (#133812)
Fixes https://github.com/flutter/flutter/issues/133402 On web `1 << 32` crashes, 31 is the maximum.
This commit is contained in:
@@ -39,7 +39,7 @@ class _ListenableBuilderExampleState extends State<ListenableBuilderExample> {
|
||||
appBar: AppBar(title: const Text('ListenableBuilder Example')),
|
||||
body: ListBody(listNotifier: _listNotifier),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () => _listNotifier.add(_random.nextInt(1 << 32)), // 1 << 32 is the maximum supported value
|
||||
onPressed: () => _listNotifier.add(_random.nextInt(1 << 31)), // 1 << 31 is the maximum supported value
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user