-
Notifications
You must be signed in to change notification settings - Fork 59
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
Display version number in settings #34
Conversation
micedreams
commented
Sep 29, 2023
•
edited
Loading
edited
![Screenshot 2023-09-29 at 18 58 45](https://private-user-images.githubusercontent.com/8918999/271603331-e630e2c4-d193-4eaf-b46a-05af392b68ec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5NzA4NzYsIm5iZiI6MTcyNDk3MDU3NiwicGF0aCI6Ii84OTE4OTk5LzI3MTYwMzMzMS1lNjMwZTJjNC1kMTkzLTRlYWYtYjQ2YS0wNWFmMzkyYjY4ZWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjlUMjIyOTM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Mzc4NzgwYWM3NGI3NDM0ZjAyYTk4YzViZjI0ZjRhOWNjMzg2YzE4OWFlMmE3OGU5MzA0M2NhYjllYjZjYTdlNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.yKFtL7V2qJINroOurTPkUmc_hbamgiiNbcorBs_3v-U)
![Screenshot 2023-09-29 at 18 59 00](https://private-user-images.githubusercontent.com/8918999/271603449-17f639f4-884d-4ae0-a6e4-04f49de1c51b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ5NzA4NzYsIm5iZiI6MTcyNDk3MDU3NiwicGF0aCI6Ii84OTE4OTk5LzI3MTYwMzQ0OS0xN2Y2MzlmNC04ODRkLTRhZTAtYTZlNC0wNGY0OWRlMWM1MWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjlUMjIyOTM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDFlZWM2MzgxYTMxZTcwNmM0MDk3MzYwYzZlZWNjNjdmNzllMmYyMjhjZTYyNTYyMmI4OWViZDZkNTY2MTJiZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.22akT3RY2uDOctAgr8fBNOcMSVVGlMosAz18Thsx5PE)
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.
Minor comment, rest all looks good!
final info = await PackageInfo.fromPlatform(); | ||
emit(info.version); | ||
} | ||
} |
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.
Creating a new cubit is not necessary as we don't have any dynamic properties in the state. Also, we can't update the version number dynamically in Flutter. So It's fine to call PackageInfo.fromPlatform();
directly in the VersionNumber
widget.
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.
@SankethBK I did not see Future Builder being used anywhere... that's why I created a cubit. Can I use a Future builder? or should I use something else?!!
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.
Hey again... I went ahead and used Future builder.
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.
Hey FutureBuilder
is fine
Thank you again for contribution |