11import 'dart:io' ;
22
33import 'package:flutter/material.dart' ;
4+ import 'package:flutter_weather_bg_null_safety/utils/weather_type.dart' ;
45import 'package:watch_it/watch_it.dart' ;
56import 'package:yaru/yaru.dart' ;
67
7- import '../../constants.dart' ;
88import '../../app/app_model.dart' ;
99import '../../app/side_bar.dart' ;
10+ import '../../constants.dart' ;
1011import '../../l10n/l10n.dart' ;
12+ import '../weather_data_x.dart' ;
13+ import '../weather_model.dart' ;
1114import 'daily_bar_chart.dart' ;
1215import 'hourly_line_chart.dart' ;
1316
@@ -20,7 +23,12 @@ class WeatherPage extends StatelessWidget with WatchItMixin {
2023 Widget build (BuildContext context) {
2124 final appModel = watchIt <AppModel >();
2225 final showToday = appModel.tabIndex == 0 ;
26+ final weatherType =
27+ watchPropertyValue ((WeatherModel m) => m.data? .weatherType);
2328
29+ final labelColor = weatherType == null
30+ ? null
31+ : contrastColor (WeatherUtil .getColor (weatherType).first);
2432 return DefaultTabController (
2533 initialIndex: appModel.tabIndex,
2634 length: 2 ,
@@ -46,6 +54,8 @@ class WeatherPage extends StatelessWidget with WatchItMixin {
4654 title: SizedBox (
4755 width: kPaneWidth,
4856 child: YaruTabBar (
57+ labelColor: labelColor,
58+ unselectedLabelColor: labelColor? .withValues (alpha: 0.8 ),
4959 onTap: (v) => appModel.tabIndex = v,
5060 tabs: [
5161 Tab (text: context.l10n.hourly),
0 commit comments