text
stringlengths 1
372
|
|---|
WidgetsApp when constructing the FlutterEngine or the
|
FlutterViewController.
|
this code sets your dart:ui’s window.defaultRouteName
|
to "/onboarding" instead of "/".
|
alternatively, to construct a FlutterViewController directly without pre-warming
|
a FlutterEngine:
|
lightbulb tip
|
in order to imperatively change your current flutter
|
route from the platform side after the FlutterEngine
|
is already running, use pushRoute()
|
or popRoute() on the FlutterViewController.
|
to pop the iOS route from the flutter side,
|
call SystemNavigator.pop().
|
see navigation and routing for more about flutter’s routes.
|
<topic_end>
|
<topic_start>
|
other
|
the previous example only illustrates a few ways to customize
|
how a flutter instance is initiated. using platform channels,
|
you’re free to push data or prepare your flutter environment
|
in any way you’d like, before presenting the flutter UI using a
|
FlutterViewController.
|
<topic_end>
|
<topic_start>
|
debug your add-to-app module
|
once you’ve integrated the flutter module to your project and used flutter’s
|
platform APIs to run the flutter engine and/or UI,
|
you can then build and run your android or iOS app the same way
|
you run normal android or iOS apps.
|
however, flutter is now powering the UI in places where you’re showing a
|
FlutterActivity or FlutterViewController.
|
<topic_end>
|
<topic_start>
|
debugging
|
you might be used to having your suite of favorite flutter debugging tools
|
available to you automatically when running flutter run or an equivalent
|
command from an IDE. but you can also use all your flutter
|
debugging functionalities such as hot reload, performance
|
overlays, DevTools, and setting breakpoints in add-to-app scenarios.
|
these functionalities are provided by the flutter attach mechanism.
|
flutter attach can be initiated through different pathways,
|
such as through the SDK’s CLI tools,
|
through VS code or IntelliJ/Android studio.
|
flutter attach can connect as soon as you run your FlutterEngine, and
|
remains attached until your FlutterEngine is disposed. but you can invoke
|
flutter attach before starting your engine. flutter attach waits for
|
the next available dart VM that is hosted by your engine.
|
<topic_end>
|
<topic_start>
|
terminal
|
run flutter attach or flutter attach -d deviceId to attach from the terminal.
|
<topic_end>
|
<topic_start>
|
VS code
|
<topic_end>
|
<topic_start>
|
build the iOS version of the flutter app in the terminal
|
to generate the needed iOS platform dependencies,
|
run the flutter build command.
|
<topic_end>
|
<topic_start>
|
start debugging with VS code first
|
if you use VS code to debug most of your code, start with this section.
|
<topic_end>
|
<topic_start>
|
start the dart debugger in VS code
|
to open the flutter app directory, go to
|
file >
|
open folder… and choose the my_app directory.
|
open the lib/main.dart file.
|
if you can build an app for more than one device,
|
you must select the device first.
|
go to
|
view >
|
command palette…
|
you can also press ctrl / cmd +
|
shift + p.
|
type flutter select.
|
click the flutter: select device command.
|
choose your target device.
|
click the debug icon
|
().
|
this opens the debug pane and launches the app.
|
wait for the app to launch on the device and for the debug pane to
|
indicate connected.
|
the debugger takes longer to launch the first time.
|
subsequent launches start faster.
|
this flutter app contains two buttons:
|
<topic_end>
|
<topic_start>
|
attach to the flutter process in xcode
|
to attach to the flutter app, go to
|
debug >
|
attach to process >
|
runner.
|
runner should be at the top of the attach to process menu
|
under the likely targets heading.
|
<topic_end>
|
<topic_start>
|
start debugging with xcode first
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.