easy_localization_loader icon indicating copy to clipboard operation
easy_localization_loader copied to clipboard

feat: add web support

Open ariefwijaya opened this issue 1 year ago • 4 comments

resolved #61

Please let me know if you have another approach. I split the file to make it easier to read and backwards compatible without touching existing main scripts smart_network_asset_loader.dart

ariefwijaya avatar Mar 24 '24 19:03 ariefwijaya

@aissat Need your help to review. Thanks

ariefwijaya avatar Mar 24 '24 19:03 ariefwijaya

@ariefwijaya Thanks that you submitted this PR, the motivation makes sense!

What I don't like is that all the logic is duplicated now. If we would make an update to the smart_network_asset_loader, one would need to remember to copy-paste the update to the other file.

I'm not aware if there is a state of the art solution for this, but I would propose the following:

Create a new file called smart_network_asset_loader_base.dart. It is as the current smart_network_asset_loader, but it is abstract and the the platform-dependent part extracted into an (abstract) method.

smart_network_asset_loader and smart_network_asset_loader_web both inherit from SmartNetworkAssetLoaderBase and implement the native part accordingly.

Wdyt?

bw-flagship avatar Mar 25 '24 08:03 bw-flagship

@bw-flagship Thank you, this is a great idea and as a best practice, it will help us upgrade to other platforms more easily and consistently. I'll refactor the code and update my PR later. (a bit busy now). Anyone who wants to help is welcome

ariefwijaya avatar Mar 25 '24 23:03 ariefwijaya