-
Notifications
You must be signed in to change notification settings - Fork 2
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
Digital Guide structure tab #538
base: main
Are you sure you want to change the base?
Conversation
d9b3d4c
to
be1d720
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me !! A lot of work with defining models here. There are a few suggestion from me. Comments refer to every place in code where you can apply it (not only marked places) .
lib/features/digital_guide_view/presentation/digital_guide_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge part of code here, but mostly coded well. I like the job you've done with creating models for everything that was needed. It will reduce scope and complexity for other tasks. Everything in terms of them looks good to me.
I left my suggestions, questions and opinions in the comments, let me know wdyt. (domain layer, typedef )
No.1 priority here is to divide large files/widgets into smaller parts in a way that they can be reused, 318 lines of code don't look nice xd
lib/features/digital_guide_view/tabs/structure/data/models/corridor.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/data/models/corridor.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/data/models/corridor.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/data/models/region_data.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/corridor_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/level_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/structure/presentation/views/region_view.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, so I'm not making a full review at the moment, but what Tomek and Mikołaj noted is very valid.
definietetly this region data should be in some domain/business layer. Would consider using typedef and record instead of freezed. Those repositories need to go to proper files in the tabs
folder, where they will be reused. And some other repetition as Tomek noted needs a refactor.
my only note here from me is a thing to test/consider if loading everything together will be acceptable in terms of loading time, cause it needs to hit 20 endpoints or so
For you to know in the future, if a PR is that big, it means the scope is bloated. PR is considered HEAVY when it has 600 diff lines, so when you get close to such sizes, it means the task should have been divided.
But good job :) It's nice to see you doing hard and nice work
} | ||
|
||
bool stringToBool(String text) { | ||
return text.toLowerCase() == "true"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we have stringToBool
somewhere else already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do in some other models I guess but where should we define it then? It cannot be an extension.
part "region_data_repository.g.dart"; | ||
|
||
@riverpod | ||
Future<RegionData> regionDataRepository(Ref ref, Region region) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is a question whether we want to load everything at once. If yes then this is cool, but defienietly as Mikołaj noted, this should be some type of domain/business layer, not data layer. And would consider using typedef
ed Records
instead of full freezed model.
but loading everything at once can be heavy to do, cause we have to wait for like 20 endpoints or so. So we gotta test if this is acceptable loading time
What's been done
Screens
Implemented pages
level_view -> region_view -> corridor_view
Pages to be implemented (probably new tasks)
Android Emulator / IOS Simulator vs physical device
Do you happen to know why in IOS Simulator and Android Emulator the spacing in some places is so extended? On physical device it works properly.