enum_to_string 1.0.2 enum_to_string: ^1.0.2 copied to clipboard
Better conversion of ENUMs to string. Dart has annoying EnumName.ValueName syntax when calling enum.toString, this package fixes that.
import 'package:enum_to_string/enum_to_string.dart';
enum TestEnum {ValueOne, Value2, valueThree}
main(){
EnumToString.parse(TestEnum.ValueOne); //ValueOne
EnumToString.parse(TestEnum.Value2); //Value2
EnumToString.parse(TestEnum.valueThree); //valueThree
EnumToString.parseCamelCase(TestEnum.ValueOne); //Value one
EnumToString.parseCamelCase(TestEnum.Value2); //Value 2
EnumToString.parseCamelCase(TestEnum.valueThree); //Value three
}