shark 0.0.6 copy "shark: ^0.0.6" to clipboard
shark: ^0.0.6 copied to clipboard

outdated

A Flutter server rendering framework for mobile application

Shark Flutter 🦈 (Under Construction) #

codecov pub package

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
57
likes
0
points
86
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter server rendering framework for mobile application

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

device_info_plus, dio, dynamic_widget, flutter, hive, hive_flutter, path_provider

More

Packages that depend on shark