Skip to content

Commit e37539e

Browse files
grdsdevclaude
andauthored
chore: align Dart SDK minimum version to >=3.3.0 across all packages (#1343)
Update postgrest, realtime_client, storage_client, and functions_client to require sdk: '>=3.3.0 <4.0.0', matching supabase_flutter, supabase, and gotrue. Since supabase_flutter already requires Dart 3.3.0+, advertising >=3.0.0 on sub-packages was misleading. Remove redundant null assertion operators in postgrest_builder.dart that become unnecessary_non_null_assertion warnings under Dart 3.3.0+ flow analysis. Linear: SDK-814 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fad2bb7 commit e37539e

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/functions_client/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/fun
66
documentation: 'https://supabase.com/docs/reference/dart/functions-invoke'
77

88
environment:
9-
sdk: '>=3.0.0 <4.0.0'
9+
sdk: '>=3.3.0 <4.0.0'
1010

1111
dependencies:
1212
http: '>=0.13.4 <2.0.0'

packages/postgrest/lib/src/postgrest_builder.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ class PostgrestBuilder<T, S, R> implements Future<T> {
107107
if (_count != null) {
108108
if (_headers['Prefer'] != null) {
109109
final oldPreferHeader = _headers['Prefer'];
110-
_headers['Prefer'] = '$oldPreferHeader,count=${_count!.name}';
110+
_headers['Prefer'] = '$oldPreferHeader,count=${_count.name}';
111111
} else {
112-
_headers['Prefer'] = 'count=${_count!.name}';
112+
_headers['Prefer'] = 'count=${_count.name}';
113113
}
114114
}
115115

@@ -126,9 +126,9 @@ class PostgrestBuilder<T, S, R> implements Future<T> {
126126
if (_schema == null) {
127127
// skip
128128
} else if ([METHOD_GET, METHOD_HEAD].contains(method)) {
129-
_headers['Accept-Profile'] = _schema!;
129+
_headers['Accept-Profile'] = _schema;
130130
} else {
131-
_headers['Content-Profile'] = _schema!;
131+
_headers['Content-Profile'] = _schema;
132132
}
133133
if (method != METHOD_GET && method != METHOD_HEAD) {
134134
_headers['Content-Type'] = 'application/json';
@@ -194,7 +194,7 @@ class PostgrestBuilder<T, S, R> implements Future<T> {
194194
} else {
195195
try {
196196
if ((response.contentLength ?? 0) > 10000 && _isolate != null) {
197-
body = await _isolate!.decode(response.body);
197+
body = await _isolate.decode(response.body);
198198
} else {
199199
body = jsonDecode(response.body);
200200
}
@@ -249,7 +249,7 @@ class PostgrestBuilder<T, S, R> implements Future<T> {
249249
body as R;
250250

251251
if (_converter != null) {
252-
converted = _converter!(body);
252+
converted = _converter(body);
253253
} else {
254254
converted = body as S;
255255
}
@@ -311,14 +311,14 @@ class PostgrestBuilder<T, S, R> implements Future<T> {
311311
error.details.toString().contains('Results contain 0 rows')) {
312312
if (_count != null && response.request!.method != METHOD_HEAD) {
313313
if (_converter != null) {
314-
return PostgrestResponse<S>(data: _converter!(null as R), count: 0)
314+
return PostgrestResponse<S>(data: _converter(null as R), count: 0)
315315
as T;
316316
} else {
317317
return null as T;
318318
}
319319
} else {
320320
if (_converter != null) {
321-
return _converter!(null as R) as T;
321+
return _converter(null as R) as T;
322322
} else {
323323
return null as T;
324324
}

packages/postgrest/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/pos
66
documentation: 'https://supabase.com/docs/reference/dart/select'
77

88
environment:
9-
sdk: '>=3.0.0 <4.0.0'
9+
sdk: '>=3.3.0 <4.0.0'
1010

1111
dependencies:
1212
http: '>=0.13.0 <2.0.0'

packages/realtime_client/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/rea
66
documentation: 'https://supabase.com/docs/reference/dart/subscribe'
77

88
environment:
9-
sdk: '>=3.0.0 <4.0.0'
9+
sdk: '>=3.3.0 <4.0.0'
1010

1111
dependencies:
1212
collection: ^1.15.0

packages/storage_client/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/sto
66
documentation: 'https://supabase.com/docs/reference/dart/storage-createbucket'
77

88
environment:
9-
sdk: '>=3.0.0 <4.0.0'
9+
sdk: '>=3.3.0 <4.0.0'
1010

1111
dependencies:
1212
http: '>=0.13.4 <2.0.0'

0 commit comments

Comments
 (0)