@@ -12,11 +12,12 @@ import 'package:flutter_local_db/src/enum/ffi_native_lib_location.dart';
1212import 'package:flutter_local_db/src/interface/local_db_request_impl.dart' ;
1313import 'package:flutter_local_db/src/model/local_db_error_model.dart' ;
1414import 'package:flutter_local_db/src/model/local_db_request_model.dart' ;
15- import 'package:flutter_local_db/src/service/local_db_result.dart' ;
15+
1616import 'package:path_provider/path_provider.dart' ;
1717
1818import 'dart:io' show Platform;
1919import 'package:flutter/foundation.dart' show kIsWeb;
20+ import 'package:result_controller/result_controller.dart' ;
2021
2122/// opaque extension
2223final class AppDbState extends Opaque {}
@@ -36,7 +37,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
3637
3738 static final LocalDbBridge instance = LocalDbBridge ._();
3839
39- LocalDbResult <DynamicLibrary , String >? _lib;
40+ Result <DynamicLibrary , String >? _lib;
4041 Pointer <AppDbState >? _dbInstance; // Cambiado de late a nullable
4142 String ?
4243 _lastDatabaseName; // Almacena el último nombre de base de datos utilizado
@@ -257,7 +258,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
257258 }
258259
259260 @override
260- Future <LocalDbResult <LocalDbModel , ErrorLocalDb >> post (
261+ Future <Result <LocalDbModel , ErrorLocalDb >> post (
261262 LocalDbModel model,
262263 ) async {
263264 if (! (await ensureConnectionValid ())) {
@@ -302,7 +303,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
302303 }
303304
304305 @override
305- Future <LocalDbResult <LocalDbModel , ErrorLocalDb >> getById (String id) async {
306+ Future <Result <LocalDbModel , ErrorLocalDb >> getById (String id) async {
306307 if (! (await ensureConnectionValid ())) {
307308 return Err (ErrorLocalDb .databaseError ('Database connection is invalid' ));
308309 }
@@ -344,7 +345,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
344345 }
345346
346347 @override
347- Future <LocalDbResult <LocalDbModel , ErrorLocalDb >> put (
348+ Future <Result <LocalDbModel , ErrorLocalDb >> put (
348349 LocalDbModel model,
349350 ) async {
350351 if (! (await ensureConnectionValid ())) {
@@ -386,7 +387,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
386387 }
387388
388389 @override
389- Future <LocalDbResult <bool , ErrorLocalDb >> cleanDatabase () async {
390+ Future <Result <bool , ErrorLocalDb >> cleanDatabase () async {
390391 if (! (await ensureConnectionValid ())) {
391392 return Err (ErrorLocalDb .databaseError ('Database connection is invalid' ));
392393 }
@@ -410,7 +411,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
410411 }
411412
412413 @override
413- Future <LocalDbResult <bool , ErrorLocalDb >> delete (String id) async {
414+ Future <Result <bool , ErrorLocalDb >> delete (String id) async {
414415 if (! (await ensureConnectionValid ())) {
415416 return Err (ErrorLocalDb .databaseError ('Database connection is invalid' ));
416417 }
@@ -442,7 +443,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
442443 }
443444
444445 @override
445- Future <LocalDbResult <List <LocalDbModel >, ErrorLocalDb >> getAll () async {
446+ Future <Result <List <LocalDbModel >, ErrorLocalDb >> getAll () async {
446447 // Verificar la conexión antes de proceder
447448 if (! await ensureConnectionValid ()) {
448449 return Err (ErrorLocalDb .databaseError ('Database connection is invalid' ));
@@ -493,7 +494,7 @@ class LocalDbBridge extends LocalSbRequestImpl {
493494}
494495
495496sealed class CurrentPlatform {
496- static Future <LocalDbResult <DynamicLibrary , String >>
497+ static Future <Result <DynamicLibrary , String >>
497498 loadRustNativeLib () async {
498499 // Web platform doesn't use FFI, this should not be called on web
499500 if (kIsWeb) {
0 commit comments