Copying source code using raw.githubusercontent.com

Viewed 89
1 Answers

You can use either the HTTP Package or the DIO Package for this. I Recommend you using DIO.

You can send a GET Request to the URL you need, and it will return the content of the file you requested.

example with DIO:

Response response;
var dio = Dio();
response = await dio.get('https://raw.githubusercontent.com/iampawan/FlutterExampleApps/master/main.dart');
print(response.data.toString());

for more info and usage please reffer to the posted plugins links.

Related