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
491 stars 60 forks source link

feat: Add Mirai Switch #207

Closed kushalmahapatro closed 8 months ago

kushalmahapatro commented 9 months ago

Description

Add support for switch in Mirai.

This basically takes up an initial value and a listener onChanged. The state of the switch is being handled by MiraiSwitchCubit.

This is a draft PR raised to confirm that we are following the right practices and to verify if this is the correct approach for handling the state.

TBD

  1. Type of switch (Material/Cupertino/ adaptive)
  2. Override colors (Is this required, or it would be always forced to adapt to the theme)
  3. Additional action onChanged. (network call / updating value in shared preference or storage etc.)

Related Issues

feat: Add support for Switch in Mirai #168

Type of Change

kushalmahapatro commented 9 months ago

Hi @divyanshub024 , @i-asimkhan.

First of all, it was great working on MIRAI and with no due time I was able to adde the support to have a Switch components.

This is not the full implementation, there are some more addition, which has been added in the TBD section and also need to discuss on those points.