text stringlengths 1 372 |
|---|
or WidgetsApp, you can get the same effect by wrapping your |
application in a stack and putting a widget on your stack that was |
created by calling PerformanceOverlay.allEnabled().) |
to learn how to interpret the graphs in the overlay, |
check out the performance overlay in |
profiling flutter performance. |
<topic_end> |
<topic_start> |
add widget alignment grid |
to add an overlay to a material design baseline grid on your app to |
help verify alignments, add the debugShowMaterialGrid argument in the |
MaterialApp constructor. |
to add an overlay to non-Material applications, add a GridPaper widget. |
<topic_end> |
<topic_start> |
use a native language debugger |
info note |
this guide presumes you understand general debugging, |
have installed flutter and git, and have familiarity |
with the dart language as well as one of the following |
languages: java, kotlin, swift, or Objective-C. |
if you write flutter apps only with dart code, |
you can debug your code using your IDE’s debugger. |
the flutter team recommends VS code. |
if you write a platform-specific plugin or |
use platform-specific libraries, you can debug |
that portion of your code with a native debugger. |
this guide shows you how you can connect two |
debuggers to your dart app, one for dart, and one for the native code. |
<topic_end> |
<topic_start> |
debug dart code |
this guide describes how to use VS code to debug your flutter app. |
you can also use your preferred IDE with the |
flutter and dart plugins installed and configured. |
<topic_end> |
<topic_start> |
debug dart code using VS code |
the following procedure explains how to use the dart debugger |
with the default sample flutter app. |
the featured components in VS code work and appear when |
debugging your own flutter project as well. |
create a basic flutter app. |
open the lib\main.dart file in the flutter app using |
VS code. |
click the bug icon |
(). |
this opens the following panes in VS code: |
the first time you run the debugger takes the longest. |
test the debugger. |
a. in main.dart, click on this line: |
b. press shift + f9. |
this adds a breakpoint where the |
_counter variable increments. |
c. in the app, click the + button |
to increment the counter. the app pauses. |
d. at this point, VS code displays: |
<topic_end> |
<topic_start> |
VS code flutter debugger |
the flutter plugin for VS code adds a number of components |
to the VS code user interface. |
<topic_end> |
<topic_start> |
changes to VS code interface |
when launched, the flutter debugger adds debugging tools to the |
VS code interface. |
the following screenshot and table explain the purpose of each tool. |
to change where the panel (in orange) appears in VS code, |
go to view > appearance > panel position. |
<topic_end> |
<topic_start> |
VS code flutter debugging toolbar |
the toolbar allows you to debug using any debugger. |
you can step in, out, and over dart statements, hot reload, or resume the app. |
<topic_end> |
<topic_start> |
update test flutter app |
for the remainder of this guide, you need to update the |
test flutter app. this update adds native code to debug. |
open the lib/main.dart file using your preferred IDE. |
replace the contents of main.dart with the following code. |
<code_start> |
// copyright 2023 the flutter authors. all rights reserved. |
// use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
import 'package:flutter/material.dart'; |
import 'package:url_launcher/url_launcher.dart'; |
void main() { |
runApp(const MyApp()); |
} |
class MyApp extends StatelessWidget { |
const MyApp({super.key}); |
@override |
widget build(BuildContext context) { |
return MaterialApp( |
title: 'url launcher', |
theme: ThemeData( |
colorSchemeSeed: colors.purple, |
brightness: brightness.light, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.