Skip to content
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

Fixes #2192 #1602 , Improving Filters UI #2245

Merged
merged 27 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
21a6146
Add:Filters
AyushRaghuvanshi Dec 13, 2023
96d3856
Add:Documentation
AyushRaghuvanshi Dec 13, 2023
22b2521
Merge branch 'develop' of https://github.com/AyushRaghuvanshi/talawa …
AyushRaghuvanshi Dec 13, 2023
ee0dde0
Add:MultiLingual Support
AyushRaghuvanshi Dec 13, 2023
cb7c7c6
Fix:Format
AyushRaghuvanshi Dec 13, 2023
6a32a87
Reduced: Lines of Codes
AyushRaghuvanshi Dec 14, 2023
5d5f20c
Fixed:Tests
AyushRaghuvanshi Dec 14, 2023
f6574c9
Add:Fix Failing test case
AyushRaghuvanshi Dec 14, 2023
4a9cd99
Add:Tests for requested lines
AyushRaghuvanshi Dec 23, 2023
63d2dbf
Add:test for filter changing
AyushRaghuvanshi Dec 23, 2023
ba118f9
Fixed:changes requested
AyushRaghuvanshi Dec 25, 2023
5fe2f38
Merge branch 'develop' of https://github.com/AyushRaghuvanshi/talawa …
AyushRaghuvanshi Dec 25, 2023
74a4576
Add:Changes
AyushRaghuvanshi Dec 25, 2023
c97b9c3
Fix:Documentation
AyushRaghuvanshi Dec 27, 2023
ffd702a
Fix:Dart version
AyushRaghuvanshi Dec 27, 2023
8c5fb25
Fixed:spacing
AyushRaghuvanshi Dec 27, 2023
3aa5821
Remove: useless docs
AyushRaghuvanshi Dec 27, 2023
ac4a4de
Remove:Spaces
AyushRaghuvanshi Dec 27, 2023
627d487
Removed:spaces
AyushRaghuvanshi Dec 27, 2023
a0a2244
Fix:Constant Sizes
AyushRaghuvanshi Dec 28, 2023
8eceaa2
Fix:Format issues
AyushRaghuvanshi Dec 28, 2023
9c87611
Minor FIx
AyushRaghuvanshi Dec 28, 2023
828b06d
Fix:format
AyushRaghuvanshi Dec 29, 2023
2a9b149
Fix:Dynamic size
AyushRaghuvanshi Dec 29, 2023
1cd15c2
Fix:Dynamic size
AyushRaghuvanshi Dec 29, 2023
9f08e2d
Fix:Failing test
AyushRaghuvanshi Dec 29, 2023
15cd4ea
Fix:Failing test
AyushRaghuvanshi Dec 29, 2023
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
10 changes: 10 additions & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@
"Cancel": "Abbrechen",
"Done": "Fertig",
"Explore Events": "Veranstaltungen erkunden",
"Filters": "Filter",
"Filter by Date": "Filtern nach Datum",
"All Events": "Alle Veranstaltungen",
"Show all events": "Alle Veranstaltungen anzeigen",
"Show all events created by you": "Alle Veranstaltungen anzeigen, die von Ihnen erstellt wurden",
"Registered Events": "Registrierte Veranstaltungen",
"Show all events you have registered": "Alle Veranstaltungen anzeigen, für die Sie sich registriert haben",
"Show events for all": "Alle Veranstaltungen anzeigen",
"Show invite-only events": "Nur Einladungsveranstaltungen anzeigen",

