Skip to content

Commit 573d927

Browse files
committed
chore: update flutter and remove custom settings
1 parent 8184194 commit 573d927

35 files changed

+631
-495
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [master]
66

77
env:
8-
FLUTTER_VERSION: '3.19.x'
8+
FLUTTER_VERSION: '3.27.4'
99

1010
jobs:
1111
analyze:
@@ -49,6 +49,6 @@ jobs:
4949
channel: 'stable'
5050
flutter-version: ${{env.FLUTTER_VERSION}}
5151
- run: sudo apt update
52-
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libmpv-dev
52+
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libsecret-1-0
5353
- run: flutter pub get
5454
- run: flutter build linux -v

analysis_options.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ linter:
1010
require_trailing_commas: true
1111
use_super_parameters: true
1212
close_sinks: true
13-
prefer_relative_imports: true
13+
prefer_relative_imports: true
14+
sort_pub_dependencies: true
15+
unnecessary_parenthesis: true
16+
unnecessary_await_in_return: true
17+
unnecessary_late: true
18+
unnecessary_breaks: true

l10n.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
arb-dir: lib/src/l10n
1+
arb-dir: lib/l10n
22
template-arb-file: app_en.arb
33
output-localization-file: app_localizations.dart
44
nullable-getter: false

lib/src/app/app.dart renamed to lib/app/app.dart

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import 'package:flutter_weather_bg_null_safety/bg/weather_bg.dart';
66
import 'package:watch_it/watch_it.dart';
77
import 'package:yaru/yaru.dart';
88

9-
import '../../constants.dart';
10-
import '../../weather.dart';
11-
import '../build_context_x.dart';
9+
import '../constants.dart';
10+
import '../weather.dart';
11+
import '../extensions/build_context_x.dart';
1212
import '../l10n/l10n.dart';
1313
import '../weather/weather_model.dart';
1414
import 'side_bar.dart';
@@ -27,12 +27,12 @@ class App extends StatelessWidget {
2727
darkTheme: yaruDark.copyWith(
2828
tabBarTheme: TabBarTheme.of(context).copyWith(
2929
labelColor: Colors.white,
30-
unselectedLabelColor: Colors.white.withOpacity(
31-
0.8,
30+
unselectedLabelColor: Colors.white.withValues(
31+
alpha: 0.8,
3232
),
3333
),
3434
),
35-
home: const AppPage(),
35+
home: const StartPage(),
3636
scrollBehavior: const MaterialScrollBehavior().copyWith(
3737
dragDevices: {
3838
PointerDeviceKind.mouse,
@@ -46,6 +46,45 @@ class App extends StatelessWidget {
4646
}
4747
}
4848

49+
class StartPage extends StatefulWidget {
50+
const StartPage({super.key});
51+
52+
@override
53+
State<StartPage> createState() => _StartPageState();
54+
}
55+
56+
class _StartPageState extends State<StartPage> {
57+
late final Future<void> _allReady;
58+
59+
@override
60+
void initState() {
61+
super.initState();
62+
_allReady = di.allReady();
63+
}
64+
65+
@override
66+
Widget build(BuildContext context) => FutureBuilder(
67+
future: _allReady,
68+
builder: (context, snapshot) =>
69+
snapshot.hasData ? const AppPage() : const LoadingPage(),
70+
);
71+
}
72+
73+
class LoadingPage extends StatelessWidget {
74+
const LoadingPage({super.key});
75+
76+
@override
77+
Widget build(BuildContext context) => const Scaffold(
78+
appBar: YaruWindowTitleBar(
79+
border: BorderSide.none,
80+
backgroundColor: Colors.transparent,
81+
),
82+
body: Center(
83+
child: YaruCircularProgressIndicator(),
84+
),
85+
);
86+
}
87+
4988
class AppPage extends StatefulWidget with WatchItStatefulWidgetMixin {
5089
const AppPage({super.key});
5190

@@ -56,12 +95,6 @@ class AppPage extends StatefulWidget with WatchItStatefulWidgetMixin {
5695
class _AppPageState extends State<AppPage> {
5796
@override
5897
void initState() {
59-
YaruWindow.of(context).onClose(
60-
() async {
61-
await di.reset();
62-
return true;
63-
},
64-
);
6598
di<WeatherModel>().loadWeather();
6699
super.initState();
67100
}
File renamed without changes.

lib/src/app/offline_page.dart renamed to lib/app/offline_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:yaru/yaru.dart';
33

4-
import '../build_context_x.dart';
4+
import '../extensions/build_context_x.dart';
55
import '../l10n/l10n.dart';
66

77
class OfflinePage extends StatelessWidget {

lib/src/app/side_bar.dart renamed to lib/app/side_bar.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
22
import 'package:watch_it/watch_it.dart';
33
import 'package:yaru/yaru.dart';
44

5-
import '../../constants.dart';
6-
import '../build_context_x.dart';
5+
import '../constants.dart';
6+
import '../extensions/build_context_x.dart';
77
import '../weather/view/city_search_field.dart';
88
import '../weather/weather_model.dart';
99

@@ -66,7 +66,7 @@ class SideBar extends StatelessWidget with WatchItMixin {
6666
);
6767

6868
return Material(
69-
color: theme.colorScheme.surface.withOpacity(0.4),
69+
color: theme.colorScheme.surface.withValues(alpha: 0.4),
7070
child: SizedBox(
7171
width: kPaneWidth,
7272
child: Column(
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)