-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor : migrate all remaining demos #618
Conversation
43c4357
to
2f4d088
Compare
Hi @guidezpl , can you please review and run the code segments generator on your machine |
this pr can be a little better done, will do the changes today. |
@@ -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; |
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.
make non-nullable and late?
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 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 ?
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.
Ah gotcha, then I would leave as is
@@ -83,51 +81,52 @@ class _DataTableDemoState extends State<DataTableDemo> with RestorationMixin { | |||
_dessertsDataSource ??= _DessertDataSource(context); |
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.
_dessertsDataSource ??= _DessertDataSource(context); | |
_dessertsDataSource = _DessertDataSource(context); |
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.
Great, LGTM! Factoring out GalleryLocalizations.of(context)
in many places cleans things up nicely as well
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
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.