Is there any by which I can store multiple dart files on some server and retrieve any one of those file during run-time in such a way that Flutter is able to build a particular widget from the file it receives?
You cannot dynamically load dart files or create new classes, no.
On the other hand, the widget tree is created at runtime, and widgets are composable by nature. So it is totally possible to make a function that deserialize some data into a widget tree.
We could, for example, write a widget tree as an xml/yaml/whatever like so:
type: Row children: - type: Container color: red child: - type: Text 0: hello world
And have a function deserialize it into:
Row( children: [ Container( color: Colors.red, child: Text('hello world'), ), ], ),
Answered By – Rémi Rousselet