mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 19:12:04 +00:00
21 lines
792 B
Dart
21 lines
792 B
Dart
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
|
import 'package:mangayomi/services/http_service/cloudflare/providers/cookie_providers.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
part 'cookie.g.dart';
|
|
|
|
@riverpod
|
|
Future setCookie(SetCookieRef ref, String sourceId, String url) async {
|
|
CookieManager cookie = CookieManager.instance();
|
|
|
|
final cookies = await cookie.getCookies(url: Uri.parse(url.toString()));
|
|
final newCookie = cookies.join("; ");
|
|
setCookieBA(newCookie, sourceId);
|
|
}
|
|
|
|
Future setCookieB(String sourceId, String url) async {
|
|
CookieManager cookie = CookieManager.instance();
|
|
|
|
final cookies = await cookie.getCookies(url: Uri.parse(url.toString()));
|
|
final newCookie = cookies.join("; ");
|
|
setCookieBA(newCookie, sourceId);
|
|
}
|