Tab bar to scroll different location
This commit is contained in:
@@ -26,16 +26,7 @@ class _CompactWeatherDataState extends State<CompactWeatherData> {
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
_weatherData(),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(35),
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fill,
|
||||
child: Icon(weatherIcon(
|
||||
widget.dwm.prevalentWeatherIcon()))))),
|
||||
]),
|
||||
_weatherData(),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -63,56 +54,65 @@ class _CompactWeatherDataState extends State<CompactWeatherData> {
|
||||
}
|
||||
|
||||
Widget _weatherData() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${widget.dwm.dailyMaxTemp()} °C ",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge!
|
||||
.copyWith(fontStyle: FontStyle.normal),
|
||||
),
|
||||
const Icon(
|
||||
Icons.circle,
|
||||
size: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Text(
|
||||
" ${widget.dwm.dailyMinTemp()} °C",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge!
|
||||
.copyWith(fontStyle: FontStyle.normal, color: Colors.grey),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.barometer),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAveragePressure().toString()} hPa")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.raindrop),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyPrecipitation().toString()} mm")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.cloud),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAverageCloudCover().toString()} %")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.windy),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAverageWindSpeed().toString()} km/h")
|
||||
]),
|
||||
],
|
||||
);
|
||||
return Row(children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
"${widget.dwm.dailyMaxTemp()} °C ",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge!
|
||||
.copyWith(fontStyle: FontStyle.normal),
|
||||
),
|
||||
const Icon(
|
||||
Icons.circle,
|
||||
size: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
Text(
|
||||
" ${widget.dwm.dailyMinTemp()} °C",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge!
|
||||
.copyWith(fontStyle: FontStyle.normal, color: Colors.grey),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.barometer),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAveragePressure().toString()} hPa")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.raindrop),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyPrecipitation().toString()} mm")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.cloud),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAverageCloudCover().toString()} %")
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
|
||||
const Icon(WeatherIcons.windy),
|
||||
const SizedBox(width: 10),
|
||||
Text("${widget.dwm.dailyAverageWindSpeed().toString()} km/h")
|
||||
]),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 35),
|
||||
child: FittedBox(
|
||||
fit: BoxFit.contain,
|
||||
child:
|
||||
Icon(weatherIcon(widget.dwm.prevalentWeatherIcon()))))),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user