bedrock 0.2.1 copy "bedrock: ^0.2.1" to clipboard
bedrock: ^0.2.1 copied to clipboard

The Flutter plugin make app builds easier, providing some convenient features for building app for Android and iOS as the bedrock.

bedrock #

Make app builds easier.

pub package

Features #

  • BedrockWidgetBuilder (base on Get)

Usage #

Easy to set the screen not sleep

await Bedrock.instance.wakelock.enable();

You can use the BedrockWidgetBuilder to simplify update ui.

  • create a controller
class Controller extends BedrockController {
  static Controller get instance => Get.find();

  int _count = 0;

  int get count => _count;

  void increase() {
    _count++;
    update();
  }
}
  • create a class
class Counter extends BedrockWidget<Controller> {
  const Counter({super.key, required super.controller});

  @override
  Widget build(BuildContext context) {
    return Text('${controller.count}');
  }
}
  • create a builder
class CounterBuilder extends BedrockWidgetBuilder<Controller, Counter> {
  const CounterBuilder({super.key, super.group, required super.child});
}
  • insert controller and add builder where you want
Get.lazyPut<Controller>(() => Controller());

CounterBuilder(
  child: (Controller controller) => Counter(controller: controller),
)
  • operating controller anywhere
final Controller controller => Get.find();
controller.increase();
1
likes
150
pub points
42%
popularity

Publisher

verified publisherchunglyric.com

The Flutter plugin make app builds easier, providing some convenient features for building app for Android and iOS as the bedrock.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

bedrock_platform_interface, flutter, get

More

Packages that depend on bedrock