BloomProjectManifest.fromJson constructor
Constructs a BloomProjectManifest from a JSON json map.
Implementation
factory BloomProjectManifest.fromJson(Map<String, dynamic> json) {
return BloomProjectManifest(
projectName: json['project']?.toString() ?? json['appName']?.toString() ?? 'bloom_app',
version: json['version']?.toString() ?? '0.1.0',
host: json['host']?.toString() ?? json['ip']?.toString() ?? '127.0.0.1',
port: json['port'] is int ? json['port'] as int : int.tryParse(json['port']?.toString() ?? '') ?? 8080,
devServerUri: json['devServerUri']?.toString() ?? json['uri']?.toString() ?? '',
routes: json['routes'] is List ? List<Map<String, dynamic>>.from(json['routes'] as List) : [],
platforms: json['platforms'] is Map ? Map<String, dynamic>.from(json['platforms'] as Map) : {},
features: json['features'] is Map ? Map<String, dynamic>.from(json['features'] as Map) : {},
);
}