Skip to content

Feat/add apply filters button #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/config/ui_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ abstract class FilterConfig {
static const bottomSheetHeightFactor = 0.65;
static const searchFilterPadding = 15.0;
static const paddingMedium = 8.0;
static const spacingBetweenWidgets = 12.0;
static final radius = BorderRadius.circular(8);
}

abstract class LottieAnimationConfig {
Expand Down
22 changes: 16 additions & 6 deletions lib/features/science_clubs_filters/filters_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "package:auto_route/auto_route.dart";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

Expand All @@ -6,6 +7,7 @@ import "../../theme/app_theme.dart";
import "../../utils/context_extensions.dart";
import "filters_controller.dart";
import "filters_search_controller.dart";
import "widgets/apply_filters_button.dart";
import "widgets/departments_wrap.dart";
import "widgets/filters_header.dart";
import "widgets/tags_wrap.dart";
Expand Down Expand Up @@ -34,12 +36,20 @@ class FiltersSheet extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListView(
shrinkWrap: true,
children: const [
TypesWrap(),
DepartmentsWrap(),
TagsWrap(),
_NoFiltersFound(),
SizedBox(height: 12),
children: [
const TypesWrap(),
const DepartmentsWrap(),
const TagsWrap(),
const _NoFiltersFound(),
const SizedBox(
height: FilterConfig.spacingBetweenWidgets,
),
ApplyFiltersButton(
onPressed: context.maybePop,
),
const SizedBox(
height: FilterConfig.spacingBetweenWidgets,
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import "package:flutter/material.dart";

import "../../../config/ui_config.dart";
import "../../../theme/app_theme.dart";
import "../../../utils/context_extensions.dart";

class ApplyFiltersButton extends StatelessWidget {
const ApplyFiltersButton({
super.key,
required this.onPressed,
});

final VoidCallback onPressed;

@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: context.colorTheme.orangePomegranade,
elevation: 4,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
shape: RoundedRectangleBorder(
borderRadius: FilterConfig.radius, // Change this value to adjust the radius
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(
width: 5,
),
Text(
context.localize.apply,
style: context.textTheme.titleWhite,
),
const SizedBox(
width: 5,
),
Icon(
Icons.check,
color: context.colorTheme.whiteSoap,
),
],
),
);
}
}
3 changes: 2 additions & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,6 @@
}
},
"last_modified": "Ostatnia aktualizacja",
"created_at": "Utworzono"
"created_at": "Utworzono",
"apply": "Zastosuj"
}
Loading