Skip to content

Commit 1cb9e9f

Browse files
author
Csongor Keller
committed
v2.4.1 formatting and package description update
1 parent 9db5770 commit 1cb9e9f

16 files changed

+397
-206
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ Easy-to integrate widgets and exported functions are also part of the package.
4949

5050
## [2.4.0] - 24/01/2025
5151

52-
* Better documentation added to the whole project
52+
* Better documentation added to the whole project
53+
54+
## [2.4.1] - 24/01/2025
55+
56+
* Formatting and package description updated

example/lib/modules/weather_summary_widget.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,22 @@ class WeatherSummary extends StatelessWidget {
138138
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
139139
children: [
140140
Container(
141-
child: _buildMinMaxRow(icon: Icons.arrow_drop_up_sharp, temperature: maxTemperature),
141+
child: _buildMinMaxRow(
142+
icon: Icons.arrow_drop_up_sharp,
143+
temperature: maxTemperature),
142144
),
143145
Container(
144-
child: _buildMinMaxRow(icon: Icons.arrow_drop_down_sharp, temperature: minTemperature),
146+
child: _buildMinMaxRow(
147+
icon: Icons.arrow_drop_down_sharp,
148+
temperature: minTemperature),
145149
),
146150
],
147151
),
148152
),
149153
Padding(
150154
padding: const EdgeInsets.only(top: 20),
151-
child: _buildHumidutyAndPressureRow(humidity: humidity, pressure: pressure),
155+
child: _buildHumidutyAndPressureRow(
156+
humidity: humidity, pressure: pressure),
152157
)
153158
],
154159
);

example/lib/screens/prebuilt_functions_demo_screen.dart

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,56 @@ class _PrebuiltFunctionScreenState extends State<PrebuiltFunctionScreen> {
4141
///
4242
/// Returns a [WeatherData] object containing the current weather information.
4343
Future<WeatherData> _getCurrentweatherByCity() async {
44-
return openWeather.currentWeatherByCityName(cityName: _cityName, weatherUnits: WeatherUnits.METRIC);
44+
return openWeather.currentWeatherByCityName(
45+
cityName: _cityName, weatherUnits: WeatherUnits.METRIC);
4546
}
4647

4748
/// Fetches the current weather data by geographic location.
4849
///
4950
/// Returns a [WeatherData] object containing the current weather information.
5051
Future<WeatherData> _getCurrentweatherByLocation() async {
5152
return openWeather.currentWeatherByLocation(
52-
latitude: _latitude, longitude: _longitude, weatherUnits: WeatherUnits.METRIC);
53+
latitude: _latitude,
54+
longitude: _longitude,
55+
weatherUnits: WeatherUnits.METRIC);
5356
}
5457

5558
/// Fetches the current weather data by zip code.
5659
///
5760
/// Returns a [WeatherData] object containing the current weather information.
5861
Future<WeatherData> _getCurrentweatherByZipCode() async {
5962
return openWeather.currentWeatherByZipCode(
60-
zipCode: _zipCode, countryCode: _countryCode, weatherUnits: WeatherUnits.METRIC);
63+
zipCode: _zipCode,
64+
countryCode: _countryCode,
65+
weatherUnits: WeatherUnits.METRIC);
6166
}
6267

6368
/// Fetches the five-day weather forecast by city name.
6469
///
6570
/// Returns a [WeatherForecastData] object containing the weather forecast information.
6671
Future<WeatherForecastData> _getFiveDaysForecastByCityName() async {
67-
return openWeather.fiveDaysWeatherForecastByCityName(cityName: _cityName, weatherUnits: WeatherUnits.METRIC);
72+
return openWeather.fiveDaysWeatherForecastByCityName(
73+
cityName: _cityName, weatherUnits: WeatherUnits.METRIC);
6874
}
6975

7076
/// Fetches the five-day weather forecast by geographic location.
7177
///
7278
/// Returns a [WeatherForecastData] object containing the weather forecast information.
7379
Future<WeatherForecastData> _getFiveDaysForecastByLocation() async {
7480
return openWeather.fiveDaysWeatherForecastByLocation(
75-
latitude: _latitude, longitude: _longitude, weatherUnits: WeatherUnits.METRIC);
81+
latitude: _latitude,
82+
longitude: _longitude,
83+
weatherUnits: WeatherUnits.METRIC);
7684
}
7785

7886
/// Fetches the five-day weather forecast by zip code.
7987
///
8088
/// Returns a [WeatherForecastData] object containing the weather forecast information.
8189
Future<WeatherForecastData> _getFiveDaysForecastByZipCode() async {
8290
return openWeather.fiveDaysWeatherForecastByZipCode(
83-
zipCode: _zipCode, countryCode: _countryCode, weatherUnits: WeatherUnits.METRIC);
91+
zipCode: _zipCode,
92+
countryCode: _countryCode,
93+
weatherUnits: WeatherUnits.METRIC);
8494
}
8595

8696
/// Builds a button that navigates back to the previous screen.
@@ -103,7 +113,9 @@ class _PrebuiltFunctionScreenState extends State<PrebuiltFunctionScreen> {
103113
backgroundColor: Colors.white,
104114
elevation: 0,
105115
title: const Text('OpenWeather prebuilt functions',
106-
style: TextStyle(color: Colors.black), maxLines: 2, textAlign: TextAlign.center),
116+
style: TextStyle(color: Colors.black),
117+
maxLines: 2,
118+
textAlign: TextAlign.center),
107119
),
108120
body: Container(
109121
width: double.infinity,
@@ -121,12 +133,19 @@ class _PrebuiltFunctionScreenState extends State<PrebuiltFunctionScreen> {
121133
),
122134
WeatherSummary(
123135
color: Colors.black,
124-
imageUrl: 'https://openweathermap.org/img/wn/${snapshot.data!.details.first.icon}@2x.png',
125-
currentTemperature: snapshot.data!.temperature.currentTemperature.toString(),
126-
maxTemperature: snapshot.data!.temperature.tempMax.toString(),
127-
minTemperature: snapshot.data!.temperature.tempMin.toString(),
128-
humidity: snapshot.data!.temperature.humidity.toString(),
129-
pressure: snapshot.data!.temperature.pressure.toString(),
136+
imageUrl:
137+
'https://openweathermap.org/img/wn/${snapshot.data!.details.first.icon}@2x.png',
138+
currentTemperature: snapshot
139+
.data!.temperature.currentTemperature
140+
.toString(),
141+
maxTemperature:
142+
snapshot.data!.temperature.tempMax.toString(),
143+
minTemperature:
144+
snapshot.data!.temperature.tempMin.toString(),
145+
humidity:
146+
snapshot.data!.temperature.humidity.toString(),
147+
pressure:
148+
snapshot.data!.temperature.pressure.toString(),
130149
),
131150
_buildButton()
132151
],

example/lib/screens/prebuilt_widgets_demo_screen.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ class _PrebuiltWidgetsScreenState extends State<PrebuiltWidgetsScreen> {
2929
Widget _buildButton() {
3030
return ElevatedButton(
3131
child: const Text('Check with prebuilt functions'),
32-
onPressed: () =>
33-
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => const PrebuiltFunctionScreen())),
32+
onPressed: () => Navigator.push(
33+
context,
34+
MaterialPageRoute(
35+
builder: (BuildContext context) =>
36+
const PrebuiltFunctionScreen())),
3437
);
3538
}
3639

0 commit comments

Comments
 (0)