shark 0.0.1 shark: ^0.0.1 copied to clipboard
A Flutter server rendering framework
Shark Flutter 🦈 (Under Construction) #
A Flutter server rendering framework
Project diagram #
How to use #
First, init
Shark library on main method on your application
void main() {
WidgetsFlutterBinding.ensureInitialized();
await Shark.init(hostUrl: 'http://yourhost.com');
runApp(MyApp());
}
Second, set up UI widget
- To be noticed, every thing related to widget is controlled by
SharkController
get
method is where we send the request
late final SharkController _controller;
/// init the shark controller
@override
void initState() {
_controller = SharkController.fromUrl(path: '/container',)..get();
super.initState();
}
@override
Widget build(BuildContext context) {
return SharkWidget(controller: _controller);
}
If you want to create your own parser
class MyCustomParser extends SharkParser {}
-
Remember that Shark is still on early development and lack of testing, I would not recommend you to use it on Production.
-
Note that Shark uses dynamic_widget for widget parsing,
-
To view the json format, go visit documentation on dynamic_widget.
You can also view the express server sample
Future Job #
- Routing
- Parsing widget optimization
- Security
- Caching