Created
February 8, 2016 23:32
-
-
Save collinjackson/b7af2b2fc2349594e1f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Configurable state of an input field. | |
class InputValue { | |
const InputValue({ this.text: '', this.selection }); | |
/// The current text being edited. | |
String text; | |
/// The range of text that is currently selected. | |
TextSelection selection; | |
static InputValue get empty => const InputValue(); | |
bool operator==(Object other) { | |
if (other.runtimeType != runtimeType) | |
return false; | |
InputValue otherValue = other; | |
return (otherValue.text == text) && | |
(otherValue.selection == selection); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment