Apparence-io / quick_settings

A Flutter plugin to manage a custom Tile in Quick Settings
https://pub.dev/packages/quick_settings
MIT License
18 stars 4 forks source link

Updating the Tile #5

Open Eliote opened 1 year ago

Eliote commented 1 year ago

Hello, It would be really useful to have a way to update the Tile at any given time.

This would allow us to something like the following:

Tile? onTileClicked(Tile tile) {
  tile.label = "Starting...";
  tile.tileStatus = TileStatus.unavailable;
  unawaited(foo(tile));
  return tile;
}

Future<void> foo(Tile tile) async {
  final didItWork = await bar();
  tile.label = didItWork ? "FooBar ON" : "FooBar OFF";
  tile.tileStatus = didItWork ? TileStatus.active : TileStatus.inactive;
  QuickSettings.updateTile(tile);
}
AliNajafzadeh7916 commented 7 months ago

Hello I also faced this issue and I need it

Is it possible to add it to the package?