Skip to content

Commit 00a341d

Browse files
committed
Update test
1 parent 2186454 commit 00a341d

File tree

9 files changed

+875
-98
lines changed

9 files changed

+875
-98
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_local_db","path":"/Volumes/Data/Private/04_Librarys/local_db/flutter_local_db/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/jhonatanortiz/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"flutter_local_db","path":"/Volumes/Data/Private/04_Librarys/local_db/flutter_local_db/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/jhonatanortiz/.pub-cache/hosted/pub.dev/path_provider_android-2.2.17/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"flutter_local_db","path":"/Volumes/Data/Private/04_Librarys/local_db/flutter_local_db/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/jhonatanortiz/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/Users/jhonatanortiz/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/Users/jhonatanortiz/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"flutter_local_db","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2025-07-13 23:48:01.101533","version":"3.32.4","swift_package_manager_enabled":{"ios":false,"macos":false}}

example/pubspec.lock

Lines changed: 308 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,308 @@
1+
# Generated by pub
2+
# See https://dart.dev/tools/pub/glossary#lockfile
3+
packages:
4+
async:
5+
dependency: transitive
6+
description:
7+
name: async
8+
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
9+
url: "https://pub.dev"
10+
source: hosted
11+
version: "2.13.0"
12+
boolean_selector:
13+
dependency: transitive
14+
description:
15+
name: boolean_selector
16+
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
17+
url: "https://pub.dev"
18+
source: hosted
19+
version: "2.1.2"
20+
characters:
21+
dependency: transitive
22+
description:
23+
name: characters
24+
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
25+
url: "https://pub.dev"
26+
source: hosted
27+
version: "1.4.0"
28+
clock:
29+
dependency: transitive
30+
description:
31+
name: clock
32+
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
33+
url: "https://pub.dev"
34+
source: hosted
35+
version: "1.1.2"
36+
collection:
37+
dependency: transitive
38+
description:
39+
name: collection
40+
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
41+
url: "https://pub.dev"
42+
source: hosted
43+
version: "1.19.1"
44+
fake_async:
45+
dependency: transitive
46+
description:
47+
name: fake_async
48+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
49+
url: "https://pub.dev"
50+
source: hosted
51+
version: "1.3.3"
52+
ffi:
53+
dependency: transitive
54+
description:
55+
name: ffi
56+
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
57+
url: "https://pub.dev"
58+
source: hosted
59+
version: "2.1.4"
60+
flutter:
61+
dependency: "direct main"
62+
description: flutter
63+
source: sdk
64+
version: "0.0.0"
65+
flutter_lints:
66+
dependency: "direct dev"
67+
description:
68+
name: flutter_lints
69+
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
70+
url: "https://pub.dev"
71+
source: hosted
72+
version: "5.0.0"
73+
flutter_local_db:
74+
dependency: "direct main"
75+
description:
76+
path: ".."
77+
relative: true
78+
source: path
79+
version: "0.6.0"
80+
flutter_test:
81+
dependency: "direct dev"
82+
description: flutter
83+
source: sdk
84+
version: "0.0.0"
85+
leak_tracker:
86+
dependency: transitive
87+
description:
88+
name: leak_tracker
89+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
90+
url: "https://pub.dev"
91+
source: hosted
92+
version: "10.0.9"
93+
leak_tracker_flutter_testing:
94+
dependency: transitive
95+
description:
96+
name: leak_tracker_flutter_testing
97+
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
98+
url: "https://pub.dev"
99+
source: hosted
100+
version: "3.0.9"
101+
leak_tracker_testing:
102+
dependency: transitive
103+
description:
104+
name: leak_tracker_testing
105+
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
106+
url: "https://pub.dev"
107+
source: hosted
108+
version: "3.0.1"
109+
lints:
110+
dependency: transitive
111+
description:
112+
name: lints
113+
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7
114+
url: "https://pub.dev"
115+
source: hosted
116+
version: "5.1.1"
117+
logger:
118+
dependency: transitive
119+
description:
120+
name: logger
121+
sha256: "2621da01aabaf223f8f961e751f2c943dbb374dc3559b982f200ccedadaa6999"
122+
url: "https://pub.dev"
123+
source: hosted
124+
version: "2.6.0"
125+
matcher:
126+
dependency: transitive
127+
description:
128+
name: matcher
129+
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
130+
url: "https://pub.dev"
131+
source: hosted
132+
version: "0.12.17"
133+
material_color_utilities:
134+
dependency: transitive
135+
description:
136+
name: material_color_utilities
137+
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
138+
url: "https://pub.dev"
139+
source: hosted
140+
version: "0.11.1"
141+
meta:
142+
dependency: transitive
143+
description:
144+
name: meta
145+
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
146+
url: "https://pub.dev"
147+
source: hosted
148+
version: "1.16.0"
149+
path:
150+
dependency: transitive
151+
description:
152+
name: path
153+
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
154+
url: "https://pub.dev"
155+
source: hosted
156+
version: "1.9.1"
157+
path_provider:
158+
dependency: transitive
159+
description:
160+
name: path_provider
161+
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
162+
url: "https://pub.dev"
163+
source: hosted
164+
version: "2.1.5"
165+
path_provider_android:
166+
dependency: transitive
167+
description:
168+
name: path_provider_android
169+
sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9
170+
url: "https://pub.dev"
171+
source: hosted
172+
version: "2.2.17"
173+
path_provider_foundation:
174+
dependency: transitive
175+
description:
176+
name: path_provider_foundation
177+
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
178+
url: "https://pub.dev"
179+
source: hosted
180+
version: "2.4.1"
181+
path_provider_linux:
182+
dependency: transitive
183+
description:
184+
name: path_provider_linux
185+
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
186+
url: "https://pub.dev"
187+
source: hosted
188+
version: "2.2.1"
189+
path_provider_platform_interface:
190+
dependency: transitive
191+
description:
192+
name: path_provider_platform_interface
193+
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
194+
url: "https://pub.dev"
195+
source: hosted
196+
version: "2.1.2"
197+
path_provider_windows:
198+
dependency: transitive
199+
description:
200+
name: path_provider_windows
201+
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
202+
url: "https://pub.dev"
203+
source: hosted
204+
version: "2.3.0"
205+
platform:
206+
dependency: transitive
207+
description:
208+
name: platform
209+
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
210+
url: "https://pub.dev"
211+
source: hosted
212+
version: "3.1.6"
213+
plugin_platform_interface:
214+
dependency: transitive
215+
description:
216+
name: plugin_platform_interface
217+
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
218+
url: "https://pub.dev"
219+
source: hosted
220+
version: "2.1.8"
221+
sky_engine:
222+
dependency: transitive
223+
description: flutter
224+
source: sdk
225+
version: "0.0.0"
226+
source_span:
227+
dependency: transitive
228+
description:
229+
name: source_span
230+
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
231+
url: "https://pub.dev"
232+
source: hosted
233+
version: "1.10.1"
234+
stack_trace:
235+
dependency: transitive
236+
description:
237+
name: stack_trace
238+
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
239+
url: "https://pub.dev"
240+
source: hosted
241+
version: "1.12.1"
242+
stream_channel:
243+
dependency: transitive
244+
description:
245+
name: stream_channel
246+
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
247+
url: "https://pub.dev"
248+
source: hosted
249+
version: "2.1.4"
250+
string_scanner:
251+
dependency: transitive
252+
description:
253+
name: string_scanner
254+
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
255+
url: "https://pub.dev"
256+
source: hosted
257+
version: "1.4.1"
258+
term_glyph:
259+
dependency: transitive
260+
description:
261+
name: term_glyph
262+
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
263+
url: "https://pub.dev"
264+
source: hosted
265+
version: "1.2.2"
266+
test_api:
267+
dependency: transitive
268+
description:
269+
name: test_api
270+
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
271+
url: "https://pub.dev"
272+
source: hosted
273+
version: "0.7.4"
274+
vector_math:
275+
dependency: transitive
276+
description:
277+
name: vector_math
278+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
279+
url: "https://pub.dev"
280+
source: hosted
281+
version: "2.1.4"
282+
vm_service:
283+
dependency: transitive
284+
description:
285+
name: vm_service
286+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
287+
url: "https://pub.dev"
288+
source: hosted
289+
version: "15.0.0"
290+
web:
291+
dependency: transitive
292+
description:
293+
name: web
294+
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
295+
url: "https://pub.dev"
296+
source: hosted
297+
version: "1.1.1"
298+
xdg_directories:
299+
dependency: transitive
300+
description:
301+
name: xdg_directories
302+
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
303+
url: "https://pub.dev"
304+
source: hosted
305+
version: "1.1.0"
306+
sdks:
307+
dart: ">=3.8.1 <4.0.0"
308+
flutter: ">=3.32.0"

