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

Add "Offline-first" architecture cookbook recipe #11425

Merged
merged 10 commits into from
Nov 22, 2024
Merged

Conversation

miquelbeltran
Copy link
Member

Description of what this PR is changing or adding, and why:

Following PRs #11410 and #11394 this PR adds the "Offline-first" cookbook recipe for the Architecture design patterns.

Issues fixed by this PR (if any):

Part of #11374

PRs or commits this PR depends on (if any):

Presubmit checklist

  • This PR is marked as draft with an explanation if not meant to land until a future stable release.
  • This PR doesn’t contain automatically generated corrections (Grammarly or similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Nov 21, 2024

Visit the preview URL for this PR (updated for commit e553a10):

https://flutter-docs-prod--pr11425-mb-offline-first-sypft802.web.app

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

Some rephrasing.

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the following documentation for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @sfshaza2 this is a generated file by the freezed package, I'd not change it.

src/content/cookbook/architecture/offline-first.md Outdated Show resolved Hide resolved
src/content/cookbook/architecture/offline-first.md Outdated Show resolved Hide resolved
src/content/cookbook/architecture/offline-first.md Outdated Show resolved Hide resolved
src/content/cookbook/architecture/offline-first.md Outdated Show resolved Hide resolved
Comment on lines 491 to 492
For example, using [Firebase messaging][],
you can push small payloads of data to the device,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, using [Firebase messaging][],
you can push small payloads of data to the device,
For example, you can use [Firebase messaging][],
to push small payloads of data to the device,

Comment on lines 493 to 494
and as well,
you can trigger synchronization tasks remotely using background messages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
and as well,
you can trigger synchronization tasks remotely using background messages.
as well as trigger synchronization tasks remotely using background messages.

you can trigger synchronization tasks remotely using background messages.

Instead of having a synchronization task running in the background,
the server will notify the application
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the server will notify the application
the server notifies the application


Instead of having a synchronization task running in the background,
the server will notify the application
when the stored data needs to be updated via a push notification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
when the stored data needs to be updated via a push notification.
when the stored data needs to be updated with a push notification.

## Putting it all together

Writing an offline-first application
requires making different decisions regarding
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
requires making different decisions regarding
requires making decisions regarding

OR change "different" to "several".

Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

lgtm!

@sfshaza2 sfshaza2 merged commit d2583ca into main Nov 22, 2024
9 checks passed
@sfshaza2 sfshaza2 deleted the mb-offline-first branch November 22, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants