Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Skimmer effect while fetching featured circuits #57

Closed
wants to merge 11 commits into from

Conversation

PseudoCode01
Copy link
Contributor

Screenshot :

@coveralls
Copy link

coveralls commented Jan 19, 2021

Pull Request Test Coverage Report for Build 522663498

  • 63 of 140 (45.0%) changed or added relevant lines in 5 files are covered.
  • 182 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+6.6%) to 74.368%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/ui/views/profile/user_favourites_view.dart 0 9 0.0%
lib/ui/views/profile/user_projects_view.dart 1 10 10.0%
lib/ui/views/groups/my_groups_view.dart 0 17 0.0%
lib/ui/components/cv_shimmer.dart 52 94 55.32%
Files with Coverage Reduction New Missed Lines %
lib/ui/views/groups/update_assignment_view.dart 20 62.73%
lib/ui/views/groups/add_assignment_view.dart 24 63.03%
lib/ui/views/groups/assignment_details_view.dart 31 71.3%
lib/ui/views/projects/project_details_view.dart 107 37.54%
Totals Coverage Status
Change from base Build 490194266: 6.6%
Covered Lines: 5968
Relevant Lines: 8025

💛 - Coveralls

enum ShimmerDirection { ltr, rtl, ttb, btt }

@immutable
class Shimmer extends StatefulWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class name and file name should follow the same name.

@@ -0,0 +1,227 @@
import 'package:flutter/material.dart';
Copy link
Member

@manjotsidhu manjotsidhu Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo "Skimmer" -> "Shimmer" wherever used

@PseudoCode01
Copy link
Contributor Author

Fixed typos please have a look

