Closed vinicius-gregorio closed 2 weeks ago
IF I'm being dumb, could you point where the problem relies?
I was being dumb. after debugging it for 4h I noticed. The problem was inside the json structure. Before:
const json01 = {
"type": "text",
"args": {"data": "Hello, World!"}
};
after:
const json01 = {
"type": "text",
"args": {"text": "Hello, World!"}
};
I think the problem relies where the EXPORTER is exporting the "Text" args as "data". And not as "text"
So wait,.is there an issue? If so, please reopen this. It seems like the problem may not be with the renderer but with the exporter.
Describe the bug Everything is as in the
README.MD
and docs, but still not working a simple text.To Reproduce
Create a simple json structure
Create a simple page
class RendererHomePage extends StatefulWidget { const RendererHomePage({super.key});
@override State createState() => _RendererHomePageState();
}
class _RendererHomePageState extends State {
late JsonWidgetData? _data;
@override void initState() { super.initState(); _data = JsonWidgetData.fromDynamic(json01, registry: JsonWidgetRegistry.instance); }
@override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.grey[200], appBar: GlobalAppbar(title: "Renderer"), drawer: GlobalDrawer(), body: Column( children: [ if (_data != null) Container( decoration: BoxDecoration( color: Colors.transparent, border: Border.all( color: Colors.black, width: 1, )), width: 500, height: 300, child: _data!.build( context: context, registry: JsonWidgetRegistry.instance, ), ) ], ), ); } }
Pubspec.yaml of my test project:
OS:
Windows 11 / MacOS Sonoma 14.7