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

A Flutter server rendering framework for mobile application

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shark/shark.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Shark.init(hostUrl: 'http://localhost:8080');

  runApp(MaterialApp(home: MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final SharkController _controller;

  @override
  void initState() {
    _controller = SharkController.fromUrl(
      '/container',
    )..get();

    /// After 10 secs, redirect to text widget
    /* Timer(Duration(seconds: 5), () {
      _controller.redirect(path: '/text');
    });*/
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return SharkWidget(
      controller: _controller,
      clickEvent: (event) {
        print(event);
      },
    );
  }
}
56
likes
120
pub points
0%
popularity

Publisher

unverified uploader

A Flutter server rendering framework for mobile application

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

device_info_plus, dio, dio_cache_interceptor, dynamic_widget, flutter, path_provider, url_launcher

More

Packages that depend on shark