Daily commit
This commit is contained in:
@ -1,7 +1,19 @@
|
||||
class Car {
|
||||
String id;
|
||||
String carName;
|
||||
String? driverName;
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
Car({required this.id, required this.carName, this.driverName});
|
||||
}
|
||||
part 'car.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Car {
|
||||
final int id;
|
||||
final String carName;
|
||||
final String? driverName;
|
||||
|
||||
Car({
|
||||
required this.id,
|
||||
required this.carName,
|
||||
this.driverName,
|
||||
});
|
||||
|
||||
factory Car.fromJson(Map<String, dynamic> json) => _$CarFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$CarToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user