feat: implement core architecture, design system, localization, and trip features for both driver and rider apps.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// نقطة توقف أثناء الرحلة.
|
||||
class StopModel extends Equatable {
|
||||
final double lat;
|
||||
final double lng;
|
||||
final String? label;
|
||||
final String? address;
|
||||
|
||||
const StopModel({
|
||||
required this.lat,
|
||||
required this.lng,
|
||||
this.label,
|
||||
this.address,
|
||||
});
|
||||
|
||||
factory StopModel.fromJson(Map<String, dynamic> j) => StopModel(
|
||||
lat: (j['lat'] as num).toDouble(),
|
||||
lng: (j['lng'] as num).toDouble(),
|
||||
label: j['label'] as String?,
|
||||
address: j['address'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'lat': lat,
|
||||
'lng': lng,
|
||||
if (label != null) 'label': label,
|
||||
if (address != null) 'address': address,
|
||||
};
|
||||
|
||||
@override
|
||||
List<Object?> get props => [lat, lng, label, address];
|
||||
}
|
||||
Reference in New Issue
Block a user