bedrock

Creator: coderz1093

Last updated:

0 purchases

bedrock Image
bedrock Images

Languages

Categories

Add to Cart

Description:

bedrock

bedrock #
Make app builds easier.

Features #

BedrockWidgetBuilder (base on Get)

Usage #
Easy to set the screen not sleep
await Bedrock.instance.wakelock.enable();
copied to clipboard
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();
}
}
copied to clipboard

create a class

class Counter extends BedrockWidget<Controller> {
const Counter({super.key, required super.controller});

@override
Widget build(BuildContext context) {
return Text('${controller.count}');
}
}
copied to clipboard

create a builder

class CounterBuilder extends BedrockWidgetBuilder<Controller, Counter> {
const CounterBuilder({super.key, super.group, required super.child});
}
copied to clipboard

insert controller and add builder where you want

Get.lazyPut<Controller>(() => Controller());

CounterBuilder(
child: (Controller controller) => Counter(controller: controller),
)
copied to clipboard

operating controller anywhere

final Controller controller => Get.find();
controller.increase();
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.