Skip to content

Instantly share code, notes, and snippets.

@Zujaj
Created May 19, 2022 10:10
Show Gist options
  • Save Zujaj/34aa582884aa1f920de5b4d612b65e5f to your computer and use it in GitHub Desktop.
Save Zujaj/34aa582884aa1f920de5b4d612b65e5f to your computer and use it in GitHub Desktop.
The PreviousColor ChangeNotifier class.
import 'package:flutter/material.dart';
/// A [ChangeNotifier] that holds the previous hex color value.
class PreviousColor with ChangeNotifier {
/// Holds the Hex Color Value.
String value = '';
PreviousColor(this.value);
void updateValue(String newValue) {
value = newValue;
notifyListeners();
}
@override
String toString() => 'PreviousColor(value:$value)';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment