Skip to content

Commit

Permalink
fix: UX refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hoosong0235 committed Aug 1, 2023
1 parent e088528 commit c7c131f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lib/providers/lecture_search_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class LectureSearchModel extends ChangeNotifier {
if (v.options.expand((i) => i).every((i) => i.selected == false)) {
if (v.isMultiSelect == true)
v.options.expand((i) => i).forEach((j) {
j.selected = true;
// j.selected = true;
});
else
v.options.first.first.selected = true;
Expand All @@ -221,7 +221,7 @@ class LectureSearchModel extends ChangeNotifier {
List<CodeLabelPair> dep = _lectureFilter['departments']!
.options
.expand((i) => i)
.every((i) => i.selected == true)
.every((i) => i.selected == false)

Check warning on line 224 in lib/providers/lecture_search_model.dart

View check run for this annotation

Codecov / codecov/patch

lib/providers/lecture_search_model.dart#L224

Added line #L224 was not covered by tests
? []
: _lectureFilter['departments']!
.options
Expand All @@ -231,7 +231,7 @@ class LectureSearchModel extends ChangeNotifier {
List<CodeLabelPair> typ = _lectureFilter['types']!
.options
.expand((i) => i)
.every((i) => i.selected == true)
.every((i) => i.selected == false)

Check warning on line 234 in lib/providers/lecture_search_model.dart

View check run for this annotation

Codecov / codecov/patch

lib/providers/lecture_search_model.dart#L234

Added line #L234 was not covered by tests
? []
: _lectureFilter['types']!
.options
Expand All @@ -241,7 +241,7 @@ class LectureSearchModel extends ChangeNotifier {
List<CodeLabelPair> lev = _lectureFilter['levels']!
.options
.expand((i) => i)
.every((i) => i.selected == true)
.every((i) => i.selected == false)

Check warning on line 244 in lib/providers/lecture_search_model.dart

View check run for this annotation

Codecov / codecov/patch

lib/providers/lecture_search_model.dart#L244

Added line #L244 was not covered by tests
? []
: _lectureFilter['levels']!
.options
Expand Down
14 changes: 6 additions & 8 deletions lib/widgets/search_filter_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,21 @@ class _SelectorState extends State<Selector> {
!widget.selectList.every(
(v) => v.every((w) => w.selected == false),
),
child: GestureDetector(
child: IconTextButton(
onTap: () {
widget.selectList.forEach((v) {
v.forEach((w) {
widget.setFilter(w.code, false);

Check warning on line 140 in lib/widgets/search_filter_panel.dart

View check run for this annotation

Codecov / codecov/patch

lib/widgets/search_filter_panel.dart#L138-L140

Added lines #L138 - L140 were not covered by tests
});
});
},
child: Text(
"common.reset".tr(),
style: bodyRegular.copyWith(
color: OTLColor.pinksMain,
decoration: TextDecoration.underline,
),
text: "common.reset".tr(),
textStyle: bodyRegular.copyWith(
color: OTLColor.pinksMain,
decoration: TextDecoration.underline,
),
),
)
),
],
),
),
Expand Down

0 comments on commit c7c131f

Please sign in to comment.