You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Attention. This is not an official package yet. Still in the development and testing phase.
Floating dynamic UI
Flutter Dynamic UI aims to make it easier to update the user interface in Flutter applications in a simple and efficient way, inspired by the concept of "code push".
The project allows the definition of the user interface through a formatted string called “coc string”, providing flexibility and ease in maintaining and updating the UI.
Language structure
The language uses an approach based on formatted strings, called "coc strings", to represent the hierarchy of components and their properties. Each component is defined with its properties in a readable format, followed by the “break” keyword to indicate the end of that specific block.
Example of "string coc":
String application=""" Center break Container color: deepPurpleAccent height: 100 width: 100 break Text text: Lorem ipsum dolor sit amet consectetur adipisicing elit and definition. textAlign: center break""";
Parser and Builder
The project includes a set of parsing functions and a constructor that interprets the "coc string" to create the corresponding widget hierarchy. Analysis is performed through a set of logic that recognizes components and properties, while the builder translates this information into Flutter widgets.
Supported Components
Currently, the project supports the following components:
MaterialApp
Scaffolding
AppBar
Column
Container
SizedBox
Center
Text
Each component has a set of specific properties that can be configured in the "coc string".
Example of use
You can integrateFlutter Dynamic UI into your project as follows:
Add thestring coc to a file, for exampleapp.flutter:
MaterialApp debugShowCheckedModeBanner:false useMaterial3:falsebreakScaffold enableAppBar:true title:AppDemo centerTitle:falsebreakColumn length:2breakText text:First text textAlign: centerbreakText text:Second text textAlign: centerbreak
Import the "coc string" intomain.dart and use the constructor to create the interface:
voidmain()=>runApp(builder(string));
This approach allows for a clear separation between interface definition and Dart logic, providing flexibility for remote updates.
Contribution
Contributions are welcome! Feel free to open issues and submit pull requests to makeFlutter Dynamic UI even more robust and versatile.