Get X Worker
Worker Type :-
- ever
- everall
- once
- debounce
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
class SimpleManagementController extends GetxController{
var count =0.obs;
void increment(){
count++;
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
// Worker
ever(count, (callback) => print('Ever'));
// List of variable in everAll Worker
everAll([count], (callback) => print('ever all'));
// called once when value change
once(count, (callback) => print('once'));
// called every time when value change with duration
debounce(count, (callback) => print('debounce'),
time: Duration(seconds: 5)
);
}
}
No comments:
Post a Comment