Skip to content

Commit

Permalink
fix(assets): fix asset path
Browse files Browse the repository at this point in the history
  • Loading branch information
kirasok committed Apr 6, 2024
1 parent aaf3602 commit cabdd33
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/data/repository/disciplines_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class DisciplinesRepository {
if ((await SharedPreferences.getInstance())
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle.loadString('templates/basic/disciplines.json');
json = await rootBundle
.loadString('assets/templates/basic/disciplines.json');
} else {
json = await ApiService().fetchDisciplines();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/data/repository/events_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EventsRepository {
.getBool(Constants.demoModeKey) ??
false) {
response = await rootBundle
.loadString('templates/advanced/events/$disciplineId.json');
.loadString('assets/templates/advanced/events/$disciplineId.json');
} else {
response = await ApiService().fetchEvents(disciplineId);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/data/repository/groups_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class GroupsRepository {
if ((await SharedPreferences.getInstance())
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle.loadString('templates/basic/groups.json');
json = await rootBundle.loadString('assets/templates/basic/groups.json');
} else {
json = await ApiService().fetchGroups();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/data/repository/schedule_of_group_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ScheduleOfGroupRepository {
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle
.loadString('templates/advanced/scheduleOfGroup.json');
.loadString('assets/templates/advanced/scheduleOfGroup.json');
} else {
json = await ApiService().fetchScheduleOfGroup(groupId);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/data/repository/schedule_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class ScheduleRepository {
if ((await SharedPreferences.getInstance())
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle.loadString('templates/basic/schedule.json');
json =
await rootBundle.loadString('assets/templates/basic/schedule.json');
} else {
json = await ApiService().fetchSchedule();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/data/repository/student_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StudentRepository {
if ((await SharedPreferences.getInstance())
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle.loadString('templates/basic/student.json');
json = await rootBundle.loadString('assets/templates/basic/student.json');
} else {
json = await ApiService().fetchStudent();
}
Expand Down
3 changes: 2 additions & 1 deletion lib/data/repository/timetable_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class TimetableRepository {
if ((await SharedPreferences.getInstance())
.getBool(Constants.demoModeKey) ??
false) {
json = await rootBundle.loadString('templates/basic/timetable.json');
json =
await rootBundle.loadString('assets/templates/basic/timetable.json');
} else {
json = await ApiService().fetchTimetable();
}
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ flutter:
- README.md
- CHANGELOG.md
- assets/
- assets/icon/
- assets/templates/
- assets/templates/basic/
- assets/templates/advanced/
- assets/templates/advanced/events/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

Expand Down

0 comments on commit cabdd33

Please sign in to comment.