Skip to content

Commit

Permalink
Revert "fix: failed to load widget/error widget (#134)"
Browse files Browse the repository at this point in the history
This reverts commit d3fd49c.
  • Loading branch information
manjotsidhu committed Oct 1, 2021
1 parent d38804e commit 2e5452e
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 82 deletions.
12 changes: 0 additions & 12 deletions lib/ui/components/cv_exception.dart

This file was deleted.

9 changes: 0 additions & 9 deletions lib/ui/views/groups/assignment_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:mobile_app/ui/components/cv_primary_button.dart';
import 'package:mobile_app/ui/components/cv_text_field.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/groups/update_assignment_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/utils/snackbar_utils.dart';
import 'package:mobile_app/utils/validators.dart';
import 'package:mobile_app/viewmodels/groups/assignment_details_viewmodel.dart';
Expand Down Expand Up @@ -464,14 +463,6 @@ class _AssignmentDetailsViewState extends State<AssignmentDetailsView> {
_buildGrades(),
],
),
if (_model.isError(_model.FETCH_ASSIGNMENT_DETAILS))
Column(
children: <Widget>[
CVException(
_model.errorMessageFor(_model.FETCH_ASSIGNMENT_DETAILS),
),
],
),
],
);
}),
Expand Down
8 changes: 0 additions & 8 deletions lib/ui/views/groups/group_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:mobile_app/ui/views/groups/components/assignment_card.dart';
import 'package:mobile_app/ui/views/groups/components/member_card.dart';
import 'package:mobile_app/ui/views/groups/edit_group_view.dart';
import 'package:mobile_app/ui/views/groups/update_assignment_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/utils/snackbar_utils.dart';
import 'package:mobile_app/utils/validators.dart';
import 'package:mobile_app/ui/components/cv_flat_button.dart';
Expand Down Expand Up @@ -408,13 +407,6 @@ class _GroupDetailsViewState extends State<GroupDetailsView> {
);
});
}
if (_model.isError(_model.FETCH_GROUP_DETAILS)) {
_items.add(
CVException(
_model.errorMessageFor(_model.FETCH_GROUP_DETAILS),
),
);
}

return ListView(
padding: const EdgeInsets.all(8),
Expand Down
15 changes: 0 additions & 15 deletions lib/ui/views/groups/my_groups_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:mobile_app/ui/views/groups/components/group_member_card.dart';
import 'package:mobile_app/ui/views/groups/components/group_mentor_card.dart';
import 'package:mobile_app/ui/views/groups/edit_group_view.dart';
import 'package:mobile_app/ui/views/groups/new_group_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/utils/snackbar_utils.dart';
import 'package:mobile_app/viewmodels/groups/my_groups_viewmodel.dart';

Expand Down Expand Up @@ -136,13 +135,6 @@ class _MyGroupsViewState extends State<MyGroupsView> {
);
}
}
if (_model.isError(_model.FETCH_MENTORED_GROUPS)) {
_items.add(
CVException(
_model.errorMessageFor(_model.FETCH_MENTORED_GROUPS),
),
);
}

_items.add(SizedBox(height: 24));

Expand All @@ -161,13 +153,6 @@ class _MyGroupsViewState extends State<MyGroupsView> {
);
}
}
if (_model.isError(_model.FETCH_MEMBER_GROUPS)) {
_items.add(
CVException(
_model.errorMessageFor(_model.FETCH_MEMBER_GROUPS),
),
);
}

