File tree Expand file tree Collapse file tree 8 files changed +25
-9
lines changed
studentCardComponent/views Expand file tree Collapse file tree 8 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,6 @@ extension SearchCategoryExtension on SearchCategory {
60
60
return context.tr ("rooms" );
61
61
case SearchCategory .studentClub:
62
62
return "Student Clubs" ;
63
- default :
64
- return context.tr ("unknown" );
65
63
}
66
64
}
67
65
Original file line number Diff line number Diff line change
1
+ import 'dart:ui' ;
2
+
3
+ extension IntColorComponents on Color {
4
+ int get intValue {
5
+ return _floatToInt8 (a) << 24 |
6
+ _floatToInt8 (r) << 16 |
7
+ _floatToInt8 (g) << 8 |
8
+ _floatToInt8 (b) << 0 ;
9
+ }
10
+
11
+ int get intAlpha => _floatToInt8 (a);
12
+ int get intRed => _floatToInt8 (r);
13
+ int get intGreen => _floatToInt8 (g);
14
+ int get intBlue => _floatToInt8 (b);
15
+
16
+ int _floatToInt8 (double x) {
17
+ return (x * 255.0 ).round () & 0xff ;
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ import 'package:campus_flutter/base/extensions/color.dart' ;
1
2
import 'package:campus_flutter/base/theme/constants.dart' ;
2
3
import 'package:campus_flutter/base/util/read_list_value.dart' ;
3
4
import 'package:campus_flutter/searchComponent/model/comparison_token.dart' ;
@@ -77,7 +78,7 @@ class CalendarEvent extends Searchable {
77
78
}
78
79
79
80
void setColor (Color ? color) {
80
- this .color = color? .value ;
81
+ this .color = color? .intValue ;
81
82
}
82
83
83
84
Color getColor () {
Original file line number Diff line number Diff line change 1
1
import 'dart:convert' ;
2
2
3
+ import 'package:campus_flutter/base/extensions/color.dart' ;
3
4
import 'package:campus_flutter/calendarComponent/model/calendar_preferences.dart' ;
4
5
import 'package:flutter/material.dart' ;
5
6
import 'package:flutter/services.dart' ;
@@ -16,7 +17,7 @@ class CalendarPreferenceService {
16
17
CalendarPreferenceService (this .sharedPreferences);
17
18
18
19
void saveColorPreference (String id, Color color) {
19
- colorPreferences[id] = color.value ;
20
+ colorPreferences[id] = color.intValue ;
20
21
try {
21
22
sharedPreferences.setString (
22
23
key,
Original file line number Diff line number Diff line change 1
1
import 'package:campus_flutter/base/util/diagonalStripePattern/diagonal_stripe_pattern_view.dart' ;
2
2
import 'package:campus_flutter/calendarComponent/model/calendar_event.dart' ;
3
- import 'package:easy_localization/easy_localization.dart' ;
4
3
import 'package:flutter/material.dart' ;
5
4
6
5
class CalendarEventView extends StatelessWidget {
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class GlobalSearch {
92
92
if (result.contains (null )) {
93
93
return null ;
94
94
} else {
95
- return result.whereNotNull () .toList ();
95
+ return result.nonNulls .toList ();
96
96
}
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -49,8 +49,6 @@ class SearchResultViewBuilder extends StatelessWidget {
49
49
return PersonSearchResultView (searchVM: searchVM);
50
50
case SearchCategory .rooms:
51
51
return NavigaTumSearchResultView (searchVM: searchVM);
52
- default :
53
- return Container ();
54
52
}
55
53
}
56
54
}
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class StudentCardView extends ConsumerWidget {
78
78
Widget _warningCard (BuildContext context) {
79
79
return CardWithPadding (
80
80
elevation: 0 ,
81
- color: context.primaryColor.withOpacity ( 0.2 ),
81
+ color: context.primaryColor.withValues (alpha : 0.2 ),
82
82
child: Row (
83
83
mainAxisAlignment: MainAxisAlignment .center,
84
84
crossAxisAlignment: CrossAxisAlignment .center,
You can’t perform that action at this time.
0 commit comments