· Starting with Flutter

What is the problem with dependencies in custom actions?

Custom Code

Hi all,

Since very recently (yesterday?) FF has stopped compiling my custom actions because of errors with "flutter pub get". Before that my actions were working OK. Now everything seems to be red, even automatic FlutterFlow imports.

What is it happening with dependencies management? This is a nightmare. The error is too general and propagates everywhere. It looks like I have to clear all code and add again every action one by one to check what's wrong.

I'm afraid something has been broken in FF. What's wrong now with this code? How do I add the dependency?

import 'package:flutter/services.dart'; Future setPortraitMode() async { await SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); }

What have you tried so far?

Tried to clear and add again custom actions. Dependencies are throwing errors even if I copy the link from pub.dev. Then I got a message that the dependency is automatically imported and better I remove it. If I remove I got another error.

Did you check FlutterFlow's Documentation for this topic?
No
3 replies