Finap Serialization Helper

Features

Utility classes for Serialization Helper

Getting started

Run this command to install

flutter pub add finap_serialization_helper

Usage

Bool Converter

Bool to Int

static int? boolToInt(bool? value) {
    try {
      return value != null && value == true ? 1 : 0;
    } on Exception catch (e) {
      return 0;
    }
  }

Bool from Int

static bool? boolFromInt(int? value) {
    try {
      return value != null && value == 1 ? true : false;
    } on Exception catch (e) {
      return false;
    }
  }

Bool from Bool

static bool? boolFromBool(bool? value) {
    return value;
  }