Skip to content

Commit f689ac6

Browse files
committed
Fix drift riverpod example
1 parent ff4a9ec commit f689ac6

File tree

9 files changed

+22
-8
lines changed

9 files changed

+22
-8
lines changed

demos/supabase-todolist-drift/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

demos/supabase-todolist-drift/lib/attachments/photo_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class PhotoWidget extends ConsumerWidget {
2323
return Container();
2424
}
2525

26-
final data = photoState.value;
26+
final data = photoState.requireValue;
2727
Widget takePhotoButton = ElevatedButton(
2828
onPressed: () async {
2929
final camera = await setupCamera();
@@ -50,7 +50,7 @@ final class PhotoWidget extends ConsumerWidget {
5050
child: const Text('Take Photo'),
5151
);
5252

53-
if (data == null) {
53+
if (todo.photoId == null) {
5454
return takePhotoButton;
5555
}
5656

demos/supabase-todolist-drift/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void main() async {
3333
WidgetsFlutterBinding.ensureInitialized();
3434
await loadSupabase();
3535

36-
runApp(const MyApp());
36+
runApp(const ProviderScope(child: MyApp()));
3737
}
3838

3939
const defaultQuery = 'SELECT * from $todosTable';

demos/supabase-todolist-drift/macos/Podfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ PODS:
1919
- sqlite3/common
2020
- sqlite3/fts5 (3.49.1):
2121
- sqlite3/common
22+
- sqlite3/math (3.49.1):
23+
- sqlite3/common
2224
- sqlite3/perf-threadsafe (3.49.1):
2325
- sqlite3/common
2426
- sqlite3/rtree (3.49.1):
@@ -29,6 +31,7 @@ PODS:
2931
- sqlite3 (~> 3.49.1)
3032
- sqlite3/dbstatvtab
3133
- sqlite3/fts5
34+
- sqlite3/math
3235
- sqlite3/perf-threadsafe
3336
- sqlite3/rtree
3437
- url_launcher_macos (0.0.1):
@@ -72,7 +75,7 @@ SPEC CHECKSUMS:
7275
powersync_flutter_libs: 011c1704766d154faf2373bb9c973d26910d322b
7376
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
7477
sqlite3: fc1400008a9b3525f5914ed715a5d1af0b8f4983
75-
sqlite3_flutter_libs: f8fc13346870e73fe35ebf6dbb997fbcd156b241
78+
sqlite3_flutter_libs: f6acaa2172e6bb3e2e70c771661905080e8ebcf2
7679
url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
7780

7881
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

demos/supabase-todolist-drift/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
6263
allowLocationSimulation = "YES">
6364
<BuildableProductRunnable
6465
runnableDebuggingMode = "0">
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import Cocoa
22
import FlutterMacOS
33

4-
@NSApplicationMain
4+
@main
55
class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true
88
}
9+
10+
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11+
return true
12+
}
913
}

demos/supabase-todolist-drift/macos/Runner/DebugProfile.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<true/>
77
<key>com.apple.security.cs.allow-jit</key>
88
<true/>
9+
<key>com.apple.security.network.client</key>
10+
<true/>
911
<key>com.apple.security.network.server</key>
1012
<true/>
1113
</dict>

demos/supabase-todolist-drift/macos/Runner/Release.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.network.client</key>
8+
<true/>
79
</dict>
810
</plist>

demos/supabase-todolist-drift/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,17 @@ packages:
301301
dependency: "direct main"
302302
description:
303303
name: drift
304-
sha256: "97d5832657d49f26e7a8e07de397ddc63790b039372878d5117af816d0fdb5cb"
304+
sha256: "76f23535e19a9f2be92f954e74d8802e96f526e5195d7408c1a20f6659043941"
305305
url: "https://pub.dev"
306306
source: hosted
307-
version: "2.25.1"
307+
version: "2.24.0"
308308
drift_dev:
309309
dependency: "direct dev"
310310
description:
311311
path: "/Users/simon/src/drift/drift_dev"
312312
relative: false
313313
source: path
314-
version: "2.25.2"
314+
version: "2.24.0"
315315
drift_sqlite_async:
316316
dependency: "direct main"
317317
description:

0 commit comments

Comments
 (0)