diff --git a/lang/de.json b/lang/de.json index 04e2ca0b25..916b02455f 100644 --- a/lang/de.json +++ b/lang/de.json @@ -91,14 +91,11 @@ "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", @@ -234,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "Dies ist der Tab 'Beitrag erstellen', hier können Sie der aktuell ausgewählten Organisation einen Beitrag hinzufügen", "This is the Chat tab here you can see all your messages of the current selected organization": "Dies ist der Chat-Tab, hier können Sie alle Ihre Nachrichten der aktuell ausgewählten Organisation sehen", "To help your organization grow you can support them financially from here": "Um Ihre Organisation zu unterstützen, können Sie sie finanziell von hier aus unterstützen.", - "You are all set to go let's get you in": "Sie sind bereit zu gehen, lassen Sie uns Ihnen helfen." + "You have no event in this organization": "Sie haben keine Veranstaltung in dieser Organisation", + "Create your first event": "Erstellen Sie Ihr erstes Event", + "You are all set to go let's get you in": "Sie sind bereit zu gehen, lassen Sie uns Ihnen helfen.", + "There are no posts in this organization": "Es gibt keine Beiträge in dieser Organisation", + "Create your first post": "Erstellen Sie Ihren ersten Beitrag", + "You have no post in this organization": "Sie haben keinen Beitrag in dieser Organisation" } diff --git a/lang/en.json b/lang/en.json index bb3239fca6..9591571782 100644 --- a/lang/en.json +++ b/lang/en.json @@ -97,10 +97,8 @@ "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", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "This is the Create post tab here you can add post to the current selected organization.", "This is the Chat tab here you can see all your messages of the current selected organization": "This is the Chat tab here you can see all your messages of the current selected organization.", "To help your organization grow you can support them financially from here": "To help your organization grow you can support them financially from here.", - "You are all set to go let's get you in": "You are all set to go let's get you in." + "You are all set to go let's get you in": "You are all set to go let's get you in.", + "You have no event in this organization": "You have no event in this organization", + "Create your first event": "Create your first event", + "There are no posts in this organization": "There are no posts in this organization", + "Create your first post": "Create your first post", + "You have no post in this organization": "You have no post in this organization" } diff --git a/lang/es.json b/lang/es.json index b66ea3e211..c0e6a7e589 100644 --- a/lang/es.json +++ b/lang/es.json @@ -92,10 +92,8 @@ "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", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "Esta es la pestaña de Crear publicación; aquí puedes agregar una publicación a la organización actualmente seleccionada", "This is the Chat tab here you can see all your messages of the current selected organization": "Esta es la pestaña de Chat; aquí puedes ver todos tus mensajes de la organización actualmente seleccionada", "To help your organization grow you can support them financially from here": "Para ayudar a que tu organización crezca, puedes apoyarla financieramente desde aquí", - "You are all set to go let's get you in": "Estás listo para ir, vamos a empezar" + "You are all set to go let's get you in": "Estás listo para ir, vamos a empezar", + "You have no event in this organization": "No tienes ningún evento en esta organización", + "Create your first event": "Crea tu primer evento", + "There are no posts in this organization": "No hay publicaciones en esta organización", + "Create your first post": "Crea tu primera publicación", + "You have no post in this organization": "No tienes ninguna publicación en esta organización" } diff --git a/lang/fr.json b/lang/fr.json index f15f4ec01e..d501be547a 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -97,10 +97,8 @@ "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", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "Ceci est l'onglet Créer une publication, ici vous pouvez ajouter une publication à l'organisation actuellement sélectionnée", "This is the Chat tab here you can see all your messages of the current selected organization": "Ceci est l'onglet Chat, ici vous pouvez voir tous vos messages de l'organisation actuellement sélectionnée", "To help your organization grow you can support them financially from here": "Pour aider votre organisation à se développer, vous pouvez les soutenir financièrement depuis ici.", - "You are all set to go let's get you in": "Vous êtes prêt à partir, laissez-nous vous aider." + "You are all set to go let's get you in": "Vous êtes prêt à partir, laissez-nous vous aider.", + "You have no event in this organization": "Vous n'avez aucun événement dans cette organisation", + "Create your first event": "Créez votre premier événement", + "There are no posts in this organization": "Il n'y a aucun article dans cette organisation", + "Create your first post": "Créez votre premier article", + "You have no post in this organization": "Vous n'avez aucun article dans cette organisation" } diff --git a/lang/hi.json b/lang/hi.json index 6a556ce4de..4508356936 100644 --- a/lang/hi.json +++ b/lang/hi.json @@ -92,10 +92,8 @@ "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": "आमंत्रित लोगों के लिए घटनाएँ दिखाएं", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "यह यहाँ से तैयार करें पोस्ट टैब है जहाँ आप वर्तमान चयनित संगठन में पोस्ट जोड़ सकते हैं।", "This is the Chat tab here you can see all your messages of the current selected organization": "यहाँ चैट टैब है जहाँ आप वर्तमान चयनित संगठन के सभी संदेश देख सकते हैं।", "To help your organization grow you can support them financially from here": "अपने संगठन को बढ़ावा देने के लिए आप उन्हें यहाँ से वित्तपोषण दे सकते हैं।", - "You are all set to go let's get you in": "आप तैयार हैं जाने के लिए, चलो आपको एंटर करते हैं।" + "You are all set to go let's get you in": "आप तैयार हैं जाने के लिए, चलो आपको एंटर करते हैं।", + "You have no event in this organization": "इस संगठन में आपका कोई इवेंट नहीं है", + "Create your first event": "अपना पहला इवेंट बनाएं", + "There are no posts in this organization": "इस संगठन में कोई पोस्ट नहीं है", + "Create your first post": "अपनी पहली पोस्ट बनाएं", + "You have no post in this organization": "इस संगठन में आपका कोई पोस्ट नहीं है" } diff --git a/lang/ja.json b/lang/ja.json index ac8f5c1b73..2f9005b6f2 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -92,10 +92,8 @@ "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": "招待限定イベントを表示", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "これは投稿を作成するタブです。ここでは、現在選択されている組織に投稿を追加できます。", "This is the Chat tab here you can see all your messages of the current selected organization": "これはチャットタブです。ここでは、現在選択されている組織のすべてのメッセージを見ることができます。", "To help your organization grow you can support them financially from here": "組織の成長をサポートするためには、ここから経済的にサポートできます。", - "You are all set to go let's get you in": "準備が整いました。さあ、始めましょう。" + "You are all set to go let's get you in": "準備が整いました。さあ、始めましょう。", + "You have no event in this organization": "この組織にはイベントがありません", + "Create your first event": "最初のイベントを作成してください", + "There are no posts in this organization": "この組織には投稿がありません", + "Create your first post": "最初の投稿を作成してください", + "You have no post in this organization": "この組織には投稿がありません" } diff --git a/lang/pt.json b/lang/pt.json index 1b2c338c2b..0dab5aa5de 100644 --- a/lang/pt.json +++ b/lang/pt.json @@ -92,10 +92,8 @@ "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", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "Esta é a aba de Criar postagem; aqui você pode adicionar uma postagem à organização atualmente selecionada", "This is the Chat tab here you can see all your messages of the current selected organization": "Esta é a aba de Chat; aqui você pode ver todas as suas mensagens da organização atualmente selecionada", "To help your organization grow you can support them financially from here": "Para ajudar sua organização a crescer, você pode apoiá-la financeiramente a partir daqui", - "You are all set to go let's get you in": "Você está pronto para ir; vamos começar" + "You are all set to go let's get you in": "Você está pronto para ir; vamos começar", + "You have no event in this organization": "Você não tem nenhum evento nesta organização", + "Create your first event": "Crie seu primeiro evento", + "There are no posts in this organization": "Não há posts nesta organização", + "Create your first post": "Crie sua primeira postagem", + "You have no post in this organization": "Você não tem nenhuma postagem nesta organização" } diff --git a/lang/zh.json b/lang/zh.json index 8c7f25b69a..f6488a4fa2 100644 --- a/lang/zh.json +++ b/lang/zh.json @@ -92,11 +92,9 @@ "Explore Events": "探索事件", "Filters": "过滤器", "Filter by Date": "按日期过滤", - "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": "显示所有人的活动", @@ -233,5 +231,10 @@ "This is the Create post tab here you can add post to the current selected organization": "这是创建帖子选项卡,您可以在此处向当前选择的组织添加帖子。", "This is the Chat tab here you can see all your messages of the current selected organization": "这是聊天选项卡,您可以在此处查看当前选择组织的所有消息。", "To help your organization grow you can support them financially from here": "要帮助您的组织成长,您可以从这里提供财务支持。", - "You are all set to go let's get you in": "您已经准备好了,让我们开始吧。" + "You are all set to go let's get you in": "您已经准备好了,让我们开始吧。", + "You have no event in this organization": "您在此组织中没有活动", + "Create your first event": "创建您的第一个活动", + "There are no posts in this organization": "此组织中没有帖子", + "Create your first post": "创建您的第一篇帖子", + "You have no post in this organization": "您在此组织中没有帖子" } diff --git a/lib/services/post_service.dart b/lib/services/post_service.dart index 43ed5c3fd7..5678bd27e3 100644 --- a/lib/services/post_service.dart +++ b/lib/services/post_service.dart @@ -40,15 +40,22 @@ class PostService { // ignore: prefer_final_fields List _posts = []; - //Getters + /// Getter for Stream of posts. Stream> get postStream => _postStream; + + /// Getter for Stream of update in any post. Stream get updatedPostStream => _updatedPostStream; - //Setters + ///This method sets up a stream that constantly listens to change in current org. + /// + /// **params**: + /// None + /// + /// **returns**: + /// None void setOrgStreamSubscription() { _userConfig.currentOrgInfoStream.listen((updatedOrganization) { if (updatedOrganization != _currentOrg) { - print("org changes from post service"); _renderedPostID.clear(); _currentOrg = updatedOrganization; getPosts(); @@ -56,12 +63,16 @@ class PostService { }); } - /// Retrieves all posts of the organization. + /// Method used to fetch all posts of the current organisation. + /// + /// **params**: + /// None /// - /// This method queries the organization ID from `_currentOrg` and fetches - /// posts using a GraphQL query. The retrieved posts are added to the internal - /// post stream + /// **returns**: + /// * `Future`: returns future void Future getPosts() async { + await _dbFunctions.refreshAccessToken(userConfig.currentUser.refreshToken!); + _dbFunctions.init(); // variables final String currentOrgID = _currentOrg.id!; final String query = PostQueries().getPostsById(currentOrgID); @@ -76,7 +87,6 @@ class PostService { // ignore:avoid_dynamic_calls final List postsJson = result.data!['postsByOrganization'] as List; - postsJson.forEach((postJson) { final Post post = Post.fromJson(postJson as Map); if (!_renderedPostID.contains(post.sId)) { @@ -87,10 +97,43 @@ class PostService { _postStreamController.add(_posts); } - /// This function is used to add Like to the Post. + /// Method to refresh feed of current selected organisation. + /// + /// **params**: + /// None /// - /// params: - /// * [postId] : id of the post where like need to be added. + /// **returns**: + /// * `Future`: returns future void + Future refreshFeed() async { + _posts.clear(); + _renderedPostID.clear(); + await getPosts(); + } + + ///Method to add newly created post at the very top of the feed. + /// + /// **params**: + /// * `newPost`: new post made by user to add in feed + /// + /// **returns**: + /// None + void addNewpost(Post newPost) { + if (!_posts.contains(newPost)) { + _posts.insert(0, newPost); + } + _postStreamController.add(_posts); + } + + ///Method to add like on a Post. + /// + /// This method basically update likedBy list of a Post + /// in database. + /// + /// **params**: + /// * `postID`: ID of the post to add like in database + /// + /// **returns**: + /// * `Future`: define_the_return Future addLike(String postID) async { _localAddLike(postID); final String mutation = PostQueries().addLike(); @@ -102,6 +145,13 @@ class PostService { return result; } + /// Locally add like on a Post and updates it using updated Post Stream. + /// + /// **params**: + /// * `postID`: ID of the post to add like locally + /// + /// **returns**: + /// None void _localAddLike(String postID) { _posts.forEach((post) { if (post.sId == postID) { @@ -111,10 +161,16 @@ class PostService { }); } - /// This function is used to remove like from the Post. + /// Method to remove like in a Post. /// - /// params: - /// * [postId] : id of the post where like need to be removed. + /// This method basically update likedBy list of a Post + /// and removes the like of a user in database. + /// + /// **params**: + /// * `postID`: ID of the post to remove like in database. + /// + /// **returns**: + /// * `Future`: nothing Future removeLike(String postID) async { _removeLocal(postID); final String mutation = PostQueries().removeLike(); @@ -124,6 +180,13 @@ class PostService { return result; } + /// Locally removes the like of a user and update the Post UI. + /// + /// **params**: + /// * `postID`: ID of the post to remove like locally + /// + /// **returns**: + /// None void _removeLocal(String postID) { _posts.forEach((post) { if (post.sId == postID) { @@ -135,7 +198,13 @@ class PostService { }); } - // Functions related to comments + ///Method to add comment of a user and update comments using updated Post Stream. + /// + /// **params**: + /// * `postID`: ID of the post to add comment locally + /// + /// **returns**: + /// None void addCommentLocally(String postID) { for (int i = 0; i < _posts.length; i++) { if (_posts[i].sId == postID) { diff --git a/lib/utils/post_queries.dart b/lib/utils/post_queries.dart index 40cff4d0d6..365c940d00 100644 --- a/lib/utils/post_queries.dart +++ b/lib/utils/post_queries.dart @@ -153,6 +153,28 @@ class PostQueries { file: \$file ) { _id + text + createdAt + imageUrl + videoUrl + title + commentCount + likeCount + creator{ + _id + firstName + lastName + image + } + organization{ + _id + } + likedBy{ + _id + } + comments{ + _id + } } } '''; diff --git a/lib/view_model/after_auth_view_models/add_post_view_models/add_post_view_model.dart b/lib/view_model/after_auth_view_models/add_post_view_models/add_post_view_model.dart index af53cb5dda..30e78f18e2 100644 --- a/lib/view_model/after_auth_view_models/add_post_view_models/add_post_view_model.dart +++ b/lib/view_model/after_auth_view_models/add_post_view_models/add_post_view_model.dart @@ -2,12 +2,15 @@ import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; +import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/models/organization/org_info.dart'; +import 'package:talawa/models/post/post_model.dart'; import 'package:talawa/services/database_mutation_functions.dart'; import 'package:talawa/services/image_service.dart'; import 'package:talawa/services/navigation_service.dart'; +import 'package:talawa/services/post_service.dart'; import 'package:talawa/services/third_party_service/multi_media_pick_service.dart'; import 'package:talawa/services/user_config.dart'; import 'package:talawa/utils/post_queries.dart'; @@ -31,6 +34,8 @@ class AddPostViewModel extends BaseModel { final TextEditingController _controller = TextEditingController(); final TextEditingController _textHashTagController = TextEditingController(); final TextEditingController _titleController = TextEditingController(); + + /// to check if in Demo mode. late bool demoMode; /// The image file that is to be uploaded. @@ -171,7 +176,7 @@ class AddPostViewModel extends BaseModel { // {TODO: Image not getting uploaded} if (_imageFile == null) { try { - await _dbFunctions.gqlAuthMutation( + final result = await _dbFunctions.gqlAuthMutation( PostQueries().uploadPost(), variables: { "text": "${_controller.text} #${_textHashTagController.text}", @@ -179,6 +184,10 @@ class AddPostViewModel extends BaseModel { "title": _titleController.text, }, ); + final Post newPost = Post.fromJson( + (result as QueryResult).data!['createPost'] as Map, + ); + locator().addNewpost(newPost); _navigationService.showTalawaErrorSnackBar( "Post is uploaded", MessageType.info, @@ -192,7 +201,7 @@ class AddPostViewModel extends BaseModel { } } else { try { - await _dbFunctions.gqlAuthMutation( + final result = await _dbFunctions.gqlAuthMutation( PostQueries().uploadPost(), variables: { "text": _controller.text, @@ -201,6 +210,10 @@ class AddPostViewModel extends BaseModel { "file": 'data:image/png;base64,${_imageInBase64!}', }, ); + final Post newPost = Post.fromJson( + (result as QueryResult).data!['createPost'] as Map, + ); + locator().addNewpost(newPost); _navigationService.showTalawaErrorSnackBar( "Post is uploaded", MessageType.info, diff --git a/lib/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart b/lib/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart index 4777b0d8d7..7166533044 100644 --- a/lib/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart +++ b/lib/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart @@ -28,6 +28,7 @@ class ExploreEventsViewModel extends BaseModel { String _chosenValue = 'All Events'; String _emptyListMessage = "Looks like there aren't any events."; List _events = []; + final List _userEvents = []; final Set _uniqueEventIds = {}; late StreamSubscription _currentOrganizationStreamSubscription; late final List _bufferEvents; @@ -35,6 +36,9 @@ class ExploreEventsViewModel extends BaseModel { /// Getter method to retrieve the list of events. List get events => _events; + /// Getter method to retrieve the list of User events. + List get userEvents => _userEvents; + /// Getter method to retrieve the EventService instance. EventService get eventService => _eventService; @@ -72,6 +76,7 @@ class ExploreEventsViewModel extends BaseModel { Future refreshEvents() async { setState(ViewState.busy); _events.clear(); + _userEvents.clear(); _uniqueEventIds.clear(); await _eventService.getEvents(); setState(ViewState.idle); @@ -108,13 +113,17 @@ class ExploreEventsViewModel extends BaseModel { /// **returns**: /// * `Future`: return future void. Future checkIfExistsAndAddNewEvent(Event newEvent) async { - // checking if the `newEvent.id` is unique and not exist already. - if ((!_uniqueEventIds.contains(newEvent.id)) && - (newEvent.organization!.id == userConfig.currentOrg.id)) { + // Check if the event is unique and belongs to the current organization + if (!_uniqueEventIds.contains(newEvent.id) && + newEvent.organization!.id == userConfig.currentOrg.id) { _uniqueEventIds.add(newEvent.id!); _parseEventDateTime(newEvent); - notifyListeners(); } + if (!_userEvents.any((event) => event.id == newEvent.id) && + newEvent.creator!.id == userConfig.currentUser.id) { + _userEvents.insert(0, newEvent); + } + notifyListeners(); } /// The helper function that used to parse the date and time. @@ -136,19 +145,21 @@ class ExploreEventsViewModel extends BaseModel { newEvent.endTime = DateFormat('HH:mm:ss').format(DateTime.now()); } - final startMoment = DateTime.parse( - '${newEvent.startDate!} ${newEvent.startTime!}', - ).toLocal(); - - final endMoment = DateTime.parse( - '${newEvent.endDate!} ${newEvent.endTime!}', - ).toLocal(); - - newEvent.startDate = DateFormat('yMd').format(startMoment); - newEvent.endDate = DateFormat('yMd').format(endMoment); - newEvent.startTime = DateFormat.jm().format(startMoment); - newEvent.endTime = DateFormat.jm().format(endMoment); + if (RegExp(r'^\d{4}-\d{2}-\d{2}$').hasMatch(newEvent.startDate!) && + RegExp(r'^\d{2}:\d{2}:\d{2}.\d{3}Z$').hasMatch(newEvent.startTime!) && + RegExp(r'^\d{4}-\d{2}-\d{2}$').hasMatch(newEvent.endDate!) && + RegExp(r'^\d{2}:\d{2}:\d{2}.\d{3}Z$').hasMatch(newEvent.endTime!)) { + final startMoment = + DateTime.parse('${newEvent.startDate} ${newEvent.startTime}') + .toLocal(); + final endMoment = + DateTime.parse('${newEvent.endDate} ${newEvent.endTime}').toLocal(); + newEvent.startDate = DateFormat('yMd').format(startMoment); + newEvent.endDate = DateFormat('yMd').format(endMoment); + newEvent.startTime = DateFormat('h:mm a').format(startMoment); + newEvent.endTime = DateFormat('h:mm a').format(endMoment); + } _events.insert(0, newEvent); } @@ -176,6 +187,7 @@ class ExploreEventsViewModel extends BaseModel { print(result); _uniqueEventIds.remove(eventId); _events.removeWhere((element) => element.id == eventId); + _userEvents.removeWhere((element) => element.id == eventId); await Future.delayed(const Duration(milliseconds: 500)); setState(ViewState.idle); } @@ -211,7 +223,7 @@ class ExploreEventsViewModel extends BaseModel { } break; // if `_chosenValue` is "created event". - case 'Created Events': + case 'My Events': { // loop through the `_events` list and check // for the creator id matched the current user id. diff --git a/lib/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart b/lib/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart index 8949d57760..4605d3c9e2 100644 --- a/lib/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart +++ b/lib/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart @@ -24,6 +24,7 @@ class OrganizationFeedViewModel extends BaseModel { // Local caching variables for a session. // ignore: prefer_final_fields List _posts = []; + final List _userPosts = []; /// flag for the test. /// @@ -55,6 +56,11 @@ class OrganizationFeedViewModel extends BaseModel { return _posts; } + /// Getter for User Posts. + List get userPosts { + return _userPosts; + } + /// getter for the pinned post. /// List get pinnedPosts { @@ -69,6 +75,11 @@ class OrganizationFeedViewModel extends BaseModel { /// String get currentOrgName => _currentOrgName; + bool _isFetchingPosts = false; + + /// getter for isFetchingPosts to show loading indicator. + bool get isFetchingPosts => _isFetchingPosts; + /// This function sets the organization name after update. /// /// more_info_if_required @@ -81,6 +92,9 @@ class OrganizationFeedViewModel extends BaseModel { void setCurrentOrganizationName(String updatedOrganization) { // if `updatedOrganization` is not same to `_currentOrgName`. if (updatedOrganization != _currentOrgName) { + _isFetchingPosts = true; + notifyListeners(); + _userPosts.clear(); _posts.clear(); _renderedPostID.clear(); _currentOrgName = updatedOrganization; @@ -97,7 +111,7 @@ class OrganizationFeedViewModel extends BaseModel { /// **returns**: /// None void fetchNewPosts() { - _postService.getPosts(); + _postService.refreshFeed(); } /// To initialize the view model. @@ -114,6 +128,8 @@ class OrganizationFeedViewModel extends BaseModel { { bool isTest = false, }) { + _isFetchingPosts = true; + // For caching/initializing the current organization after the stream subscription has canceled and the stream is updated _currentOrgName = _userConfig.currentOrg.name!; // ------ @@ -123,6 +139,7 @@ class OrganizationFeedViewModel extends BaseModel { (updatedOrganization) => setCurrentOrganizationName(updatedOrganization.name!), ); + _postsSubscription = _postService.postStream.listen((newPosts) { return buildNewPosts(newPosts); }); @@ -169,6 +186,15 @@ class OrganizationFeedViewModel extends BaseModel { /// None void buildNewPosts(List newPosts) { _posts = newPosts; + final currentUserId = _userConfig.currentUser.id!; + _userPosts.clear(); + for (final post in newPosts) { + if (!_userPosts.any((element) => element.sId == post.sId) && + post.creator!.id == currentUserId) { + _userPosts.insert(0, post); + } + } + _isFetchingPosts = false; notifyListeners(); } diff --git a/lib/views/after_auth_screens/feed/organization_feed.dart b/lib/views/after_auth_screens/feed/organization_feed.dart index 9c378f8636..837f571883 100644 --- a/lib/views/after_auth_screens/feed/organization_feed.dart +++ b/lib/views/after_auth_screens/feed/organization_feed.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/services/size_config.dart'; +import 'package:talawa/utils/app_localization.dart'; import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart'; import 'package:talawa/view_model/main_screen_view_model.dart'; import 'package:talawa/views/base_view.dart'; @@ -26,7 +27,6 @@ class OrganizationFeed extends StatelessWidget { return BaseView( onModelReady: (model) => model.initialise(isTest: forTest), builder: (context, model, child) { - print(model.pinnedPosts); return Scaffold( floatingActionButton: FloatingActionButton( shape: const CircleBorder(side: BorderSide.none), @@ -67,21 +67,21 @@ class OrganizationFeed extends StatelessWidget { ), ), // if the model is fetching the data then renders Circular Progress Indicator else renders the result. - body: model.isBusy - ? const CircularProgressIndicator() + body: model.isFetchingPosts || model.isBusy + ? const Center(child: CircularProgressIndicator()) : RefreshIndicator( onRefresh: () async => model.fetchNewPosts(), child: ListView( shrinkWrap: true, children: [ - // If the organization has pinned posts then renders PinnedPostCarousel widget else Container. - model.pinnedPosts.isNotEmpty - ? PinnedPost( - pinnedPost: model.pinnedPosts, - model: homeModel!, - ) - : Container(), - // If the organization has posts then renders PostListWidget widget else Container. + // Always show PinnedPost if available + if (model.pinnedPosts.isNotEmpty) + PinnedPost( + key: const Key('pinnedPosts'), + pinnedPost: model.pinnedPosts, + model: homeModel!, + ), + // Show PostListWidget if there are posts, otherwise show the 'no posts' message model.posts.isNotEmpty ? PostListWidget( key: homeModel?.keySHPost, @@ -89,7 +89,39 @@ class OrganizationFeed extends StatelessWidget { function: model.navigateToIndividualPage, deletePost: model.removePost, ) - : Container(), + : // if there is no post in an organisation then show text button to create a post. + Column( + children: [ + Padding( + padding: EdgeInsets.only( + top: SizeConfig.screenHeight! * 0.21, + ), + child: Text( + AppLocalizations.of(context)! + .strictTranslate( + 'There are no posts in this organization', + ), + style: TextStyle( + fontSize: + SizeConfig.screenHeight! * 0.026, + ), + textAlign: TextAlign.center, + ), + ), + TextButton( + onPressed: () { + navigationService + .pushScreen('/addpostscreen'); + }, + child: Text( + AppLocalizations.of(context)! + .strictTranslate( + 'Create your first post', + ), + ), + ), + ], + ), ], ), ), diff --git a/lib/views/after_auth_screens/profile/profile_page.dart b/lib/views/after_auth_screens/profile/profile_page.dart index 8c0f8584f4..6b349f9919 100644 --- a/lib/views/after_auth_screens/profile/profile_page.dart +++ b/lib/views/after_auth_screens/profile/profile_page.dart @@ -3,18 +3,16 @@ import 'package:flutter/material.dart'; import 'package:flutter_braintree/flutter_braintree.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:talawa/constants/routing_constants.dart'; -import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; -import 'package:talawa/models/options/options.dart'; import 'package:talawa/plugins/talawa_plugin_provider.dart'; import 'package:talawa/services/size_config.dart'; import 'package:talawa/utils/app_localization.dart'; import 'package:talawa/view_model/after_auth_view_models/profile_view_models/profile_page_view_model.dart'; import 'package:talawa/view_model/main_screen_view_model.dart'; +import 'package:talawa/views/after_auth_screens/profile/user_event.dart'; +import 'package:talawa/views/after_auth_screens/profile/user_feed.dart'; import 'package:talawa/views/base_view.dart'; import 'package:talawa/widgets/custom_avatar.dart'; -import 'package:talawa/widgets/custom_list_tile.dart'; -import 'package:talawa/widgets/from_palisadoes.dart'; import 'package:talawa/widgets/raised_round_edge_button.dart'; /// ProfilePage returns a widget that renders a page of user's profile. @@ -154,109 +152,22 @@ class ProfilePage extends StatelessWidget { ), ), SizedBox( - height: SizeConfig.screenHeight! * 0.6, + height: SizeConfig.screenHeight! * 0.68, width: double.infinity, child: ContainedTabBarView( tabs: [ - const Tab(text: 'Posts'), - const Tab(text: 'Events'), - const Tab(text: 'Tasks'), - ], - views: [ - ColoredBox( - color: Theme.of(context).colorScheme.background, - child: GridView.count( - mainAxisSpacing: 5, - crossAxisCount: 3, - children: [ - Image.asset('assets/images/pfp2.png'), - Image.asset('assets/images/pfp2.png'), - Image.asset('assets/images/pfp2.png'), - Image.asset('assets/images/pfp2.png'), - Image.asset('assets/images/pfp2.png'), - ], - ), + const Tab( + text: 'Posts', + key: Key('UserpostTab'), ), - Container( - color: Theme.of(context).colorScheme.background, - ), - ColoredBox( - color: Theme.of(context).colorScheme.onPrimary, - child: GestureDetector( - key: const Key('tastscrn'), - onTap: () { - navigationService - .pushScreen(Routes.userTasks); - }, - ), + const Tab( + text: 'Events', + key: Key('UserEventsTab'), ), ], - ), - ), - SizedBox( - height: SizeConfig.screenHeight! * 0.67, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.screenHeight! * 0.01, - ), - SizedBox( - height: SizeConfig.screenHeight! * 0.05, - ), - - /// `Donation` acts as plugin. If visible is true the it will be always visible. - /// even if it's uninstalled by the admin (for development purposes) - //TODO: custom tile for Invitation. - CustomListTile( - key: homeModel!.keySPInvite, - index: 3, - type: TileType.option, - option: Options( - icon: Icon( - Icons.share, - color: - Theme.of(context).colorScheme.secondary, - size: SizeConfig.screenHeight! * 0.025, - ), - // title - title: AppLocalizations.of(context)! - .strictTranslate('Invite'), - // subtitle - subtitle: AppLocalizations.of(context)! - .strictTranslate('Invite to org'), - ), - // on tap call the invite function - onTapOption: () => model.invite(context), - ), - SizedBox( - height: SizeConfig.screenHeight! * 0.05, - ), - // Custom tile for Logout option. - //TODO: logout - // CustomListTile( - // key: homeModel!.keySPLogout, - // index: 3, - // type: TileType.option, - // option: Options( - // icon: Icon( - // Icons.logout, - // color: - // Theme.of(context).colorScheme.secondary, - // size: 30, - // ), - // title: AppLocalizations.of(context)! - // .strictTranslate('Log out'), - // subtitle: AppLocalizations.of(context)! - // .strictTranslate('Log out from Talawa'), - // ), - // // on tap calls the logout function - // onTapOption: () => model.logout(context), - // ), - SizedBox( - height: SizeConfig.screenHeight! * 0.05, - ), - FromPalisadoes(key: homeModel!.keySPPalisadoes), + views: [ + const UserFeed(key: Key("UserFeed")), + const UserEvents(key: Key("UserEvents")), ], ), ), diff --git a/lib/views/after_auth_screens/profile/user_event.dart b/lib/views/after_auth_screens/profile/user_event.dart new file mode 100644 index 0000000000..e9fea98b04 --- /dev/null +++ b/lib/views/after_auth_screens/profile/user_event.dart @@ -0,0 +1,91 @@ +import 'package:flutter/material.dart'; +import 'package:talawa/locator.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'; +import 'package:talawa/views/base_view.dart'; +import 'package:talawa/widgets/event_card.dart'; + +///UserEvents to show events created by user in current organisation . +class UserEvents extends StatefulWidget { + const UserEvents({ + required super.key, + }); + + @override + State createState() => _UserEventsState(); +} + +class _UserEventsState extends State + with AutomaticKeepAliveClientMixin { + @override + bool get wantKeepAlive => true; + + @override + Widget build(BuildContext context) { + super.build(context); + return BaseView( + onModelReady: (model) => model.initialise(), + builder: (context, model, child) { + return Scaffold( + body: model.isBusy + ? const Center(child: CircularProgressIndicator()) + : model.userEvents.isEmpty + ? Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + AppLocalizations.of(context)!.strictTranslate( + 'You have no event in this organization', + ), + style: TextStyle( + fontSize: SizeConfig.screenHeight! * 0.026, + ), + ), + TextButton( + onPressed: () { + navigationService.pushScreen( + "/createEventPage", + ); + }, + child: Text( + AppLocalizations.of(context)!.strictTranslate( + 'Create your first event', + ), + ), + ), + ], + ), + ) + : SingleChildScrollView( + key: const Key('UserEventsList'), + child: ListView.builder( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.userEvents.length, + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + key: Key('event$index'), + onTap: () { + navigationService.pushScreen( + "/eventInfo", + arguments: { + "event": model.userEvents[index], + "exploreEventViewModel": model, + }, + ); + }, + child: EventCard( + event: model.userEvents[index], + isSearchItem: false, + ), + ); + }, + ), + ), + ); + }, + ); + } +} diff --git a/lib/views/after_auth_screens/profile/user_feed.dart b/lib/views/after_auth_screens/profile/user_feed.dart new file mode 100644 index 0000000000..f8130d69af --- /dev/null +++ b/lib/views/after_auth_screens/profile/user_feed.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:talawa/locator.dart'; +import 'package:talawa/services/size_config.dart'; +import 'package:talawa/utils/app_localization.dart'; +import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart'; +import 'package:talawa/views/base_view.dart'; +import 'package:talawa/widgets/post_list_widget.dart'; + +/// User Feed to shows posts by user in current organisation. +class UserFeed extends StatefulWidget { + const UserFeed({ + required Key key, + this.forTest = false, + }) : super(key: key); + + /// for testing. + final bool forTest; + + @override + State createState() => _UserFeedState(); +} + +class _UserFeedState extends State + with AutomaticKeepAliveClientMixin { + @override + bool get wantKeepAlive => true; + + @override + Widget build(BuildContext context) { + super.build(context); + return BaseView( + onModelReady: (model) => model.initialise(isTest: widget.forTest), + builder: (context, model, child) { + model.userPosts.sort((a, b) => b.createdAt!.compareTo(a.createdAt!)); + return Scaffold( + body: model.isFetchingPosts + ? const Center(child: CircularProgressIndicator()) + : (model.userPosts.isEmpty + ? Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + AppLocalizations.of(context)!.strictTranslate( + 'You have no post in this organization', + ), + style: TextStyle( + fontSize: SizeConfig.screenHeight! * 0.026, + ), + ), + TextButton( + onPressed: () { + navigationService.pushScreen('/addpostscreen'); + }, + child: Text( + AppLocalizations.of(context)!.strictTranslate( + 'Create your first post', + ), + ), + ), + ], + ), + ) + : SingleChildScrollView( + child: PostListWidget( + key: const Key('UserPostWidget'), + posts: model.userPosts, + function: model.navigateToIndividualPage, + deletePost: model.removePost, + ), + )), + ); + }, + ); + } +} diff --git a/lib/widgets/post_list_widget.dart b/lib/widgets/post_list_widget.dart index 2f103c0df0..5f0cd08b7f 100644 --- a/lib/widgets/post_list_widget.dart +++ b/lib/widgets/post_list_widget.dart @@ -32,10 +32,10 @@ class PostListWidget extends StatelessWidget { shrinkWrap: true, itemCount: posts.length, itemBuilder: (BuildContext context, int index) { - print(posts[index].imageUrl); return Column( children: [ NewsPost( + key: ValueKey(posts[index].sId), post: posts[index], function: function, deletePost: deletePost, diff --git a/test/helpers/test_helpers.dart b/test/helpers/test_helpers.dart index 71ebf67576..eeecb0d794 100644 --- a/test/helpers/test_helpers.dart +++ b/test/helpers/test_helpers.dart @@ -84,6 +84,9 @@ import 'test_helpers.mocks.dart'; MockSpec( onMissingStub: OnMissingStub.returnDefault, ), + MockSpec( + onMissingStub: OnMissingStub.returnDefault, + ), MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 4f51950a68..962ee4a935 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -1,56 +1,61 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.4 from annotations // in talawa/test/helpers/test_helpers.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; -import 'dart:io' as _i18; -import 'dart:ui' as _i9; +import 'dart:async' as _i5; +import 'dart:io' as _i21; +import 'dart:ui' as _i10; -import 'package:connectivity_plus/connectivity_plus.dart' as _i26; +import 'package:connectivity_plus/connectivity_plus.dart' as _i28; import 'package:connectivity_plus_platform_interface/connectivity_plus_platform_interface.dart' - as _i27; + as _i29; import 'package:flutter/material.dart' as _i1; import 'package:graphql_flutter/graphql_flutter.dart' as _i3; -import 'package:image_cropper/image_cropper.dart' as _i41; -import 'package:image_picker/image_picker.dart' as _i12; +import 'package:image_cropper/src/cropper.dart' as _i43; +import 'package:image_cropper_platform_interface/image_cropper_platform_interface.dart' + as _i44; +import 'package:image_picker/image_picker.dart' as _i13; import 'package:mockito/mockito.dart' as _i2; -import 'package:mockito/src/dummies.dart' as _i24; -import 'package:qr_code_scanner/src/qr_code_scanner.dart' as _i32; -import 'package:qr_code_scanner/src/types/barcode.dart' as _i33; -import 'package:qr_code_scanner/src/types/camera.dart' as _i34; -import 'package:qr_code_scanner/src/types/features.dart' as _i11; -import 'package:talawa/enums/enums.dart' as _i13; -import 'package:talawa/models/chats/chat_list_tile_data_model.dart' as _i21; -import 'package:talawa/models/chats/chat_message.dart' as _i22; -import 'package:talawa/models/events/event_model.dart' as _i19; -import 'package:talawa/models/organization/org_info.dart' as _i5; -import 'package:talawa/models/post/post_model.dart' as _i16; -import 'package:talawa/models/task/task_model.dart' as _i38; -import 'package:talawa/models/user/user_info.dart' as _i6; -import 'package:talawa/services/chat_service.dart' as _i20; -import 'package:talawa/services/comment_service.dart' as _i35; -import 'package:talawa/services/database_mutation_functions.dart' as _i8; -import 'package:talawa/services/event_service.dart' as _i10; -import 'package:talawa/services/graphql_config.dart' as _i14; -import 'package:talawa/services/navigation_service.dart' as _i7; -import 'package:talawa/services/org_service.dart' as _i29; -import 'package:talawa/services/post_service.dart' as _i15; -import 'package:talawa/services/task_service.dart' as _i37; +import 'package:mockito/src/dummies.dart' as _i16; +import 'package:qr_code_scanner/src/qr_code_scanner.dart' as _i34; +import 'package:qr_code_scanner/src/types/barcode.dart' as _i35; +import 'package:qr_code_scanner/src/types/camera.dart' as _i36; +import 'package:qr_code_scanner/src/types/features.dart' as _i12; +import 'package:talawa/enums/enums.dart' as _i17; +import 'package:talawa/models/chats/chat_list_tile_data_model.dart' as _i24; +import 'package:talawa/models/chats/chat_message.dart' as _i25; +import 'package:talawa/models/events/event_model.dart' as _i22; +import 'package:talawa/models/organization/org_info.dart' as _i6; +import 'package:talawa/models/post/post_model.dart' as _i15; +import 'package:talawa/models/task/task_model.dart' as _i40; +import 'package:talawa/models/user/user_info.dart' as _i7; +import 'package:talawa/services/chat_service.dart' as _i23; +import 'package:talawa/services/comment_service.dart' as _i37; +import 'package:talawa/services/database_mutation_functions.dart' as _i9; +import 'package:talawa/services/event_service.dart' as _i11; +import 'package:talawa/services/graphql_config.dart' as _i18; +import 'package:talawa/services/navigation_service.dart' as _i8; +import 'package:talawa/services/org_service.dart' as _i31; +import 'package:talawa/services/post_service.dart' as _i19; +import 'package:talawa/services/task_service.dart' as _i39; import 'package:talawa/services/third_party_service/multi_media_pick_service.dart' - as _i17; -import 'package:talawa/services/user_config.dart' as _i23; -import 'package:talawa/utils/validators.dart' as _i31; + as _i20; +import 'package:talawa/services/user_config.dart' as _i26; +import 'package:talawa/utils/validators.dart' as _i33; import 'package:talawa/view_model/after_auth_view_models/chat_view_models/direct_chat_view_model.dart' - as _i40; + as _i42; import 'package:talawa/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart' - as _i39; + as _i41; import 'package:talawa/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart' - as _i30; -import 'package:talawa/view_model/lang_view_model.dart' as _i25; + as _i32; +import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart' + as _i14; +import 'package:talawa/view_model/lang_view_model.dart' as _i27; import 'package:talawa/view_model/pre_auth_view_models/signup_details_view_model.dart' - as _i28; -import 'package:talawa/view_model/theme_view_model.dart' as _i36; + as _i30; +import 'package:talawa/view_model/theme_view_model.dart' as _i38; +import 'package:talawa/widgets/custom_alert_dialog.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -169,9 +174,24 @@ class _FakeQueryResult_9 extends _i2.SmartFake ); } -class _FakeStreamController_10 extends _i2.SmartFake - implements _i4.StreamController { - _FakeStreamController_10( +class _FakeCustomAlertDialog_10 extends _i2.SmartFake + implements _i4.CustomAlertDialog { + _FakeCustomAlertDialog_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); + + @override + String toString({_i1.DiagnosticLevel? minLevel = _i1.DiagnosticLevel.info}) => + super.toString(); +} + +class _FakeStreamController_11 extends _i2.SmartFake + implements _i5.StreamController { + _FakeStreamController_11( Object parent, Invocation parentInvocation, ) : super( @@ -180,8 +200,8 @@ class _FakeStreamController_10 extends _i2.SmartFake ); } -class _FakeOrgInfo_11 extends _i2.SmartFake implements _i5.OrgInfo { - _FakeOrgInfo_11( +class _FakeOrgInfo_12 extends _i2.SmartFake implements _i6.OrgInfo { + _FakeOrgInfo_12( Object parent, Invocation parentInvocation, ) : super( @@ -190,8 +210,8 @@ class _FakeOrgInfo_11 extends _i2.SmartFake implements _i5.OrgInfo { ); } -class _FakeUser_12 extends _i2.SmartFake implements _i6.User { - _FakeUser_12( +class _FakeUser_13 extends _i2.SmartFake implements _i7.User { + _FakeUser_13( Object parent, Invocation parentInvocation, ) : super( @@ -200,9 +220,9 @@ class _FakeUser_12 extends _i2.SmartFake implements _i6.User { ); } -class _FakeNavigationService_13 extends _i2.SmartFake - implements _i7.NavigationService { - _FakeNavigationService_13( +class _FakeNavigationService_14 extends _i2.SmartFake + implements _i8.NavigationService { + _FakeNavigationService_14( Object parent, Invocation parentInvocation, ) : super( @@ -211,9 +231,9 @@ class _FakeNavigationService_13 extends _i2.SmartFake ); } -class _FakeDataBaseMutationFunctions_14 extends _i2.SmartFake - implements _i8.DataBaseMutationFunctions { - _FakeDataBaseMutationFunctions_14( +class _FakeDataBaseMutationFunctions_15 extends _i2.SmartFake + implements _i9.DataBaseMutationFunctions { + _FakeDataBaseMutationFunctions_15( Object parent, Invocation parentInvocation, ) : super( @@ -222,8 +242,8 @@ class _FakeDataBaseMutationFunctions_14 extends _i2.SmartFake ); } -class _FakeLocale_15 extends _i2.SmartFake implements _i9.Locale { - _FakeLocale_15( +class _FakeLocale_16 extends _i2.SmartFake implements _i10.Locale { + _FakeLocale_16( Object parent, Invocation parentInvocation, ) : super( @@ -232,9 +252,9 @@ class _FakeLocale_15 extends _i2.SmartFake implements _i9.Locale { ); } -class _FakeTextEditingController_16 extends _i2.SmartFake +class _FakeTextEditingController_17 extends _i2.SmartFake implements _i1.TextEditingController { - _FakeTextEditingController_16( + _FakeTextEditingController_17( Object parent, Invocation parentInvocation, ) : super( @@ -243,8 +263,8 @@ class _FakeTextEditingController_16 extends _i2.SmartFake ); } -class _FakeFocusNode_17 extends _i2.SmartFake implements _i1.FocusNode { - _FakeFocusNode_17( +class _FakeFocusNode_18 extends _i2.SmartFake implements _i1.FocusNode { + _FakeFocusNode_18( Object parent, Invocation parentInvocation, ) : super( @@ -257,8 +277,8 @@ class _FakeFocusNode_17 extends _i2.SmartFake implements _i1.FocusNode { super.toString(); } -class _FakeGraphQLError_18 extends _i2.SmartFake implements _i3.GraphQLError { - _FakeGraphQLError_18( +class _FakeGraphQLError_19 extends _i2.SmartFake implements _i3.GraphQLError { + _FakeGraphQLError_19( Object parent, Invocation parentInvocation, ) : super( @@ -267,8 +287,8 @@ class _FakeGraphQLError_18 extends _i2.SmartFake implements _i3.GraphQLError { ); } -class _FakeEventService_19 extends _i2.SmartFake implements _i10.EventService { - _FakeEventService_19( +class _FakeEventService_20 extends _i2.SmartFake implements _i11.EventService { + _FakeEventService_20( Object parent, Invocation parentInvocation, ) : super( @@ -277,9 +297,9 @@ class _FakeEventService_19 extends _i2.SmartFake implements _i10.EventService { ); } -class _FakeSystemFeatures_20 extends _i2.SmartFake - implements _i11.SystemFeatures { - _FakeSystemFeatures_20( +class _FakeSystemFeatures_21 extends _i2.SmartFake + implements _i12.SystemFeatures { + _FakeSystemFeatures_21( Object parent, Invocation parentInvocation, ) : super( @@ -288,8 +308,8 @@ class _FakeSystemFeatures_20 extends _i2.SmartFake ); } -class _FakeTimeOfDay_21 extends _i2.SmartFake implements _i1.TimeOfDay { - _FakeTimeOfDay_21( +class _FakeTimeOfDay_22 extends _i2.SmartFake implements _i1.TimeOfDay { + _FakeTimeOfDay_22( Object parent, Invocation parentInvocation, ) : super( @@ -298,8 +318,8 @@ class _FakeTimeOfDay_21 extends _i2.SmartFake implements _i1.TimeOfDay { ); } -class _FakeDateTime_22 extends _i2.SmartFake implements DateTime { - _FakeDateTime_22( +class _FakeDateTime_23 extends _i2.SmartFake implements DateTime { + _FakeDateTime_23( Object parent, Invocation parentInvocation, ) : super( @@ -308,9 +328,9 @@ class _FakeDateTime_22 extends _i2.SmartFake implements DateTime { ); } -class _FakeLostDataResponse_23 extends _i2.SmartFake - implements _i12.LostDataResponse { - _FakeLostDataResponse_23( +class _FakeLostDataResponse_24 extends _i2.SmartFake + implements _i13.LostDataResponse { + _FakeLostDataResponse_24( Object parent, Invocation parentInvocation, ) : super( @@ -319,10 +339,224 @@ class _FakeLostDataResponse_23 extends _i2.SmartFake ); } +/// A class which mocks [OrganizationFeedViewModel]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockOrganizationFeedViewModel extends _i2.Mock + implements _i14.OrganizationFeedViewModel { + MockOrganizationFeedViewModel() { + _i2.throwOnMissingStub(this); + } + + @override + bool get istest => (super.noSuchMethod( + Invocation.getter(#istest), + returnValue: false, + ) as bool); + + @override + set istest(bool? _istest) => super.noSuchMethod( + Invocation.setter( + #istest, + _istest, + ), + returnValueForMissingStub: null, + ); + + @override + List<_i15.Post> get posts => (super.noSuchMethod( + Invocation.getter(#posts), + returnValue: <_i15.Post>[], + ) as List<_i15.Post>); + + @override + List<_i15.Post> get userPosts => (super.noSuchMethod( + Invocation.getter(#userPosts), + returnValue: <_i15.Post>[], + ) as List<_i15.Post>); + + @override + List<_i15.Post> get pinnedPosts => (super.noSuchMethod( + Invocation.getter(#pinnedPosts), + returnValue: <_i15.Post>[], + ) as List<_i15.Post>); + + @override + String get currentOrgName => (super.noSuchMethod( + Invocation.getter(#currentOrgName), + returnValue: _i16.dummyValue( + this, + Invocation.getter(#currentOrgName), + ), + ) as String); + + @override + bool get isFetchingPosts => (super.noSuchMethod( + Invocation.getter(#isFetchingPosts), + returnValue: false, + ) as bool); + + @override + _i17.ViewState get state => (super.noSuchMethod( + Invocation.getter(#state), + returnValue: _i17.ViewState.idle, + ) as _i17.ViewState); + + @override + bool get isBusy => (super.noSuchMethod( + Invocation.getter(#isBusy), + returnValue: false, + ) as bool); + + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + ) as bool); + + @override + void setCurrentOrganizationName(String? updatedOrganization) => + super.noSuchMethod( + Invocation.method( + #setCurrentOrganizationName, + [updatedOrganization], + ), + returnValueForMissingStub: null, + ); + + @override + void fetchNewPosts() => super.noSuchMethod( + Invocation.method( + #fetchNewPosts, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void initialise({bool? isTest = false}) => super.noSuchMethod( + Invocation.method( + #initialise, + [], + {#isTest: isTest}, + ), + returnValueForMissingStub: null, + ); + + @override + void initializeWithDemoData() => super.noSuchMethod( + Invocation.method( + #initializeWithDemoData, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void buildNewPosts(List<_i15.Post>? newPosts) => super.noSuchMethod( + Invocation.method( + #buildNewPosts, + [newPosts], + ), + returnValueForMissingStub: null, + ); + + @override + void navigateToIndividualPage(_i15.Post? post) => super.noSuchMethod( + Invocation.method( + #navigateToIndividualPage, + [post], + ), + returnValueForMissingStub: null, + ); + + @override + void navigateToPinnedPostPage() => super.noSuchMethod( + Invocation.method( + #navigateToPinnedPostPage, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void addNewPost(_i15.Post? newPost) => super.noSuchMethod( + Invocation.method( + #addNewPost, + [newPost], + ), + returnValueForMissingStub: null, + ); + + @override + void updatedPost(_i15.Post? post) => super.noSuchMethod( + Invocation.method( + #updatedPost, + [post], + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future removePost(_i15.Post? post) => (super.noSuchMethod( + Invocation.method( + #removePost, + [post], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + void setState(_i17.ViewState? viewState) => super.noSuchMethod( + Invocation.method( + #setState, + [viewState], + ), + returnValueForMissingStub: null, + ); + + @override + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} + /// A class which mocks [NavigationService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNavigationService extends _i2.Mock implements _i7.NavigationService { +class MockNavigationService extends _i2.Mock implements _i8.NavigationService { @override _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), @@ -347,7 +581,7 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { ); @override - _i4.Future pushScreen( + _i5.Future pushScreen( String? routeName, { dynamic arguments, }) => @@ -357,12 +591,12 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future popAndPushScreen( + _i5.Future popAndPushScreen( String? routeName, { dynamic arguments, }) => @@ -372,12 +606,12 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future pushReplacementScreen( + _i5.Future pushReplacementScreen( String? routeName, { dynamic arguments, }) => @@ -387,12 +621,12 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future removeAllAndPush( + _i5.Future removeAllAndPush( String? routeName, String? tillRoute, { dynamic arguments, @@ -406,9 +640,9 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { ], {#arguments: arguments}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void pushDialog(_i1.Widget? dialog) => super.noSuchMethod( @@ -436,9 +670,8 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { @override void showTalawaErrorSnackBar( String? errorMessage, - _i13.MessageType? messageType, { - Duration? duration = const Duration(seconds: 2), - }) => + _i17.MessageType? messageType, + ) => super.noSuchMethod( Invocation.method( #showTalawaErrorSnackBar, @@ -446,7 +679,6 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { errorMessage, messageType, ], - {#duration: duration}, ), returnValueForMissingStub: null, ); @@ -454,7 +686,7 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { @override void showTalawaErrorDialog( String? errorMessage, - _i13.MessageType? messageType, + _i17.MessageType? messageType, ) => super.noSuchMethod( Invocation.method( @@ -480,7 +712,7 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService { /// A class which mocks [GraphqlConfig]. /// /// See the documentation for Mockito's code generation for more information. -class MockGraphqlConfig extends _i2.Mock implements _i14.GraphqlConfig { +class MockGraphqlConfig extends _i2.Mock implements _i18.GraphqlConfig { @override _i3.HttpLink get httpLink => (super.noSuchMethod( Invocation.getter(#httpLink), @@ -535,14 +767,14 @@ class MockGraphqlConfig extends _i2.Mock implements _i14.GraphqlConfig { ); @override - _i4.Future getToken() => (super.noSuchMethod( + _i5.Future getToken() => (super.noSuchMethod( Invocation.method( #getToken, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void getOrgUrl() => super.noSuchMethod( @@ -777,14 +1009,14 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { ) as _i3.ObservableQuery); @override - _i4.Future<_i3.QueryResult> query( + _i5.Future<_i3.QueryResult> query( _i3.QueryOptions? options) => (super.noSuchMethod( Invocation.method( #query, [options], ), - returnValue: _i4.Future<_i3.QueryResult>.value( + returnValue: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -792,7 +1024,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - returnValueForMissingStub: _i4.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -800,17 +1032,17 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - ) as _i4.Future<_i3.QueryResult>); + ) as _i5.Future<_i3.QueryResult>); @override - _i4.Future<_i3.QueryResult> mutate( + _i5.Future<_i3.QueryResult> mutate( _i3.MutationOptions? options) => (super.noSuchMethod( Invocation.method( #mutate, [options], ), - returnValue: _i4.Future<_i3.QueryResult>.value( + returnValue: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -818,7 +1050,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - returnValueForMissingStub: _i4.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -826,22 +1058,22 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - ) as _i4.Future<_i3.QueryResult>); + ) as _i5.Future<_i3.QueryResult>); @override - _i4.Stream<_i3.QueryResult> subscribe( + _i5.Stream<_i3.QueryResult> subscribe( _i3.SubscriptionOptions? options) => (super.noSuchMethod( Invocation.method( #subscribe, [options], ), - returnValue: _i4.Stream<_i3.QueryResult>.empty(), - returnValueForMissingStub: _i4.Stream<_i3.QueryResult>.empty(), - ) as _i4.Stream<_i3.QueryResult>); + returnValue: _i5.Stream<_i3.QueryResult>.empty(), + returnValueForMissingStub: _i5.Stream<_i3.QueryResult>.empty(), + ) as _i5.Stream<_i3.QueryResult>); @override - _i4.Future<_i3.QueryResult> fetchMore( + _i5.Future<_i3.QueryResult> fetchMore( _i3.FetchMoreOptions? fetchMoreOptions, { required _i3.QueryOptions? originalOptions, required _i3.QueryResult? previousResult, @@ -855,7 +1087,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { #previousResult: previousResult, }, ), - returnValue: _i4.Future<_i3.QueryResult>.value( + returnValue: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -867,7 +1099,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { }, ), )), - returnValueForMissingStub: _i4.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -879,7 +1111,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { }, ), )), - ) as _i4.Future<_i3.QueryResult>); + ) as _i5.Future<_i3.QueryResult>); @override Map? readQuery( @@ -946,7 +1178,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { ); @override - _i4.Future?>>? resetStore( + _i5.Future?>>? resetStore( {bool? refetchQueries = true}) => (super.noSuchMethod( Invocation.method( @@ -955,26 +1187,26 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { {#refetchQueries: refetchQueries}, ), returnValueForMissingStub: null, - ) as _i4.Future?>>?); + ) as _i5.Future?>>?); } /// A class which mocks [PostService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPostService extends _i2.Mock implements _i15.PostService { +class MockPostService extends _i2.Mock implements _i19.PostService { @override - _i4.Stream> get postStream => (super.noSuchMethod( + _i5.Stream> get postStream => (super.noSuchMethod( Invocation.getter(#postStream), - returnValue: _i4.Stream>.empty(), - returnValueForMissingStub: _i4.Stream>.empty(), - ) as _i4.Stream>); + returnValue: _i5.Stream>.empty(), + returnValueForMissingStub: _i5.Stream>.empty(), + ) as _i5.Stream>); @override - _i4.Stream<_i16.Post> get updatedPostStream => (super.noSuchMethod( + _i5.Stream<_i15.Post> get updatedPostStream => (super.noSuchMethod( Invocation.getter(#updatedPostStream), - returnValue: _i4.Stream<_i16.Post>.empty(), - returnValueForMissingStub: _i4.Stream<_i16.Post>.empty(), - ) as _i4.Stream<_i16.Post>); + returnValue: _i5.Stream<_i15.Post>.empty(), + returnValueForMissingStub: _i5.Stream<_i15.Post>.empty(), + ) as _i5.Stream<_i15.Post>); @override void setOrgStreamSubscription() => super.noSuchMethod( @@ -986,34 +1218,52 @@ class MockPostService extends _i2.Mock implements _i15.PostService { ); @override - _i4.Future getPosts() => (super.noSuchMethod( + _i5.Future getPosts() => (super.noSuchMethod( Invocation.method( #getPosts, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future addLike(String? postID) => (super.noSuchMethod( + Future refreshFeed() async => super.noSuchMethod( + Invocation.method( + #refreshFeed, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void addnewpost(_i15.Post? newPost) => super.noSuchMethod( + Invocation.method( + #addnewpost, + [newPost], + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future addLike(String? postID) => (super.noSuchMethod( Invocation.method( #addLike, [postID], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future removeLike(String? postID) => (super.noSuchMethod( + _i5.Future removeLike(String? postID) => (super.noSuchMethod( Invocation.method( #removeLike, [postID], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void addCommentLocally(String? postID) => super.noSuchMethod( @@ -1029,49 +1279,59 @@ class MockPostService extends _i2.Mock implements _i15.PostService { /// /// See the documentation for Mockito's code generation for more information. class MockMultiMediaPickerService extends _i2.Mock - implements _i17.MultiMediaPickerService { + implements _i20.MultiMediaPickerService { @override - _i4.Stream get fileStream => (super.noSuchMethod( + _i5.Stream get fileStream => (super.noSuchMethod( Invocation.getter(#fileStream), - returnValue: _i4.Stream.empty(), - returnValueForMissingStub: _i4.Stream.empty(), - ) as _i4.Stream); + returnValue: _i5.Stream.empty(), + returnValueForMissingStub: _i5.Stream.empty(), + ) as _i5.Stream); @override - _i4.Future<_i18.File?> getPhotoFromGallery({bool? camera = false}) => + _i5.Future<_i21.File?> getPhotoFromGallery({bool? camera = false}) => (super.noSuchMethod( Invocation.method( #getPhotoFromGallery, [], {#camera: camera}, ), - returnValue: _i4.Future<_i18.File?>.value(), - returnValueForMissingStub: _i4.Future<_i18.File?>.value(), - ) as _i4.Future<_i18.File?>); + returnValue: _i5.Future<_i21.File?>.value(), + returnValueForMissingStub: _i5.Future<_i21.File?>.value(), + ) as _i5.Future<_i21.File?>); @override - _i4.Future<_i18.File?> cropImage({required _i18.File? imageFile}) => - (super.noSuchMethod( + _i4.CustomAlertDialog permissionDeniedDialog() => (super.noSuchMethod( Invocation.method( - #cropImage, + #permissionDeniedDialog, [], - {#imageFile: imageFile}, ), - returnValue: _i4.Future<_i18.File?>.value(), - returnValueForMissingStub: _i4.Future<_i18.File?>.value(), - ) as _i4.Future<_i18.File?>); + returnValue: _FakeCustomAlertDialog_10( + this, + Invocation.method( + #permissionDeniedDialog, + [], + ), + ), + returnValueForMissingStub: _FakeCustomAlertDialog_10( + this, + Invocation.method( + #permissionDeniedDialog, + [], + ), + ), + ) as _i4.CustomAlertDialog); } /// A class which mocks [EventService]. /// /// See the documentation for Mockito's code generation for more information. -class MockEventService extends _i2.Mock implements _i10.EventService { +class MockEventService extends _i2.Mock implements _i11.EventService { @override - _i4.Stream<_i19.Event> get eventStream => (super.noSuchMethod( + _i5.Stream<_i22.Event> get eventStream => (super.noSuchMethod( Invocation.getter(#eventStream), - returnValue: _i4.Stream<_i19.Event>.empty(), - returnValueForMissingStub: _i4.Stream<_i19.Event>.empty(), - ) as _i4.Stream<_i19.Event>); + returnValue: _i5.Stream<_i22.Event>.empty(), + returnValueForMissingStub: _i5.Stream<_i22.Event>.empty(), + ) as _i5.Stream<_i22.Event>); @override void setOrgStreamSubscription() => super.noSuchMethod( @@ -1083,49 +1343,49 @@ class MockEventService extends _i2.Mock implements _i10.EventService { ); @override - _i4.Future getEvents() => (super.noSuchMethod( + _i5.Future getEvents() => (super.noSuchMethod( Invocation.method( #getEvents, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future fetchRegistrantsByEvent(String? eventId) => + _i5.Future fetchRegistrantsByEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #fetchRegistrantsByEvent, [eventId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future registerForAnEvent(String? eventId) => + _i5.Future registerForAnEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #registerForAnEvent, [eventId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future deleteEvent(String? eventId) => (super.noSuchMethod( + _i5.Future deleteEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #deleteEvent, [eventId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future editEvent({ + _i5.Future editEvent({ required String? eventId, required Map? variables, }) => @@ -1138,9 +1398,9 @@ class MockEventService extends _i2.Mock implements _i10.EventService { #variables: variables, }, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void dispose() => super.noSuchMethod( @@ -1155,16 +1415,16 @@ class MockEventService extends _i2.Mock implements _i10.EventService { /// A class which mocks [ChatService]. /// /// See the documentation for Mockito's code generation for more information. -class MockChatService extends _i2.Mock implements _i20.ChatService { +class MockChatService extends _i2.Mock implements _i23.ChatService { @override - _i4.Stream<_i3.QueryResult> get chatStream => (super.noSuchMethod( + _i5.Stream<_i3.QueryResult> get chatStream => (super.noSuchMethod( Invocation.getter(#chatStream), - returnValue: _i4.Stream<_i3.QueryResult>.empty(), - returnValueForMissingStub: _i4.Stream<_i3.QueryResult>.empty(), - ) as _i4.Stream<_i3.QueryResult>); + returnValue: _i5.Stream<_i3.QueryResult>.empty(), + returnValueForMissingStub: _i5.Stream<_i3.QueryResult>.empty(), + ) as _i5.Stream<_i3.QueryResult>); @override - set chatStream(_i4.Stream<_i3.QueryResult>? _chatStream) => + set chatStream(_i5.Stream<_i3.QueryResult>? _chatStream) => super.noSuchMethod( Invocation.setter( #chatStream, @@ -1174,23 +1434,23 @@ class MockChatService extends _i2.Mock implements _i20.ChatService { ); @override - _i4.Stream<_i21.ChatListTileDataModel> get chatListStream => + _i5.Stream<_i24.ChatListTileDataModel> get chatListStream => (super.noSuchMethod( Invocation.getter(#chatListStream), - returnValue: _i4.Stream<_i21.ChatListTileDataModel>.empty(), + returnValue: _i5.Stream<_i24.ChatListTileDataModel>.empty(), returnValueForMissingStub: - _i4.Stream<_i21.ChatListTileDataModel>.empty(), - ) as _i4.Stream<_i21.ChatListTileDataModel>); + _i5.Stream<_i24.ChatListTileDataModel>.empty(), + ) as _i5.Stream<_i24.ChatListTileDataModel>); @override - _i4.Stream<_i22.ChatMessage> get chatMessagesStream => (super.noSuchMethod( + _i5.Stream<_i25.ChatMessage> get chatMessagesStream => (super.noSuchMethod( Invocation.getter(#chatMessagesStream), - returnValue: _i4.Stream<_i22.ChatMessage>.empty(), - returnValueForMissingStub: _i4.Stream<_i22.ChatMessage>.empty(), - ) as _i4.Stream<_i22.ChatMessage>); + returnValue: _i5.Stream<_i25.ChatMessage>.empty(), + returnValueForMissingStub: _i5.Stream<_i25.ChatMessage>.empty(), + ) as _i5.Stream<_i25.ChatMessage>); @override - _i4.Future sendMessageToDirectChat( + _i5.Future sendMessageToDirectChat( String? chatId, String? messageContent, ) => @@ -1202,78 +1462,78 @@ class MockChatService extends _i2.Mock implements _i20.ChatService { messageContent, ], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future getDirectChatsByUserId() => (super.noSuchMethod( + _i5.Future getDirectChatsByUserId() => (super.noSuchMethod( Invocation.method( #getDirectChatsByUserId, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future getDirectChatMessagesByChatId(dynamic chatId) => + _i5.Future getDirectChatMessagesByChatId(dynamic chatId) => (super.noSuchMethod( Invocation.method( #getDirectChatMessagesByChatId, [chatId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [UserConfig]. /// /// See the documentation for Mockito's code generation for more information. -class MockUserConfig extends _i2.Mock implements _i23.UserConfig { +class MockUserConfig extends _i2.Mock implements _i26.UserConfig { @override - _i4.Stream<_i5.OrgInfo> get currentOrgInfoStream => (super.noSuchMethod( + _i5.Stream<_i6.OrgInfo> get currentOrgInfoStream => (super.noSuchMethod( Invocation.getter(#currentOrgInfoStream), - returnValue: _i4.Stream<_i5.OrgInfo>.empty(), - returnValueForMissingStub: _i4.Stream<_i5.OrgInfo>.empty(), - ) as _i4.Stream<_i5.OrgInfo>); + returnValue: _i5.Stream<_i6.OrgInfo>.empty(), + returnValueForMissingStub: _i5.Stream<_i6.OrgInfo>.empty(), + ) as _i5.Stream<_i6.OrgInfo>); @override - _i4.StreamController<_i5.OrgInfo> get currentOrgInfoController => + _i5.StreamController<_i6.OrgInfo> get currentOrgInfoController => (super.noSuchMethod( Invocation.getter(#currentOrgInfoController), - returnValue: _FakeStreamController_10<_i5.OrgInfo>( + returnValue: _FakeStreamController_11<_i6.OrgInfo>( this, Invocation.getter(#currentOrgInfoController), ), - returnValueForMissingStub: _FakeStreamController_10<_i5.OrgInfo>( + returnValueForMissingStub: _FakeStreamController_11<_i6.OrgInfo>( this, Invocation.getter(#currentOrgInfoController), ), - ) as _i4.StreamController<_i5.OrgInfo>); + ) as _i5.StreamController<_i6.OrgInfo>); @override - _i5.OrgInfo get currentOrg => (super.noSuchMethod( + _i6.OrgInfo get currentOrg => (super.noSuchMethod( Invocation.getter(#currentOrg), - returnValue: _FakeOrgInfo_11( + returnValue: _FakeOrgInfo_12( this, Invocation.getter(#currentOrg), ), - returnValueForMissingStub: _FakeOrgInfo_11( + returnValueForMissingStub: _FakeOrgInfo_12( this, Invocation.getter(#currentOrg), ), - ) as _i5.OrgInfo); + ) as _i6.OrgInfo); @override String get currentOrgName => (super.noSuchMethod( Invocation.getter(#currentOrgName), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.getter(#currentOrgName), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.getter(#currentOrgName), ), @@ -1287,7 +1547,7 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { ) as bool); @override - set currentOrg(_i5.OrgInfo? org) => super.noSuchMethod( + set currentOrg(_i6.OrgInfo? org) => super.noSuchMethod( Invocation.setter( #currentOrg, org, @@ -1296,20 +1556,20 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { ); @override - _i6.User get currentUser => (super.noSuchMethod( + _i7.User get currentUser => (super.noSuchMethod( Invocation.getter(#currentUser), - returnValue: _FakeUser_12( + returnValue: _FakeUser_13( this, Invocation.getter(#currentUser), ), - returnValueForMissingStub: _FakeUser_12( + returnValueForMissingStub: _FakeUser_13( this, Invocation.getter(#currentUser), ), - ) as _i6.User); + ) as _i7.User); @override - set currentUser(_i6.User? user) => super.noSuchMethod( + set currentUser(_i7.User? user) => super.noSuchMethod( Invocation.setter( #currentUser, user, @@ -1327,71 +1587,71 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { ); @override - _i4.Future userLoggedIn() => (super.noSuchMethod( + _i5.Future userLoggedIn() => (super.noSuchMethod( Invocation.method( #userLoggedIn, [], ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override - _i4.Future userLogOut() => (super.noSuchMethod( + _i5.Future userLogOut() => (super.noSuchMethod( Invocation.method( #userLogOut, [], ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override - _i4.Future updateUserJoinedOrg(List<_i5.OrgInfo>? orgDetails) => + _i5.Future updateUserJoinedOrg(List<_i6.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserJoinedOrg, [orgDetails], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future updateUserCreatedOrg(List<_i5.OrgInfo>? orgDetails) => + _i5.Future updateUserCreatedOrg(List<_i6.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserCreatedOrg, [orgDetails], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future updateUserMemberRequestOrg(List<_i5.OrgInfo>? orgDetails) => + _i5.Future updateUserMemberRequestOrg(List<_i6.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserMemberRequestOrg, [orgDetails], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future updateUserAdminOrg(List<_i5.OrgInfo>? orgDetails) => + _i5.Future updateUserAdminOrg(List<_i6.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserAdminOrg, [orgDetails], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future updateAccessToken({ + _i5.Future updateAccessToken({ required String? accessToken, required String? refreshToken, }) => @@ -1404,20 +1664,20 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { #refreshToken: refreshToken, }, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future updateUser(_i6.User? updatedUserDetails) => + _i5.Future updateUser(_i7.User? updatedUserDetails) => (super.noSuchMethod( Invocation.method( #updateUser, [updatedUserDetails], ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override void saveUserInHive() => super.noSuchMethod( @@ -1429,7 +1689,7 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { ); @override - void saveCurrentOrgInHive(_i5.OrgInfo? saveOrgAsCurrent) => + void saveCurrentOrgInHive(_i6.OrgInfo? saveOrgAsCurrent) => super.noSuchMethod( Invocation.method( #saveCurrentOrgInHive, @@ -1442,7 +1702,7 @@ class MockUserConfig extends _i2.Mock implements _i23.UserConfig { /// A class which mocks [AppLanguage]. /// /// See the documentation for Mockito's code generation for more information. -class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { +class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { @override bool get isTest => (super.noSuchMethod( Invocation.getter(#isTest), @@ -1451,50 +1711,50 @@ class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { ) as bool); @override - _i7.NavigationService get navigationService => (super.noSuchMethod( + _i8.NavigationService get navigationService => (super.noSuchMethod( Invocation.getter(#navigationService), - returnValue: _FakeNavigationService_13( + returnValue: _FakeNavigationService_14( this, Invocation.getter(#navigationService), ), - returnValueForMissingStub: _FakeNavigationService_13( + returnValueForMissingStub: _FakeNavigationService_14( this, Invocation.getter(#navigationService), ), - ) as _i7.NavigationService); + ) as _i8.NavigationService); @override - _i8.DataBaseMutationFunctions get databaseFunctions => (super.noSuchMethod( + _i9.DataBaseMutationFunctions get databaseFunctions => (super.noSuchMethod( Invocation.getter(#databaseFunctions), - returnValue: _FakeDataBaseMutationFunctions_14( + returnValue: _FakeDataBaseMutationFunctions_15( this, Invocation.getter(#databaseFunctions), ), - returnValueForMissingStub: _FakeDataBaseMutationFunctions_14( + returnValueForMissingStub: _FakeDataBaseMutationFunctions_15( this, Invocation.getter(#databaseFunctions), ), - ) as _i8.DataBaseMutationFunctions); + ) as _i9.DataBaseMutationFunctions); @override - _i9.Locale get appLocal => (super.noSuchMethod( + _i10.Locale get appLocal => (super.noSuchMethod( Invocation.getter(#appLocal), - returnValue: _FakeLocale_15( + returnValue: _FakeLocale_16( this, Invocation.getter(#appLocal), ), - returnValueForMissingStub: _FakeLocale_15( + returnValueForMissingStub: _FakeLocale_16( this, Invocation.getter(#appLocal), ), - ) as _i9.Locale); + ) as _i10.Locale); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -1511,77 +1771,77 @@ class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { ) as bool); @override - _i4.Future initialize() => (super.noSuchMethod( + _i5.Future initialize() => (super.noSuchMethod( Invocation.method( #initialize, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future fetchLocale() => (super.noSuchMethod( + _i5.Future fetchLocale() => (super.noSuchMethod( Invocation.method( #fetchLocale, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future changeLanguage(_i9.Locale? type) => (super.noSuchMethod( + _i5.Future changeLanguage(_i10.Locale? type) => (super.noSuchMethod( Invocation.method( #changeLanguage, [type], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future selectLanguagePress() => (super.noSuchMethod( + _i5.Future selectLanguagePress() => (super.noSuchMethod( Invocation.method( #selectLanguagePress, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future dbLanguageUpdate() => (super.noSuchMethod( + _i5.Future dbLanguageUpdate() => (super.noSuchMethod( Invocation.method( #dbLanguageUpdate, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future appLanguageQuery() => (super.noSuchMethod( + _i5.Future appLanguageQuery() => (super.noSuchMethod( Invocation.method( #appLanguageQuery, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future userLanguageQuery(String? userId) => (super.noSuchMethod( + _i5.Future userLanguageQuery(String? userId) => (super.noSuchMethod( Invocation.method( #userLanguageQuery, [userId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -1590,7 +1850,7 @@ class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1599,7 +1859,7 @@ class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -1629,34 +1889,34 @@ class MockAppLanguage extends _i2.Mock implements _i25.AppLanguage { /// A class which mocks [Connectivity]. /// /// See the documentation for Mockito's code generation for more information. -class MockConnectivity extends _i2.Mock implements _i26.Connectivity { +class MockConnectivity extends _i2.Mock implements _i28.Connectivity { @override - _i4.Stream<_i27.ConnectivityResult> get onConnectivityChanged => + _i5.Stream<_i29.ConnectivityResult> get onConnectivityChanged => (super.noSuchMethod( Invocation.getter(#onConnectivityChanged), - returnValue: _i4.Stream<_i27.ConnectivityResult>.empty(), - returnValueForMissingStub: _i4.Stream<_i27.ConnectivityResult>.empty(), - ) as _i4.Stream<_i27.ConnectivityResult>); + returnValue: _i5.Stream<_i29.ConnectivityResult>.empty(), + returnValueForMissingStub: _i5.Stream<_i29.ConnectivityResult>.empty(), + ) as _i5.Stream<_i29.ConnectivityResult>); @override - _i4.Future<_i27.ConnectivityResult> checkConnectivity() => + _i5.Future<_i29.ConnectivityResult> checkConnectivity() => (super.noSuchMethod( Invocation.method( #checkConnectivity, [], ), - returnValue: _i4.Future<_i27.ConnectivityResult>.value( - _i27.ConnectivityResult.bluetooth), - returnValueForMissingStub: _i4.Future<_i27.ConnectivityResult>.value( - _i27.ConnectivityResult.bluetooth), - ) as _i4.Future<_i27.ConnectivityResult>); + returnValue: _i5.Future<_i29.ConnectivityResult>.value( + _i29.ConnectivityResult.bluetooth), + returnValueForMissingStub: _i5.Future<_i29.ConnectivityResult>.value( + _i29.ConnectivityResult.bluetooth), + ) as _i5.Future<_i29.ConnectivityResult>); } /// A class which mocks [SignupDetailsViewModel]. /// /// See the documentation for Mockito's code generation for more information. class MockSignupDetailsViewModel extends _i2.Mock - implements _i28.SignupDetailsViewModel { + implements _i30.SignupDetailsViewModel { @override _i1.GlobalKey<_i1.FormState> get formKey => (super.noSuchMethod( Invocation.getter(#formKey), @@ -1687,20 +1947,20 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i5.OrgInfo get selectedOrganization => (super.noSuchMethod( + _i6.OrgInfo get selectedOrganization => (super.noSuchMethod( Invocation.getter(#selectedOrganization), - returnValue: _FakeOrgInfo_11( + returnValue: _FakeOrgInfo_12( this, Invocation.getter(#selectedOrganization), ), - returnValueForMissingStub: _FakeOrgInfo_11( + returnValueForMissingStub: _FakeOrgInfo_12( this, Invocation.getter(#selectedOrganization), ), - ) as _i5.OrgInfo); + ) as _i6.OrgInfo); @override - set selectedOrganization(_i5.OrgInfo? _selectedOrganization) => + set selectedOrganization(_i6.OrgInfo? _selectedOrganization) => super.noSuchMethod( Invocation.setter( #selectedOrganization, @@ -1712,11 +1972,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get confirmPassword => (super.noSuchMethod( Invocation.getter(#confirmPassword), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#confirmPassword), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#confirmPassword), ), @@ -1735,11 +1995,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get firstName => (super.noSuchMethod( Invocation.getter(#firstName), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#firstName), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#firstName), ), @@ -1757,11 +2017,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get lastName => (super.noSuchMethod( Invocation.getter(#lastName), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#lastName), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#lastName), ), @@ -1779,11 +2039,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get password => (super.noSuchMethod( Invocation.getter(#password), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#password), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#password), ), @@ -1801,11 +2061,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get email => (super.noSuchMethod( Invocation.getter(#email), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#email), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#email), ), @@ -1839,11 +2099,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.FocusNode get confirmFocus => (super.noSuchMethod( Invocation.getter(#confirmFocus), - returnValue: _FakeFocusNode_17( + returnValue: _FakeFocusNode_18( this, Invocation.getter(#confirmFocus), ), - returnValueForMissingStub: _FakeFocusNode_17( + returnValueForMissingStub: _FakeFocusNode_18( this, Invocation.getter(#confirmFocus), ), @@ -1875,11 +2135,11 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -1896,7 +2156,7 @@ class MockSignupDetailsViewModel extends _i2.Mock ) as bool); @override - void initialise(_i5.OrgInfo? org) => super.noSuchMethod( + void initialise(_i6.OrgInfo? org) => super.noSuchMethod( Invocation.method( #initialise, [org], @@ -1905,17 +2165,17 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i4.Future signUp() => (super.noSuchMethod( + _i5.Future signUp() => (super.noSuchMethod( Invocation.method( #signUp, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -1924,7 +2184,7 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1933,7 +2193,7 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -1963,15 +2223,15 @@ class MockSignupDetailsViewModel extends _i2.Mock /// A class which mocks [Post]. /// /// See the documentation for Mockito's code generation for more information. -class MockPost extends _i2.Mock implements _i16.Post { +class MockPost extends _i2.Mock implements _i15.Post { @override String get sId => (super.noSuchMethod( Invocation.getter(#sId), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.getter(#sId), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.getter(#sId), ), @@ -2032,7 +2292,7 @@ class MockPost extends _i2.Mock implements _i16.Post { ); @override - set creator(_i6.User? _creator) => super.noSuchMethod( + set creator(_i7.User? _creator) => super.noSuchMethod( Invocation.setter( #creator, _creator, @@ -2041,7 +2301,7 @@ class MockPost extends _i2.Mock implements _i16.Post { ); @override - set organization(_i5.OrgInfo? _organization) => super.noSuchMethod( + set organization(_i6.OrgInfo? _organization) => super.noSuchMethod( Invocation.setter( #organization, _organization, @@ -2050,7 +2310,7 @@ class MockPost extends _i2.Mock implements _i16.Post { ); @override - set likedBy(List<_i16.LikedBy>? _likedBy) => super.noSuchMethod( + set likedBy(List<_i15.LikedBy>? _likedBy) => super.noSuchMethod( Invocation.setter( #likedBy, _likedBy, @@ -2059,7 +2319,7 @@ class MockPost extends _i2.Mock implements _i16.Post { ); @override - set comments(List<_i16.Comments>? _comments) => super.noSuchMethod( + set comments(List<_i15.Comments>? _comments) => super.noSuchMethod( Invocation.setter( #comments, _comments, @@ -2073,14 +2333,14 @@ class MockPost extends _i2.Mock implements _i16.Post { #getPostCreatedDuration, [], ), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.method( #getPostCreatedDuration, [], ), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.method( #getPostCreatedDuration, @@ -2094,7 +2354,7 @@ class MockPost extends _i2.Mock implements _i16.Post { /// /// See the documentation for Mockito's code generation for more information. class MockDataBaseMutationFunctions extends _i2.Mock - implements _i8.DataBaseMutationFunctions { + implements _i9.DataBaseMutationFunctions { @override _i3.GraphQLClient get clientNonAuth => (super.noSuchMethod( Invocation.getter(#clientNonAuth), @@ -2142,11 +2402,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get userNotFound => (super.noSuchMethod( Invocation.getter(#userNotFound), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#userNotFound), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#userNotFound), ), @@ -2164,11 +2424,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get userNotAuthenticated => (super.noSuchMethod( Invocation.getter(#userNotAuthenticated), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#userNotAuthenticated), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#userNotAuthenticated), ), @@ -2187,11 +2447,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get emailAccountPresent => (super.noSuchMethod( Invocation.getter(#emailAccountPresent), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#emailAccountPresent), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#emailAccountPresent), ), @@ -2210,11 +2470,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get wrongCredentials => (super.noSuchMethod( Invocation.getter(#wrongCredentials), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#wrongCredentials), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#wrongCredentials), ), @@ -2233,11 +2493,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get organizationNotFound => (super.noSuchMethod( Invocation.getter(#organizationNotFound), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#organizationNotFound), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#organizationNotFound), ), @@ -2257,11 +2517,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock _i3.GraphQLError get refreshAccessTokenExpiredException => (super.noSuchMethod( Invocation.getter(#refreshAccessTokenExpiredException), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#refreshAccessTokenExpiredException), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#refreshAccessTokenExpiredException), ), @@ -2281,11 +2541,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get memberRequestExist => (super.noSuchMethod( Invocation.getter(#memberRequestExist), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#memberRequestExist), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#memberRequestExist), ), @@ -2304,11 +2564,11 @@ class MockDataBaseMutationFunctions extends _i2.Mock @override _i3.GraphQLError get notifFeatureNotInstalled => (super.noSuchMethod( Invocation.getter(#notifFeatureNotInstalled), - returnValue: _FakeGraphQLError_18( + returnValue: _FakeGraphQLError_19( this, Invocation.getter(#notifFeatureNotInstalled), ), - returnValueForMissingStub: _FakeGraphQLError_18( + returnValueForMissingStub: _FakeGraphQLError_19( this, Invocation.getter(#notifFeatureNotInstalled), ), @@ -2348,7 +2608,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock ) as bool?); @override - _i4.Future gqlAuthQuery( + _i5.Future gqlAuthQuery( String? query, { Map? variables, }) => @@ -2358,12 +2618,12 @@ class MockDataBaseMutationFunctions extends _i2.Mock [query], {#variables: variables}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future gqlAuthMutation( + _i5.Future gqlAuthMutation( String? mutation, { Map? variables, }) => @@ -2373,12 +2633,12 @@ class MockDataBaseMutationFunctions extends _i2.Mock [mutation], {#variables: variables}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future gqlNonAuthMutation( + _i5.Future gqlNonAuthMutation( String? mutation, { Map? variables, bool? reCall = true, @@ -2392,12 +2652,12 @@ class MockDataBaseMutationFunctions extends _i2.Mock #reCall: reCall, }, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future<_i3.QueryResult?> gqlNonAuthQuery( + _i5.Future<_i3.QueryResult?> gqlNonAuthQuery( String? query, { Map? variables, }) => @@ -2407,56 +2667,56 @@ class MockDataBaseMutationFunctions extends _i2.Mock [query], {#variables: variables}, ), - returnValue: _i4.Future<_i3.QueryResult?>.value(), + returnValue: _i5.Future<_i3.QueryResult?>.value(), returnValueForMissingStub: - _i4.Future<_i3.QueryResult?>.value(), - ) as _i4.Future<_i3.QueryResult?>); + _i5.Future<_i3.QueryResult?>.value(), + ) as _i5.Future<_i3.QueryResult?>); @override - _i4.Future refreshAccessToken(String? refreshToken) => + _i5.Future refreshAccessToken(String? refreshToken) => (super.noSuchMethod( Invocation.method( #refreshAccessToken, [refreshToken], ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override - _i4.Future fetchOrgById(String? id) => (super.noSuchMethod( + _i5.Future fetchOrgById(String? id) => (super.noSuchMethod( Invocation.method( #fetchOrgById, [id], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [OrganizationService]. /// /// See the documentation for Mockito's code generation for more information. class MockOrganizationService extends _i2.Mock - implements _i29.OrganizationService { + implements _i31.OrganizationService { @override - _i4.Future> getOrgMembersList(String? orgId) => + _i5.Future> getOrgMembersList(String? orgId) => (super.noSuchMethod( Invocation.method( #getOrgMembersList, [orgId], ), - returnValue: _i4.Future>.value(<_i6.User>[]), + returnValue: _i5.Future>.value(<_i7.User>[]), returnValueForMissingStub: - _i4.Future>.value(<_i6.User>[]), - ) as _i4.Future>); + _i5.Future>.value(<_i7.User>[]), + ) as _i5.Future>); } /// A class which mocks [ExploreEventsViewModel]. /// /// See the documentation for Mockito's code generation for more information. class MockExploreEventsViewModel extends _i2.Mock - implements _i30.ExploreEventsViewModel { + implements _i32.ExploreEventsViewModel { @override bool get demoMode => (super.noSuchMethod( Invocation.getter(#demoMode), @@ -2474,33 +2734,40 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - List<_i19.Event> get events => (super.noSuchMethod( + List<_i22.Event> get events => (super.noSuchMethod( Invocation.getter(#events), - returnValue: <_i19.Event>[], - returnValueForMissingStub: <_i19.Event>[], - ) as List<_i19.Event>); + returnValue: <_i22.Event>[], + returnValueForMissingStub: <_i22.Event>[], + ) as List<_i22.Event>); + + @override + List<_i22.Event> get userEvents => (super.noSuchMethod( + Invocation.getter(#userEvents), + returnValue: <_i22.Event>[], + returnValueForMissingStub: <_i22.Event>[], + ) as List<_i22.Event>); @override - _i10.EventService get eventService => (super.noSuchMethod( + _i11.EventService get eventService => (super.noSuchMethod( Invocation.getter(#eventService), - returnValue: _FakeEventService_19( + returnValue: _FakeEventService_20( this, Invocation.getter(#eventService), ), - returnValueForMissingStub: _FakeEventService_19( + returnValueForMissingStub: _FakeEventService_20( this, Invocation.getter(#eventService), ), - ) as _i10.EventService); + ) as _i11.EventService); @override String get emptyListMessage => (super.noSuchMethod( Invocation.getter(#emptyListMessage), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.getter(#emptyListMessage), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.getter(#emptyListMessage), ), @@ -2509,22 +2776,22 @@ class MockExploreEventsViewModel extends _i2.Mock @override String get chosenValue => (super.noSuchMethod( Invocation.getter(#chosenValue), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.getter(#chosenValue), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.getter(#chosenValue), ), ) as String); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -2541,67 +2808,67 @@ class MockExploreEventsViewModel extends _i2.Mock ) as bool); @override - _i4.Future fetchNewEvents() => (super.noSuchMethod( + _i5.Future fetchNewEvents() => (super.noSuchMethod( Invocation.method( #fetchNewEvents, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future refreshEvents() => (super.noSuchMethod( + _i5.Future refreshEvents() => (super.noSuchMethod( Invocation.method( #refreshEvents, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future initialise() => (super.noSuchMethod( + _i5.Future initialise() => (super.noSuchMethod( Invocation.method( #initialise, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future checkIfExistsAndAddNewEvent(_i19.Event? newEvent) => + _i5.Future checkIfExistsAndAddNewEvent(_i22.Event? newEvent) => (super.noSuchMethod( Invocation.method( #checkIfExistsAndAddNewEvent, [newEvent], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future deleteEvent({required String? eventId}) => + _i5.Future deleteEvent({required String? eventId}) => (super.noSuchMethod( Invocation.method( #deleteEvent, [], {#eventId: eventId}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future choseValueFromDropdown(String? value) => (super.noSuchMethod( + _i5.Future choseValueFromDropdown(String? value) => (super.noSuchMethod( Invocation.method( #choseValueFromDropdown, [value], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void dispose() => super.noSuchMethod( @@ -2613,7 +2880,7 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -2622,7 +2889,7 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2631,7 +2898,7 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2652,28 +2919,28 @@ class MockExploreEventsViewModel extends _i2.Mock /// A class which mocks [Validator]. /// /// See the documentation for Mockito's code generation for more information. -class MockValidator extends _i2.Mock implements _i31.Validator { +class MockValidator extends _i2.Mock implements _i33.Validator { @override - _i4.Future validateUrlExistence(String? url) => (super.noSuchMethod( + _i5.Future validateUrlExistence(String? url) => (super.noSuchMethod( Invocation.method( #validateUrlExistence, [url], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [QRViewController]. /// /// See the documentation for Mockito's code generation for more information. -class MockQRViewController extends _i2.Mock implements _i32.QRViewController { +class MockQRViewController extends _i2.Mock implements _i34.QRViewController { @override - _i4.Stream<_i33.Barcode> get scannedDataStream => (super.noSuchMethod( + _i5.Stream<_i35.Barcode> get scannedDataStream => (super.noSuchMethod( Invocation.getter(#scannedDataStream), - returnValue: _i4.Stream<_i33.Barcode>.empty(), - returnValueForMissingStub: _i4.Stream<_i33.Barcode>.empty(), - ) as _i4.Stream<_i33.Barcode>); + returnValue: _i5.Stream<_i35.Barcode>.empty(), + returnValueForMissingStub: _i5.Stream<_i35.Barcode>.empty(), + ) as _i5.Stream<_i35.Barcode>); @override bool get hasPermissions => (super.noSuchMethod( @@ -2683,87 +2950,87 @@ class MockQRViewController extends _i2.Mock implements _i32.QRViewController { ) as bool); @override - _i4.Future<_i34.CameraFacing> getCameraInfo() => (super.noSuchMethod( + _i5.Future<_i36.CameraFacing> getCameraInfo() => (super.noSuchMethod( Invocation.method( #getCameraInfo, [], ), returnValue: - _i4.Future<_i34.CameraFacing>.value(_i34.CameraFacing.back), + _i5.Future<_i36.CameraFacing>.value(_i36.CameraFacing.back), returnValueForMissingStub: - _i4.Future<_i34.CameraFacing>.value(_i34.CameraFacing.back), - ) as _i4.Future<_i34.CameraFacing>); + _i5.Future<_i36.CameraFacing>.value(_i36.CameraFacing.back), + ) as _i5.Future<_i36.CameraFacing>); @override - _i4.Future<_i34.CameraFacing> flipCamera() => (super.noSuchMethod( + _i5.Future<_i36.CameraFacing> flipCamera() => (super.noSuchMethod( Invocation.method( #flipCamera, [], ), returnValue: - _i4.Future<_i34.CameraFacing>.value(_i34.CameraFacing.back), + _i5.Future<_i36.CameraFacing>.value(_i36.CameraFacing.back), returnValueForMissingStub: - _i4.Future<_i34.CameraFacing>.value(_i34.CameraFacing.back), - ) as _i4.Future<_i34.CameraFacing>); + _i5.Future<_i36.CameraFacing>.value(_i36.CameraFacing.back), + ) as _i5.Future<_i36.CameraFacing>); @override - _i4.Future getFlashStatus() => (super.noSuchMethod( + _i5.Future getFlashStatus() => (super.noSuchMethod( Invocation.method( #getFlashStatus, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future toggleFlash() => (super.noSuchMethod( + _i5.Future toggleFlash() => (super.noSuchMethod( Invocation.method( #toggleFlash, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future pauseCamera() => (super.noSuchMethod( + _i5.Future pauseCamera() => (super.noSuchMethod( Invocation.method( #pauseCamera, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future stopCamera() => (super.noSuchMethod( + _i5.Future stopCamera() => (super.noSuchMethod( Invocation.method( #stopCamera, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future resumeCamera() => (super.noSuchMethod( + _i5.Future resumeCamera() => (super.noSuchMethod( Invocation.method( #resumeCamera, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future<_i11.SystemFeatures> getSystemFeatures() => (super.noSuchMethod( + _i5.Future<_i12.SystemFeatures> getSystemFeatures() => (super.noSuchMethod( Invocation.method( #getSystemFeatures, [], ), returnValue: - _i4.Future<_i11.SystemFeatures>.value(_FakeSystemFeatures_20( + _i5.Future<_i12.SystemFeatures>.value(_FakeSystemFeatures_21( this, Invocation.method( #getSystemFeatures, @@ -2771,14 +3038,14 @@ class MockQRViewController extends _i2.Mock implements _i32.QRViewController { ), )), returnValueForMissingStub: - _i4.Future<_i11.SystemFeatures>.value(_FakeSystemFeatures_20( + _i5.Future<_i12.SystemFeatures>.value(_FakeSystemFeatures_21( this, Invocation.method( #getSystemFeatures, [], ), )), - ) as _i4.Future<_i11.SystemFeatures>); + ) as _i5.Future<_i12.SystemFeatures>); @override void dispose() => super.noSuchMethod( @@ -2790,22 +3057,22 @@ class MockQRViewController extends _i2.Mock implements _i32.QRViewController { ); @override - _i4.Future scanInvert(bool? isScanInvert) => (super.noSuchMethod( + _i5.Future scanInvert(bool? isScanInvert) => (super.noSuchMethod( Invocation.method( #scanInvert, [isScanInvert], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [CommentService]. /// /// See the documentation for Mockito's code generation for more information. -class MockCommentService extends _i2.Mock implements _i35.CommentService { +class MockCommentService extends _i2.Mock implements _i37.CommentService { @override - _i4.Future createComments( + _i5.Future createComments( String? postId, String? text, ) => @@ -2817,44 +3084,34 @@ class MockCommentService extends _i2.Mock implements _i35.CommentService { text, ], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future> getCommentsForPost(String? postId) { - final result = super.noSuchMethod( - Invocation.method( - #getCommentsForPost, - [postId], - ), - returnValue: _i4.Future>.value( - []), // Provide an empty list as a default value - returnValueForMissingStub: _i4.Future>.value([]), - ); - - // Check if the result is null, and return an empty list if it is - if (result == null) { - return _i4.Future>.value([]); - } - - // Otherwise, cast the result to List - return result as _i4.Future>; - } + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future> getCommentsForPost(String? postId) => + (super.noSuchMethod( + Invocation.method( + #getCommentsForPost, + [postId], + ), + returnValue: _i5.Future>.value([]), + returnValueForMissingStub: _i5.Future>.value([]), + ) as _i5.Future>); } /// A class which mocks [AppTheme]. /// /// See the documentation for Mockito's code generation for more information. -class MockAppTheme extends _i2.Mock implements _i36.AppTheme { +class MockAppTheme extends _i2.Mock implements _i38.AppTheme { @override String get key => (super.noSuchMethod( Invocation.getter(#key), - returnValue: _i24.dummyValue( + returnValue: _i16.dummyValue( this, Invocation.getter(#key), ), - returnValueForMissingStub: _i24.dummyValue( + returnValueForMissingStub: _i16.dummyValue( this, Invocation.getter(#key), ), @@ -2868,11 +3125,11 @@ class MockAppTheme extends _i2.Mock implements _i36.AppTheme { ) as bool); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -2908,7 +3165,7 @@ class MockAppTheme extends _i2.Mock implements _i36.AppTheme { ); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -2917,7 +3174,7 @@ class MockAppTheme extends _i2.Mock implements _i36.AppTheme { ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -2926,7 +3183,7 @@ class MockAppTheme extends _i2.Mock implements _i36.AppTheme { ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -2956,16 +3213,16 @@ class MockAppTheme extends _i2.Mock implements _i36.AppTheme { /// A class which mocks [TaskService]. /// /// See the documentation for Mockito's code generation for more information. -class MockTaskService extends _i2.Mock implements _i37.TaskService { +class MockTaskService extends _i2.Mock implements _i39.TaskService { @override - _i9.VoidCallback get callbackNotifyListeners => (super.noSuchMethod( + _i10.VoidCallback get callbackNotifyListeners => (super.noSuchMethod( Invocation.getter(#callbackNotifyListeners), returnValue: () {}, returnValueForMissingStub: () {}, - ) as _i9.VoidCallback); + ) as _i10.VoidCallback); @override - set callbackNotifyListeners(_i9.VoidCallback? _callbackNotifyListeners) => + set callbackNotifyListeners(_i10.VoidCallback? _callbackNotifyListeners) => super.noSuchMethod( Invocation.setter( #callbackNotifyListeners, @@ -2975,34 +3232,34 @@ class MockTaskService extends _i2.Mock implements _i37.TaskService { ); @override - List<_i38.Task> get tasks => (super.noSuchMethod( + List<_i40.Task> get tasks => (super.noSuchMethod( Invocation.getter(#tasks), - returnValue: <_i38.Task>[], - returnValueForMissingStub: <_i38.Task>[], - ) as List<_i38.Task>); + returnValue: <_i40.Task>[], + returnValueForMissingStub: <_i40.Task>[], + ) as List<_i40.Task>); @override - _i4.Future getTasksForEvent(String? eventId) => (super.noSuchMethod( + _i5.Future getTasksForEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #getTasksForEvent, [eventId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future getTasksByUser() => (super.noSuchMethod( + _i5.Future getTasksByUser() => (super.noSuchMethod( Invocation.method( #getTasksByUser, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future editTask({ + _i5.Future editTask({ required String? title, required String? description, required String? deadline, @@ -3019,12 +3276,12 @@ class MockTaskService extends _i2.Mock implements _i37.TaskService { #taskId: taskId, }, ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override - _i4.Future createTask({ + _i5.Future createTask({ required String? title, required String? description, required String? deadline, @@ -3041,12 +3298,12 @@ class MockTaskService extends _i2.Mock implements _i37.TaskService { #eventId: eventId, }, ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) as _i5.Future); @override - _i4.Future deleteTask( + _i5.Future deleteTask( String? taskId, String? creatorId, ) => @@ -3058,24 +3315,24 @@ class MockTaskService extends _i2.Mock implements _i37.TaskService { creatorId, ], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [CreateEventViewModel]. /// /// See the documentation for Mockito's code generation for more information. class MockCreateEventViewModel extends _i2.Mock - implements _i39.CreateEventViewModel { + implements _i41.CreateEventViewModel { @override _i1.TextEditingController get eventTitleTextController => (super.noSuchMethod( Invocation.getter(#eventTitleTextController), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#eventTitleTextController), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#eventTitleTextController), ), @@ -3096,11 +3353,11 @@ class MockCreateEventViewModel extends _i2.Mock _i1.TextEditingController get eventLocationTextController => (super.noSuchMethod( Invocation.getter(#eventLocationTextController), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#eventLocationTextController), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#eventLocationTextController), ), @@ -3121,11 +3378,11 @@ class MockCreateEventViewModel extends _i2.Mock _i1.TextEditingController get eventDescriptionTextController => (super.noSuchMethod( Invocation.getter(#eventDescriptionTextController), - returnValue: _FakeTextEditingController_16( + returnValue: _FakeTextEditingController_17( this, Invocation.getter(#eventDescriptionTextController), ), - returnValueForMissingStub: _FakeTextEditingController_16( + returnValueForMissingStub: _FakeTextEditingController_17( this, Invocation.getter(#eventDescriptionTextController), ), @@ -3145,11 +3402,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.TimeOfDay get eventStartTime => (super.noSuchMethod( Invocation.getter(#eventStartTime), - returnValue: _FakeTimeOfDay_21( + returnValue: _FakeTimeOfDay_22( this, Invocation.getter(#eventStartTime), ), - returnValueForMissingStub: _FakeTimeOfDay_21( + returnValueForMissingStub: _FakeTimeOfDay_22( this, Invocation.getter(#eventStartTime), ), @@ -3167,11 +3424,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.TimeOfDay get eventEndTime => (super.noSuchMethod( Invocation.getter(#eventEndTime), - returnValue: _FakeTimeOfDay_21( + returnValue: _FakeTimeOfDay_22( this, Invocation.getter(#eventEndTime), ), - returnValueForMissingStub: _FakeTimeOfDay_21( + returnValueForMissingStub: _FakeTimeOfDay_22( this, Invocation.getter(#eventEndTime), ), @@ -3189,11 +3446,11 @@ class MockCreateEventViewModel extends _i2.Mock @override DateTime get eventStartDate => (super.noSuchMethod( Invocation.getter(#eventStartDate), - returnValue: _FakeDateTime_22( + returnValue: _FakeDateTime_23( this, Invocation.getter(#eventStartDate), ), - returnValueForMissingStub: _FakeDateTime_22( + returnValueForMissingStub: _FakeDateTime_23( this, Invocation.getter(#eventStartDate), ), @@ -3211,11 +3468,11 @@ class MockCreateEventViewModel extends _i2.Mock @override DateTime get eventEndDate => (super.noSuchMethod( Invocation.getter(#eventEndDate), - returnValue: _FakeDateTime_22( + returnValue: _FakeDateTime_23( this, Invocation.getter(#eventEndDate), ), - returnValueForMissingStub: _FakeDateTime_22( + returnValueForMissingStub: _FakeDateTime_23( this, Invocation.getter(#eventEndDate), ), @@ -3265,11 +3522,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get titleFocus => (super.noSuchMethod( Invocation.getter(#titleFocus), - returnValue: _FakeFocusNode_17( + returnValue: _FakeFocusNode_18( this, Invocation.getter(#titleFocus), ), - returnValueForMissingStub: _FakeFocusNode_17( + returnValueForMissingStub: _FakeFocusNode_18( this, Invocation.getter(#titleFocus), ), @@ -3287,11 +3544,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get locationFocus => (super.noSuchMethod( Invocation.getter(#locationFocus), - returnValue: _FakeFocusNode_17( + returnValue: _FakeFocusNode_18( this, Invocation.getter(#locationFocus), ), - returnValueForMissingStub: _FakeFocusNode_17( + returnValueForMissingStub: _FakeFocusNode_18( this, Invocation.getter(#locationFocus), ), @@ -3309,11 +3566,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get descriptionFocus => (super.noSuchMethod( Invocation.getter(#descriptionFocus), - returnValue: _FakeFocusNode_17( + returnValue: _FakeFocusNode_18( this, Invocation.getter(#descriptionFocus), ), - returnValueForMissingStub: _FakeFocusNode_17( + returnValueForMissingStub: _FakeFocusNode_18( this, Invocation.getter(#descriptionFocus), ), @@ -3347,14 +3604,14 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - List<_i6.User> get orgMembersList => (super.noSuchMethod( + List<_i7.User> get orgMembersList => (super.noSuchMethod( Invocation.getter(#orgMembersList), - returnValue: <_i6.User>[], - returnValueForMissingStub: <_i6.User>[], - ) as List<_i6.User>); + returnValue: <_i7.User>[], + returnValueForMissingStub: <_i7.User>[], + ) as List<_i7.User>); @override - set orgMembersList(List<_i6.User>? _orgMembersList) => super.noSuchMethod( + set orgMembersList(List<_i7.User>? _orgMembersList) => super.noSuchMethod( Invocation.setter( #orgMembersList, _orgMembersList, @@ -3392,11 +3649,11 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - List<_i6.User> get selectedMembers => (super.noSuchMethod( + List<_i7.User> get selectedMembers => (super.noSuchMethod( Invocation.getter(#selectedMembers), - returnValue: <_i6.User>[], - returnValueForMissingStub: <_i6.User>[], - ) as List<_i6.User>); + returnValue: <_i7.User>[], + returnValueForMissingStub: <_i7.User>[], + ) as List<_i7.User>); @override Map get memberCheckedMap => (super.noSuchMethod( @@ -3406,11 +3663,11 @@ class MockCreateEventViewModel extends _i2.Mock ) as Map); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -3436,26 +3693,26 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - _i4.Future createEvent() => (super.noSuchMethod( + _i5.Future createEvent() => (super.noSuchMethod( Invocation.method( #createEvent, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future getImageFromGallery({bool? camera = false}) => + _i5.Future getImageFromGallery({bool? camera = false}) => (super.noSuchMethod( Invocation.method( #getImageFromGallery, [], {#camera: camera}, ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void removeImage() => super.noSuchMethod( @@ -3467,15 +3724,15 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - _i4.Future> getCurrentOrgUsersList() => (super.noSuchMethod( + _i5.Future> getCurrentOrgUsersList() => (super.noSuchMethod( Invocation.method( #getCurrentOrgUsersList, [], ), - returnValue: _i4.Future>.value(<_i6.User>[]), + returnValue: _i5.Future>.value(<_i7.User>[]), returnValueForMissingStub: - _i4.Future>.value(<_i6.User>[]), - ) as _i4.Future>); + _i5.Future>.value(<_i7.User>[]), + ) as _i5.Future>); @override void buildUserList() => super.noSuchMethod( @@ -3497,7 +3754,7 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -3506,7 +3763,7 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -3515,7 +3772,7 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -3546,7 +3803,7 @@ class MockCreateEventViewModel extends _i2.Mock /// /// See the documentation for Mockito's code generation for more information. class MockDirectChatViewModel extends _i2.Mock - implements _i40.DirectChatViewModel { + implements _i42.DirectChatViewModel { @override _i1.GlobalKey<_i1.AnimatedListState> get listKey => (super.noSuchMethod( Invocation.getter(#listKey), @@ -3561,14 +3818,14 @@ class MockDirectChatViewModel extends _i2.Mock ) as _i1.GlobalKey<_i1.AnimatedListState>); @override - _i13.ChatState get chatState => (super.noSuchMethod( + _i17.ChatState get chatState => (super.noSuchMethod( Invocation.getter(#chatState), - returnValue: _i13.ChatState.initial, - returnValueForMissingStub: _i13.ChatState.initial, - ) as _i13.ChatState); + returnValue: _i17.ChatState.initial, + returnValueForMissingStub: _i17.ChatState.initial, + ) as _i17.ChatState); @override - set chatState(_i13.ChatState? _chatState) => super.noSuchMethod( + set chatState(_i17.ChatState? _chatState) => super.noSuchMethod( Invocation.setter( #chatState, _chatState, @@ -3586,26 +3843,26 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - List<_i21.ChatListTileDataModel> get chats => (super.noSuchMethod( + List<_i24.ChatListTileDataModel> get chats => (super.noSuchMethod( Invocation.getter(#chats), - returnValue: <_i21.ChatListTileDataModel>[], - returnValueForMissingStub: <_i21.ChatListTileDataModel>[], - ) as List<_i21.ChatListTileDataModel>); + returnValue: <_i24.ChatListTileDataModel>[], + returnValueForMissingStub: <_i24.ChatListTileDataModel>[], + ) as List<_i24.ChatListTileDataModel>); @override - Map> get chatMessagesByUser => + Map> get chatMessagesByUser => (super.noSuchMethod( Invocation.getter(#chatMessagesByUser), - returnValue: >{}, - returnValueForMissingStub: >{}, - ) as Map>); + returnValue: >{}, + returnValueForMissingStub: >{}, + ) as Map>); @override - _i13.ViewState get state => (super.noSuchMethod( + _i17.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i13.ViewState.idle, - returnValueForMissingStub: _i13.ViewState.idle, - ) as _i13.ViewState); + returnValue: _i17.ViewState.idle, + returnValueForMissingStub: _i17.ViewState.idle, + ) as _i17.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -3631,27 +3888,27 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - _i4.Future initialise() => (super.noSuchMethod( + _i5.Future initialise() => (super.noSuchMethod( Invocation.method( #initialise, [], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future getChatMessages(String? chatId) => (super.noSuchMethod( + _i5.Future getChatMessages(String? chatId) => (super.noSuchMethod( Invocation.method( #getChatMessages, [chatId], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.Future sendMessageToDirectChat( + _i5.Future sendMessageToDirectChat( String? chatId, String? messageContent, ) => @@ -3663,9 +3920,9 @@ class MockDirectChatViewModel extends _i2.Mock messageContent, ], ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override void dispose() => super.noSuchMethod( @@ -3686,7 +3943,7 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - void setState(_i13.ViewState? viewState) => super.noSuchMethod( + void setState(_i17.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -3695,7 +3952,7 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - void addListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -3704,7 +3961,7 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -3725,24 +3982,24 @@ class MockDirectChatViewModel extends _i2.Mock /// A class which mocks [ImageCropper]. /// /// See the documentation for Mockito's code generation for more information. -class MockImageCropper extends _i2.Mock implements _i41.ImageCropper { +class MockImageCropper extends _i2.Mock implements _i43.ImageCropper { @override - _i4.Future<_i41.CroppedFile?> cropImage({ + _i5.Future<_i44.CroppedFile?> cropImage({ required String? sourcePath, int? maxWidth, int? maxHeight, - _i41.CropAspectRatio? aspectRatio, - List<_i41.CropAspectRatioPreset>? aspectRatioPresets = const [ - _i41.CropAspectRatioPreset.original, - _i41.CropAspectRatioPreset.square, - _i41.CropAspectRatioPreset.ratio3x2, - _i41.CropAspectRatioPreset.ratio4x3, - _i41.CropAspectRatioPreset.ratio16x9, + _i44.CropAspectRatio? aspectRatio, + List<_i44.CropAspectRatioPreset>? aspectRatioPresets = const [ + _i44.CropAspectRatioPreset.original, + _i44.CropAspectRatioPreset.square, + _i44.CropAspectRatioPreset.ratio3x2, + _i44.CropAspectRatioPreset.ratio4x3, + _i44.CropAspectRatioPreset.ratio16x9, ], - _i41.CropStyle? cropStyle = _i41.CropStyle.rectangle, - _i41.ImageCompressFormat? compressFormat = _i41.ImageCompressFormat.jpg, + _i44.CropStyle? cropStyle = _i44.CropStyle.rectangle, + _i44.ImageCompressFormat? compressFormat = _i44.ImageCompressFormat.jpg, int? compressQuality = 90, - List<_i41.PlatformUiSettings>? uiSettings, + List<_i44.PlatformUiSettings>? uiSettings, }) => (super.noSuchMethod( Invocation.method( @@ -3760,32 +4017,32 @@ class MockImageCropper extends _i2.Mock implements _i41.ImageCropper { #uiSettings: uiSettings, }, ), - returnValue: _i4.Future<_i41.CroppedFile?>.value(), - returnValueForMissingStub: _i4.Future<_i41.CroppedFile?>.value(), - ) as _i4.Future<_i41.CroppedFile?>); + returnValue: _i5.Future<_i44.CroppedFile?>.value(), + returnValueForMissingStub: _i5.Future<_i44.CroppedFile?>.value(), + ) as _i5.Future<_i44.CroppedFile?>); @override - _i4.Future<_i41.CroppedFile?> recoverImage() => (super.noSuchMethod( + _i5.Future<_i44.CroppedFile?> recoverImage() => (super.noSuchMethod( Invocation.method( #recoverImage, [], ), - returnValue: _i4.Future<_i41.CroppedFile?>.value(), - returnValueForMissingStub: _i4.Future<_i41.CroppedFile?>.value(), - ) as _i4.Future<_i41.CroppedFile?>); + returnValue: _i5.Future<_i44.CroppedFile?>.value(), + returnValueForMissingStub: _i5.Future<_i44.CroppedFile?>.value(), + ) as _i5.Future<_i44.CroppedFile?>); } /// A class which mocks [ImagePicker]. /// /// See the documentation for Mockito's code generation for more information. -class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { +class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { @override - _i4.Future<_i12.XFile?> pickImage({ - required _i12.ImageSource? source, + _i5.Future<_i13.XFile?> pickImage({ + required _i13.ImageSource? source, double? maxWidth, double? maxHeight, int? imageQuality, - _i12.CameraDevice? preferredCameraDevice = _i12.CameraDevice.rear, + _i13.CameraDevice? preferredCameraDevice = _i13.CameraDevice.rear, bool? requestFullMetadata = true, }) => (super.noSuchMethod( @@ -3801,12 +4058,12 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i4.Future<_i12.XFile?>.value(), - returnValueForMissingStub: _i4.Future<_i12.XFile?>.value(), - ) as _i4.Future<_i12.XFile?>); + returnValue: _i5.Future<_i13.XFile?>.value(), + returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), + ) as _i5.Future<_i13.XFile?>); @override - _i4.Future> pickMultiImage({ + _i5.Future> pickMultiImage({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -3823,13 +4080,13 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i4.Future>.value(<_i12.XFile>[]), + returnValue: _i5.Future>.value(<_i13.XFile>[]), returnValueForMissingStub: - _i4.Future>.value(<_i12.XFile>[]), - ) as _i4.Future>); + _i5.Future>.value(<_i13.XFile>[]), + ) as _i5.Future>); @override - _i4.Future<_i12.XFile?> pickMedia({ + _i5.Future<_i13.XFile?> pickMedia({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -3846,12 +4103,12 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i4.Future<_i12.XFile?>.value(), - returnValueForMissingStub: _i4.Future<_i12.XFile?>.value(), - ) as _i4.Future<_i12.XFile?>); + returnValue: _i5.Future<_i13.XFile?>.value(), + returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), + ) as _i5.Future<_i13.XFile?>); @override - _i4.Future> pickMultipleMedia({ + _i5.Future> pickMultipleMedia({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -3868,15 +4125,15 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i4.Future>.value(<_i12.XFile>[]), + returnValue: _i5.Future>.value(<_i13.XFile>[]), returnValueForMissingStub: - _i4.Future>.value(<_i12.XFile>[]), - ) as _i4.Future>); + _i5.Future>.value(<_i13.XFile>[]), + ) as _i5.Future>); @override - _i4.Future<_i12.XFile?> pickVideo({ - required _i12.ImageSource? source, - _i12.CameraDevice? preferredCameraDevice = _i12.CameraDevice.rear, + _i5.Future<_i13.XFile?> pickVideo({ + required _i13.ImageSource? source, + _i13.CameraDevice? preferredCameraDevice = _i13.CameraDevice.rear, Duration? maxDuration, }) => (super.noSuchMethod( @@ -3889,18 +4146,18 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { #maxDuration: maxDuration, }, ), - returnValue: _i4.Future<_i12.XFile?>.value(), - returnValueForMissingStub: _i4.Future<_i12.XFile?>.value(), - ) as _i4.Future<_i12.XFile?>); + returnValue: _i5.Future<_i13.XFile?>.value(), + returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), + ) as _i5.Future<_i13.XFile?>); @override - _i4.Future<_i12.LostDataResponse> retrieveLostData() => (super.noSuchMethod( + _i5.Future<_i13.LostDataResponse> retrieveLostData() => (super.noSuchMethod( Invocation.method( #retrieveLostData, [], ), returnValue: - _i4.Future<_i12.LostDataResponse>.value(_FakeLostDataResponse_23( + _i5.Future<_i13.LostDataResponse>.value(_FakeLostDataResponse_24( this, Invocation.method( #retrieveLostData, @@ -3908,17 +4165,17 @@ class MockImagePicker extends _i2.Mock implements _i12.ImagePicker { ), )), returnValueForMissingStub: - _i4.Future<_i12.LostDataResponse>.value(_FakeLostDataResponse_23( + _i5.Future<_i13.LostDataResponse>.value(_FakeLostDataResponse_24( this, Invocation.method( #retrieveLostData, [], ), )), - ) as _i4.Future<_i12.LostDataResponse>); + ) as _i5.Future<_i13.LostDataResponse>); @override - bool supportsImageSource(_i12.ImageSource? source) => (super.noSuchMethod( + bool supportsImageSource(_i13.ImageSource? source) => (super.noSuchMethod( Invocation.method( #supportsImageSource, [source], diff --git a/test/service_tests/post_service_test.dart b/test/service_tests/post_service_test.dart index b5d82cb178..ab1f60f7e4 100644 --- a/test/service_tests/post_service_test.dart +++ b/test/service_tests/post_service_test.dart @@ -5,6 +5,7 @@ import 'package:mockito/mockito.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/models/organization/org_info.dart'; import 'package:talawa/models/post/post_model.dart'; +import 'package:talawa/models/user/user_info.dart'; import 'package:talawa/services/database_mutation_functions.dart'; import 'package:talawa/services/post_service.dart'; import 'package:talawa/services/user_config.dart'; @@ -74,6 +75,37 @@ void main() { const postID = '1'; group('Test PostService', () { + test('Test refreshFeed method', () async { + final dataBaseMutationFunctions = locator(); + final service = PostService(); + // Populating refreshing feed + await service.refreshFeed(); + verify(dataBaseMutationFunctions.refreshAccessToken('testtoken')) + .called(2); + }); + + test('Test addNewPost method', () async { + final dataBaseMutationFunctions = locator(); + final query = PostQueries().getPostsById(currentOrgID); + when( + dataBaseMutationFunctions.gqlAuthQuery( + query, + ), + ).thenAnswer( + (_) async => QueryResult( + options: QueryOptions(document: gql(query)), + data: demoJson, + source: QueryResultSource.network, + ), + ); + + final service = PostService(); + await service.getPosts(); + service.addNewpost(Post(sId: '1', creator: User())); + + final List posts = await service.postStream.first; + expect(posts.length, 3); + }); test('Test getPosts Method', () async { final dataBaseMutationFunctions = locator(); //Setting up Demo data to be returned @@ -273,8 +305,9 @@ void main() { const Duration(seconds: 1), ); // Adjust the delay as needed - // Verify that getPosts was called after the organization update - verify(service.getPosts()).called(1); + // Verify that refresh token was called to check getPost method was called correctly. + verify(dataBaseMutationFunctions.refreshAccessToken('testtoken')) + .called(3); // Close the stream controller to avoid memory leaks await orgInfoStreamController.close(); diff --git a/test/utils/post_queries_test.dart b/test/utils/post_queries_test.dart index 1aa9a3217c..5f5029d245 100644 --- a/test/utils/post_queries_test.dart +++ b/test/utils/post_queries_test.dart @@ -81,5 +81,54 @@ void main() { final fnData = PostQueries().removePost(); expect(fnData, data); }); + test("Check if uploadPost works correctly", () { + const data = ''' + mutation CreatePost( + \$text: String! + \$title: String! + \$imageUrl: URL + \$videoUrl: URL + \$organizationId: ID! + \$file: String + ) { + createPost( + data: { + text: \$text + title: \$title + imageUrl: \$imageUrl + videoUrl: \$videoUrl + organizationId: \$organizationId + } + file: \$file + ) { + _id + text + createdAt + imageUrl + videoUrl + title + commentCount + likeCount + creator{ + _id + firstName + lastName + image + } + organization{ + _id + } + likedBy{ + _id + } + comments{ + _id + } + } + } + '''; + final fnData = PostQueries().uploadPost(); + expect(fnData, data); + }); }); } diff --git a/test/view_model_tests/after_auth_view_model_tests/add_post_view_model_test.dart b/test/view_model_tests/after_auth_view_model_tests/add_post_view_model_test.dart index 227eb914e8..54228863d2 100644 --- a/test/view_model_tests/after_auth_view_model_tests/add_post_view_model_test.dart +++ b/test/view_model_tests/after_auth_view_model_tests/add_post_view_model_test.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; +import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mockito/mockito.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/services/database_mutation_functions.dart'; @@ -19,6 +20,30 @@ class MockCallbackFunction extends Mock { void call(); } +final demoJson = { + 'createPost': { + '__typename': 'Post', + '_id': '1', + 'text': 'text #hastag', + 'createdAt': '2023-11-13T19:28:21.095Z', + 'imageUrl': 'https://imageurl', + 'videoUrl': 'https://videoUrl', + 'title': 'demo title', + 'commentCount': 0, + 'likeCount': 0, + 'creator': { + '__typename': 'User', + '_id': '1', + 'firstName': 'Ayush', + 'lastName': 'Raghuwanshi', + 'image': 'https://imageUrl', + }, + 'organization': {'__typename': 'Organization', '_id': '1'}, + 'likedBy': [], + 'comments': [], + }, +}; + void main() { testSetupLocator(); setUp(() { @@ -86,9 +111,26 @@ void main() { verify(notifyListenerCallback()); }); test("Check if upload post works correctly", () async { + final dataBaseMutationFunctions = locator(); final notifyListenerCallback = MockCallbackFunction(); final model = AddPostViewModel()..addListener(notifyListenerCallback); model.initialise(); + when( + dataBaseMutationFunctions.gqlAuthMutation( + PostQueries().uploadPost(), + variables: { + "text": " #", + "organizationId": 'XYZ', + "title": '', + }, + ), + ).thenAnswer( + (realInvocation) async => QueryResult( + options: QueryOptions(document: gql(PostQueries().uploadPost())), + data: demoJson, + source: QueryResultSource.network, + ), + ); await model.uploadPost(); verify( @@ -112,6 +154,7 @@ void main() { }); test('uploadPost with _imageFile != null and throws no exception', () async { + final dataBaseMutationFunctions = locator(); final viewModel = AddPostViewModel(); viewModel.initialise(); final mockImageFile = File( @@ -124,6 +167,23 @@ void main() { viewModel.controller.text = "Some post content"; viewModel.textHashTagController.text = "hashtag"; viewModel.titleController.text = "Post Title"; + when( + dataBaseMutationFunctions.gqlAuthMutation( + PostQueries().uploadPost(), + variables: { + "text": 'Some post content', + "organizationId": 'XYZ', + "title": 'Post Title', + "file": 'data:image/png;base64,', + }, + ), + ).thenAnswer( + (realInvocation) async => QueryResult( + options: QueryOptions(document: gql(PostQueries().uploadPost())), + data: demoJson, + source: QueryResultSource.network, + ), + ); await viewModel.uploadPost(); verify( diff --git a/test/view_model_tests/after_auth_view_model_tests/event_view_model_tests/explore_events_view_model_test.dart b/test/view_model_tests/after_auth_view_model_tests/event_view_model_tests/explore_events_view_model_test.dart index 15ea37f24a..b95ba77042 100644 --- a/test/view_model_tests/after_auth_view_model_tests/event_view_model_tests/explore_events_view_model_test.dart +++ b/test/view_model_tests/after_auth_view_model_tests/event_view_model_tests/explore_events_view_model_test.dart @@ -75,10 +75,10 @@ void main() { attendees: "20", location: "fake_event_loc", recurring: false, - startDate: DateTime.now().toString().substring(0, 10), - endDate: DateTime.now().toString().substring(0, 10), - startTime: "1900", - endTime: "2000", + startDate: '2024-01-14', + endDate: '2024-01-14', + startTime: '08:01:00.000Z', + endTime: '08:50:00.000Z', recurrence: "none", creator: User(id: 'Test Id'), isPublic: true, @@ -162,7 +162,7 @@ void main() { await model.choseValueFromDropdown('All Events'); expect(model.emptyListMessage, "Looks like there aren't any events."); - await model.choseValueFromDropdown("Created Events"); + await model.choseValueFromDropdown("My Events"); bool allCreated = true; final userConfig = getAndRegisterUserConfig(); for (int i = 0; i < model.events.length; i++) { @@ -232,5 +232,12 @@ void main() { await model.choseValueFromDropdown('Registered Events'); expect(model.emptyListMessage, "No registered events are present"); }); + test( + "Test chooseValueFromDropdown when value is Registered Events and _bufferEvents is not empty", + () async { + final model = ExploreEventsViewModel(); + final List userEvents = model.userEvents; + expect(userEvents, []); + }); }); } diff --git a/test/view_model_tests/after_auth_view_model_tests/organization_feed_view_model_test.dart b/test/view_model_tests/after_auth_view_model_tests/organization_feed_view_model_test.dart index 553fc78262..d3634880ae 100644 --- a/test/view_model_tests/after_auth_view_model_tests/organization_feed_view_model_test.dart +++ b/test/view_model_tests/after_auth_view_model_tests/organization_feed_view_model_test.dart @@ -4,7 +4,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:talawa/constants/routing_constants.dart'; -import 'package:talawa/locator.dart'; import 'package:talawa/models/organization/org_info.dart'; import 'package:talawa/models/post/post_model.dart'; import 'package:talawa/models/user/user_info.dart'; @@ -15,12 +14,14 @@ import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organi import '../../helpers/test_helpers.dart'; import '../../helpers/test_helpers.mocks.dart'; +import '../../helpers/test_locator.dart'; class MockCallbackFunction extends Mock { void call(); } void main() { + testSetupLocator(); late OrganizationFeedViewModel model; final notifyListenerCallback = MockCallbackFunction(); @@ -47,21 +48,24 @@ void main() { test('Test setCurrentOrganizationName function', () { model.setCurrentOrganizationName('Updated Organization Name'); expect(model.posts.length, 0); + expect(model.userPosts.length, 0); expect(model.currentOrgName, 'Updated Organization Name'); }); test('Test fetchNewPosts function', () { model.fetchNewPosts(); - verify(locator().getPosts()); + verify(locator().refreshFeed()); }); test('Test buildNewPosts function', () { + when(userConfig.currentUser).thenReturn(User(id: 'a')); model.buildNewPosts([ - Post(sId: '1', creator: User()), - Post(sId: '2', creator: User()), + Post(sId: '1', creator: User(id: 'a')), + Post(sId: '2', creator: User(id: 'a')), ]); expect(model.posts.length, 2); + expect(model.userPosts.length, 2); verify(notifyListenerCallback()); }); diff --git a/test/views/after_auth_screens/add_post_page_test.dart b/test/views/after_auth_screens/add_post_page_test.dart index 73644edea8..249c696f3d 100644 --- a/test/views/after_auth_screens/add_post_page_test.dart +++ b/test/views/after_auth_screens/add_post_page_test.dart @@ -6,10 +6,13 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:mockito/mockito.dart'; import 'package:talawa/locator.dart'; +import 'package:talawa/services/database_mutation_functions.dart'; import 'package:talawa/services/third_party_service/multi_media_pick_service.dart'; import 'package:talawa/utils/app_localization.dart'; +import 'package:talawa/utils/post_queries.dart'; import 'package:talawa/view_model/after_auth_view_models/add_post_view_models/add_post_view_model.dart'; import 'package:talawa/view_model/main_screen_view_model.dart'; import 'package:talawa/views/after_auth_screens/add_post_page.dart'; @@ -88,6 +91,30 @@ Widget createAddPostScreen({ ); } +final demoJson = { + 'createPost': { + '__typename': 'Post', + '_id': '1', + 'text': 'text #hastag', + 'createdAt': '2023-11-13T19:28:21.095Z', + 'imageUrl': 'https://imageurl', + 'videoUrl': 'https://videoUrl', + 'title': 'demo title', + 'commentCount': 0, + 'likeCount': 0, + 'creator': { + '__typename': 'User', + '_id': '1', + 'firstName': 'Ayush', + 'lastName': 'Raghuwanshi', + 'image': 'https://imageUrl', + }, + 'organization': {'__typename': 'Organization', '_id': '1'}, + 'likedBy': [], + 'comments': [], + }, +}; + void main() { // SizeConfig().test(); setupLocator(); @@ -122,6 +149,23 @@ void main() { group('checks if the upload post button is working properly', () { testWidgets('checks if the upload post button is pressable', (tester) async { + final dataBaseMutationFunctions = locator(); + when( + dataBaseMutationFunctions.gqlAuthMutation( + PostQueries().uploadPost(), + variables: { + "text": " #", + "organizationId": 'XYZ', + "title": '', + }, + ), + ).thenAnswer( + (realInvocation) async => QueryResult( + options: QueryOptions(document: gql(PostQueries().uploadPost())), + data: demoJson, + source: QueryResultSource.network, + ), + ); await tester.pumpWidget(createAddPostScreen()); await tester.pump(); diff --git a/test/views/after_auth_screens/profile/profile_page_test.dart b/test/views/after_auth_screens/profile/profile_page_test.dart index b3dd1928e7..7d272b85e5 100644 --- a/test/views/after_auth_screens/profile/profile_page_test.dart +++ b/test/views/after_auth_screens/profile/profile_page_test.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:contained_tab_bar_view/contained_tab_bar_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -47,7 +48,7 @@ Widget createProfilePage({required MainScreenViewModel mainScreenViewModel}) { void main() async { testSetupLocator(); locator().test(); - final Directory dir = Directory('test/fixtures/core'); + final Directory dir = Directory('test/fixtures/coree'); group('build', () { setUpAll(() async { registerServices(); @@ -58,15 +59,27 @@ void main() async { ..registerAdapter(OrgInfoAdapter()); await Hive.openBox('currentUser'); await Hive.openBox('currentOrg'); - final pbox = await Hive.openBox('pluginBox'); - print(pbox.get('plugins')); + await Hive.openBox('pluginBox'); }); - tearDownAll(() { - File('test/fixtures/core/currentorg.hive').delete(); - File('test/fixtures/core/currentorg.lock').delete(); - File('test/fixtures/core/currentuser.hive').delete(); - File('test/fixtures/core/currentuser.lock').delete(); + tearDownAll(() async { + await Hive.close(); + Future safeDelete(String filePath) async { + final file = File(filePath); + if (await file.exists()) { + try { + await file.delete(); + } catch (e) { + print('Error deleting $filePath: $e'); + } + } + } + + await safeDelete('test/fixtures/coree/currentorg.hive'); + await safeDelete('test/fixtures/coree/currentorg.lock'); + await safeDelete('test/fixtures/coree/currentuser.hive'); + await safeDelete('test/fixtures/coree/currentuser.lock'); + await safeDelete('test/fixtures/coree/pluginbox.hive'); }); testWidgets('check if profilePage shows up and refreshIndicator work', (tester) async { @@ -81,7 +94,7 @@ void main() async { find.byKey(const Key('profilepic')), const Offset(0, 300), ); - await tester.pumpAndSettle(); + await tester.pump(); }); testWidgets('check if invitebutton work', (tester) async { await tester.pumpWidget( @@ -89,9 +102,9 @@ void main() async { mainScreenViewModel: locator(), ), ); - await tester.pumpAndSettle(); + await tester.pump(); await tester.tap(find.byKey(const Key('inviteicon'))); - await tester.pumpAndSettle(); + await tester.pump(); }); testWidgets('check if Donate button work', (tester) async { await tester.pumpWidget( @@ -99,43 +112,44 @@ void main() async { mainScreenViewModel: locator(), ), ); - await tester.pumpAndSettle(); + await tester.pump(); await tester.tap(find.text('Donate to the Community')); - await tester.pumpAndSettle(); + await tester.pump(); }); - testWidgets('check if naviagte to task screen work', (tester) async { + + testWidgets('check if settings page is opening up', (tester) async { await tester.pumpWidget( createProfilePage( mainScreenViewModel: locator(), ), ); - await tester.pumpAndSettle(); - await tester.tap(find.text('Tasks')); - await tester.pumpAndSettle(); - await tester.tap(find.byKey(const Key('tastscrn'))); - await tester.pumpAndSettle(); + await tester.pump(); + final settingsIcon = find.byKey(const Key('settingIcon')); + await tester.tap(settingsIcon); + verify(navigationService.navigatorKey); }); - testWidgets('check if Invite customListTile work', (tester) async { + testWidgets('check if User Feed is present', (tester) async { await tester.pumpWidget( createProfilePage( mainScreenViewModel: locator(), ), ); - await tester.pumpAndSettle(); - await tester.ensureVisible(find.text('Invite')); - await tester.tap(find.text('Invite')); - await tester.pumpAndSettle(); + await tester.pump(); + + expect(find.byType(ContainedTabBarView), findsOneWidget); + expect(find.byKey(const Key("UserFeed")), findsOneWidget); }); - testWidgets('check if settings page is opening up', (tester) async { + testWidgets('check if User Event is present', (tester) async { await tester.pumpWidget( createProfilePage( mainScreenViewModel: locator(), ), ); - await tester.pumpAndSettle(); - final settingsIcon = find.byKey(const Key('settingIcon')); - await tester.tap(settingsIcon); - verify(navigationService.navigatorKey); + await tester.pump(); + + expect(find.byType(ContainedTabBarView), findsOneWidget); + await tester.tap(find.text('Events')); + await tester.pump(); }); }); } diff --git a/test/views/after_auth_screens/profile/user_event_test.dart b/test/views/after_auth_screens/profile/user_event_test.dart new file mode 100644 index 0000000000..b702046a88 --- /dev/null +++ b/test/views/after_auth_screens/profile/user_event_test.dart @@ -0,0 +1,181 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:talawa/models/events/event_model.dart'; +import 'package:talawa/models/organization/org_info.dart'; +import 'package:talawa/models/user/user_info.dart'; +import 'package:talawa/router.dart'; +import 'package:talawa/services/navigation_service.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'; +import 'package:talawa/view_model/lang_view_model.dart'; +import 'package:talawa/view_model/main_screen_view_model.dart'; +import 'package:talawa/views/after_auth_screens/profile/user_event.dart'; +import 'package:talawa/views/base_view.dart'; +import 'package:talawa/widgets/event_card.dart'; + +import '../../../helpers/test_helpers.dart'; +import '../../../helpers/test_helpers.mocks.dart'; +import '../../../helpers/test_locator.dart'; + +Widget userEventsScreen({ + bool reverse = false, + String? dialogTitle, + bool passSecondaryFunc = true, + required bool isTest, +}) { + return BaseView( + onModelReady: (model) => model.initialize(), + builder: (context, langModel, child) { + // return BaseView( + // onModelReady: (model) { + // model.initialize(likedBy0, 'test_post_id'); + // }, + // builder: (context, model, child) { + return MaterialApp( + locale: const Locale('en'), + localizationsDelegates: [ + const AppLocalizationsDelegate(isTest: true), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + home: Scaffold( + key: MainScreenViewModel.scaffoldKey, + body: const UserEvents( + key: Key('test_key'), + ), + ), + navigatorKey: locator().navigatorKey, + onGenerateRoute: generateRoute, + ); + }, + ); + // }, + // ); +} + +void main() { + SizeConfig().test(); + testSetupLocator(); + late MockExploreEventsViewModel mockViewModel; + setUp(() { + registerServices(); + mockViewModel = MockExploreEventsViewModel(); + locator.unregister(); + locator.registerSingleton(mockViewModel); + }); + tearDown(() { + unregisterServices(); + }); + group('tests for UserEvents Screen', () { + testWidgets('check if UserEvents Screen shows up', (tester) async { + when(mockViewModel.isBusy).thenReturn(true); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.events).thenReturn([]); + + await tester.pumpWidget(userEventsScreen(isTest: true)); + await tester.pump(); + final finder = find.byKey(const Key('test_key')); + expect(finder, findsOneWidget); + }); + testWidgets('check if CircularIndicator Shows up', (tester) async { + when(mockViewModel.isBusy).thenReturn(true); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.events).thenReturn([]); + + await tester.pumpWidget(userEventsScreen(isTest: false)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsOneWidget); + }); + testWidgets('check if No Events text shows up', (tester) async { + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.events).thenReturn([]); + + await tester.pumpWidget(userEventsScreen(isTest: true)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + expect( + find.text('You have no event in this organization'), + findsOneWidget, + ); + }); + testWidgets('check if text button shows up', (tester) async { + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.events).thenReturn([]); + + await tester.pumpWidget(userEventsScreen(isTest: true)); + await tester.pump(); + + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + expect( + find.text('Create your first event'), + findsOneWidget, + ); + await tester.tap(find.text('Create your first event')); + await tester.pumpAndSettle(); + }); + testWidgets('check if User Event screen shows up', (tester) async { + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.events).thenReturn([]); + + await tester.pumpWidget(userEventsScreen(isTest: true)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('test_key')), findsOneWidget); + }); + testWidgets('check if User Events shows up if not null', (tester) async { + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenAnswer((_) async {}); + when(mockViewModel.userEvents).thenReturn([ + Event( + id: 'a', + title: 'Sample Event', + description: 'This is a fake event description.', + attendees: 'John Doe, Jane Doe', + location: 'City Park', + latitude: 40.7128, + longitude: -74.0060, + recurring: false, + allDay: false, + startDate: '2022-01-01', + endDate: '2022-01-02', + startTime: '12:00 PM', + endTime: '3:00 PM', + recurrence: 'Weekly', + isPublic: true, + isRegistered: false, + isRegisterable: true, + creator: User(id: 'creator'), + organization: OrgInfo(), + admins: [ + User(id: 'admin'), + ], + registrants: [ + User(id: 'registrant'), + ], + ), + ]); + + await tester.pumpWidget(userEventsScreen(isTest: true)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + expect( + find.text('Create your first event'), + findsNothing, + ); + final finder1 = find.byType(SingleChildScrollView); + expect(finder1, findsOneWidget); + expect(find.byType(EventCard), findsOneWidget); + await tester.tap(find.byType(GestureDetector)); + await tester.pumpAndSettle(); + }); + }); +} diff --git a/test/views/after_auth_screens/profile/user_feed_test.dart b/test/views/after_auth_screens/profile/user_feed_test.dart new file mode 100644 index 0000000000..dc9ee4659a --- /dev/null +++ b/test/views/after_auth_screens/profile/user_feed_test.dart @@ -0,0 +1,198 @@ +// ignore_for_file: talawa_api_doc +// ignore_for_file: talawa_good_doc_comments + +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:talawa/models/post/post_model.dart'; +import 'package:talawa/router.dart'; +import 'package:talawa/services/navigation_service.dart'; +import 'package:talawa/services/size_config.dart'; +import 'package:talawa/utils/app_localization.dart'; +import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart'; +import 'package:talawa/view_model/lang_view_model.dart'; +import 'package:talawa/view_model/main_screen_view_model.dart'; +import 'package:talawa/views/after_auth_screens/profile/user_feed.dart'; +import 'package:talawa/views/base_view.dart'; +import 'package:talawa/widgets/post_list_widget.dart'; +import 'package:talawa/widgets/post_widget.dart'; + +import '../../../helpers/test_helpers.dart'; +import '../../../helpers/test_helpers.mocks.dart'; +import '../../../helpers/test_locator.dart'; + +Widget userFeedScreen({ + bool reverse = false, + String? dialogTitle, + bool passSecondaryFunc = true, + required bool isTest, +}) { + return MaterialApp( + navigatorObservers: [], + locale: const Locale('en'), + supportedLocales: [ + const Locale('en', 'US'), + const Locale('es', 'ES'), + const Locale('fr', 'FR'), + const Locale('hi', 'IN'), + const Locale('zh', 'CN'), + const Locale('de', 'DE'), + const Locale('ja', 'JP'), + const Locale('pt', 'PT'), + ], + localizationsDelegates: [ + const AppLocalizationsDelegate(isTest: true), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + home: Scaffold( + key: MainScreenViewModel.scaffoldKey, + body: UserFeed( + forTest: isTest, + key: const Key('test_key'), + ), + ), + ); +} + +Widget userFeedScreen1({ + bool reverse = false, + String? dialogTitle, + bool passSecondaryFunc = true, + required bool isTest, +}) { + return BaseView( + onModelReady: (model) => model.initialize(), + builder: (context, langModel, child) { + // return BaseView( + // onModelReady: (model) { + // model.initialize(likedBy0, 'test_post_id'); + // }, + // builder: (context, model, child) { + return MaterialApp( + locale: const Locale('en'), + localizationsDelegates: [ + const AppLocalizationsDelegate(isTest: true), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + home: Scaffold( + key: MainScreenViewModel.scaffoldKey, + body: UserFeed( + forTest: isTest, + key: const Key('test_key'), + ), + ), + navigatorKey: locator().navigatorKey, + onGenerateRoute: generateRoute, + ); + }, + ); + // }, + // ); +} + +final List likedBy0 = [ + LikedBy(sId: 'Test user 1'), + LikedBy(sId: 'Test user 2'), +]; + +final post = Post( + sId: "test_post_id", + creator: userConfig.currentUser, + likedBy: likedBy0, +); + +void main() { + SizeConfig().test(); + testSetupLocator(); + late MockOrganizationFeedViewModel mockViewModel; + + setUp(() { + registerServices(); + mockViewModel = MockOrganizationFeedViewModel(); + locator.unregister(); + locator.registerSingleton(mockViewModel); + }); + tearDown(() { + unregisterServices(); + }); + + TestWidgetsFlutterBinding.ensureInitialized(); + group('tests for User feed Screen', () { + testWidgets('check if UserFeedScreen shows up', (tester) async { + when(mockViewModel.isFetchingPosts).thenReturn(true); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); + await tester.pumpWidget(userFeedScreen(isTest: true)); + await tester.pump(); + final finder = find.byKey(const Key('test_key')); + expect(finder, findsOneWidget); + }); + + testWidgets('check if CircularIndicator Shows up', (tester) async { + when(mockViewModel.isFetchingPosts).thenReturn(true); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); + + await tester.pumpWidget(userFeedScreen(isTest: false)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsOneWidget); + }); + testWidgets('check if No posts text shows up', (tester) async { + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); + + await tester.pumpWidget(userFeedScreen(isTest: true)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + expect( + find.text('You have no post in this organization'), + findsOneWidget, + ); + }); + testWidgets('check if text button shows up', (tester) async { + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); + + await tester.pumpWidget(userFeedScreen(isTest: true)); + await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + expect( + find.text('Create your first post'), + findsOneWidget, + ); + await tester.tap(find.text('Create your first post')); + await tester.pumpAndSettle(); + }); + testWidgets('check if PostListWIdget shows up', (tester) async { + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.userPosts).thenReturn([ + Post( + sId: "test_post_id", + creator: userConfig.currentUser, + likedBy: likedBy0, + description: 'Testing', + comments: [Comments(sId: 'cmmnt1')], + createdAt: DateTime.now(), + organization: userConfig.currentOrg, + ), + ]); + when(mockViewModel.initialise()).thenReturn(null); + + await tester.pumpWidget(userFeedScreen1(isTest: true)); + await tester.pumpAndSettle(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsNothing); + final finder1 = find.byType(PostListWidget); + expect(finder1, findsOneWidget); + expect(find.byType(NewsPost), findsOneWidget); + }); + }); +} diff --git a/test/widget_tests/after_auth_screens/feed/organization_feed_test.dart b/test/widget_tests/after_auth_screens/feed/organization_feed_test.dart index bc08c8142b..ee00a4e210 100644 --- a/test/widget_tests/after_auth_screens/feed/organization_feed_test.dart +++ b/test/widget_tests/after_auth_screens/feed/organization_feed_test.dart @@ -5,17 +5,20 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; +import 'package:talawa/models/post/post_model.dart'; import 'package:talawa/router.dart'; import 'package:talawa/services/navigation_service.dart'; -import 'package:talawa/services/post_service.dart'; import 'package:talawa/services/size_config.dart'; import 'package:talawa/utils/app_localization.dart'; +import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart'; import 'package:talawa/view_model/lang_view_model.dart'; import 'package:talawa/view_model/main_screen_view_model.dart'; import 'package:talawa/views/after_auth_screens/feed/organization_feed.dart'; import 'package:talawa/views/base_view.dart'; +import 'package:talawa/widgets/post_list_widget.dart'; import '../../../helpers/test_helpers.dart'; +import '../../../helpers/test_helpers.mocks.dart'; import '../../../helpers/test_locator.dart'; Widget createOrganizationFeedScreen({ @@ -92,37 +95,50 @@ Widget createOrganizationFeedScreen2({ ); } +final post = Post( + sId: "test_post_id", + creator: userConfig.currentUser, + likedBy: [], + description: 'Testing', + comments: [Comments(sId: 'cmmnt1')], + createdAt: DateTime.now(), + organization: userConfig.currentOrg, +); + void main() { SizeConfig().test(); testSetupLocator(); - // locator.registerSingleton(LikeButtonViewModel()); + late MockOrganizationFeedViewModel mockViewModel; setUp(() { registerServices(); + mockViewModel = MockOrganizationFeedViewModel(); + locator.unregister(); + locator.registerSingleton(mockViewModel); + }); + tearDown(() { + unregisterServices(); }); TestWidgetsFlutterBinding.ensureInitialized(); group('tests for Organizaiton feed Screen', () { - testWidgets('check if createOrganizationFeedScreen shows up', - (tester) async { - final model = locator(); - await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); - await tester.pump(); - - final finder = find.byType(Scaffold); - - expect(finder, findsNWidgets(2)); - }); testWidgets('check if orgname is displayed shows up', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(true); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); final model = locator(); await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); await tester.pump(); - final finder = find.byType(Text); - expect(finder, findsNWidgets(9)); - // expect(text, findsOneWidget); + final finder = find.text('testOrg'); + expect(finder, findsOneWidget); }); testWidgets('check if side drawer shows up', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(true); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); final model = locator(); await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); await tester.pump(); @@ -132,54 +148,109 @@ void main() { await tester.tap(finder); await tester.pump(); }); - testWidgets('check if post shows up when model.posts.isNotEmpty is true', + testWidgets('check if Circular Indicator shows up when fetching posts', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(true); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.userPosts).thenReturn([]); final model = locator(); await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); await tester.pump(); - final finder = find.byIcon(Icons.menu); - - await tester.tap(finder); - await tester.pump(); + final finder = find.byType(CircularProgressIndicator); + expect(finder, findsOneWidget); }); - testWidgets('check if refresh indicator is launched on dragging', - (tester) async { + + testWidgets('check if refresh Indicator works fine', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.posts).thenReturn([post]); + when(mockViewModel.pinnedPosts).thenReturn([post]); final model = locator(); + await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); await tester.pump(); - final postservice = locator(); - bool refreshed = false; - when(postservice.getPosts()).thenAnswer((_) async { + bool refreshed = false; + when(mockViewModel.fetchNewPosts()).thenAnswer((_) async { refreshed = true; }); - await tester.drag( find.byType(RefreshIndicator), - const Offset(0, 200), + const Offset(0, 400), ); await tester.pumpAndSettle(); expect(refreshed, true); }); - testWidgets( - 'check if post shows up when model.posts.isNotEmpty is true and post', + + testWidgets('check if pinned posts shows up if not empty', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.posts).thenReturn([post]); + when(mockViewModel.pinnedPosts).thenReturn([post]); + + final model = locator(); + await tester.pumpWidget(createOrganizationFeedScreen2(homeModel: model)); + await tester.pumpAndSettle(); + + final finder = find.byKey(const Key('pinnedPosts')); + expect(finder, findsOneWidget); + }); + testWidgets('check if posts shows up if not empty', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.posts).thenReturn([post]); + when(mockViewModel.pinnedPosts).thenReturn([post]); + + final model = locator(); + await tester.pumpWidget(createOrganizationFeedScreen2(homeModel: model)); + await tester.pumpAndSettle(); + + final finder = find.byType(PostListWidget); + expect(finder, findsOneWidget); + }); + testWidgets('check if no posts shows up then No posts text is there', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.posts).thenReturn([]); + when(mockViewModel.pinnedPosts).thenReturn([post]); + final model = locator(); await tester.pumpWidget(createOrganizationFeedScreen2(homeModel: model)); - await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(); + + final finder = find.text('There are no posts in this organization'); + expect(finder, findsOneWidget); }); - testWidgets('check if floating action button is visible and functional', + testWidgets( + 'check if no posts shows up then create post textButton is present', (tester) async { + when(mockViewModel.currentOrgName).thenReturn('testOrg'); + when(mockViewModel.isFetchingPosts).thenReturn(false); + when(mockViewModel.isBusy).thenReturn(false); + when(mockViewModel.initialise()).thenReturn(null); + when(mockViewModel.posts).thenReturn([]); + when(mockViewModel.pinnedPosts).thenReturn([post]); + final model = locator(); - await tester.pumpWidget(createOrganizationFeedScreen(homeModel: model)); - await tester.pump(); - final fabFinder = find.byKey(const Key('floating_action_btn')); - expect(fabFinder, findsOneWidget); - await tester.tap(fabFinder); - await tester.pump(); - verify(navigationService.pushScreen('/addpostscreen')).called(1); + await tester.pumpWidget(createOrganizationFeedScreen2(homeModel: model)); + await tester.pumpAndSettle(); + + final finder = find.text('Create your first post'); + expect(finder, findsOneWidget); + await tester.tap(finder); + await tester.pumpAndSettle(); }); }); }