chore: formatted files

This commit is contained in:
Ben Vercammen 2023-03-22 08:24:24 +01:00
parent 0d969aa7f9
commit c307147780
2 changed files with 3 additions and 3 deletions

View file

@ -2,12 +2,10 @@ import 'package:angel3_orm_test/src/models/has_car.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() async { void main() async {
/// See https://github.com/dukefirehawk/angel/pull/98 /// See https://github.com/dukefirehawk/angel/pull/98
test('enum field with custom deserializer should be parsed consistently', () { test('enum field with custom deserializer should be parsed consistently', () {
final query = HasCarQuery(); final query = HasCarQuery();
final hasCar = query.parseRow([null, null, null, 'R', null]).value; final hasCar = query.parseRow([null, null, null, 'R', null]).value;
expect(hasCar.color, equals(Color.red)); expect(hasCar.color, equals(Color.red));
}); });
} }

View file

@ -18,7 +18,9 @@ Color? codeToColor(String? code) => code == null
String? colorToCode(Color? color) => color?.code; String? colorToCode(Color? color) => color?.code;
enum Color { enum Color {
red('R'), green('G'), blue('B'); red('R'),
green('G'),
blue('B');
const Color(this.code); const Color(this.code);