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 d5a2fb9 commit d9f736e
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)
? []
: _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)
? []
: _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)
? []
: _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 @@ -132,23 +132,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);
});
});
},
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 d9f736e

Please sign in to comment.