"Add Date": "Datum hinzufügen",
"Event": "Vorfall",
"My Events": "Meine Veranstaltungen",
Expand Down
9 changes: 9 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
"Cancel": "Cancel",
"Done": "Done",
"Explore Events": "Explore Events",
"Filters": "Filters",
"Filter by Date": "Filter by Date",
"All Events": "All Events",
"Show all events": "Show all events",
"Show all events created by you": "Show all events created by you",
"Registered Events": "Registered Events",
"Show all events you have registered": "Show all events you have registered",
"Show events for all": "Show events for all",
"Show invite-only events": "Show invite-only events",
"Add Date": "Add Date",
"Event": "Event",
"My Events": "My Events",
Expand Down
9 changes: 9 additions & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
"Cancel": "Cancelar",
"Done": "Hecho",
"Explore Events": "Explorar eventos",
"Filters": "Filtros",
"Filter by Date": "Filtrar por fecha",
"All Events": "Todos los eventos",
"Show all events": "Mostrar todos los eventos",
"Show all events created by you": "Mostrar todos los eventos creados por ti",
"Registered Events": "Eventos registrados",
"Show all events you have registered": "Mostrar todos los eventos en los que te has registrado",
"Show events for all": "Mostrar eventos para todos",
"Show invite-only events": "Mostrar eventos solo por invitación",
"Add Date": "Agregar fecha",
"Event": "Evento",
"My Events": "Mis Eventos",
Expand Down
9 changes: 9 additions & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@
"Cancel": "Annuler",
"Done": "Fait",
"Explore Events": "Explorer les événements",
"Filters": "Filtres",
"Filter by Date": "Filtrer par date",
"All Events": "Tous les événements",
"Show all events": "Afficher tous les événements",
"Show all events created by you": "Afficher tous les événements créés par vous",
"Registered Events": "Événements enregistrés",
"Show all events you have registered": "Afficher tous les événements auxquels vous êtes inscrit",
"Show events for all": "Afficher les événements pour tous",
"Show invite-only events": "Afficher les événements sur invitation uniquement",
"Add Date": "Ajouter une date",
"Event": "Événement",
"My Events": "Mes événements",
Expand Down
9 changes: 9 additions & 0 deletions lang/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@
"Cancel": "रद्द करना",
"Done": "किया हुआ",
"Explore Events": "घटनाओं का अन्वेषण करें",
"Filters": "फ़िल्टर",
"Filter by Date": "तारीख़ से फ़िल्टर करें",
"All Events": "सभी घटनाएँ",
"Show all events": "सभी घटनाएँ दिखाएं",
"Show all events created by you": "आपके द्वारा बनाई गई सभी घटनाएँ दिखाएं",
"Registered Events": "रजिस्टर की गई घटनाएँ",
"Show all events you have registered": "आपने जिन घटनाओं में पंजीकृत हुए हैं, उन सभी घटनाएँ दिखाएं",
"Show events for all": "सभी के लिए घटनाएँ दिखाएं",
"Show invite-only events": "आमंत्रित लोगों के लिए घटनाएँ दिखाएं",
"Add Date": "तिथि जोड़ें",
"Event": "प्रतिस्पर्धा",
"My Events": "मेरे कार्यक्रम",
Expand Down
9 changes: 9 additions & 0 deletions lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@
"Cancel": "キャンセル",
"Done": "終わり",
"Explore Events": "イベントを探索する",
"Filters": "フィルター",
"Filter by Date": "日付で絞り込む",
"All Events": "すべてのイベント",
"Show all events": "すべてのイベントを表示",
"Show all events created by you": "あなたが作成したすべてのイベントを表示",
"Registered Events": "登録済みイベント",
"Show all events you have registered": "あなたが登録したすべてのイベントを表示",
"Show events for all": "すべてのイベントを表示",
"Show invite-only events": "招待限定イベントを表示",
"Add Date": "日付を追加",
"Event": "イベント",
"My Events": "私のイベント",
Expand Down
9 changes: 9 additions & 0 deletions lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
"Cancel": "Cancelar",
"Done": "Feita",
"Explore Events": "Explorar eventos",
"Filters": "Filtros",
"Filter by Date": "Filtrar por data",
"All Events": "Todos os eventos",
"Show all events": "Mostrar todos os eventos",
"Show all events created by you": "Mostrar todos os eventos criados por você",
"Registered Events": "Eventos registrados",
"Show all events you have registered": "Mostrar todos os eventos em que você se registrou",
"Show events for all": "Mostrar eventos para todos",
"Show invite-only events": "Mostrar apenas eventos com convite",
"Add Date": "Adicionar Data",
"Event": "Evento",
"My Events": "Meus Eventos",
Expand Down
15 changes: 12 additions & 3 deletions lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,20 @@
"Cancel": "取消",
"Done": "完成",
"Explore Events": "探索事件",
"Add Date": "添加日期",
"Event": "事件",
"Filters": "过滤器",
"Filter by Date": "按日期过滤",
"All Events": "所有活动",
"Show all events": "显示所有活动",
"My Events": "我的活动",
"Public Events": "公共事件",
"Show all events created by you": "显示由您创建的所有活动",
"Registered Events": "已注册活动",
"Show all events you have registered": "显示您已注册的所有活动",
"Public Events": "公共活动",
"Show events for all": "显示所有人的活动",
"Private Events": "私人活动",
"Show invite-only events": "仅显示邀请活动",
"Add Date": "添加日期",
"Event": "事件",
"Liked by": "喜欢的人",
"Comments": "评论",
"FirstName LastName": "名字姓氏",
Expand Down
31 changes: 31 additions & 0 deletions lib/services/navigation_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:talawa/widgets/talawa_error_snackbar.dart';
/// * `showTalawaErrorDialog`
/// * `pop`
class NavigationService {
/// Key for Navigator State.
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

/// Pushes a Screen.
Expand Down Expand Up @@ -106,6 +107,13 @@ class NavigationService {
}

/// This is used for the quick alert of `duration: 2 seconds` with text message(passed).
///
/// **params**:
/// * `message`: Message would be shown on snackbar
/// * `duration`: Duration of Snackbar
///
/// **returns**:
/// None
void showSnackBar(
String message, {
Duration duration = const Duration(seconds: 2),
Expand All @@ -119,6 +127,15 @@ class NavigationService {
);
}

/// This is used for the quick error of `duration: 2 seconds`.
///
/// **params**:
/// * `errorMessage`: Error Message shown in snackbar
/// * `messageType`: Type of Message
/// * `duration`: Duration of snackbar
///
/// **returns**:
/// None
void showTalawaErrorSnackBar(
String errorMessage,
MessageType messageType,
Expand All @@ -138,6 +155,14 @@ class NavigationService {
);
}

/// Shows an Error Dialog Box.
///
/// **params**:
/// * `errorMessage`: Message shown in dialog
/// * `messageType`: Type of Message
///
/// **returns**:
/// None
void showTalawaErrorDialog(String errorMessage, MessageType messageType) {
showDialog(
context: navigatorKey.currentContext!,
Expand All @@ -153,6 +178,12 @@ class NavigationService {
}

/// This function pops the current state.
///
/// **params**:
/// None
///
/// **returns**:
/// None
void pop() {
return navigatorKey.currentState!.pop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class LikeButtonViewModel extends BaseModel {
// ignore: unused_field
late StreamSubscription _updatePostSubscription;

// Getters
///Getters.
bool get isLiked => _isLiked;
List<LikedBy> get likedBy => _likedBy;
int get likesCount => _likedBy.length;
Expand Down
150 changes: 150 additions & 0 deletions lib/views/after_auth_screens/events/event_filter_bottomsheet.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import 'package:flutter/material.dart';
import 'package:talawa/apptheme.dart';
import 'package:talawa/services/size_config.dart';
import 'package:talawa/utils/app_localization.dart';
import 'package:talawa/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart';

/// Shows a list of dropdown taken from `model` and `context`.
///
/// **params**:
/// * `model`: contains the events data
/// * `context`: the overall context of UI
///
/// **returns**:
/// * `Widget`: the dropdown
Widget dropDownList(
ExploreEventsViewModel model,
BuildContext context,
) {
final Map<String, String> filters = {
'All Events': 'Show all events',
'My Events': 'Show all events created by you',
'Registered Events': 'Show all events you have registered',
'Public Events': 'Show events for all',
'Private Events': 'Show invite-only events',
};
return SizedBox(
height: SizeConfig.screenHeight,
width: SizeConfig.screenWidth,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: SizeConfig.safeBlockHorizontal! * 10,
),
child: StatefulBuilder(
builder: (_, StateSetter setState) {
return SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: SizeConfig.safeBlockVertical,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
AppLocalizations.of(
context,
)!
.strictTranslate(
"Filters",
),
style: Theme.of(
context,
).textTheme.headlineSmall,
),
IconButton(
key: const Key('close'),
onPressed: () {
Navigator.pop(context);
AyushRaghuvanshi marked this conversation as resolved.
Show resolved Hide resolved
},
icon: const Icon(
Icons.close,
),
),
],
),
...List.generate(
filters.length,
(index) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: SizeConfig.safeBlockVertical! * 2,
),
child: GestureDetector(
onTap: () {
model.choseValueFromDropdown(
filters.keys.toList()[index],
);
setState(() {});
},
child: Container(
key: Key(
filters.keys.toList()[index],
),
decoration: BoxDecoration(
color: model.chosenValue ==
filters.keys.toList()[index]
? Theme.of(context).colorScheme.secondary
: AppTheme.white,
borderRadius: BorderRadius.all(
Radius.circular(
SizeConfig.safeBlockHorizontal! * 2,
),
),
),
width: SizeConfig.screenWidth! - 60,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: SizeConfig.safeBlockHorizontal! * 5,
vertical: SizeConfig.safeBlockVertical! / 2,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
AppLocalizations.of(context)!.strictTranslate(
filters.keys.toList()[index],
),
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(
color: model.chosenValue ==
filters.keys.toList()[index]
? AppTheme.white
: AppTheme.blackPrimary,
),
),
Text(
AppLocalizations.of(context)!.strictTranslate(
filters.values.toList()[index],
),
style: Theme.of(context)
.textTheme
.labelSmall!
.copyWith(
color: model.chosenValue ==
filters.keys.toList()[index]
? AppTheme.white
: AppTheme.blackSecondary,
),
),
],
),
),
),
),
);
},
),
],
),
);
},
),
),
);
}
Loading
Loading