text
stringlengths 1
372
|
---|
to the mobile platform using a BasicMessageChannel. |
learn more about accessing platform and third-party services |
in flutter with platform channels. |
here is an example project that shows how to use a |
platform channel to access battery state information on |
iOS and android. |
<topic_end> |
<topic_start> |
does flutter come with a reflection / mirrors system? |
no. dart includes dart:mirrors, |
which provides type reflection. but since |
flutter apps are pre-compiled for production, |
and binary size is always a concern with mobile apps, |
this library is unavailable for flutter apps. |
using static analysis we can strip out anything that isn’t |
used (“tree shaking”). if you import a huge dart library |
but only use a self-contained two-line method, |
then you only pay the cost of the two-line method, |
even if that dart library itself imports dozens and |
dozens of other libraries. this guarantee is only secure |
if dart can identify the code path at compile time. |
to date, we’ve found other approaches for specific needs |
that offer a better trade-off, such as code generation. |
<topic_end> |
<topic_start> |
how do i do internationalization (i18n), localization (l10n), and accessibility (a11y) in flutter? |
learn more about i18n and l10n in the |
internationalization tutorial. |
learn more about a11y in the |
accessibility documentation. |
<topic_end> |
<topic_start> |
how do i write parallel and/or concurrent apps for flutter? |
flutter supports isolates. isolates are separate heaps in |
flutter’s VM, and they are able to run in parallel |
(usually implemented as separate threads). isolates |
communicate by sending and receiving asynchronous messages. |
check out an example of using isolates with flutter. |
<topic_end> |
<topic_start> |
can i run dart code in the background of a flutter app? |
yes, you can run dart code in a background process on both |
iOS and android. for more information, see the free medium article |
executing dart in the background with flutter plugins and geofencing. |
<topic_end> |
<topic_start> |
can i use JSON/XML/protobuffers (and so on) with flutter? |
absolutely. there are libraries on |
pub.dev for JSON, XML, protobufs, |
and many other utilities and formats. |
for a detailed writeup on using JSON with flutter, |
check out the JSON tutorial. |
<topic_end> |
<topic_start> |
can i build 3d (opengl) apps with flutter? |
today we don’t support 3d using OpenGL ES or similar. |
we have long-term plans to expose an optimized 3d API, |
but right now we’re focused on 2d. |
<topic_end> |
<topic_start> |
why is my APK or IPA so big? |
usually, assets including images, sound files, fonts, and so on, |
are the bulk of an APK or IPA. various tools in the |
android and iOS ecosystems can help you understand |
what’s inside of your APK or IPA. |
also, be sure to create a release build |
of your APK or IPA with the flutter tools. |
a release build is usually much smaller |
than a debug build. |
learn more about creating a |
release build of your android app, |
and creating a release build of your iOS app. |
also, check out measuring your app’s size. |
<topic_end> |
<topic_start> |
do flutter apps run on chromebooks? |
we have seen flutter apps run on some chromebooks. |
we are tracking issues related to running flutter on |
chromebooks. |
<topic_end> |
<topic_start> |
is flutter ABI compatible? |
flutter and dart don’t offer application binary interface (abi) |
compatibility. offering ABI compatibility is not a current |
goal for flutter or dart. |
<topic_end> |
<topic_start> |
framework |
<topic_end> |
<topic_start> |
why is the build() method on state, rather than StatefulWidget? |
putting a widget build(BuildContext context) method on state |
rather putting a widget build(BuildContext context, state state) |
method on StatefulWidget gives developers more flexibility when |
subclassing StatefulWidget. you can read a more |
detailed discussion on the API docs for state.build. |
<topic_end> |
<topic_start> |
where is flutter’s markup language? why doesn’t flutter have a markup syntax? |
flutter UIs are built with an imperative, object-oriented |
Subsets and Splits