import 'package:isar/isar.dart'; part 'db.g.dart'; @collection class Settings { Id id = Isar.autoIncrement; bool onboard = false; String? theme = 'system'; bool location = false; bool notifications = false; bool materialColor = false; bool amoledTheme = false; bool roundDegree = false; bool largeElement = false; bool hideMap = false; String? widgetBackgroundColor; String? widgetTextColor; String measurements = 'metric'; String degrees = 'celsius'; String wind = 'kph'; String pressure = 'hPa'; String timeformat = '24'; String? language; int? timeRange; String? timeStart; String? timeEnd; } @collection class MainWeatherCache { Id id = Isar.autoIncrement; List? time; List? weathercode; List? temperature2M; List? apparentTemperature; List? relativehumidity2M; List? precipitation; List? rain; List? surfacePressure; List? visibility; List? evapotranspiration; List? windspeed10M; List? winddirection10M; List? windgusts10M; List? cloudcover; List? uvIndex; List? dewpoint2M; List? precipitationProbability; List? shortwaveRadiation; List? timeDaily; List? weathercodeDaily; List? temperature2MMax; List? temperature2MMin; List? apparentTemperatureMax; List? apparentTemperatureMin; List? sunrise; List? sunset; List? precipitationSum; List? precipitationProbabilityMax; List? windspeed10MMax; List? windgusts10MMax; List? uvIndexMax; List? rainSum; List? winddirection10MDominant; String? timezone; DateTime? timestamp; MainWeatherCache({ this.time, this.temperature2M, this.relativehumidity2M, this.apparentTemperature, this.precipitation, this.rain, this.weathercode, this.surfacePressure, this.visibility, this.evapotranspiration, this.windspeed10M, this.winddirection10M, this.windgusts10M, this.cloudcover, this.uvIndex, this.dewpoint2M, this.precipitationProbability, this.shortwaveRadiation, this.timeDaily, this.weathercodeDaily, this.temperature2MMax, this.temperature2MMin, this.apparentTemperatureMax, this.apparentTemperatureMin, this.sunrise, this.sunset, this.precipitationSum, this.precipitationProbabilityMax, this.windspeed10MMax, this.windgusts10MMax, this.uvIndexMax, this.rainSum, this.winddirection10MDominant, this.timezone, this.timestamp, }); Map toJson() => { 'id': id, 'time': time, 'weathercode': weathercode, 'temperature2M': temperature2M, 'apparentTemperature': apparentTemperature, 'relativehumidity2M': relativehumidity2M, 'precipitation': precipitation, 'rain': rain, 'surfacePressure': surfacePressure, 'visibility': visibility, 'evapotranspiration': evapotranspiration, 'windspeed10M': windspeed10M, 'winddirection10M': winddirection10M, 'windgusts10M': windgusts10M, 'cloudcover': cloudcover, 'uvIndex': uvIndex, 'dewpoint2M': dewpoint2M, 'precipitationProbability': precipitationProbability, 'shortwaveRadiation': shortwaveRadiation, 'timeDaily': timeDaily, 'weathercodeDaily': weathercodeDaily, 'temperature2MMax': temperature2MMax, 'temperature2MMin': temperature2MMin, 'apparentTemperatureMax': apparentTemperatureMax, 'apparentTemperatureMin': apparentTemperatureMin, 'sunrise': sunrise, 'sunset': sunset, 'precipitationSum': precipitationSum, 'precipitationProbabilityMax': precipitationProbabilityMax, 'windspeed10MMax': windspeed10MMax, 'windgusts10MMax': windgusts10MMax, 'uvIndexMax': uvIndexMax, 'rainSum': rainSum, 'winddirection10MDominant': winddirection10MDominant, 'timezone': timezone, 'timestamp': timestamp, }; } @collection class LocationCache { Id id = Isar.autoIncrement; double? lat; double? lon; String? city; String? district; LocationCache({this.lat, this.lon, this.city, this.district}); Map toJson() => { 'id': id, 'lat': lat, 'lon': lon, 'city': city, 'district': district, }; } @collection class WeatherCard { Id id = Isar.autoIncrement; List? time; List? weathercode; List? temperature2M; List? apparentTemperature; List? relativehumidity2M; List? precipitation; List? rain; List? surfacePressure; List? visibility; List? evapotranspiration; List? windspeed10M; List? winddirection10M; List? windgusts10M; List? cloudcover; List? uvIndex; List? dewpoint2M; List? precipitationProbability; List? shortwaveRadiation; List? timeDaily; List? weathercodeDaily; List? temperature2MMax; List? temperature2MMin; List? apparentTemperatureMax; List? apparentTemperatureMin; List? sunrise; List? sunset; List? precipitationSum; List? precipitationProbabilityMax; List? windspeed10MMax; List? windgusts10MMax; List? uvIndexMax; List? rainSum; List? winddirection10MDominant; double? lat; double? lon; String? city; String? district; String? timezone; DateTime? timestamp; int? index; WeatherCard({ this.time, this.temperature2M, this.relativehumidity2M, this.apparentTemperature, this.precipitation, this.rain, this.weathercode, this.surfacePressure, this.visibility, this.evapotranspiration, this.windspeed10M, this.winddirection10M, this.windgusts10M, this.cloudcover, this.uvIndex, this.dewpoint2M, this.precipitationProbability, this.shortwaveRadiation, this.timeDaily, this.weathercodeDaily, this.temperature2MMax, this.temperature2MMin, this.apparentTemperatureMax, this.apparentTemperatureMin, this.sunrise, this.sunset, this.precipitationSum, this.precipitationProbabilityMax, this.windspeed10MMax, this.windgusts10MMax, this.uvIndexMax, this.rainSum, this.winddirection10MDominant, this.lat, this.lon, this.city, this.district, this.timezone, this.timestamp, this.index, }); Map toJson() => { 'id': id, 'time': time, 'weathercode': weathercode, 'temperature2M': temperature2M, 'apparentTemperature': apparentTemperature, 'relativehumidity2M': relativehumidity2M, 'precipitation': precipitation, 'rain': rain, 'surfacePressure': surfacePressure, 'visibility': visibility, 'evapotranspiration': evapotranspiration, 'windspeed10M': windspeed10M, 'winddirection10M': winddirection10M, 'windgusts10M': windgusts10M, 'cloudcover': cloudcover, 'uvIndex': uvIndex, 'dewpoint2M': dewpoint2M, 'precipitationProbability': precipitationProbability, 'shortwaveRadiation': shortwaveRadiation, 'timeDaily': timeDaily, 'weathercodeDaily': weathercodeDaily, 'temperature2MMax': temperature2MMax, 'temperature2MMin': temperature2MMin, 'apparentTemperatureMax': apparentTemperatureMax, 'apparentTemperatureMin': apparentTemperatureMin, 'sunrise': sunrise, 'sunset': sunset, 'precipitationSum': precipitationSum, 'precipitationProbabilityMax': precipitationProbabilityMax, 'windspeed10MMax': windspeed10MMax, 'windgusts10MMax': windgusts10MMax, 'uvIndexMax': uvIndexMax, 'rainSum': rainSum, 'winddirection10MDominant': winddirection10MDominant, 'timezone': timezone, 'timestamp': timestamp, 'lat': lat, 'lon': lon, 'city': city, 'district': district, 'index': index, }; factory WeatherCard.fromJson(Map json) { return WeatherCard( time: List.from(json['time'] ?? []), weathercode: List.from(json['weathercode'] ?? []), temperature2M: List.from(json['temperature2M'] ?? []), apparentTemperature: List.from( json['apparentTemperature'] ?? [], ), relativehumidity2M: List.from(json['relativehumidity2M'] ?? []), precipitation: List.from(json['precipitation'] ?? []), rain: List.from(json['rain'] ?? []), surfacePressure: List.from(json['surfacePressure'] ?? []), visibility: List.from(json['visibility'] ?? []), evapotranspiration: List.from(json['evapotranspiration'] ?? []), windspeed10M: List.from(json['windspeed10M'] ?? []), winddirection10M: List.from(json['winddirection10M'] ?? []), windgusts10M: List.from(json['windgusts10M'] ?? []), cloudcover: List.from(json['cloudcover'] ?? []), uvIndex: List.from(json['uvIndex'] ?? []), dewpoint2M: List.from(json['dewpoint2M'] ?? []), precipitationProbability: List.from( json['precipitationProbability'] ?? [], ), shortwaveRadiation: List.from(json['shortwaveRadiation'] ?? []), timeDaily: List.from(json['timeDaily'] ?? []), weathercodeDaily: List.from(json['weathercodeDaily'] ?? []), temperature2MMax: List.from(json['temperature2MMax'] ?? []), temperature2MMin: List.from(json['temperature2MMin'] ?? []), apparentTemperatureMax: List.from( json['apparentTemperatureMax'] ?? [], ), apparentTemperatureMin: List.from( json['apparentTemperatureMin'] ?? [], ), windspeed10MMax: List.from(json['windspeed10MMax'] ?? []), windgusts10MMax: List.from(json['windgusts10MMax'] ?? []), uvIndexMax: List.from(json['uvIndexMax'] ?? []), rainSum: List.from(json['rainSum'] ?? []), winddirection10MDominant: List.from( json['winddirection10MDominant'] ?? [], ), precipitationSum: List.from(json['precipitationSum'] ?? []), precipitationProbabilityMax: List.from( json['precipitationProbabilityMax'] ?? [], ), sunrise: List.from(json['sunrise'] ?? []), sunset: List.from(json['sunset'] ?? []), lat: json['lat'], lon: json['lon'], city: json['city'], district: json['district'], timezone: json['timezone'], timestamp: json['timestamp'], index: json['index'], ); } }