Flutter - abhishekkumardwivedi/Fuchs1a-doc GitHub Wiki

Flutter

Apart from existing flutter support for Android and iOS application development, flutter is extending its coverage to desktop as well and that too to run on top of different operating systems, Linux, Mac and Windows. As in flutter official github wiki, support will be integrated to mainline for application development the way it is for mobile phones. Which also means, we can write application for Android, iOS and Desktop. And so we can assume that once Fuchsia OS is will be officially released with stable or maybe preview build, we may be able to build app for Fuchsia, Android, iOS and eventually app for desktop from the same IDE.

It is straightforward to start working with flatter application. Install Android studio, add flutter pluggin (which will also add dart) and you are done. Android studio will prompt for sdk installation during first time flutter application development. Just get it done and restart android studio and you are set to start flutter app. This app will be for only Android and iOS but as far as starting with flutter app is conserned, it is good to start. Fuchsia will differ the way app will be packaged. It will be in the form of .far.

Flutter Console

Flutter Doctor

Let's understand a simple Flutter exeception

I/flutter ( 5282): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 5282): The following assertion was thrown building UpdatedApp(dirty):
I/flutter ( 5282): A build function returned null.
I/flutter ( 5282): The offending widget is: UpdatedApp
I/flutter ( 5282): Build functions must never return null. To return an empty space that causes the building widget to
I/flutter ( 5282): fill available room, return "new Container()". To return an empty space that takes as little room as
I/flutter ( 5282): possible, return "new Container(width: 0.0, height: 0.0)".
I/flutter ( 5282):
I/flutter ( 5282): When the exception was thrown, this was the stack:
I/flutter ( 5282): #0 debugWidgetBuilderValue.<anonymous closure> (package:flutter/src/widgets/debug.dart:271:7)
I/flutter ( 5282): #1 debugWidgetBuilderValue (package:flutter/src/widgets/debug.dart:288:4)
I/flutter ( 5282): #2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3925:7)
I/flutter ( 5282): #3 Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
I/flutter ( 5282): #4 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3907:5)
I/flutter ( 5282): #5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
I/flutter ( 5282): #6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
I/flutter ( 5282): #7 Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
I/flutter ( 5282): #8 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:939:16)
I/flutter ( 5282): #9 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:910:5)
I/flutter ( 5282): #10 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:856:17)
I/flutter ( 5282): #11 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2320:19)
I/flutter ( 5282): #12 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:855:13)
I/flutter ( 5282): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:736:7)
I/flutter ( 5282): #14 runApp (package:flutter/src/widgets/binding.dart:786:7)
I/flutter ( 5282): #15 main (package:flutter_app/main.dart:3:16)
I/flutter ( 5282): #16 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:216:25)
I/flutter ( 5282): #21 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:208:5)
I/flutter ( 5282): #22 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
I/flutter ( 5282): #23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
I/flutter ( 5282): (elided 4 frames from package dart:async)
I/flutter ( 5282): ════════════════════════════════════════════════════════════════════════════════════════════════════