Flutter: Expanded vs Flexible
I’ve used both Expanded and Flexible widgets and they both seem to work the same. What is the difference between Expanded and Flexible? 8 Answers 8
I’ve used both Expanded and Flexible widgets and they both seem to work the same. What is the difference between Expanded and Flexible? 8 Answers 8
In Android match_parent and wrap_content are used to resize the widgets automatically relative to their parent to the content the widget contains. In Flutter it seems by default all widgets are set to wrap_content, how would I change it such that I can fill its width and height to that of its parent? 13 Answers … Read more
In Android, every single View subclass has a setVisibility() method that allows you modify the visibility of a View object There are 3 options of setting the visibility: Visible: Renders the View visible inside the layout Invisible: Hides the View, but leaves a gap that is equivalent to what the View would occupy if it … Read more
How would you approach adding a splash screen to Flutter apps? It should load and display before any other content. Currently, there is a brief flash of color before the Scaffold(home:X) widget loads. 25 Answers 25
Working on my first flutter app. The main app screen doesn’t have this issue, all the texts show up as they should. However in this new screen I’m developing, all the text widget have some weird yellow line / double-line underneath. Any ideas on why this is happening? 14 Answers 14
I have realized that it is possible to create widgets using plain functions instead of subclassing StatelessWidget. An example would be this: Widget function({ String title, VoidCallback callback }) { return GestureDetector( onTap: callback, child: // some widget ); } This is interesting because it requires far less code than a full-blown class. Example: class … Read more
For various reasons, sometimes the build method of my widgets is called again. I know that it happens because a parent updated. But this causes undesired effects. A typical situation where it causes problems is when using FutureBuilder this way: @override Widget build(BuildContext context) { return FutureBuilder( future: httpCall(), builder: (context, snapshot) { // create … Read more
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
I’m using Flutter and I’d like to add a border to a widget (in this case, a Text widget). I tried TextStyle and Text, but I didn’t see how to add a border. 12 Answers 12