Open putnokiabel opened 2 months ago
That's most definitely an SDK issue, not a provider bug.
Thank you @rrousselGit !
In that case, could you help me submit an issue for this on https://github.com/flutter/flutter , or help construct a code example without the use of Provider
?
Unfortunately I'm not sure how this example would translate to the underlying APIs of the Flutter SDK.
I don't really have the time for this, sorry.
I'd suggest trying to keep your example as is. It's probably small enough.
Describe the bug When using a provider with a record type (e.g.
typedef ExampleRecord = ({String name});
), the provider is not found when compiling to WASM.To Reproduce
flutter pub add provider
main.dart
with the following:import 'package:provider/provider.dart';
typedef Record = ({String name});
void main() { runApp(const MyApp()); }
class MyApp extends StatelessWidget { const MyApp({super.key});
// This widget is the root of your application. @override Widget build(BuildContext context) { return Provider.value(
value: (name: 'Hello, World!'),
child: const MaterialApp(
home: MyHomePage(),
),
);
}
}
class MyHomePage extends StatefulWidget { const MyHomePage({super.key});
@override State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
print('build 0');
final record = context.read();
print('build 1');
} }