return ListView(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/views/ib/ib_landing_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:mobile_app/models/ib/ib_chapter.dart';
import 'package:mobile_app/ui/components/cv_drawer_tile.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/ib/ib_page_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/viewmodels/ib/ib_landing_viewmodel.dart';
import 'package:theme_provider/theme_provider.dart';

Expand Down Expand Up @@ -162,8 +161,8 @@ class _IbLandingViewState extends State<IbLandingView> {
),
!_model.isSuccess(_model.IB_FETCH_CHAPTERS)
? InkWell(
child: CVException(
_model.errorMessageFor(_model.IB_FETCH_CHAPTERS),
child: CVDrawerTile(
title: 'Loading...',
),
)
: _buildChapters(_model.chapters),
Expand Down
8 changes: 0 additions & 8 deletions lib/ui/views/profile/user_favourites_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:mobile_app/ui/components/cv_add_icon_button.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/projects/components/project_card.dart';
import 'package:mobile_app/ui/views/projects/project_details_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/viewmodels/profile/user_favourites_viewmodel.dart';

class UserFavouritesView extends StatefulWidget {
Expand Down Expand Up @@ -47,13 +46,6 @@ class _UserFavouritesViewState extends State<UserFavouritesView>
);
});
}
if (model.isError(model.FETCH_USER_FAVOURITES)) {
_items.add(
CVException(
model.errorMessageFor(model.FETCH_USER_FAVOURITES),
),
);
}

if (model?.previousUserFavouritesBatch?.links?.next != null) {
_items.add(
Expand Down
9 changes: 0 additions & 9 deletions lib/ui/views/profile/user_projects_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:mobile_app/ui/components/cv_add_icon_button.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/projects/components/project_card.dart';
import 'package:mobile_app/ui/views/projects/project_details_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/viewmodels/profile/user_projects_viewmodel.dart';

class UserProjectsView extends StatefulWidget {
Expand Down Expand Up @@ -45,14 +44,6 @@ class _UserProjectsViewState extends State<UserProjectsView>
});
}

if (model.isError(model.FETCH_USER_PROJECTS)) {
_items.add(
CVException(
model.errorMessageFor(model.FETCH_USER_PROJECTS),
),
);
}

if (model?.previousUserProjectsBatch?.links?.next != null) {
_items.add(
CVAddIconButton(
Expand Down
8 changes: 0 additions & 8 deletions lib/ui/views/projects/featured_projects_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:mobile_app/ui/components/cv_primary_button.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/projects/components/featured_project_card.dart';
import 'package:mobile_app/ui/views/projects/project_details_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/viewmodels/projects/featured_projects_viewmodel.dart';

class FeaturedProjectsView extends StatefulWidget {
Expand Down Expand Up @@ -43,13 +42,6 @@ class _FeaturedProjectsViewState extends State<FeaturedProjectsView> {
);
});
}
if (model.isError(model.FETCH_FEATURED_PROJECTS)) {
_items.add(
CVException(
model.errorMessageFor(model.FETCH_FEATURED_PROJECTS),
),
);
}

if (!widget.embed &&
model?.previousFeaturedProjectsBatch?.links?.next != null) {
Expand Down
10 changes: 0 additions & 10 deletions lib/ui/views/projects/project_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:mobile_app/ui/components/cv_flat_button.dart';
import 'package:mobile_app/ui/views/base_view.dart';
import 'package:mobile_app/ui/views/profile/profile_view.dart';
import 'package:mobile_app/ui/views/projects/edit_project_view.dart';
import 'package:mobile_app/ui/components/cv_exception.dart';
import 'package:mobile_app/utils/snackbar_utils.dart';
import 'package:mobile_app/utils/validators.dart';
import 'package:mobile_app/viewmodels/projects/project_details_viewmodel.dart';
Expand Down Expand Up @@ -625,15 +624,6 @@ class _ProjectDetailsViewState extends State<ProjectDetailsView> {
);
});
}
if (_model.isError(_model.FETCH_PROJECT_DETAILS)) {
_items.add(Divider());

_items.add(
CVException(
_model.errorMessageFor(_model.FETCH_PROJECT_DETAILS),
),
);
}
return ListView(
shrinkWrap: true,
padding: const EdgeInsets.all(16),
Expand Down

0 comments on commit 2e5452e

Please sign in to comment.