Dart SDK is not configured

I installed Flutter and set up Android Studio. Then I cloned an example of flutter on GitHub (https://github.com/flutter/flutter) and launched it in Android Studio, but it warns me “Dart SDK is not configured”, this happened to my co-worker as well. But if I create a new project in Android Studio, no problem at all. What … Read more

How to add a ListView to a Column in Flutter?

I’m trying to construct a simple login page for my Flutter app. I’ve successfully built the TextFields and log in/Sign in buttons. I want to add a horizontal ListView. When I run the code my elements disappear, if I do it without the ListView, it’s fine again. How can I do this correctly? return new … Read more

flutter doctor –android-licenses gives a java error

Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156) at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75) at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) … 5 more I get this error above when running flutter doctor –android-licenses. Does anyone know why this is happening and how I can fix it? I’m already running … Read more

Scaffold.of() called with a context that does not contain a Scaffold

As you can see, my button is inside the Scaffold‘s body. But I get this exception: Scaffold.of() called with a context that does not contain a Scaffold. import ‘package:flutter/material.dart’; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: ‘Flutter Demo’, theme: ThemeData( primarySwatch: Colors.blue, ), home: HomePage(), … Read more

Flutter – Wrap text on overflow, like insert ellipsis or fade

I’m trying to create a line in which center text has a maximum size, and if the text content is too large, it fits in size. I insert the TextOverflow.ellipsis property to shorten the text and inserting the triple points … but it is not working. main.dart import ‘package:flutter/material.dart’; void main() { runApp(new MyApp()); } … Read more

How can I dismiss the on screen keyboard?

I am collecting user input with a TextFormField and when the user presses a FloatingActionButton indicating they are done, I want to dismiss the on screen keyboard. How do I make the keyboard go away automatically? import ‘package:flutter/material.dart’; class MyHomePage extends StatefulWidget { MyHomePageState createState() => new MyHomePageState(); } class MyHomePageState extends State<MyHomePage> { TextEditingController … Read more