How to turn off warning/error bars on APK build?

Posted by Editorial Staff | Updated on | Flutter


Want to turn off warning/error bars on APK build? That is because Hero transition is done trough Overlay, which is rendered outside of Scaffold or other Material widgets. The problem ? It means during transition, …

Flutter screen change callback

Posted by Editorial Staff | Updated on | Flutter


Flutter screen change callback. Register a RouteObserver on your MaterialApp or WidgetsApp and make your stateful widget a RouteAware. Sample code here: RouteObserver

Flutter remove firebase database Listener

Posted by Editorial Staff | Updated on | Flutter


Flutter remove firebase database Listener. You can use the below example code: If you have this code in a widget you can use:

How to wait for the future object before proceeding in flutter?

Posted by Editorial Staff | Updated on | Flutter


Want to wait for the future object before proceeding in flutter? Start fetching the list in initState() and call setState when the list is fetched, to do this asynchronously. Below you can find a simplified …

Tap on entire row in ListView Flutter layout

Posted by Editorial Staff | Updated on | Flutter


Tap on entire row in ListView Flutter layout. In your Code change – crossAxisAlignment: CrossAxisAlignment.start to: This will make the Column children to take up all horizontal Space.

How to align DropdownButton next to a TextField in Flutter?

Posted by Editorial Staff | Updated on | Flutter


Want to align DropdownButton next to a TextField in Flutter? I am not sure whether this solution helps you or not, but I think its better than using row.

Flutter Matrix4 to rotate a Container by its center

Posted by Editorial Staff | Updated on | Flutter


Flutter Matrix4 to rotate a Container by its center. I’ve found the answer and just made this package (to do all kinds of transformations, not only rotate by the center): https://pub.dev/packages/matrix4_transform

Implementing a bidirectional listview in Flutter

Posted by Editorial Staff | Updated on | Flutter


Implementing a bidirectional listview in Flutter. Here’s a potential solution using an outer SingleChildScrollView. You could also use a PageView of multiple ListViews if you’re ok with the offscreen ListViews being torn down.

How to push a UIViewController from FlutterViewController?

Posted by Editorial Staff | Updated on | Flutter


Want to push a UIViewController from FlutterViewController? You need to embed FlutterViewController in container UINavigationController programmatically or in storyboard, then you will be able to push your next controller. Here is example how to embed …

Saving picture of Canvas with PictureRecorder results in empty image

Posted by Editorial Staff | Updated on | Flutter


Saving picture of Canvas with PictureRecorder results in empty image. The first is that you shouldn’t be passing the canvas & points from Signature to SignatureState; that’s an antipattern in flutter. This code here works. …

Is it possible to draw an image with Dart/Flutter?

Posted by Editorial Staff | Updated on | Flutter


PictureRecorder lets you create a Canvas, use the Canvas drawing methods and provides endRecording() returning a Picture. You can draw this Picture to other Scenes or Canvases, or use .toImage(width, height).toByteData(format) to convert it to …

Implementing setState causes Infinite Loop Flutter

Posted by Editorial Staff | Updated on | Flutter


Implementing setState causes Infinite Loop Flutter. getClassesToDisplay() calls setState() with a delay (then) which causes build() to be run, which calls getClassesToDisplay() – simple endless loop. Remove getClassesToDisplay() from build() and call it from initState() …

How to set minimum height of SliverAppBar within NestedScrollView in flutter?

Posted by Editorial Staff | Updated on | Flutter


Want to set minimum height of SliverAppBar within NestedScrollView in flutter? This is Actually an requested Feature – https://github.com/flutter/flutter/issues/21298 A work Around is to use Bottom:

How to extract Dart/Flutter video metadata?

Posted by Editorial Staff | Updated on | Flutter


Want to extract Dart/Flutter video metadata? You can use the VideoPlayerController.file constructor from the official video player plugin (which is maintained by the official google team so you don’t have to worry about its future …

ancestorInheritedElementForWidgetOfExactType is deprecated

Posted by Editorial Staff | Updated on | Flutter


ancestorInheritedElementForWidgetOfExactType is deprecated. Use context.getElementForInheritedWidgetOfExactType().widget and it should work. As far as benefits go, the documentation basically states the same though someone can correct me but I don’t see any difference. You should be able …