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

docs: add cache explanation to Flutter Firebase Login Tutorial #4339

Closed
wants to merge 3 commits into from

Conversation

AffanShaikhsurab
Copy link

docs: improve Flutter Firebase Login Tutorial with cache explanation (#3941)

Status

READY

Breaking Changes

NO

Description

  • Added detailed explanation of the purpose and benefits of caching in the login flow.
  • Described the caching implementation, including mechanisms, strategies, and error handling.
  • Provided an overview of third-party packages used (firebase_auth, firebase_core) with usage and installation instructions.
  • Enhanced project structure explanations, including folder purposes and key file roles.
  • Improved Firebase setup instructions with step-by-step guidance for project configuration, platform-specific setup, and troubleshooting tips.
  • Ensured tutorial content is beginner-friendly and aligned with BLoC principles.

Addresses #3941. Makes the tutorial more accessible for developers new to Flutter, Firebase, or BLoC.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

docs: improve Flutter Firebase Login Tutorial with cache explanation (felangel#3941)

- Added detailed explanation of the purpose and benefits of caching in the login flow.
- Described the caching implementation, including mechanisms, strategies, and error handling.
- Provided an overview of third-party packages used (firebase_auth, firebase_core) with usage and installation instructions.
- Enhanced project structure explanations, including folder purposes and key file roles.
- Improved Firebase setup instructions with step-by-step guidance for project configuration, platform-specific setup, and troubleshooting tips.
- Ensured tutorial content is beginner-friendly and aligned with BLoC principles.

Addresses felangel#3941. Makes the tutorial more accessible for developers new to Flutter, Firebase, or BLoC.
@felangel felangel linked an issue Jan 16, 2025 that may be closed by this pull request
@felangel felangel added example Example application documentation Documentation requested labels Jan 16, 2025
@AffanShaikhsurab AffanShaikhsurab changed the title docs : add tutorials/flutter-firebase-login.mdx docs: add cache explanation to Flutter Firebase Login Tutorial Jan 16, 2025
style: format Flutter Firebase Login tutorial with Prettier

- Resolved code style issues in `src/content/docs/tutorials/flutter-firebase-login.mdx` using Prettier.
- Ensured consistent formatting and adherence to the project's coding standards.
@AffanShaikhsurab
Copy link
Author

@felangel the documentation doesnt specifies using the" prettier --write" but it is required at Semantic check in the build process , can we have that mentioned in the contributions doc itself it would be a good addon to the beginners i feel.

@AffanShaikhsurab
Copy link
Author

@felangel can you just check the pr once you get free ! thanks !

Comment on lines +113 to +141
## Caching Implementation

### Purpose of Caching

The caching mechanism in this login flow provides several key benefits:

- **Improved User Experience**: By caching the user's authentication state, we eliminate unnecessary sign-in prompts and provide seamless transitions between app sessions.
- **Offline Support**: The cached authentication state allows the application to function even with intermittent internet connectivity.
- **Performance Optimization**: Caching reduces authentication checks, improving app responsiveness.

### Caching Details

#### Caching Mechanism

- Implementation using shared preferences for persistent storage
- Secure storage of authentication tokens
- User state management through local caching

#### Caching Strategy

- When cache is updated: After successful login, registration, and token refresh
- When cache is read: App startup and authentication state checks
- Cache invalidation rules and refresh policies

#### Error Handling

- Handling expired cached credentials
- Cache corruption recovery
- Fallback mechanisms for cache failures
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this fits in with the rest of the tutorial and a lot of this information doesn't apply to the cache usage in this tutorial.

Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR but I don't think this addresses the original issue. I think we should close this PR and open a new one where we specifically focus on explaining the role of the cache in this tutorial (along with the relevant source code so folks can follow along).

@AffanShaikhsurab
Copy link
Author

sure i will make the necessary changes !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation requested example Example application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: describe cache in Flutter Firebase Login Tutorial
2 participants