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

Feat/add lottie animation #428

Merged
merged 7 commits into from
Nov 29, 2024
Merged

Feat/add lottie animation #428

merged 7 commits into from
Nov 29, 2024

Conversation

mmzek
Copy link
Member

@mmzek mmzek commented Nov 24, 2024

lottie-animation lottie-animation1

When error occurres or SKS's closed, the lottie animation "closed" is showing on SKS Menu.
In my opinion, the offline menu functionality is out of scope for this task and should be addressed as a separate task.

@mikolaj-jalocha
Copy link
Member

mikolaj-jalocha commented Nov 24, 2024

It appears that again some weird linter error occurred. Imo this happens only if build_runner has not been sent before push.
Linter complaints should disapear once merged into main.

And sure, I agree, task with offline menu should be created separately (since directed for beginners). I will create one and assign it for you, as a task for next week ;)

Copy link
Member

@tomasz-trela tomasz-trela left a comment

Choose a reason for hiding this comment

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

I don't think it's good to make these changes (gradle properties and java version)

android/app/build.gradle Outdated Show resolved Hide resolved
android/gradle.properties Outdated Show resolved Hide resolved
@tomasz-trela
Copy link
Member

That wasn't the whole review and I'm not an expert in android build tools, but I'm pretty sure that it's not proper to do this changes

@tomasz-trela
Copy link
Member

I think @mikolaj-jalocha can say more it that matter

Copy link
Member

@mikolaj-jalocha mikolaj-jalocha left a comment

Choose a reason for hiding this comment

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

First of all, congrats of your first commit here and working code! Animation looks great😎

I left few suggestions of mine regarding UI. I think button could be removed (as of now) and some text regarding error could be displayed as well.

I also left notes regarding better use of lottie and some regarding changes of files that should only be made locally.

assets/animations/closed.json Outdated Show resolved Hide resolved
pubspec.yaml Outdated Show resolved Hide resolved
Copy link
Member

@tomasz-trela tomasz-trela left a comment

Choose a reason for hiding this comment

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

We don't really want to have magic nubers in code.

Copy link
Member

@simon-the-shark simon-the-shark left a comment

Choose a reason for hiding this comment

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

So good job and congrats for the first completed task.

I've left one note about the sized box, but everything else was pretty much covered by Tomek and Mikołaj, so good job guys too.

As for java build settings, let's not change anything globally for now. I've actually seen that Andrea has made some fancy tool related on the topic, so someone can investigate on that: https://gist.github.com/bizz84/605e2ca2088cb4acb7a076ca993f41cd?trk=public_post_comment-text But let's rollback for now

@mikolaj-jalocha mikolaj-jalocha self-requested a review November 29, 2024 11:49
@mmzek
Copy link
Member Author

mmzek commented Nov 29, 2024

Sorry for pushing java path etc., @mikolaj-jalocha was right (some demands of Android Studio), will not happen again.
I applied changes you mentioned in review and added text describing whats wrong on the screen. Still have some problems with linter even tho flutter analyze shows no issues found.

Copy link
Member

@mikolaj-jalocha mikolaj-jalocha left a comment

Choose a reason for hiding this comment

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

Good job! Code looks cleaner now. I tested it and animations works good on my device.
I left few notes (one is crucial, pls see what happens if menu is offline)

Copy link
Member

Choose a reason for hiding this comment

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

Name of the file could be different since this animation's not responsible for loading. In fact we could use that class inside top level sks_menu_screen as a private class.

),
),
Align(
child: Text(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it'd be good to add detailed error message (error message that comes from api). Maybe in small print and in different color.

});

@override
Widget build(BuildContext context) {
Copy link
Member

Choose a reason for hiding this comment

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

It'd be great to add logger somewhere here:

Logger().e(error.toString());

Copy link
Member

@mikolaj-jalocha mikolaj-jalocha left a comment

Choose a reason for hiding this comment

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

and one more

@@ -63,11 +56,7 @@ class _SksMenuView extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (sksMenuData.meals.isEmpty) {
Copy link
Member

Choose a reason for hiding this comment

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

Here we should check if menu's online or not and then show animation (list of meals now is only empty in case of error, if sks's closed cached data are provided, so this condition'll never work)

Copy link
Member

@mikolaj-jalocha mikolaj-jalocha left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Copy link
Member

@simon-the-shark simon-the-shark 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 to me. I would maybe think of changing the animation color, but that's secondary consern. Merging it now. Good job!

@simon-the-shark simon-the-shark merged commit e353472 into main Nov 29, 2024
2 checks passed
@simon-the-shark simon-the-shark deleted the feat/add-lottie-animation branch November 29, 2024 17:22
BombardierBulge pushed a commit that referenced this pull request Dec 8, 2024
* feat: add lottie animation for sks menu

* feat: adding statefull widget for showing the menu from the latest update

* feat: changing to  CircularProgressIndicator() for loading of sks menu and adding sks_old_menu text

* feat: add sks menu loading

* feat: sks menu not available message

* chore: fix linter complaints

* feat: show error on screen

---------

Co-authored-by: mikolaj-jalocha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat/ add Lottie animation when error occurred or SKS's closed on SKS Menu
4 participants