sdk-generator icon indicating copy to clipboard operation
sdk-generator copied to clipboard

🚀 Feature: Unify Dart and Flutter Package

Open Mabenan opened this issue 3 years ago • 3 comments

🔖 Feature description

At the moment we have different SDKs for Backend (Dart) and Frontend (Flutter). This is not optimal for people who want to reduce their boilerplate code.

For example if someone want to use the same strongly typed data models in functions like he does in the frontend he is forced to write a lot of Boilerplate code to first generalize the API calls in a Package and then again define specific for the appwrite packages in a Server Package and Client Package again.

🎤 Pitch

My Idea is to create a Dart SDK booth used by Dart and Flutter and then one Specific Flutter SDK which is only used by Flutter.

In the specific Flutter framework only things like OAuth or other Frontend Specific things are defined.

This can be done b using Mixins in the Flutter SDK.

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Mabenan avatar Nov 16 '22 08:11 Mabenan

Thanks for raising this issue! 🙏🏼

For example if someone want to use the same strongly typed data models in functions like he does in the frontend he is forced to write a lot of Boilerplate code to first generalize the API calls in a Package and then again define specific for the appwrite packages in a Server Package and Client Package again.

Can you expand more on the boilerplate?

stnguyen90 avatar Nov 16 '22 20:11 stnguyen90

I created abstract API class which has basically the same methods like database,account,team and so on.

Then I have a singelton Class which holds an instance of the API that is given over an Init method.

In Server functions I created an Implementation of the API class that uses dart_appwrite package

In Client code I created an Implementation of the API class that uses appwrite package

Mabenan avatar Nov 16 '22 20:11 Mabenan

We did this split for a few reasons:

  1. A lot of the server or client method don't work in the opposite environment and no way for someone to understand that just like that no matter how familiar they are with Appwrite

  2. Using an API key for authentication on the client is very dangerous. In the past we had the web SDK including both functionalities and we saw a lot of developers passing an API key on the client side, this is very risky.

eldadfux avatar Feb 15 '23 13:02 eldadfux

closing this

ChiragAgg5k avatar Jul 28 '25 09:07 ChiragAgg5k