Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JElgar committed Nov 11, 2024
1 parent 58a7714 commit 15aa1ea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class App extends StatelessWidget {
BlocProvider(
create: (_) => UserProgressBloc(
causesService: locator<CausesService>(),
)..fetchUserState(),
)..init(),
),
],
child: Builder(
Expand Down
2 changes: 1 addition & 1 deletion lib/models/action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ListAction implements Explorable {
required this.time,
required BuiltList<Api.Cause> causes,
required Api.ActionTypeEnum actionType,
}) : cause = Cause.fromApiModel(causes[0]),
}) : cause = Cause.fromApiModel(causes.first),
type = getActionTypeFromSubtype(actionType);

factory ListAction.fromApiModel(
Expand Down
2 changes: 1 addition & 1 deletion lib/models/campaign.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ListCampaign implements Explorable {
required this.title,
required this.headerImage,
required BuiltList<Api.Cause> causes,
}) : cause = Cause.fromApiModel(causes[0]);
}) : cause = Cause.fromApiModel(causes.first);

ListCampaign.fromApiModel(Api.ListCampaign apiModel)
: this.fromApiData(
Expand Down
2 changes: 1 addition & 1 deletion lib/models/learning.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class LearningResource extends Explorable {
) : id = apiModel.id,
title = apiModel.title,
link = Uri.parse(apiModel.link),
cause = Cause.fromApiModel(apiModel.causes[0]),
cause = Cause.fromApiModel(apiModel.causes.first),
type = getResourceTypeFromEnum(apiModel.learningResourceType),
time = apiModel.time,
createdAt = apiModel.createdAt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UserProgressBloc extends Cubit<UserProgressState> {
});
}

void fetchUserState() async {
void init() async {
try {
final userInfo = await _causesService.getUserInfo();
if (userInfo == null) {
Expand Down

0 comments on commit 15aa1ea

Please sign in to comment.