From f397047ff1750e3f035953ebe2dac199f89f7740 Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:28:23 +0100 Subject: [PATCH] Update CONTRIBUTING --- CONTRIBUTING.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f6a6fe7..e6d3ab56 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ final testSourceModelList = [ sourceCode: testSourceCode, // Example: en lang: "", - // Example: false for true for manga + // Example: false for anime true for manga isManga: false) ]; @@ -56,6 +56,9 @@ import 'dart:convert'; class TestSource extends MProvider { TestSource(); + @override + bool get supportsLatest => true; + @override Future getPopular(MSource source, int page) async { // TODO: implement @@ -229,25 +232,34 @@ All control filters can have a default state set. It's usually recommended if th ## Some functions already available and usable -### http +### http client -Return a body response as `String` +Return a body response as Response ```bash - Simple request -String res = await http('GET', json.encode({'url': 'http://example.com'})); +final client = Client(); + +final res = await client.get(Uri.parse("http://example.com")); + +print(res.body); - With headers -String res = await http('GET', json.encode({'url': 'http://example.com','headers':{'Referer': 'http://example.com'}})); +final client = Client(); + +final res = await client.get(Uri.parse("http://example.com"),headers:{"Referer": "http://example.com"}); + +print(res.body); - With body -String res = await http('POST', json.encode({'url': 'http://example.com','body':{'name':'test'}})); +final client = Client(); -- With FormBuilder +final res = await client.post(Uri.parse("http://example.com"),headers:{"Referer": "http://example.com"},'body':{'name':'test'}); + +print(res.body); -String res = await http('POST',json.encode({'useFormBuilder': true,'body': {'name':'test'},'url': 'http://example.com'})); ``` ### xpath selector @@ -331,6 +343,7 @@ See [`MDocument` model](https://github.com/kodjodevf/mangayomi/blob/main/lib/eva - `String` substringAfterLast(`String text`, `String pattern`) - `String` substringBefore(`String text`, `String pattern`) - `String` substringBeforeLast(`String text`, `String pattern`) +- `String` getUrlWithoutDomain(`String url`) ### Crypto utils - `String` unpackJs(`String code`);