4

I have develop Desktop project using c# which include Web API. Now we plan to start develop with Mobile platform using Flutter. So I already have build all functions which contains calculation and action to API into DLL. So Is it possible way that i can use this DLL in Flutter?

DLL project type " Class Library (Portable for IOS, Android and Windows)

Chhornkimchheng
  • 197
  • 2
  • 12

2 Answers2

1

I don't think so.

Class Library (Portable for IOS, Android and Windows)

If you use xamarin, you can use .net library there.

However, if your project includes Web Api, you can easily fetch data from it!

  1. To install the http package, add it to the dependencies section of the pubspec.yaml
  2. Get data from you asp.net web api:
Future<http.Response> fetchPost() {   return http.get('https://jsonplaceholder.typicode.com/posts/1'); }

more information about deserialization can be found in the official documentation of flutter: https://flutter.dev/docs/cookbook/networking/fetch-data

Maciej Pulikowski
  • 2,457
  • 3
  • 15
  • 34
1

Yes, but is necessary to use native source for each platform. Ex: For android, use http://en.wikipedia.org/wiki/Java_Native_Access for import functions from dll .net; For windows its possible with c++... I recommend you create a plugin for better organization.

For android, this link help you: Setting up JNA in Android Studio

For communication Java/kotlin with flutter use:

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;