Update CONTRIBUTING

This commit is contained in:
kodjomoustapha
2024-01-09 09:28:23 +01:00
parent beb2f08aec
commit f397047ff1

View File

@@ -45,7 +45,7 @@ final testSourceModelList = [
sourceCode: testSourceCode, sourceCode: testSourceCode,
// Example: en // Example: en
lang: "", lang: "",
// Example: false for true for manga // Example: false for anime true for manga
isManga: false) isManga: false)
]; ];
@@ -56,6 +56,9 @@ import 'dart:convert';
class TestSource extends MProvider { class TestSource extends MProvider {
TestSource(); TestSource();
@override
bool get supportsLatest => true;
@override @override
Future<MPages> getPopular(MSource source, int page) async { Future<MPages> getPopular(MSource source, int page) async {
// TODO: implement // 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 ## Some functions already available and usable
### http ### http client
Return a body response as `String` Return a body response as Response
```bash ```bash
- Simple request - 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 - 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 - 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 ### 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` substringAfterLast(`String text`, `String pattern`)
- `String` substringBefore(`String text`, `String pattern`) - `String` substringBefore(`String text`, `String pattern`)
- `String` substringBeforeLast(`String text`, `String pattern`) - `String` substringBeforeLast(`String text`, `String pattern`)
- `String` getUrlWithoutDomain(`String url`)
### Crypto utils ### Crypto utils
- `String` unpackJs(`String code`); - `String` unpackJs(`String code`);