-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The following sample code is fine in Windows(desktop) platform, but it reports an error in web (Edge) platform.
Off topic, is this project still going to be updated?The library 'package:notifier_plugin/notifier_plugin.dart' is legacy, and shouldn't be imported into a null safe library.
import 'package:flutter/material.dart';
import 'package:notifier_plugin/notifier_plugin.dart';
ValNotifier countN = ValNotifier(initialVal: 0);
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyAppState();
}
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'App',
initialRoute: '/',
routes: {
'/': (context) => HomePage(),
},
);
}
}
class HomePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HomePageState();
}
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
print('build');
return Scaffold(
appBar: AppBar(title: Text('notifier_plugin')),
body: Column(
children: [
countN - (count)=> Text(count.toString()),
ElevatedButton(onPressed: () => countN(countN.val+1), child: Text("Click Me")),
],
),
);
}
}
Flutter Web Bootstrap: Programmatic
build
======== Exception caught by widgets library =======================================================
The following JSRangeError was thrown building KeyedSubtree-[GlobalKey#ece68]:
Invalid argument: Maximum call stack size exceeded
The relevant error-causing widget was:
Scaffold Scaffold:file:///D:/SoftwareDev/flutter/HelloWorld/lib/main.dart:42:12
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart 304:22 getMethods
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart 347:11 getMethodType
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 55:39 bind
...