mirror of
https://github.com/darkmoonight/Rain.git
synced 2025-06-28 12:09:57 +00:00
fix
This commit is contained in:
parent
8a47668bad
commit
1944bb8f1c
16 changed files with 290 additions and 246 deletions
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
|
|
|
@ -27,7 +27,7 @@ class WeatherAPI {
|
|||
: urlHourly = baseUrlHourly;
|
||||
|
||||
String baseUrlDaily =
|
||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=10&timezone=auto';
|
||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=7&timezone=auto';
|
||||
String urlDaily;
|
||||
settings.degrees == 'fahrenheit'
|
||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||
|
@ -125,7 +125,7 @@ class WeatherAPI {
|
|||
: urlHourly = baseUrlHourly;
|
||||
|
||||
String baseUrlDaily =
|
||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=10&timezone=auto';
|
||||
'latitude=$lat&longitude=$lon&daily=weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,sunset,precipitation_sum,precipitation_probability_max,windspeed_10m_max,windgusts_10m_max,uv_index_max,rain_sum,winddirection_10m_dominant&forecast_days=7&timezone=auto';
|
||||
String urlDaily;
|
||||
settings.degrees == 'fahrenheit'
|
||||
? urlDaily = '$baseUrlDaily&temperature_unit=fahrenheit'
|
||||
|
|
|
@ -6,9 +6,9 @@ class CityApi {
|
|||
List<Result> results;
|
||||
|
||||
factory CityApi.fromJson(Map<String, dynamic> json) => CityApi(
|
||||
results: json["results"] == null
|
||||
results: json['results'] == null
|
||||
? List<Result>.empty()
|
||||
: List<Result>.from(json["results"].map((x) => Result.fromJson(x))),
|
||||
: List<Result>.from(json['results'].map((x) => Result.fromJson(x))),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -26,9 +26,9 @@ class Result {
|
|||
double longitude;
|
||||
|
||||
factory Result.fromJson(Map<String, dynamic> json) => Result(
|
||||
admin1: json["admin1"] ?? '',
|
||||
name: json["name"],
|
||||
latitude: json["latitude"],
|
||||
longitude: json["longitude"],
|
||||
admin1: json['admin1'] ?? '',
|
||||
name: json['name'],
|
||||
latitude: json['latitude'],
|
||||
longitude: json['longitude'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ class WeatherDailyApi {
|
|||
|
||||
factory WeatherDailyApi.fromJson(Map<String, dynamic> json) =>
|
||||
WeatherDailyApi(
|
||||
daily: Daily.fromJson(json["daily"]),
|
||||
daily: Daily.fromJson(json['daily']),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -47,29 +47,29 @@ class Daily {
|
|||
List<int>? winddirection10MDominant;
|
||||
|
||||
factory Daily.fromJson(Map<String, dynamic> json) => Daily(
|
||||
time: List<DateTime>.from(json["time"].map((x) => DateTime.parse(x))),
|
||||
weathercode: List<int>.from(json["weathercode"].map((x) => x)),
|
||||
time: List<DateTime>.from(json['time'].map((x) => DateTime.parse(x))),
|
||||
weathercode: List<int>.from(json['weathercode'].map((x) => x)),
|
||||
temperature2MMax:
|
||||
List<double>.from(json["temperature_2m_max"].map((x) => x)),
|
||||
List<double>.from(json['temperature_2m_max'].map((x) => x)),
|
||||
temperature2MMin:
|
||||
List<double>.from(json["temperature_2m_min"].map((x) => x)),
|
||||
List<double>.from(json['temperature_2m_min'].map((x) => x)),
|
||||
apparentTemperatureMax:
|
||||
List<double>.from(json["apparent_temperature_max"].map((x) => x)),
|
||||
List<double>.from(json['apparent_temperature_max'].map((x) => x)),
|
||||
apparentTemperatureMin:
|
||||
List<double>.from(json["apparent_temperature_min"].map((x) => x)),
|
||||
sunrise: List<String>.from(json["sunrise"].map((x) => x)),
|
||||
sunset: List<String>.from(json["sunset"].map((x) => x)),
|
||||
List<double>.from(json['apparent_temperature_min'].map((x) => x)),
|
||||
sunrise: List<String>.from(json['sunrise'].map((x) => x)),
|
||||
sunset: List<String>.from(json['sunset'].map((x) => x)),
|
||||
precipitationSum:
|
||||
List<double>.from(json["precipitation_sum"].map((x) => x)),
|
||||
List<double>.from(json['precipitation_sum'].map((x) => x)),
|
||||
precipitationProbabilityMax:
|
||||
List<int>.from(json["precipitation_probability_max"].map((x) => x)),
|
||||
List<int>.from(json['precipitation_probability_max'].map((x) => x)),
|
||||
windspeed10MMax:
|
||||
List<double>.from(json["windspeed_10m_max"].map((x) => x)),
|
||||
List<double>.from(json['windspeed_10m_max'].map((x) => x)),
|
||||
windgusts10MMax:
|
||||
List<double>.from(json["windgusts_10m_max"].map((x) => x)),
|
||||
uvIndexMax: List<double>.from(json["uv_index_max"].map((x) => x)),
|
||||
rainSum: List<double>.from(json["rain_sum"].map((x) => x)),
|
||||
List<double>.from(json['windgusts_10m_max'].map((x) => x)),
|
||||
uvIndexMax: List<double>.from(json['uv_index_max'].map((x) => x)),
|
||||
rainSum: List<double>.from(json['rain_sum'].map((x) => x)),
|
||||
winddirection10MDominant:
|
||||
List<int>.from(json["winddirection_10m_dominant"].map((x) => x)),
|
||||
List<int>.from(json['winddirection_10m_dominant'].map((x) => x)),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ class WeatherHourlyApi {
|
|||
|
||||
factory WeatherHourlyApi.fromJson(Map<String, dynamic> json) =>
|
||||
WeatherHourlyApi(
|
||||
hourly: Hourly.fromJson(json["hourly"]),
|
||||
timezone: json["timezone"],
|
||||
hourly: Hourly.fromJson(json['hourly']),
|
||||
timezone: json['timezone'],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -50,25 +50,25 @@ class Hourly {
|
|||
List<double>? uvIndex;
|
||||
|
||||
factory Hourly.fromJson(Map<String, dynamic> json) => Hourly(
|
||||
time: List<String>.from(json["time"].map((x) => x)),
|
||||
temperature2M: List<double>.from(json["temperature_2m"].map((x) => x)),
|
||||
time: List<String>.from(json['time'].map((x) => x)),
|
||||
temperature2M: List<double>.from(json['temperature_2m'].map((x) => x)),
|
||||
relativehumidity2M:
|
||||
List<int>.from(json["relativehumidity_2m"].map((x) => x)),
|
||||
List<int>.from(json['relativehumidity_2m'].map((x) => x)),
|
||||
apparentTemperature:
|
||||
List<double>.from(json["apparent_temperature"].map((x) => x)),
|
||||
precipitation: List<double>.from(json["precipitation"].map((x) => x)),
|
||||
rain: List<double>.from(json["rain"].map((x) => x)),
|
||||
weathercode: List<int>.from(json["weathercode"].map((x) => x)),
|
||||
List<double>.from(json['apparent_temperature'].map((x) => x)),
|
||||
precipitation: List<double>.from(json['precipitation'].map((x) => x)),
|
||||
rain: List<double>.from(json['rain'].map((x) => x)),
|
||||
weathercode: List<int>.from(json['weathercode'].map((x) => x)),
|
||||
surfacePressure:
|
||||
List<double>.from(json["surface_pressure"].map((x) => x)),
|
||||
visibility: List<double>.from(json["visibility"].map((x) => x)),
|
||||
List<double>.from(json['surface_pressure'].map((x) => x)),
|
||||
visibility: List<double>.from(json['visibility'].map((x) => x)),
|
||||
evapotranspiration:
|
||||
List<double>.from(json["evapotranspiration"].map((x) => x)),
|
||||
windspeed10M: List<double>.from(json["windspeed_10m"].map((x) => x)),
|
||||
List<double>.from(json['evapotranspiration'].map((x) => x)),
|
||||
windspeed10M: List<double>.from(json['windspeed_10m'].map((x) => x)),
|
||||
winddirection10M:
|
||||
List<int>.from(json["winddirection_10m"].map((x) => x)),
|
||||
windgusts10M: List<double>.from(json["windgusts_10m"].map((x) => x)),
|
||||
cloudcover: List<int>.from(json["cloudcover"].map((x) => x)),
|
||||
uvIndex: List<double>.from(json["uv_index"].map((x) => x)),
|
||||
List<int>.from(json['winddirection_10m'].map((x) => x)),
|
||||
windgusts10M: List<double>.from(json['windgusts_10m'].map((x) => x)),
|
||||
cloudcover: List<int>.from(json['cloudcover'].map((x) => x)),
|
||||
uvIndex: List<double>.from(json['uv_index'].map((x) => x)),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -157,11 +157,12 @@ class LocationController extends GetxController {
|
|||
_mainWeather.value =
|
||||
await WeatherAPI().getWeatherData(_latitude.value, _longitude.value);
|
||||
|
||||
final List<PendingNotificationRequest> pendingNotificationRequests =
|
||||
await flutterLocalNotificationsPlugin.pendingNotificationRequests();
|
||||
|
||||
if (settings.notifications && pendingNotificationRequests.isEmpty) {
|
||||
notlification(_mainWeather.value);
|
||||
if (settings.notifications) {
|
||||
final List<PendingNotificationRequest> pendingNotificationRequests =
|
||||
await flutterLocalNotificationsPlugin.pendingNotificationRequests();
|
||||
if (pendingNotificationRequests.isEmpty) {
|
||||
notlification(_mainWeather.value);
|
||||
}
|
||||
}
|
||||
|
||||
await writeCache();
|
||||
|
|
|
@ -189,15 +189,48 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
|||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: TabBarView(
|
||||
controller: tabController,
|
||||
children: pages,
|
||||
child: Row(
|
||||
children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// NavigationRail(
|
||||
// selectedIndex: tabIndex,
|
||||
// labelType: NavigationRailLabelType.all,
|
||||
// onDestinationSelected: (int index) => changeTabIndex(index),
|
||||
// destinations: [
|
||||
// NavigationRailDestination(
|
||||
// icon: const Icon(Iconsax.cloud_sunny),
|
||||
// selectedIcon: const Icon(Iconsax.cloud_sunny5),
|
||||
// label: Text('name'.tr),
|
||||
// ),
|
||||
// NavigationRailDestination(
|
||||
// icon: const Icon(Iconsax.map_1),
|
||||
// selectedIcon: const Icon(Iconsax.map5),
|
||||
// label: Text('city'.tr),
|
||||
// ),
|
||||
// NavigationRailDestination(
|
||||
// icon: const Icon(Iconsax.category),
|
||||
// selectedIcon: const Icon(Iconsax.category5),
|
||||
// label: Text('settings'.tr),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// const VerticalDivider(thickness: 1, width: 1),
|
||||
// ],
|
||||
// ),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: tabController,
|
||||
children: pages,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: NavigationBar(
|
||||
onDestinationSelected: (int index) => changeTabIndex(index),
|
||||
selectedIndex: tabIndex,
|
||||
destinations: <Widget>[
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: const Icon(Iconsax.cloud_sunny),
|
||||
selectedIcon: const Icon(Iconsax.cloud_sunny5),
|
||||
|
|
|
@ -41,93 +41,75 @@ class DescContainer extends StatelessWidget {
|
|||
margin: const EdgeInsets.only(bottom: 15),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 22, bottom: 5),
|
||||
child: Column(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
runAlignment: WrapAlignment.center,
|
||||
spacing: 5,
|
||||
runSpacing: 2,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/humidity.png',
|
||||
value: '$humidity%',
|
||||
desc: 'humidity'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/temperature.png',
|
||||
value: '${feels.round()}°',
|
||||
desc: 'feels'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/fog.png',
|
||||
value: statusData.getVisibility(visibility),
|
||||
desc: 'visibility'.tr,
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/humidity.png',
|
||||
value: '$humidity%',
|
||||
desc: 'humidity'.tr,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windsock.png',
|
||||
value: '$direction°',
|
||||
desc: 'direction'.tr,
|
||||
message: message.getDirection(direction),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/wind.png',
|
||||
value: statusData.getSpeed(wind.round()),
|
||||
desc: 'wind'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windgusts.png',
|
||||
value: statusData.getSpeed(windgusts.round()),
|
||||
desc: 'windgusts'.tr,
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/temperature.png',
|
||||
value: '${feels.round()}°',
|
||||
desc: 'feels'.tr,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/evaporation.png',
|
||||
value: statusData.getPrecipitation(evaporation.abs()),
|
||||
desc: 'evaporation'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/rainfall.png',
|
||||
value: statusData.getPrecipitation(precipitation),
|
||||
desc: 'precipitation'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/water.png',
|
||||
value: statusData.getPrecipitation(rain),
|
||||
desc: 'rain'.tr,
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/fog.png',
|
||||
value: statusData.getVisibility(visibility),
|
||||
desc: 'visibility'.tr,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/cloudy.png',
|
||||
value: '$cloudcover%',
|
||||
desc: 'cloudcover'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/atmospheric.png',
|
||||
value: '${pressure.round()} ${'hPa'.tr}',
|
||||
desc: 'pressure'.tr,
|
||||
message: message.getPressure(pressure.round()),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/uv.png',
|
||||
value: '${uvIndex.round()}',
|
||||
desc: 'uvIndex'.tr,
|
||||
message: message.getUvIndex(uvIndex.round()),
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windsock.png',
|
||||
value: '$direction°',
|
||||
desc: 'direction'.tr,
|
||||
message: message.getDirection(direction),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/wind.png',
|
||||
value: statusData.getSpeed(wind.round()),
|
||||
desc: 'wind'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windgusts.png',
|
||||
value: statusData.getSpeed(windgusts.round()),
|
||||
desc: 'windgusts'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/evaporation.png',
|
||||
value: statusData.getPrecipitation(evaporation.abs()),
|
||||
desc: 'evaporation'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/rainfall.png',
|
||||
value: statusData.getPrecipitation(precipitation),
|
||||
desc: 'precipitation'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/water.png',
|
||||
value: statusData.getPrecipitation(rain),
|
||||
desc: 'rain'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/cloudy.png',
|
||||
value: '$cloudcover%',
|
||||
desc: 'cloudcover'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/atmospheric.png',
|
||||
value: '${pressure.round()} ${'hPa'.tr}',
|
||||
desc: 'pressure'.tr,
|
||||
message: message.getPressure(pressure.round()),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/uv.png',
|
||||
value: '${uvIndex.round()}',
|
||||
desc: 'uvIndex'.tr,
|
||||
message: message.getUvIndex(uvIndex.round()),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -124,7 +124,7 @@ class _InfoDailyCardState extends State<InfoDailyCard> {
|
|||
),
|
||||
const SizedBox(height: 10),
|
||||
GlowText(
|
||||
'${statusData.getDegree(widget.temperature2MMin[index].round())} / ${statusData.getDegree(widget.temperature2MMax[index].round())}',
|
||||
'${widget.temperature2MMin[index].round()} / ${widget.temperature2MMax[index].round()}',
|
||||
style: context.textTheme.titleLarge?.copyWith(
|
||||
fontSize: 35,
|
||||
fontWeight: FontWeight.w800,
|
||||
|
@ -158,83 +158,68 @@ class _InfoDailyCardState extends State<InfoDailyCard> {
|
|||
margin: const EdgeInsets.only(bottom: 15),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 20, bottom: 5),
|
||||
child: Column(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
runAlignment: WrapAlignment.center,
|
||||
spacing: 5,
|
||||
runSpacing: 2,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/cold.png',
|
||||
value: statusData.getDegree(widget
|
||||
.apparentTemperatureMin[index]
|
||||
.round()),
|
||||
desc: 'apparentTemperatureMin'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/hot.png',
|
||||
value: statusData.getDegree(widget
|
||||
.apparentTemperatureMax[index]
|
||||
.round()),
|
||||
desc: 'apparentTemperatureMax'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/uv.png',
|
||||
value: '${widget.uvIndexMax[index].round()}',
|
||||
desc: 'uvIndex'.tr,
|
||||
message: message.getUvIndex(
|
||||
widget.uvIndexMax[index].round()),
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/cold.png',
|
||||
value: statusData.getDegree(
|
||||
widget.apparentTemperatureMin[index].round()),
|
||||
desc: 'apparentTemperatureMin'.tr,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windsock.png',
|
||||
value:
|
||||
'${widget.winddirection10MDominant[index]}°',
|
||||
desc: 'direction'.tr,
|
||||
message: message.getDirection(
|
||||
widget.winddirection10MDominant[index]),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/wind.png',
|
||||
value: statusData.getSpeed(
|
||||
widget.windspeed10MMax[index].round()),
|
||||
desc: 'wind'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windgusts.png',
|
||||
value: statusData.getSpeed(
|
||||
widget.windgusts10MMax[index].round()),
|
||||
desc: 'windgusts'.tr,
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/hot.png',
|
||||
value: statusData.getDegree(
|
||||
widget.apparentTemperatureMax[index].round()),
|
||||
desc: 'apparentTemperatureMax'.tr,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
DescWeather(
|
||||
imageName: 'assets/images/humidity.png',
|
||||
value:
|
||||
'${widget.precipitationProbabilityMax[index]}%',
|
||||
desc: 'precipitationProbabilit'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/water.png',
|
||||
value: statusData
|
||||
.getPrecipitation(widget.rainSum[index]),
|
||||
desc: 'rain'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/rainfall.png',
|
||||
value: statusData.getPrecipitation(
|
||||
widget.precipitationSum[index]),
|
||||
desc: 'precipitation'.tr,
|
||||
),
|
||||
],
|
||||
DescWeather(
|
||||
imageName: 'assets/images/uv.png',
|
||||
value: '${widget.uvIndexMax[index].round()}',
|
||||
desc: 'uvIndex'.tr,
|
||||
message: message
|
||||
.getUvIndex(widget.uvIndexMax[index].round()),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windsock.png',
|
||||
value: '${widget.winddirection10MDominant[index]}°',
|
||||
desc: 'direction'.tr,
|
||||
message: message.getDirection(
|
||||
widget.winddirection10MDominant[index]),
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/wind.png',
|
||||
value: statusData.getSpeed(
|
||||
widget.windspeed10MMax[index].round()),
|
||||
desc: 'wind'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/windgusts.png',
|
||||
value: statusData.getSpeed(
|
||||
widget.windgusts10MMax[index].round()),
|
||||
desc: 'windgusts'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/humidity.png',
|
||||
value:
|
||||
'${widget.precipitationProbabilityMax[index]}%',
|
||||
desc: 'precipitationProbabilit'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/water.png',
|
||||
value: statusData
|
||||
.getPrecipitation(widget.rainSum[index]),
|
||||
desc: 'rain'.tr,
|
||||
),
|
||||
DescWeather(
|
||||
imageName: 'assets/images/rainfall.png',
|
||||
value: statusData.getPrecipitation(
|
||||
widget.precipitationSum[index]),
|
||||
desc: 'precipitation'.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -25,7 +25,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
|
|||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 15),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
@ -50,7 +50,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
|
|||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
Flexible(
|
||||
child: Image.asset(
|
||||
'assets/images/sunrise.png',
|
||||
scale: 10,
|
||||
|
@ -81,7 +81,7 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
|
|||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
Flexible(
|
||||
child: Image.asset(
|
||||
'assets/images/sunset.png',
|
||||
scale: 10,
|
||||
|
|
|
@ -14,6 +14,7 @@ import 'package:path_provider/path_provider.dart';
|
|||
import 'package:rain/app/modules/home.dart';
|
||||
import 'package:rain/app/modules/onboarding.dart';
|
||||
import 'package:rain/theme/theme.dart';
|
||||
import 'package:time_machine/time_machine.dart';
|
||||
import 'app/data/weather.dart';
|
||||
import 'translation/translation.dart';
|
||||
import 'theme/theme_controller.dart';
|
||||
|
@ -48,6 +49,7 @@ final List appLanguages = [
|
|||
];
|
||||
|
||||
void main() async {
|
||||
final String timeZoneName;
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
|
@ -58,6 +60,13 @@ void main() async {
|
|||
if (Platform.isAndroid) {
|
||||
await setOptimalDisplayMode();
|
||||
}
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
timeZoneName = await FlutterTimezone.getLocalTimezone();
|
||||
} else {
|
||||
timeZoneName = '${DateTimeZone.local}';
|
||||
}
|
||||
tz.initializeTimeZones();
|
||||
tz.setLocalLocation(tz.getLocation(timeZoneName));
|
||||
Connectivity()
|
||||
.onConnectivityChanged
|
||||
.listen((ConnectivityResult result) async {
|
||||
|
@ -68,17 +77,18 @@ void main() async {
|
|||
isDeviceConnectedNotifier.value = Future(() => false);
|
||||
}
|
||||
});
|
||||
final String timeZoneName = await FlutterTimezone.getLocalTimezone();
|
||||
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||
AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
const DarwinInitializationSettings initializationSettingsDarwin =
|
||||
DarwinInitializationSettings();
|
||||
const LinuxInitializationSettings initializationSettingsLinux =
|
||||
LinuxInitializationSettings(defaultActionName: 'Rain');
|
||||
const InitializationSettings initializationSettings = InitializationSettings(
|
||||
android: initializationSettingsAndroid,
|
||||
iOS: initializationSettingsDarwin);
|
||||
android: initializationSettingsAndroid,
|
||||
iOS: initializationSettingsDarwin,
|
||||
linux: initializationSettingsLinux,
|
||||
);
|
||||
await flutterLocalNotificationsPlugin.initialize(initializationSettings);
|
||||
tz.initializeTimeZones();
|
||||
tz.setLocalLocation(tz.getLocation(timeZoneName));
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,6 @@ class RainTheme {
|
|||
primaryColor: lightColor,
|
||||
canvasColor: lightColor,
|
||||
scaffoldBackgroundColor: lightColor,
|
||||
drawerTheme: baseLigth.drawerTheme.copyWith(
|
||||
backgroundColor: lightColor,
|
||||
),
|
||||
cardTheme: baseLigth.cardTheme.copyWith(
|
||||
color: lightColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
|
@ -37,7 +34,7 @@ class RainTheme {
|
|||
backgroundColor: lightColor,
|
||||
),
|
||||
colorScheme: baseLigth.colorScheme.copyWith(
|
||||
brightness: Brightness.dark,
|
||||
brightness: Brightness.light,
|
||||
background: lightColor,
|
||||
surface: baseLigth.colorScheme.background,
|
||||
),
|
||||
|
@ -83,9 +80,6 @@ class RainTheme {
|
|||
primaryColor: darkColor,
|
||||
canvasColor: darkColor,
|
||||
scaffoldBackgroundColor: darkColor,
|
||||
drawerTheme: baseDark.drawerTheme.copyWith(
|
||||
backgroundColor: darkColor,
|
||||
),
|
||||
cardTheme: baseDark.cardTheme.copyWith(
|
||||
color: darkColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
|
@ -143,9 +137,6 @@ class RainTheme {
|
|||
primaryColor: oledColor,
|
||||
canvasColor: oledColor,
|
||||
scaffoldBackgroundColor: oledColor,
|
||||
drawerTheme: baseDark.drawerTheme.copyWith(
|
||||
backgroundColor: oledColor,
|
||||
),
|
||||
cardTheme: baseDark.cardTheme.copyWith(
|
||||
color: oledColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
|
|
|
@ -84,7 +84,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Высокий',
|
||||
'uvVeryHigh': 'Очень высокий',
|
||||
'uvExtreme': 'Экстремальный',
|
||||
'weatherMore': 'Прогноз погоды на 10 дней',
|
||||
'weatherMore': 'Прогноз погоды на 7 дней',
|
||||
'windgusts': 'Шквал',
|
||||
'north': 'Север',
|
||||
'northeast': 'Северо-восток',
|
||||
|
@ -189,7 +189,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'High',
|
||||
'uvVeryHigh': 'Very high',
|
||||
'uvExtreme': 'Extreme',
|
||||
'weatherMore': '10-day weather forecast',
|
||||
'weatherMore': '7-day weather forecast',
|
||||
'windgusts': 'Gust',
|
||||
'north': 'North',
|
||||
'northeast': 'Northeast',
|
||||
|
@ -292,7 +292,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Élevé',
|
||||
'uvVeryHigh': 'Très élevé',
|
||||
'uvExtreme': 'Extrême',
|
||||
'weatherMore': 'Prévisions météo pour 10 jours',
|
||||
'weatherMore': 'Prévisions météo pour 7 jours',
|
||||
'windgusts': 'Rafale',
|
||||
'north': 'Nord',
|
||||
'northeast': 'Nord-Est',
|
||||
|
@ -395,7 +395,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Alto',
|
||||
'uvVeryHigh': 'Molto alto',
|
||||
'uvExtreme': 'Estremo',
|
||||
'weatherMore': 'Previsioni del tempo per 10 giorni',
|
||||
'weatherMore': 'Previsioni del tempo per 7 giorni',
|
||||
'windgusts': 'Raffica',
|
||||
'north': 'Nord',
|
||||
'northeast': 'Nord-est',
|
||||
|
@ -498,7 +498,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Hoch',
|
||||
'uvVeryHigh': 'Sehr hoch',
|
||||
'uvExtreme': 'Extrem',
|
||||
'weatherMore': '10-Tage-Wettervorhersage',
|
||||
'weatherMore': '7-Tage-Wettervorhersage',
|
||||
'windgusts': 'Böe',
|
||||
'north': 'Norden',
|
||||
'northeast': 'Nordosten',
|
||||
|
@ -600,7 +600,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Yüksek',
|
||||
'uvVeryHigh': 'Çok yüksek',
|
||||
'uvExtreme': 'Aşırı',
|
||||
'weatherMore': '10 günlük hava tahmini',
|
||||
'weatherMore': '7 günlük hava tahmini',
|
||||
'windgusts': 'Bir telaş',
|
||||
'north': 'Kuzey',
|
||||
'northeast': 'Kuzeydoğu',
|
||||
|
@ -702,7 +702,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Alto',
|
||||
'uvVeryHigh': 'Muito alto',
|
||||
'uvExtreme': 'Extremo',
|
||||
'weatherMore': 'Previsão do tempo para 10 dias',
|
||||
'weatherMore': 'Previsão do tempo para 7 dias',
|
||||
'windgusts': 'Rajadas',
|
||||
'north': 'Norte',
|
||||
'northeast': 'Nordeste',
|
||||
|
@ -805,7 +805,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Alto',
|
||||
'uvVeryHigh': 'Muy alto',
|
||||
'uvExtreme': 'Extremo',
|
||||
'weatherMore': 'Pronóstico del tiempo para 10 días',
|
||||
'weatherMore': 'Pronóstico del tiempo para 7 días',
|
||||
'windgusts': 'Ráfagas',
|
||||
'north': 'Norte',
|
||||
'northeast': 'Noreste',
|
||||
|
@ -907,7 +907,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Vysoký',
|
||||
'uvVeryHigh': 'Veľmi vysoký',
|
||||
'uvExtreme': 'Extrémny',
|
||||
'weatherMore': 'Predpoveď počasia na 10 dní',
|
||||
'weatherMore': 'Predpoveď počasia na 7 dní',
|
||||
'windgusts': 'Squall',
|
||||
'north': 'Sever',
|
||||
'northeast': 'Severo-Východ',
|
||||
|
@ -1010,7 +1010,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'Hoog',
|
||||
'uvVeryHigh': 'Erg hoog',
|
||||
'uvExtreme': 'Extreem',
|
||||
'weatherMore': '10-daagse weersverwachting',
|
||||
'weatherMore': '7-daagse weersverwachting',
|
||||
'windgusts': 'Windstoten',
|
||||
'north': 'Noord',
|
||||
'northeast': 'Noordoost',
|
||||
|
@ -1110,7 +1110,7 @@ class Translation extends Translations {
|
|||
'uvHigh': 'उच्च',
|
||||
'uvVeryHigh': 'बहुत उच्च',
|
||||
'uvExtreme': 'अत्यधिक',
|
||||
'weatherMore': '10-दिवसीय मौसम पूर',
|
||||
'weatherMore': '7-दिवसीय मौसम पूर',
|
||||
'windgusts': 'गुस्त',
|
||||
'north': 'उत्तर',
|
||||
'northeast': 'उत्तर-पूर्व',
|
||||
|
|
|
@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) {
|
|||
if (use_header_bar) {
|
||||
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
||||
gtk_widget_show(GTK_WIDGET(header_bar));
|
||||
gtk_header_bar_set_title(header_bar, "rain");
|
||||
gtk_header_bar_set_title(header_bar, "Rain");
|
||||
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
||||
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
||||
} else {
|
||||
gtk_window_set_title(window, "rain");
|
||||
gtk_window_set_title(window, "Rain");
|
||||
}
|
||||
|
||||
gtk_window_set_default_size(window, 1280, 720);
|
||||
|
|
50
pubspec.lock
50
pubspec.lock
|
@ -261,10 +261,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
version: "6.1.4"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -373,6 +373,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
geoclue:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geoclue
|
||||
sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.1"
|
||||
geocoding:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -429,6 +437,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.7"
|
||||
geolocator_linux:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geolocator_linux
|
||||
sha256: dd0f4461577e8b2560b4384a2d182230a7e075d0b193093441355f93728d1920
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -485,6 +501,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
gsettings:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gsettings
|
||||
sha256: fe90d719e09a6f36607021047e642068a0c98839d9633db00b91633420ae8b0d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.7"
|
||||
home_widget:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -789,6 +813,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.1"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: process
|
||||
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.4"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -914,6 +946,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
time_machine:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: time_machine
|
||||
sha256: b39511bf66cc8553d86c1242c43dbf67a17c594d5d7124727c1fdbf331e3989d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.17"
|
||||
timezone:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1062,10 +1102,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff
|
||||
sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "0.2.0+3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1091,5 +1131,5 @@ packages:
|
|||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.0.0 <4.0.0"
|
||||
dart: ">=3.0.6 <4.0.0"
|
||||
flutter: ">=3.10.0"
|
||||
|
|
|
@ -6,7 +6,7 @@ publish_to: "none"
|
|||
version: 1.2.0+23
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
sdk: ">=3.0.6 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
@ -26,9 +26,11 @@ dependencies:
|
|||
home_widget: ^0.3.0
|
||||
google_fonts: ^5.1.0
|
||||
flutter_glow: ^0.3.0
|
||||
time_machine: ^0.9.17
|
||||
url_launcher: ^6.1.12
|
||||
dynamic_color: ^1.6.6
|
||||
path_provider: ^2.0.15
|
||||
geolocator_linux: ^0.1.0
|
||||
flutter_timezone: ^1.0.7
|
||||
package_info_plus: ^4.0.2
|
||||
connectivity_plus: ^4.0.1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue