Skip to content

Commit 9797f60

Browse files
committed
chore: change to 3.27 on actions
chore: fix flutter color deprecations
1 parent 04c5577 commit 9797f60

16 files changed

+38
-29
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
env:
10-
FLUTTER_VERSION: "3.24.x"
10+
FLUTTER_VERSION: "3.27.x"
1111
JAVA_VERSION: "17"
1212
XCODE_VERSION: "Xcode_16"
1313

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Coverage
33
on: [push]
44

55
env:
6-
FLUTTER_VERSION: "3.24.x"
6+
FLUTTER_VERSION: "3.27.x"
77

88
jobs:
99
coverage:

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
env:
10-
FLUTTER_VERSION: "3.24.x"
10+
FLUTTER_VERSION: "3.27.x"
1111

1212
jobs:
1313
lint:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [main]
66

77
env:
8-
FLUTTER_VERSION: "3.24.x"
8+
FLUTTER_VERSION: "3.27.x"
99
JAVA_VERSION: "17"
1010
ANDROID_API_LEVEL: "34"
1111
XCODE_VERSION: "Xcode_16"

lib/pages/course_detail_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CourseDetailPage extends StatelessWidget {
8787
}
8888

8989
Widget _buildDivider() {
90-
return Divider(color: OTLColor.gray0.withOpacity(0.25));
90+
return Divider(color: OTLColor.gray0.withValues(alpha: .25));
9191
}
9292

