The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Docs : Missing part of code in Tutorial "Build a User Management App with Flutter" (#28070)
ad-angelod1ac838328a4
diff --git a/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx b/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdxindex a0a6003cb4f..6ff234f4c45 100644--- a/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx+++ b/apps/docs/content/guides/getting-started/tutorials/with-flutter.mdx@@ -636,6 +636,7 @@ And then we can add the widget to the Account page as well as some logic to upda```dart lib/pages/account_page.dartimport 'package:flutter/material.dart';import 'package:supabase_flutter/supabase_flutter.dart';+import 'package:supabase_quickstart/components/avatar.dart';import 'package:supabase_quickstart/main.dart';import 'package:supabase_quickstart/pages/login_page.dart';@@ -731,6 +732,35 @@ class _AccountPageState extends State<AccountPage> {}}+ /// Called when image has been uploaded to Supabase storage from within Avatar widget+ Future<void> _onUpload(String imageUrl) async {+ try {+ final userId = supabase.auth.currentUser!.id;+ await supabase.from('profiles').upsert({+ 'id': userId,+ 'avatar_url': imageUrl,+ });+ if (mounted) {+ const SnackBar(+ content: Text('Updated your profile image!'),+ );+ }+ } on PostgrestException catch (error) {+ if (mounted) context.showSnackBar(error.message, isError: true);+ } catch (error) {+ if (mounted) {+ context.showSnackBar('Unexpected error occurred', isError: true);+ }+ }+ if (!mounted) {+ return;+ }++ setState(() {+ _avatarUrl = imageUrl;+ });+ }+@overridevoid initState() {super.initState();@@ -751,6 +781,11 @@ class _AccountPageState extends State<AccountPage> {body: ListView(padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 12),children: [+ Avatar(+ imageUrl: _avatarUrl,+ onUpload: _onUpload,+ ),+ const SizedBox(height: 18),TextFormField(controller: _usernameController,decoration: const InputDecoration(labelText: 'User Name'),