/stream-feed-unofficial

Stream Feed Unofficial is a powerful Flutter package that integrates seamlessly with the Stream API, providing developers with the tools to build rich, modern feed-based applications effortlessly. this package is designed with scalability and maintainability in mind, following Clean Code architecture principles.

Primary LanguageDartMIT LicenseMIT

Stream Feed Unofficial

Untitled-2

Github Mail LinkedIn Buy Me A Coffee Website

Stream Feed Unofficial is a powerful Flutter package that integrates seamlessly with the getstream.io API, providing developers with the tools to build rich, modern feed-based applications effortlessly. Compatible with Flutter 3.24.2, this package is designed with scalability and maintainability in mind, following Clean Code architecture principles. It offers comprehensive support for managing activities, posts, and Open Graph data, while also allowing developers to use its core models and use cases independently to create custom UI and state management solutions.

Note: This package is still evolving and is currently less feature-rich compared to the official stream_feed package. However, it is compatible with the latest Flutter versions 3.24.x. If you need all the features of Stream's API, you may want to consider using the official package, though it may not support the latest Flutter updates.

Key Features

  • Clean Code Architecture: Structured with data, domain, and presentation layers to ensure code maintainability and scalability.
  • Use Case Exposure: Access to core usecases allows developers to implement their logic and state management framework.
  • Feed Management: Easily create, manage, and interact with feeds using the Stream API.
  • Activity Integration: Integrate activities seamlessly within your application for a dynamic user experience.
  • Open Graph Data Handling: Fetch and display Open Graph data for rich content previews that enhance your feeds.
  • Dark and Light Theme Support: Built-in support for customizable themes to match your app's branding.
  • State Management: Designed using the BLoC pattern.
  • Comprehensive Documentation: Detailed guides and examples to get you started quickly and efficiently.

Designed for scalability inspired by Clean code architecture

stream_feed_unofficial/
│
├── lib/
│   ├── src/
│   │   ├── data/
│   │   │   ├── activity/
│   │   │   │   ├── datasources/
│   │   │   │   ├── models/
│   │   │   │   └── repositories/
│   │   ├── domain/
│   │   │   ├── activity/
│   │   │   │   ├── entities/
│   │   │   │   ├── repositories/
│   │   │   │   └── usecases/
│   │   ├── presentation/
│   │   │   ├── activity/
│   │   │   │   ├── bloc/
│   │   │   │   ├── components/
│   │   │   │   └── activity_list_screen.dart

Preview

Watch example video

Image 1 Image 2 Image 3 Image 3

Getting Started

Installation

Add the following to your pubspec.yaml file:

dependencies:
  stream_feed_unofficial: ^0.0.1

Usage

Here's a basic guide to help you get started with Stream Feed Unofficial:

Dependency registration as per your requirements

_locator.registerLazySingleton<StreamFeed>(
    () => StreamFeed(),
  );
await streamFeed.initializeBaseConfigurations(
  apiKey: 'YOUR_API_KEY',
  feedName: 'YOUR_FEED_NAME',
  baseEndpoint: 'https://[appRegion]-api.stream-io-api.com/api/',
  userReadToken: 'YOUR_USER_READ_TOKEN',
  userWriteToken: 'YOUR_USER_WRITE_TOKEN',
  openGraphToken: 'YOUR_OPEN_GRAPH_TOKEN',
);
await streamFeed.initializeFeed(
  feedReadToken: 'YOUR_FEED_READ_TOKEN',
  feedWriteToken: 'YOUR_FEED_WRITE_TOKEN',
  feedFollowWriteToken: 'YOUR_FEED_FOLLOW_WRITE_TOKEN',
);

Directly access usecase to build your own solution for state management

  /// Steam Feed Unofficial package exposes all its usecases
  /// For you to write your logic using whichever state management solution.
  final SignupUsecase signupUsecase;
  ...
  ...
  final user = await signupUsecase.execute(
        username: username,
        fullName: fullName,
        profilePictureUrl: profilePictureUrl,
        occupation: occupation,
        gender: gender,
      );
   emit(SignupSuccess(user));

Full Example

For a complete implementation, please refer to the example directory included in the package.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more details.

Roadmap

  1. Add navigation, most likely going to use auto_router.
  2. Exception handling with proper message
  3. Delete post usecase
  4. Add Comments and likes
  5. Handle content length and activity details screen
  6. Better caching
  7. Localization
  8. Create separate packages for Data, Domain, and Presentation layers.

...To be continued

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For any issues or feature requests, please visit the issue tracker - https://github.com/kartikeyaa-k/stream-feed-unofficial/issues