Securrency-OSS / mirai

Mirai is a Server-Driven UI (SDUI) library for Flutter. Mirai allows you to build beautiful cross-platform applications with JSON in real time.
https://pub.dev/packages/mirai
MIT License
486 stars 58 forks source link

feat: Add Support for PageView Widget in Mirai Library #237

Closed ArjunBhilare closed 4 months ago

ArjunBhilare commented 5 months ago

Feature Request

Summary: Introduce support for the PageView widget in the Mirai SDUI library to enhance the dynamic UI capabilities with horizontally or vertically scrollable pages.

Details: The PageView widget is a crucial component in Flutter for creating swipeable views, which are commonly used in various app interfaces like onboarding screens, image carousels, and tabbed documents. Adding support for PageView in the Mirai library would significantly expand the range of UIs that can be dynamically generated from the server side.

Proposed Implementation

JSON Structure: Define a JSON schema to represent PageView properties such as scrollDirection, pageSnapping, controller, and children widgets.

Dynamic Page Creation: Allow dynamic creation of pages in the PageView based on JSON data, enabling real-time updates and modifications from the server.

Page Interaction: Support for onPageChanged to handle user interactions with page changes.

Custom Parser: Implement a custom parser in Mirai for PageView that can convert JSON definitions to the PageView widget in Flutter.

Use Cases

Onboarding Flows: Create dynamic onboarding experiences where pages can be modified or reordered without needing a client-side update.

Content Carousels: Allow dynamic content updates in carousels, useful for news apps, e-commerce platforms, etc.

Interactive Guides: Build step-by-step guides or tutorials that can be updated or personalized based on user data.

Impact

This feature would greatly enhance the flexibility of the Mirai library, making it more suitable for a wider range of applications that rely on dynamic content delivery and engaging user interfaces.

divyanshub024 commented 5 months ago

Hey @ArjunBhilare, I feel this is quite important. Will try to add it in the coming release. Thank you for raising the issue.