Thursday, March 7, 2024

Get X Worker

 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

Featured post

Compress Image With Show File Size & Resolution in Flutter

 Compress Image With Show File Size & Resolution  1.Multiple File Image Compress with file Size import 'dart:io' ; import 'p...

LightBlog