Skip to content

Commit ba1d7af

Browse files
authored
Merge pull request #641 from appwrite/fix-dart-flutter-analyzer-issue
fix return type
2 parents 2ac74d5 + 71ae6d8 commit ba1d7af

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

templates/dart/lib/query.dart.twig

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@ part of {{ language.params.packageName }};
33
class Query {
44
Query._();
55

6-
static equal(String attribute, dynamic value) =>
6+
static String equal(String attribute, dynamic value) =>
77
_addQuery(attribute, 'equal', value);
88

9-
static notEqual(String attribute, dynamic value) =>
9+
static String notEqual(String attribute, dynamic value) =>
1010
_addQuery(attribute, 'notEqual', value);
1111

12-
static lessThan(String attribute, dynamic value) =>
12+
static String lessThan(String attribute, dynamic value) =>
1313
_addQuery(attribute, 'lessThan', value);
1414

15-
static lessThanEqual(String attribute, dynamic value) =>
15+
static String lessThanEqual(String attribute, dynamic value) =>
1616
_addQuery(attribute, 'lessThanEqual', value);
1717

18-
static greaterThan(String attribute, dynamic value) =>
18+
static String greaterThan(String attribute, dynamic value) =>
1919
_addQuery(attribute, 'greaterThan', value);
2020

21-
static greaterThanEqual(String attribute, dynamic value) =>
21+
static String greaterThanEqual(String attribute, dynamic value) =>
2222
_addQuery(attribute, 'greaterThanEqual', value);
2323

24-
static search(String attribute, String value) =>
24+
static String search(String attribute, String value) =>
2525
_addQuery(attribute, 'search', value);
2626

27-
static isNull(String attribute) => 'isNull("$attribute")';
27+
static String isNull(String attribute) => 'isNull("$attribute")';
2828

29-
static isNotNull(String attribute) => 'isNotNull("$attribute")';
29+
static String isNotNull(String attribute) => 'isNotNull("$attribute")';
3030

31-
static between(String attribute, dynamic start, dynamic end) =>
31+
static String between(String attribute, dynamic start, dynamic end) =>
3232
_addQuery(attribute, 'between', [start, end]);
3333

34-
static startsWith(String attribute, String value) =>
34+
static String startsWith(String attribute, String value) =>
3535
_addQuery(attribute, 'startsWith', value);
3636

37-
static endsWith(String attribute, String value) =>
37+
static String endsWith(String attribute, String value) =>
3838
_addQuery(attribute, 'endsWith', value);
3939

40-
static select(List<String> attributes) => 'select([${attributes.map((attr) => "\"$attr\"").join(",")}])';
40+
static String select(List<String> attributes) => 'select([${attributes.map((attr) => "\"$attr\"").join(",")}])';
4141

4242
static String orderAsc(String attribute) => 'orderAsc("$attribute")';
4343

templates/flutter/lib/src/client_io.dart.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,15 @@ class ClientIO extends ClientBase with ClientMixin {
305305
return res;
306306
}
307307

308+
bool get _customSchemeAllowed => Platform.isWindows || Platform.isLinux;
309+
308310
@override
309311
Future webAuth(Uri url, {String? callbackUrlScheme}) {
310312
return FlutterWebAuth2.authenticate(
311313
url: url.toString(),
312-
callbackUrlScheme: callbackUrlScheme != null && Platform.isWindows ? callbackUrlScheme : "appwrite-callback-" + config['project']!,
314+
callbackUrlScheme: callbackUrlScheme != null && _customSchemeAllowed
315+
? callbackUrlScheme
316+
: "{{spec.title | caseLower}}-callback-" + config['project']!,
313317
preferEphemeral: true,
314318
).then((value) async {
315319
Uri url = Uri.parse(value);

0 commit comments

Comments
 (0)