feat: Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
@immutable
|
||||
class MobilityModel {
|
||||
const MobilityModel({
|
||||
required this.hasACar,
|
||||
required this.canRelocate,
|
||||
});
|
||||
|
||||
factory MobilityModel.fromJson(Map<String, dynamic> json) {
|
||||
return MobilityModel(
|
||||
hasACar: json['has_car'] as bool? ?? false,
|
||||
canRelocate: json['can_relocate'] as bool? ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
final bool hasACar;
|
||||
final bool canRelocate;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'has_car': hasACar,
|
||||
'can_relocate': canRelocate,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user