9393
SliverPersistentHeader _buildReviewHeader() {

lib/pages/main_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class _MainPageState extends State<MainPage> {
303303
}
304304

305305
Widget _buildDivider() {
306-
return Divider(color: OTLColor.gray0.withOpacity(0.25));
306+
return Divider(color: OTLColor.gray0.withValues(alpha: .25));
307307
}
308308

309309
Widget _buildTextButtons(BuildContext context) {

lib/pages/people_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class PeoplePage extends StatelessWidget {
138138
child: Text(
139139
people_info[people[i][j]]['name'],
140140
style: TextStyle(
141-
color: Color(0xFFEBA12A).withOpacity(0.4),
141+
color: Color(0xFFEBA12A).withValues(alpha: .4),
142142
fontFamily: 'NanumSquare',
143143
fontSize: 9.5,
144144
fontWeight: FontWeight.w800,

lib/pages/user_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class UserPage extends StatelessWidget {
101101
}
102102

103103
Widget _buildDivider() {
104-
return Divider(color: OTLColor.gray0.withOpacity(0.25));
104+
return Divider(color: OTLColor.gray0.withValues(alpha: .25));
105105
}
106106

107107
Widget _buildContent(String title, String body) {

lib/utils/create_material_color.dart

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,30 @@ import 'package:flutter/material.dart';
33
MaterialColor createMaterialColor(Color color) {
44
List strengths = <double>[.05];
55
Map<int, Color> swatch = {};
6-
final int r = color.red, g = color.green, b = color.blue;
6+
final double r = color.r, g = color.g, b = color.b;
77

88
for (int i = 1; i < 10; i++) {
99
strengths.add(0.1 * i);
1010
}
1111
strengths.forEach((strength) {
1212
final double ds = 0.5 - strength;
13-
swatch[(strength * 1000).round()] = Color.fromRGBO(
14-
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
15-
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
16-
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
17-
1,
13+
swatch[(strength * 1000).round()] = Color.from(
14+
red: r + ((ds < 0 ? r : (255 - r)) * ds),
15+
green: g + ((ds < 0 ? g : (255 - g)) * ds),
16+
blue: b + ((ds < 0 ? b : (255 - b)) * ds),
17+
alpha: 1,
1818
);
1919
});
20-
return MaterialColor(color.value, swatch);
20+
return MaterialColor(color.toHexValue, swatch);
21+
}
22+
23+
extension ColorExtension on Color {
24+
int get toHexValue {
25+
final red = (r * 255).toInt().toRadixString(16).padLeft(2, '0');
26+
final green = (g * 255).toInt().toRadixString(16).padLeft(2, '0');
27+
final blue = (b * 255).toInt().toRadixString(16).padLeft(2, '0');
28+
final alpha = (a * 255).toInt().toRadixString(16).padLeft(2, '0');
29+
30+
return int.parse('$alpha$red$green$blue', radix: 16);
31+
}
2132
}

lib/widgets/course_block.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ class CourseBlock extends StatelessWidget {
9191
}
9292

9393
Widget _buildDivider() {
94-
return Divider(color: OTLColor.gray0.withOpacity(0.25));
94+
return Divider(color: OTLColor.gray0.withValues(alpha: .25));
9595
}
9696
}

lib/widgets/dropdown.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Dropdown<T> extends StatelessWidget {
109109
),
110110
if (itemData != items.last)
111111
Container(
112-
color: OTLColor.grayF.withOpacity(0.5),
112+
color: OTLColor.grayF.withValues(alpha: .5),
113113
height: 0.5,
114114
),
115115
],

lib/widgets/lecture_simple_block.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class LectureSimpleBlock extends StatelessWidget {
3737
TextSpan(
3838
style: bodyRegular.copyWith(
3939
color: hasReview
40-
? OTLColor.gray0.withOpacity(0.4)
40+
? OTLColor.gray0.withValues(alpha: .4)
4141
: OTLColor.gray0,
4242
),
4343
children: <TextSpan>[

lib/widgets/map_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class _MapViewState extends State<MapView> {
129129
Widget _buildMapPin(BuildContext context, String buildingCode) {
130130
List<BoxShadow> boxShadow = [
131131
BoxShadow(
132-
color: OTLColor.gray0.withOpacity(0.25),
132+
color: OTLColor.gray0.withValues(alpha: .25),
133133
blurRadius: 4,
134134
offset: Offset(0, 4),
135135
)
@@ -234,7 +234,7 @@ class _MapViewState extends State<MapView> {
234234
Divider(
235235
height: 15,
236236
thickness: 1,
237-
color: OTLColor.gray0.withOpacity(0.25),
237+
color: OTLColor.gray0.withValues(alpha: .25),
238238
),
239239
const SizedBox(height: 1),
240240
...List.generate(

lib/widgets/otl_dialog.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class OTLDialog extends StatelessWidget {
178178
borderRadius: BorderRadius.circular(10),
179179
boxShadow: [
180180
BoxShadow(
181-
color: OTLColor.gray0.withOpacity(0.15),
181+
color: OTLColor.gray0.withValues(alpha: .15),
182182
offset: const Offset(2, 2),
183183
blurRadius: 16,
184184
),
@@ -310,8 +310,6 @@ class OTLDialog extends StatelessWidget {
310310
},
311311
onTap: onTapContent,
312312
);
313-
default:
314-
return SizedBox();
315313
}
316314
}
317315

lib/widgets/timetable.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ class Timetable extends StatelessWidget {
117117

118118
Widget _buildCell(int i) {
119119
if (i % 100 == 0)
120-
return Container(color: OTLColor.gray0.withOpacity(0.25), height: 1);
120+
return Container(color: OTLColor.gray0.withValues(alpha: .25), height: 1);
121121
if (i % 50 == 0)
122122
return Row(
123123
children: List.generate(
124124
20,
125125
(i) => Expanded(
126126
child: Padding(
127127
padding: const EdgeInsets.symmetric(horizontal: 1.0),
128-
child:
129-
Container(color: OTLColor.gray0.withOpacity(0.25), height: 1),
128+
child: Container(
129+
color: OTLColor.gray0.withValues(alpha: .25), height: 1),
130130
),
131131
),
132132
),

lib/widgets/today_timetable.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,16 @@ class TodayTimetable extends StatelessWidget {
107107

108108
Widget _buildCell(int i) {
109109
if (i % 100 == 0)
110-
return Container(color: OTLColor.gray0.withOpacity(0.25), width: 1);
110+
return Container(color: OTLColor.gray0.withValues(alpha: .25), width: 1);
111111
if (i % 50 == 0)
112112
return Column(
113113
children: List.generate(
114114
15,
115115
(i) => Expanded(
116116
child: Padding(
117117
padding: const EdgeInsets.symmetric(vertical: 1.0),
118-
child:
119-
Container(color: OTLColor.gray0.withOpacity(0.25), width: 1),
118+
child: Container(
119+
color: OTLColor.gray0.withValues(alpha: .25), width: 1),
120120
),
121121
),
122122
),

0 commit comments

Comments
 (0)