Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

refactor : migrate all remaining demos #618

Merged
merged 9 commits into from
Mar 29, 2022

Conversation

amanv8060
Copy link
Contributor

@amanv8060 amanv8060 commented Mar 14, 2022

Migrates cupertino and material demoes

part of #527

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@amanv8060 amanv8060 marked this pull request as draft March 14, 2022 07:35
@amanv8060 amanv8060 marked this pull request as ready for review March 26, 2022 20:26
@amanv8060
Copy link
Contributor Author

Hi @guidezpl , can you please review and run the code segments generator on your machine

@amanv8060
Copy link
Contributor Author

this pr can be a little better done, will do the changes today.

@amanv8060 amanv8060 requested a review from guidezpl March 27, 2022 19:16
@amanv8060 amanv8060 changed the title [WIP] Migrate all remaining demos Migrate all remaining demos Mar 27, 2022
@amanv8060 amanv8060 changed the title Migrate all remaining demos refactor : migrate all remaining demos Mar 27, 2022
@@ -67,13 +65,13 @@ class _DataTableDemoState extends State<DataTableDemo> with RestorationMixin {
RestorableInt(PaginatedDataTable.defaultRowsPerPage);
final RestorableBool _sortAscending = RestorableBool(true);
final RestorableIntN _sortColumnIndex = RestorableIntN(null);
_DessertDataSource _dessertsDataSource;
_DessertDataSource? _dessertsDataSource;
Copy link
Member

Choose a reason for hiding this comment

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

make non-nullable and late?

Copy link
Contributor Author

@amanv8060 amanv8060 Mar 28, 2022

Choose a reason for hiding this comment

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

so currently(before migration) we are only assigning with fresh values only if it's null, making late would make it reassign every time in didChangeDependencies and restoreState, so should I do it ?

Copy link
Member

Choose a reason for hiding this comment

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

Ah gotcha, then I would leave as is

@@ -83,51 +81,52 @@ class _DataTableDemoState extends State<DataTableDemo> with RestorationMixin {
_dessertsDataSource ??= _DessertDataSource(context);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_dessertsDataSource ??= _DessertDataSource(context);
_dessertsDataSource = _DessertDataSource(context);

Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

Great, LGTM! Factoring out GalleryLocalizations.of(context) in many places cleans things up nicely as well

@guidezpl guidezpl merged commit ebcedb7 into flutter:master Mar 29, 2022
@amanv8060 amanv8060 deleted the more_migrations branch March 29, 2022 08:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants