Skip to content

Commit 05c9951

Browse files
authored
Merge pull request #36 from ashtanko/renovate/actions-setup-java-5.x
Update actions/setup-java action to v5
2 parents 116e210 + 0d9152c commit 05c9951

File tree

3 files changed

+418
-35
lines changed

3 files changed

+418
-35
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
#2 Setup Java
1919
- name: Set Up Java
20-
uses: actions/setup-java@v4.7.1
20+
uses: actions/setup-java@v5.0.0
2121
with:
2222
distribution: 'oracle'
2323
java-version: '17'

lib/features/appearance/dark_theme_screen.dart

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'package:flutter_bloc_app_template/bloc/theme/app_theme.dart';
44
import 'package:flutter_bloc_app_template/index.dart';
5-
import 'package:flutter_bloc_app_template/utils/pair.dart';
65

76
class DarkThemeScreen extends StatelessWidget {
87
const DarkThemeScreen({super.key});
@@ -16,42 +15,52 @@ class DarkThemeScreen extends StatelessWidget {
1615
body: ListView(children: <Widget>[
1716
BlocConsumer<ThemeCubit, AppThemeSettings>(
1817
builder: (context, state) {
19-
return Column(
20-
children: [
21-
...[
22-
Pair(
23-
DarkThemePreference.on,
24-
context.darkThemeOnSettingsItemTitle,
18+
return RadioGroup<int>(
19+
groupValue: state.darkTheme.darkThemeValue,
20+
onChanged: (int? value) {
21+
context.read<ThemeCubit>().updateTheme(
22+
state.copyWith(
23+
darkTheme: state.darkTheme.copyWith(
24+
darkThemeValue: value,
25+
),
26+
),
27+
);
28+
},
29+
child: Column(
30+
children: <Widget>[
31+
RadioListTile<int>(
32+
title: Text(context.darkThemeOnSettingsItemTitle),
33+
value: DarkThemePreference.on,
34+
key: Key(context.darkThemeOnSettingsItemTitle),
35+
secondary: ThemeIcon(
36+
icon: themeIcon(DarkThemePreference.on),
37+
isSelected: DarkThemePreference.on ==
38+
state.darkTheme.darkThemeValue,
39+
),
2540
),
26-
Pair(
27-
DarkThemePreference.off,
28-
context.darkThemeOffSettingsItemTitle,
41+
RadioListTile<int>(
42+
title: Text(context.darkThemeOffSettingsItemTitle),
43+
value: DarkThemePreference.off,
44+
key: Key(context.darkThemeOffSettingsItemTitle),
45+
secondary: ThemeIcon(
46+
icon: themeIcon(DarkThemePreference.off),
47+
isSelected: DarkThemePreference.off ==
48+
state.darkTheme.darkThemeValue,
49+
),
2950
),
30-
Pair(
31-
DarkThemePreference.followSystem,
32-
context.darkThemeFollowSystemSettingsItemTitle,
51+
RadioListTile<int>(
52+
title: Text(context.darkThemeFollowSystemSettingsItemTitle),
53+
value: DarkThemePreference.followSystem,
54+
key: Key(context.darkThemeFollowSystemSettingsItemTitle),
55+
secondary: ThemeIcon(
56+
icon: themeIcon(DarkThemePreference.followSystem),
57+
isSelected: DarkThemePreference.followSystem ==
58+
state.darkTheme.darkThemeValue,
59+
),
3360
),
34-
].map((elem) => RadioListTile<int>(
35-
title: Text(elem.second),
36-
value: elem.first,
37-
key: Key(elem.second),
38-
groupValue: state.darkTheme.darkThemeValue,
39-
onChanged: (value) {
40-
context.read<ThemeCubit>().updateTheme(
41-
state.copyWith(
42-
darkTheme: state.darkTheme.copyWith(
43-
darkThemeValue: value,
44-
),
45-
),
46-
);
47-
},
48-
secondary: ThemeIcon(
49-
icon: themeIcon(elem.first),
50-
isSelected:
51-
elem.first == state.darkTheme.darkThemeValue,
52-
),
53-
))
54-
],
61+
//Radio<int>(value: DarkThemePreference.off),
62+
],
63+
),
5564
);
5665
},
5766
listener: (context, state) => {},

0 commit comments

Comments
 (0)