lib/src/core/database.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class DatabaseValidator {
253253
/// ```
254254
static bool isValidDatabaseName(String name) {
255255
if (name.isEmpty) return false;
256-
// Check for invalid filename characters
257-
return !RegExp(r'[<>:"/\\|?*]').hasMatch(name);
256+
// Check for invalid filename characters and special characters
257+
return !RegExp(r'[<>:"/\\|?*@#$ &]').hasMatch(name);
258258
}
259259

260260
/// Gets a validation error message for an invalid key

lib/src/core/models.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,16 @@ class DbEntry {
121121
_mapEquals(data, other.data);
122122

123123
@override
124-
int get hashCode => id.hashCode ^ hash.hashCode ^ data.hashCode;
124+
int get hashCode => id.hashCode ^ hash.hashCode ^ _mapHashCode(data);
125+
126+
/// Hash code computation for maps that matches our equality comparison
127+
static int _mapHashCode(Map<String, dynamic> map) {
128+
int hash = 0;
129+
for (final entry in map.entries) {
130+
hash ^= entry.key.hashCode ^ entry.value.hashCode;
131+
}
132+
return hash;
133+
}
125134

126135
/// Deep equality comparison for maps
127136
static bool _mapEquals(Map<String, dynamic> a, Map<String, dynamic> b) {

lib/src/enum/ffi_native_lib_location.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ enum FFiNativeLibLocation {
3434
try {
3535
final result = await Process.run('uname', ['-m']);
3636
final arch = result.stdout.toString().trim();
37-
final archPath = lib.replaceAll('liboffline_first_core', 'liboffline_first_core_$arch');
37+
final archPath = 'macos/Frameworks/liboffline_first_core_$arch.dylib';
3838
print('Architecture: $arch, Library path: $archPath');
3939
return archPath;
4040
} catch (e) {
4141
print('Error getting architecture: $e, falling back to default');
42-
return lib;
42+
return 'macos/Frameworks/liboffline_first_core.dylib';
4343
}
4444
}
4545
}

lib/src/platform/native/native_database.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,39 @@ class NativeDatabase implements Database {
558558
DbError _parseRustError(String errorResponse) {
559559
try {
560560
final response = jsonDecode(errorResponse) as Map<String, dynamic>;
561+
562+
// Handle Rust error format: {"ErrorType": "message"}
563+
if (response.containsKey('NotFound')) {
564+
final errorMessage = response['NotFound'] as String;
565+
return DbError.notFound(errorMessage);
566+
}
567+
568+
if (response.containsKey('ValidationError')) {
569+
final errorMessage = response['ValidationError'] as String;
570+
return DbError.validationError(errorMessage);
571+
}
572+
573+
if (response.containsKey('SerializationError')) {
574+
final errorMessage = response['SerializationError'] as String;
575+
return DbError.serializationError(errorMessage);
576+
}
577+
578+
if (response.containsKey('DatabaseError')) {
579+
final errorMessage = response['DatabaseError'] as String;
580+
return DbError.databaseError(errorMessage);
581+
}
582+
583+
// Fallback for legacy format {"Err": "message"}
561584
if (response.containsKey('Err')) {
562585
final errorData = response['Err'] as String;
563586
return DbError.databaseError('Rust error: $errorData');
564587
}
588+
589+
// Unknown error format
590+
final firstKey = response.keys.first;
591+
final firstValue = response[firstKey] as String;
592+
return DbError.databaseError('Rust error ($firstKey): $firstValue');
593+
565594
} catch (e) {
566595
// Fallback if JSON parsing fails
567596
}

0 commit comments

Comments
 (0)