### Well-Organized LICENSE File Example 1 Source: https://docs.flutter.dev/packages-and-plugins/developing-packages This example demonstrates how to structure a LICENSE file with multiple component licenses, each starting with its package name and separated by hyphens. ```text package_1 -------------------------------------------------------------------------------- package_2 ``` -------------------------------- ### Run Flutter Example App Source: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors Use this command to build and run the Flutter plugin's example application, verifying its functionality at different stages of the setup process. ```sh flutter run ``` ```sh flutter run ``` -------------------------------- ### Add Flutter SDK bin to PATH (Example) Source: https://docs.flutter.dev/install/add-to-path An example of adding the Flutter SDK's `bin` directory to the `PATH` environment variable, assuming the SDK is installed in `$HOME/develop/flutter`. ```bash export PATH="$HOME/develop/flutter/bin:$PATH" ``` -------------------------------- ### Example Java JDK Path for Flutter Configuration Source: https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide An example path to a Java Development Kit (JDK) installation, used with `flutter config --jdk-dir`. ```sh /opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home ``` -------------------------------- ### Initialize LXD Configuration Source: https://docs.flutter.dev/deployment/linux Configure LXD after installation. The default answers are suitable for most use cases during the interactive setup. ```bash $ sudo lxd init Would you like to use LXD clustering? (yes/no) [default=no]: Do you want to configure a new storage pool? (yes/no) [default=yes]: Name of the new storage pool [default=default]: Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: Create a new ZFS pool? (yes/no) [default=yes]: Would you like to use an existing empty disk or partition? (yes/no) [default=no]: Size in GB of the new loop device (1GB minimum) [default=5GB]: Would you like to connect to a MAAS server? (yes/no) [default=no]: Would you like to create a new local network bridge? (yes/no) [default=yes]: What should the new bridge be called? [default=lxdbr0]: What IPv4 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]: What IPv6 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]: Would you like LXD to be available over the network? (yes/no) [default=no]: Would you like stale cached images to be updated automatically? (yes/no) [default=yes] Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: ``` -------------------------------- ### Example of Deferred Components Configuration Source: https://docs.flutter.dev/tools/pubspec Concrete example showing how to define multiple deferred components with libraries and assets. ```yaml flutter: deferred-components: - name: box_component libraries: - package:testdeferredcomponents/box.dart - name: gallery_feature libraries: - package:testdeferredcomponents/gallery_feature.dart assets: - assets/gallery_images/gallery_feature.png ``` -------------------------------- ### Install Snapcraft CLI Source: https://docs.flutter.dev/deployment/linux Install the Snapcraft command-line tool, which is necessary for building and publishing snaps. ```bash $ sudo snap install snapcraft --classic ``` -------------------------------- ### Install Snap for Local Testing Source: https://docs.flutter.dev/deployment/linux Install the locally built snap package for testing. The `--dangerous` flag is required for installing unsigned local snaps. ```bash $ sudo snap install ./super-cool-app_0.1.0_amd64.snap --dangerous ``` -------------------------------- ### Complete Example: Take and Display a Picture (Dart) Source: https://docs.flutter.dev/cookbook/plugins/picture-using-camera This comprehensive Flutter application demonstrates the full workflow of using the `camera` plugin to capture and display an image. It covers camera setup, preview, taking a photo, and navigating to a screen to show the result. ```dart import 'dart:async'; import 'dart:io'; import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; Future main() async { // Ensure that plugin services are initialized so that `availableCameras()` // can be called before `runApp()` WidgetsFlutterBinding.ensureInitialized(); // Obtain a list of the available cameras on the device. final cameras = await availableCameras(); // Get a specific camera from the list of available cameras. final firstCamera = cameras.first; runApp( MaterialApp( theme: ThemeData.dark(), home: TakePictureScreen( // Pass the appropriate camera to the TakePictureScreen widget. camera: firstCamera, ), ), ); } // A screen that allows users to take a picture using a given camera. class TakePictureScreen extends StatefulWidget { const TakePictureScreen({super.key, required this.camera}); final CameraDescription camera; @override TakePictureScreenState createState() => TakePictureScreenState(); } class TakePictureScreenState extends State { late CameraController _controller; late Future _initializeControllerFuture; @override void initState() { super.initState(); // To display the current output from the Camera, // create a CameraController. _controller = CameraController( // Get a specific camera from the list of available cameras. widget.camera, // Define the resolution to use. ResolutionPreset.medium, ); // Next, initialize the controller. This returns a Future. _initializeControllerFuture = _controller.initialize(); } @override void dispose() { // Dispose of the controller when the widget is disposed. _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Take a picture')), // You must wait until the controller is initialized before displaying the // camera preview. Use a FutureBuilder to display a loading spinner until the // controller has finished initializing. body: FutureBuilder( future: _initializeControllerFuture, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { // If the Future is complete, display the preview. return CameraPreview(_controller); } else { // Otherwise, display a loading indicator. return const Center(child: CircularProgressIndicator()); } }, ), floatingActionButton: FloatingActionButton( // Provide an onPressed callback. onPressed: () async { // Take the Picture in a try / catch block. If anything goes wrong, // catch the error. try { // Ensure that the camera is initialized. await _initializeControllerFuture; // Attempt to take a picture and get the file `image` // where it was saved. final image = await _controller.takePicture(); if (!context.mounted) return; // If the picture was taken, display it on a new screen. await Navigator.of(context).push( MaterialPageRoute( builder: (context) => DisplayPictureScreen( // Pass the automatically generated path to // the DisplayPictureScreen widget. imagePath: image.path, ), ), ); } catch (e) { // If an error occurs, log the error to the console. print(e); } }, child: const Icon(Icons.camera_alt), ), ); } } // A widget that displays the picture taken by the user. class DisplayPictureScreen extends StatelessWidget { final String imagePath; const DisplayPictureScreen({super.key, required this.imagePath}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Display the Picture')), // The image is stored as a file on the device. Use the `Image.file` // constructor with the given path to display the image. body: Image.file(File(imagePath)), ); } } ``` -------------------------------- ### Navigate to Plugin Example App Source: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors Use this command to change the current directory to your plugin's example application. This is a prerequisite for testing the plugin. ```sh cd path/to/plugin/example/ ``` -------------------------------- ### Well-Organized LICENSE File Example 2 Source: https://docs.flutter.dev/packages-and-plugins/developing-packages This example shows a LICENSE file where a single license applies to multiple packages, listed before the license text. ```text package_1 -------------------------------------------------------------------------------- package_1 package_2 ``` -------------------------------- ### Open Xcode Workspace for Plugin Example Source: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors Use this command in the terminal to open the example app's Xcode workspace. Replace 'ios' with 'macos' as appropriate. ```bash open example/ios/Runner.xcworkspace ``` -------------------------------- ### Install APKS for Local Testing with bundletool Source: https://docs.flutter.dev/perf/deferred-components Install the generated APKS file onto a test device using `bundletool` for local verification of deferred components. ```bash $ java -jar bundletool.jar install-apks --apks=/app.apks ``` -------------------------------- ### Install Antigravity CLI on Windows (Command Prompt) Source: https://docs.flutter.dev/ai/antigravity-cli Installs the Antigravity CLI on Windows using winget in Command Prompt. ```cmd winget install Google.AntigravityCLI ``` -------------------------------- ### Poorly-Organized LICENSE File Example 1 Source: https://docs.flutter.dev/packages-and-plugins/developing-packages This example illustrates an incorrectly formatted LICENSE file where component licenses lack package name headers. ```text -------------------------------------------------------------------------------- ``` -------------------------------- ### Create Flutter installation directory on macOS/Linux Source: https://docs.flutter.dev/community/china Creates a `dev` directory in the user's home directory and navigates into it, preparing for Flutter SDK installation. ```Bash $ mkdir ~/dev; cd ~/dev ``` -------------------------------- ### Poorly-Organized LICENSE File Example 2 Source: https://docs.flutter.dev/packages-and-plugins/developing-packages This example shows an incorrectly formatted LICENSE file where the separator is not on its own line, violating the recommended structure. ```text package_1 -------------------------------------------------------------------------------- ``` -------------------------------- ### Call Graph for Example Dependencies Source: https://docs.flutter.dev/tools/devtools/app-size Presents the call graph for the example package dependencies, highlighting direct many-to-many relationships between packages. ```text package:a --> package:b --> package:d package:a --> package:c --> ``` -------------------------------- ### Complete example for finding widgets Source: https://docs.flutter.dev/cookbook/testing/widget/finders A comprehensive example demonstrating how to find widgets by text, by key, and by instance within a single Flutter widget test file. ```dart import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('finds a Text widget', (tester) async { // Build an App with a Text widget that displays the letter 'H'. await tester.pumpWidget(const MaterialApp(home: Scaffold(body: Text('H')))); // Find a widget that displays the letter 'H'. expect(find.text('H'), findsOneWidget); }); testWidgets('finds a widget using a Key', (tester) async { // Define the test key. const testKey = Key('K'); // Build a MaterialApp with the testKey. await tester.pumpWidget(MaterialApp(key: testKey, home: Container())); // Find the MaterialApp widget using the testKey. expect(find.byKey(testKey), findsOneWidget); }); testWidgets('finds a specific instance', (tester) async { const childWidget = Padding(padding: EdgeInsets.zero); // Provide the childWidget to the Container. await tester.pumpWidget(Container(child: childWidget)); // Search for the childWidget in the tree and verify it exists. expect(find.byWidget(childWidget), findsOneWidget); }); } ``` -------------------------------- ### Dominator Tree for Example Dependencies Source: https://docs.flutter.dev/tools/devtools/app-size Shows the dominator tree derived from the example package dependencies, illustrating how a node dominates others if all paths to them pass through it. ```text package:a |__ package:b |__ package:c |__ package:d ``` -------------------------------- ### Set up project directory structure Source: https://docs.flutter.dev/learn/pathway/tutorial/advanced-ui Create folders within the `lib` directory to organize data models, screen widgets, and theme configuration. ```bash $ mkdir lib/data lib/screens lib/theme ``` -------------------------------- ### Install package dependencies using flutter pub get Source: https://docs.flutter.dev/packages-and-plugins/using-packages Run this command in the terminal after modifying `pubspec.yaml` to fetch and install new or updated package dependencies. ```bash flutter pub get ``` -------------------------------- ### Create a new Flutter project Source: https://docs.flutter.dev/deployment/flavors-ios Use this command to initialize a new Flutter project named `flavors_example`. ```bash $ flutter create flavors_example ``` -------------------------------- ### Initialize ThemeRepository and MainApp in main() Source: https://docs.flutter.dev/app-architecture/design-patterns/key-value-data Demonstrates how to initialize `ThemeRepository` with `SharedPreferencesService` and pass it to `MainApp` as a dependency during application startup. ```dart void main() { // ··· runApp( MainApp( themeRepository: ThemeRepository(SharedPreferencesService()), // ··· ), ); } ``` -------------------------------- ### Flutter pub get Exit Code 69 Source: https://docs.flutter.dev/install/troubleshoot Example of an 'exit code: 69' error during 'flutter pub get', typically indicating a network or TLS issue when resolving dependencies. ```bash Running "flutter pub get" in flutter_tools... Resolving dependencies in .../flutter/packages/flutter_tools... (28.0s) Got TLS error trying to find package test at https://pub.dev/. pub get failed command: ".../flutter/bin/cache/dart-sdk/bin/ dart __deprecated_pub --color --directory .../flutter/packages/flutter_tools get --example" pub env: { "FLUTTER_ROOT": ".../flutter", "PUB_ENVIRONMENT": "flutter_cli:get", "PUB_CACHE": ".../.pub-cache", } exit code: 69 ``` -------------------------------- ### Test App Link Setup with ADB Command Source: https://docs.flutter.dev/cookbook/navigation/set-up-app-links Use this `adb` command to test only the app's deep link setup on a device or emulator. Ensure the Flutter app is installed before running. ```bash adb shell 'am start -a android.intent.action.VIEW \ -c android.intent.category.BROWSABLE \ -d "http:///details"' \ ``` -------------------------------- ### Flutter: Making a GET Request with dart:io HttpClient Source: https://docs.flutter.dev/flutter-for/react-native-devs This example demonstrates how to use Flutter's `dart:io` `HttpClient` to perform a GET request, parse the JSON response, and update state. ```dart final Uri url = Uri.parse('https://httpbin.org/ip'); final HttpClient httpClient = HttpClient();​ Future getIPAddress() async { final request = await httpClient.getUrl(url); final response = await request.close(); final responseBody = await response.transform(utf8.decoder).join(); final ip = jsonDecode(responseBody)['origin'] as String; setState(() { _ipAddress = ip; }); } ``` -------------------------------- ### Add Flutter Post-Install Hook Source: https://docs.flutter.dev/add-to-app/ios/project-setup-legacy?tab=embed-using-cocoapods Include this 'post_install' block as the last section in your 'Podfile' to ensure proper Flutter setup after CocoaPods installation. ```ruby post_install do |installer| flutter_post_install(installer) if defined?(flutter_post_install) end ``` -------------------------------- ### Update MainActivity for Flutter v2 Embedding (Java) Source: https://docs.flutter.dev/release/breaking-changes/plugin-api-migration Update the example app's `MainActivity.java` to extend `FlutterActivity` for the v2 embedding. Plugins are automatically registered with this setup. ```java package io.flutter.plugins.firebasecoreexample; import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.firebase.core.FirebaseCorePlugin; public class MainActivity extends FlutterActivity { // You can keep this empty class or remove it. Plugins on the new embedding // now automatically registers plugins. } ``` -------------------------------- ### Example .desktop File for Flutter Snap Source: https://docs.flutter.dev/deployment/linux This example demonstrates the structure of a .desktop file for a Flutter application, defining its name, execution command, icon path, and categories. Place this file in /snap/gui/. ```yaml [Desktop Entry] Name=Super Cool App Comment=Super Cool App that does everything Exec=super-cool-app Icon=${SNAP}/meta/gui/super-cool-app.png # Replace name with your app name. Terminal=false Type=Application Categories=Education; # Adjust accordingly your snap category. ``` -------------------------------- ### Validate Flutter web setup with flutter devices Source: https://docs.flutter.dev/platform-integration/web/setup Run this command in your terminal to verify that Flutter can detect your installed web browser (Chrome or Edge) for web development. ```bash $ flutter devices Found 1 connected devices: Chrome (web) • chrome • web-javascript • Google Chrome ``` -------------------------------- ### Example: Extract Flutter SDK on Windows Source: https://docs.flutter.dev/install/manual This PowerShell example demonstrates extracting the Flutter SDK from the user's Downloads directory to a develop folder within their user profile. ```powershell $ Expand-Archive ` -Path $env:USERPROFILE\Downloads\flutter_windows_3.29.3-stable.zip ` -Destination $env:USERPROFILE\develop\ ``` -------------------------------- ### Build Snap with Multipass VM Backend Source: https://docs.flutter.dev/deployment/linux Run this command from the project's root directory to build the snap using the Multipass VM backend. ```bash $ snapcraft ``` -------------------------------- ### Check Flutter Linux Toolchain Issues Source: https://docs.flutter.dev/platform-integration/linux/setup Runs the `flutter doctor -v` command to check for any issues with the Linux development setup and toolchain. Use this to validate your environment after installing prerequisites. ```bash $ flutter doctor -v ``` -------------------------------- ### Initialize Firebase Hosting Source: https://docs.flutter.dev/deployment/web Initializes Firebase Hosting in an empty directory or an existing Flutter project. This command guides you through configuring your hosting setup, including selecting a web framework and hosting source directory. ```bash firebase init hosting ``` -------------------------------- ### List, Launch, and Create Emulators for Flutter Source: https://docs.flutter.dev/reference/flutter-cli Provides commands to list available emulators, launch existing ones, or create new emulators for testing Flutter apps. ```bash flutter emulators ``` -------------------------------- ### Example: Extract Flutter SDK on macOS Source: https://docs.flutter.dev/install/manual This unzip example demonstrates extracting the Flutter SDK from the user's Downloads directory to a develop folder in their home directory on macOS. ```bash $ unzip ~/Downloads/flutter_macos_3.29.3-stable.zip -d ~/develop/ ``` -------------------------------- ### Windows: Example Flutter SDK bin path Source: https://docs.flutter.dev/install/add-to-path This path illustrates a typical location for the Flutter SDK's bin directory when installed under the user profile on Windows, used for setting the system's PATH variable. ```cmd %USERPROFILE%\develop\flutter\bin ``` -------------------------------- ### Complete Flutter File Persistence Example Source: https://docs.flutter.dev/cookbook/persistence/reading-writing-files A full Flutter application demonstrating how to read and write an integer counter to a local file. It integrates `path_provider` for getting the application's document directory and uses `dart:io` for file operations within a `StatefulWidget`. ```dart import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:path_provider/path_provider.dart'; void main() { runApp( MaterialApp( title: 'Reading and Writing Files', home: FlutterDemo(storage: CounterStorage()), ), ); } class CounterStorage { Future get _localPath async { final directory = await getApplicationDocumentsDirectory(); return directory.path; } Future get _localFile async { final path = await _localPath; return File('$path/counter.txt'); } Future readCounter() async { try { final file = await _localFile; // Read the file final contents = await file.readAsString(); return int.parse(contents); } catch (e) { // If encountering an error, return 0 return 0; } } Future writeCounter(int counter) async { final file = await _localFile; // Write the file return file.writeAsString('$counter'); } } class FlutterDemo extends StatefulWidget { const FlutterDemo({super.key, required this.storage}); final CounterStorage storage; @override State createState() => _FlutterDemoState(); } class _FlutterDemoState extends State { int _counter = 0; @override void initState() { super.initState(); widget.storage.readCounter().then((value) { setState(() { _counter = value; }); }); } Future _incrementCounter() { setState(() { _counter++; }); // Write the variable as a string to the file. return widget.storage.writeCounter(_counter); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Reading and Writing Files')), body: Center( child: Text('Button tapped $_counter time${_counter == 1 ? '' : 's'}.'), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment', child: const Icon(Icons.add), ), ); } } ``` -------------------------------- ### Verify ChromeDriver Installation Source: https://docs.flutter.dev/testing/integration-tests Check the installed version of ChromeDriver to confirm successful installation. ```bash chromedriver --version ChromeDriver 124.0.6367.60 (8771130bd84f76d855ae42fbe02752b03e352f17-refs/branch-heads/6367@{#798}) ``` -------------------------------- ### Verify Antigravity CLI Installation Source: https://docs.flutter.dev/ai/antigravity-cli Checks the installed version of the Antigravity CLI to confirm successful installation. ```bash $ agy --version agy version 2.0.0 ``` -------------------------------- ### Create FlutterEngine in App Delegate Source: https://docs.flutter.dev/add-to-app/macos/add-flutter-screen This example demonstrates creating a FlutterEngine as a property on app startup in the app delegate. ```swift import Cocoa import FlutterMacOS // The following library connects plugins with macOS platform code to this app. import FlutterPluginRegistrant @main class AppDelegate: FlutterAppDelegate { lazy var flutterEngine = FlutterEngine(name: "my flutter engine", project: nil) override func applicationDidFinishLaunching(_ aNotification: Notification) { flutterEngine.run(withEntrypoint: nil) RegisterGeneratedPlugins(registry: self.flutterEngine) } } ``` -------------------------------- ### Package and Sign macOS App Installer Source: https://docs.flutter.dev/deployment/macos Package the built macOS application into an unsigned installer (.pkg), then sign it using the Mac Developer Installer certificate, and remove the temporary unsigned package. ```bash APP_NAME=$(find $(pwd) -name "*.app") PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg INSTALLER_CERT_NAME=$(keychain list-certificates \ | jq '[.[]\ | select(.common_name\ | contains("Mac Developer Installer"))\ | .common_name][0]' \ | xargs) xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME" rm -f unsigned.pkg ``` -------------------------------- ### Build Snap with LXD Container Backend Source: https://docs.flutter.dev/deployment/linux Run this command from the project's root directory to build the snap using the LXD container backend. ```bash $ snapcraft --use-lxd ``` -------------------------------- ### Start a Xamarin.Forms application Source: https://docs.flutter.dev/flutter-for/xamarin-forms-devs This method is called for each platform to initialize and start the Xamarin.Forms application. ```csharp LoadApplication(new App()); ``` -------------------------------- ### Start Flutter Widget Previewer from command line Source: https://docs.flutter.dev/tools/widget-previewer Run this command in your Flutter project's root directory to launch the Widget Previewer. It starts a local server and opens a preview environment in Chrome. ```shell flutter widget-preview start ``` -------------------------------- ### Install Antigravity CLI on Windows (PowerShell) Source: https://docs.flutter.dev/ai/antigravity-cli Installs the Antigravity CLI on Windows using PowerShell. ```powershell irm https://antigravity.google/install.ps1 | iex ``` -------------------------------- ### Install ChromeDriver using npx Source: https://docs.flutter.dev/testing/integration-tests Install ChromeDriver for web testing using the `@puppeteer/browsers` Node.js library. ```bash npx @puppeteer/browsers install chromedriver@stable ``` -------------------------------- ### Old Windows Build Path Example Source: https://docs.flutter.dev/release/breaking-changes/windows-build-architecture Illustrates the previous build path for Flutter Windows executables before the introduction of architecture-specific directories. ```text build\windows\runner\Release\hello_world.exe ``` -------------------------------- ### Install Flutter App on an Attached Device Source: https://docs.flutter.dev/reference/flutter-cli Installs a Flutter application onto a specified attached device. ```bash flutter install -d ``` -------------------------------- ### Install LXD Container Manager Source: https://docs.flutter.dev/deployment/linux Install LXD, a container manager required for the snap build process. ```bash $ sudo snap install lxd ``` -------------------------------- ### Example: Generate Android APK Size Analysis Source: https://docs.flutter.dev/tools/devtools/app-size This example demonstrates generating a size analysis file for an Android APK targeting `android-arm64`. The output includes a summary and the path to the generated JSON analysis file. ```bash flutter build apk --analyze-size --target-platform=android-arm64 ... ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ app-release.apk (total compressed) 6 MB ... ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ A summary of your APK analysis can be found at: build/apk-code-size-analysis_01.json ``` -------------------------------- ### Validate Flutter Installation Source: https://docs.flutter.dev/install/with-vs-code Run this command in your terminal to verify that Flutter is installed correctly and all necessary dependencies are met. ```bash flutter doctor -v ``` -------------------------------- ### Import Google Sign-In Package Source: https://docs.flutter.dev/data-and-backend/google-apis Import the `google_sign_in` package to handle user authentication with Google identities. This package provides the `GoogleSignIn` class. ```dart /// Provides the `GoogleSignIn` class. import 'package:google_sign_in/google_sign_in.dart'; ``` -------------------------------- ### Install Antigravity CLI on macOS/Linux Source: https://docs.flutter.dev/ai/antigravity-cli Installs the Antigravity CLI on macOS or Linux systems using a curl command. ```bash curl -fsSL https://antigravity.google/install.sh | bash ``` -------------------------------- ### Example Project Directory Structure Source: https://docs.flutter.dev/tools/devtools/inspector Illustrates a typical Flutter project directory layout with multiple packages, used to explain package directory configuration in the inspector. ```text project_foo pkgs project_foo_app widgets_A widgets_B ``` -------------------------------- ### Install Pods for iOS Project Source: https://docs.flutter.dev/platform-integration/ios/ios-app-clip Run these commands from your Flutter project directory to install the necessary CocoaPods after modifying the Podfile. ```bash cd ios pod install ``` -------------------------------- ### Example Output for Web Integration Test Source: https://docs.flutter.dev/testing/integration-tests Illustrative output showing successful execution of Flutter driver tests on a web browser. ```bash Resolving dependencies... leak_tracker 10.0.0 (10.0.5 available) leak_tracker_flutter_testing 2.0.1 (3.0.5 available) leak_tracker_testing 2.0.1 (3.0.1 available) material_color_utilities 0.8.0 (0.11.1 available) meta 1.11.0 (1.14.0 available) test_api 0.6.1 (0.7.1 available) vm_service 13.0.0 (14.2.1 available) Got dependencies! 7 packages have newer versions incompatible with dependency constraints. Try `flutter pub outdated` for more information. Launching integration_test/app_test.dart on Chrome in debug mode... Waiting for connection from debug service on Chrome... 10.9s This app is linked to the debug service: ws://127.0.0.1:51523/3lofIjIdmbs=/ws Debug service listening on ws://127.0.0.1:51523/3lofIjIdmbs=/ws 00:00 +0: end-to-end test tap on the floating action button, verify counter 00:01 +1: (tearDownAll) 00:01 +2: All tests passed! All tests passed. Application finished. ```