Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Flutter 3) how can i disable http fromWebUrl and postUrl ? #274

Open
fuuunani opened this issue Aug 4, 2022 · 1 comment
Open

(Flutter 3) how can i disable http fromWebUrl and postUrl ? #274

fuuunani opened this issue Aug 4, 2022 · 1 comment

Comments

@fuuunani
Copy link

fuuunani commented Aug 4, 2022

Hi i am having issue with the generated code,

can these 2 functions be disabled (not generated) in model.g.dart ?
`
static Future<List?> fromWebUrl(Uri uri,
{Map<String, String>? headers}) async {
try {
final response = await http.get(uri, headers: headers);
return await fromJson(response.body);
} catch (e) {
debugPrint(
'SQFENTITY ERROR Todo.fromWebUrl: ErrorMessage: ${e.toString()}');
return null;
}
}

Future<http.Response> postUrl(Uri uri, {Map<String, String>? headers}) {
return http.post(uri, headers: headers, body: toJson());
}
`

pubspec.yaml

environment:
sdk: '>=2.17.6 <3.0.0'

dependencies:
sqfentity: ^2.2.0+6
sqfentity_gen: ^2.2.0+12

dev_dependencies:
build_runner: ^2.2.0
build_verify: ^3.0.0


flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.5, on Ubuntu 18.04.6 LTS 5.4.0-122-generic,
locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.2)
[✓] Android Studio
[✓] VS Code (version 1.67.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!


@blindgaenger
Copy link

Hi @FananiMZ,

Unfortunately, you only described your solution, but not the actual problem. I am not sure if this is a solution for you, but you need to install http to use the generated code.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants