Refactor
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:ffi/ffi.dart';
|
||||
|
||||
R withMemory<R, T extends NativeType>(
|
||||
int size,
|
||||
R Function(Pointer<T> memory) action,
|
||||
) {
|
||||
final memory = calloc<Int8>(size);
|
||||
try {
|
||||
return action(memory.cast());
|
||||
} finally {
|
||||
calloc.free(memory);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:hiddify/domain/singbox/singbox.dart';
|
||||
import 'package:hiddify/singbox/model/singbox_proxy_type.dart';
|
||||
import 'package:hiddify/utils/validators.dart';
|
||||
|
||||
typedef ProfileLink = ({String url, String name});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hiddify/domain/failures.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
|
||||
part 'mutation_state.freezed.dart';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:hiddify/data/data_providers.dart';
|
||||
import 'package:hiddify/core/preferences/preferences_provider.dart';
|
||||
import 'package:hiddify/utils/custom_loggers.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -75,7 +75,7 @@ class PrefNotifier<T, P> extends AutoDisposeNotifier<T> with InfraLogger {
|
||||
final P Function(T)? _mapTo;
|
||||
|
||||
late final Pref<T, P> _pref = Pref(
|
||||
ref.watch(sharedPreferencesProvider),
|
||||
ref.watch(sharedPreferencesProvider).requireValue,
|
||||
_key,
|
||||
_defaultValue,
|
||||
mapFrom: _mapFrom,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:hiddify/domain/failures.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user