Get Future as a String for use in Text Widget?

I've got the following future method which fetches a string from a PHP/Mysql database. <pre><code>Future&lt;String&gt; getCount({ String audioid,}) async { final...

How to declare a variable depending on if statement in Dart like in Kotlin?

How to declare a variable depending on if statement in Dart? In Kotlin it would look like this: <pre><code> val max = if (a &gt; b) { a } else {...

Pass variable to child widget FLUTTER

I've got Container with ListView Builder with child widget placed in separated file. <pre><code>itemCount: articles.length, itemBuilder: (context, index ) =&gt; al...

How to get current class instance and assign to final property by `this` in Dart

I followed this <a href="https://codelabs.developers.google.com/codelabs/flutter/" rel="nofollow noreferrer">code lab</a> to learning Dart/Flutter. I tried to edit som...

How do I define a variable inside an .env file in Flutter?

I am using this <a href="https://pub.dev/packages/flutter_dotenv#-installing-tab-" rel="noreferrer">library</a>. I want to define a variable for host and port in `.env...

How to fix unable to find Git in your path error , despite providing required path

Whenever i try to run a flutter command (in cmd), the following error occurs : <blockquote> 'where' is not recognized as an internal or external command, o...

Flutter Globals losing their value

Okay, I am sure this is probably an easy to answer question, but after much searching I can't put my finger on the solution. How does one in Flutter/Dart creat...

it is giving error in declaring variable gender (flutter)

<a href="https://i.stack.imgur.com/9igWa.png" rel="nofollow noreferrer">error in adding variable name gender</a> <pre><code>class _InputPageState extends State&lt;...

The value of the local variable *** isnt used. Dart SWITCH statement

I'm new to Dart and I'm hoping someone can explain this variable scoping warning. When I use the following: <pre><code>enum fruits {tomatoes, apples, orange...

protect secrets in flutter app from reverse engineering

I started developing on an existing flutter application and see that they have used regular .dart files to keep the api and secrets. This is of course in the .gitignor...

Passing a value (age) from a widget to another

Through textfield inputs, age of user is obtained with the following code (truncated for simplicity): <pre><code>onChanged: (valueYear) {...

unable to pass instance to the initializer

Error : The instance member 'widget' can't be accessed in an initializer. Im creating a bar chart with getx controller, i want to retrieve values from firebase...

the getter text was called on null flutter

I have this error in my Flutter app: <blockquote> <strong>NoSuchMethodError: The getter 'text' was called on null. Receiver: null Tried calling: text S...

Add flutter to environment path (Bash)

I am trying to permanently add flutter to my PATH. I will tell you what I previously did. So I unzipped the MacOS version in my user folder. Then I went into my .bash-...

How can I access global data from another class in Flutter?

I have a simple class like; <pre><code>import 'dart:io'; class IDCardClass { File frontImageFile; File backImageFile; } </code></pre> From <code>front_tes...