@@ -41,6 +43,40 @@ class _FeaturedProjectsViewState extends State<FeaturedProjectsView> {
),
);
});
} else if (model.isBusy(model.FETCH_FEATURED_PROJECTS)) {
_items.add(Padding(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reduce code by making a single widget and adding it to the list 3 times.

Copy link
Member

@manjotsidhu manjotsidhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can we get this shimmer loading in other views as well where projects are fetched ?

@PseudoCode01
Copy link
Contributor Author

okk i will do that

@PseudoCode01
Copy link
Contributor Author

ui test are failing in user_projects_view.dart
what's the issue

logs

00:50 +226 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/profile_view_test.dart: ProfileViewTest - finds Generic MyGroupsView widgets [E]
Test failed. See exception logs above.
The test description was: finds Generic MyGroupsView widgets

00:51 +226 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/signup_view_test.dart: SignupViewTest - When name/email/password is not valid or empty, proper error message should be shown
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:51 +227 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/forgot_password_view_test.dart: ForgotPasswordViewTest - New User? Sign Up onTap takes to SignupView
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:51 +228 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/forgot_password_view_test.dart: ForgotPasswordViewTest - When email is not valid or empty, proper error message should be shown
[GOING TO ROUTE] /
00:52 +228 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/login_view_test.dart: LoginViewTest - New User? Sign Up onTap takes to SignupView
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:52 +229 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/login_view_test.dart: LoginViewTest - When email/password is not valid or empty, proper error message should be shown
[GOING TO ROUTE] /
00:52 +229 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/edit_profile_view_test.dart: EditProfileViewTest - finds Generic MyGroupsView widgets
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:52 +230 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/edit_profile_view_test.dart: EditProfileViewTest - on Save Details is Tapped
[GOING TO ROUTE] /
00:52 +230 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/forgot_password_view_test.dart: ForgotPasswordViewTest - When email is not valid or empty, proper error message should be shown
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:54 +231 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/user_projects_view_test.dart: UserProjectsViewTest - finds Generic MyGroupsView widgets
[GET] GetMaterialController has been initialized
00:54 +231 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/edit_profile_view_test.dart: EditProfileViewTest - on Save Details is Tapped
[BACK ROUTE] /
[OPEN SNACKBAR] snackbar
[CLOSE SNACKBAR] snackbar
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:54 +232 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/authentication/login_view_test.dart: LoginViewTest - When email/password is not valid or empty, proper error message should be shown
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:54 +233 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/user_projects_view_test.dart: UserProjectsViewTest - finds Generic MyGroupsView widgets
[GOING TO ROUTE] /
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:56 +234 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/user_projects_view_test.dart: UserProjectsViewTest - Project Page is Pushed onTap View button
[GOING TO ROUTE] /
[GOING TO ROUTE] null
LocalStorageService:_getFromDisk. key: logged_in_user value: null
LocalStorageService:_getFromDisk. key: is_logged_in value: null
LocalStorageService:_getFromDisk. key: is_logged_in value: null
LocalStorageService:_getFromDisk. key: logged_in_user value: null
LocalStorageService:_getFromDisk. key: logged_in_user value: null
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
00:59 +235 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - finds Generic MyGroupsView widgets
[GET] GetMaterialController has been initialized
[GOING TO ROUTE] /
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:00 +236 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - New Group Page is Pushed onTap
[GOING TO ROUTE] /
01:00 +236 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/teachers/teachers_view_test.dart: TeachersViewTest - finds TeachersView Widgets
[GET] GetMaterialController has been initialized
01:01 +236 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - New Group Page is Pushed onTap
[GOING TO ROUTE] null
01:01 +236 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/teachers/teachers_view_test.dart: TeachersViewTest - finds TeachersView Widgets
[GOING TO ROUTE] /
01:02 +236 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - New Group Page is Pushed onTap
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:02 +237 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - View Group Details Page is Pushed onTap
[GOING TO ROUTE] /
01:02 +237 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
[GET] GetMaterialController has been initialized
01:03 +237 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - View Group Details Page is Pushed onTap
[GOING TO ROUTE] null
01:03 +237 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/teachers/teachers_view_test.dart: TeachersViewTest - finds TeachersView Widgets
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:03 +238 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
[GOING TO ROUTE] /
01:03 +238 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - View Group Details Page is Pushed onTap
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:03 +239 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - Edit Group View is Pushed onTap
[GOING TO ROUTE] /
01:03 +239 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - Edit Group View is Pushed onTap
[GOING TO ROUTE] null
01:04 +239 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - Edit Group View is Pushed onTap
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:04 +240 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
[GOING TO ROUTE] null
[REMOVING ROUTE] /
01:04 +240 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - Delete Group Dialog is visible onTap
[GOING TO ROUTE] /
01:04 +240 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
LocalStorageService:_getFromDisk. key: is_logged_in value: null
01:04 +240 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/home/home_view_test.dart: HomeViewTest - finds HomeView Widgets
[GET] GetMaterialController has been initialized
01:04 +240 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/groups/my_groups_view_test.dart: MyGroupsViewTest - Delete Group Dialog is visible onTap
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:05 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
LocalStorageService:_getFromDisk. key: token value: null
01:05 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/home/home_view_test.dart: HomeViewTest - finds HomeView Widgets
[GOING TO ROUTE] /
01:05 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_privacy_policy_view_test.dart: AboutPrivacyPolicyTest - finds RichText and Text Widgets on AboutTosView
[GET] GetMaterialController has been initialized
[GOING TO ROUTE] /
01:06 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/home/home_view_test.dart: HomeViewTest - finds HomeView Widgets
LocalStorageService:_getFromDisk. key: token value: null
01:07 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_tos_view_test.dart: AboutTosViewTest - finds RichText and Text Widgets on AboutTosView
[GET] GetMaterialController has been initialized
[GOING TO ROUTE] /
01:08 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - finds Generic AboutView widgets
[GET] GetMaterialController has been initialized
01:08 +241 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - finds CircuitVerse logo on StartUpView
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:08 +242 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - HomeView is pushed over StartUpView after 1 second
[GOING TO ROUTE] /
01:08 +242 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_privacy_policy_view_test.dart: AboutPrivacyPolicyTest - finds RichText and Text Widgets on AboutTosView
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:08 +242 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - HomeView is pushed over StartUpView after 1 second
[GOING TO ROUTE] null
[REMOVING ROUTE] /
LocalStorageService:_getFromDisk. key: is_logged_in value: null
01:08 +243 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - HomeView is pushed over StartUpView after 1 second
LocalStorageService:_getFromDisk. key: token value: null
01:09 +243 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - finds Generic AboutView widgets
[GOING TO ROUTE] /
01:09 +243 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/home/home_view_test.dart: HomeViewTest - finds HomeView Widgets
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:10 +244 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/startup/startup_view_test.dart: StartupViewTest - HomeView is pushed over StartUpView after 1 second
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:11 +245 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - finds Generic AboutView widgets
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:11 +246 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - AboutView widgets for different API states - when error response, finds GENERIC_FAILURE
[GOING TO ROUTE] /
01:11 +246 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_tos_view_test.dart: AboutTosViewTest - finds RichText and Text Widgets on AboutTosView
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:11 +247 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - AboutView widgets for different API states - when error response, finds GENERIC_FAILURE
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:11 +248 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - AboutView widgets for different API states - when success response, finds contributor avatars
[GOING TO ROUTE] /
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:12 +249 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - Terms of Service Page is Pushed onTap
[GOING TO ROUTE] /
[GOING TO ROUTE] null
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:14 +250 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/about/about_view_test.dart: AboutViewTest - Policy Page is Pushed onTap
[GOING TO ROUTE] /
[GOING TO ROUTE] null
[GET] onClose of GetMaterialController called
[GET] GetMaterialController deleted from memory
01:15 +251 -1: Some tests failed.

@manjotsidhu
Copy link
Member

In the logs I can see only ProfileViewTest failing and without exception logs. Can you send the full logs ? and also push the changes which are causing this, so that I can check.

00:50 +226 -1: /home/saurabh/Desktop/circutverseapp/mobile-app/test/ui_tests/profile/profile_view_test.dart: ProfileViewTest - finds Generic MyGroupsView widgets [E]
Test failed. See exception logs above.

@Nitish145
Copy link
Member

What exactly is the utility of using the exact same code from https://pub.dev/packages/shimmer rather than to just increase the number lines? @iCoder-007

Also, it's better to discuss this in #ux channel because if this gets approved, it should be used in place of all the loading indicators.

@manjotsidhu
Copy link
Member

What exactly is the utility of using the exact same code from https://pub.dev/packages/shimmer rather than to just increase the number lines? @iCoder-007

Also, it's better to discuss this in #ux channel because if this gets approved, it should be used in place of all the loading indicators.

@iCoder-007

@PseudoCode01
Copy link
Contributor Author

Where is ux channel

@manjotsidhu
Copy link
Member

Where is ux channel

Check Slack Channel

@Nitish145 Nitish145 linked an issue Feb 7, 2021 that may be closed by this pull request
@manjotsidhu
Copy link
Member

What exactly is the utility of using the exact same code from https://pub.dev/packages/shimmer rather than to just increase the number lines? @iCoder-007

Also, it's better to discuss this in #ux channel because if this gets approved, it should be used in place of all the loading indicators.

@iCoder-007 can you use shimmer package instead of using it locally ? Rest of the things looks good to me.

@tachyons
Copy link
Member

tachyons commented May 6, 2021

Also you can't simply copy paste code from another open source library as it will be a copyright violation. For instance shimmer library is licensed under BSD, so copying code to our code base requires copyright notice from the original code

@PseudoCode01
Copy link
Contributor Author

okk i will replace it shimmer package

@manjotsidhu
Copy link
Member

Since the PR is now stale and due to new changes, I am closing this PR. Feel free to open another one anytime :)
Thanks for Contributing 👍

@manjotsidhu manjotsidhu closed this Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Showing Shimmer effect while fetching the circuit.
5 participants