Skip to content

Instantly share code, notes, and snippets.

@Albert221
Created June 17, 2022 12:20
Show Gist options
  • Save Albert221/c62ad9f782c7021690f9bf585ce8fd5c to your computer and use it in GitHub Desktop.
Save Albert221/c62ad9f782c7021690f9bf585ce8fd5c to your computer and use it in GitHub Desktop.
NeverChangingValueListenable<T> for Flutter
import 'package:flutter/foundation.dart';
class NeverChangingValueListenable<T> implements ValueListenable<T> {
const NeverChangingValueListenable(this.value);
@override
final T value;
@override
void addListener(VoidCallback listener) {}
@override
void removeListener(VoidCallback listener) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment