flutter_reference 0.0.2 copy "flutter_reference: ^0.0.2" to clipboard
flutter_reference: ^0.0.2 copied to clipboard

outdated

A simple Flutter plugin to keep object in memory on native code, while pass a string reference to Flutter code.

example/example.md

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter_reference/flutter_reference.dart';

class Fruit extends Reference {
  @protected
  Fruit(super.id);

  static Future<Fruit> create() {
    return _FruitChannel.create();
  }

  Future<String> name() {
    return _FruitChannel.name(this);
  }
}

class _FruitChannel {
  static const channel = MethodChannel("example_plugin");

  static Future<Fruit> create() {
    return channel.invokeMethod("create").then((value) => Fruit(value));
  }

  static Future<String> name(final Fruit fruit) {
    return channel
        .invokeMethod("name", fruit.id)
        .then((value) => value.toString());
  }
}
1
likes
0
points
15
downloads

Publisher

verified publisherdig.dev.br

Weekly Downloads

A simple Flutter plugin to keep object in memory on native code, while pass a string reference to Flutter code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_reference

Packages that implement flutter_reference