packages Documentation

A collection of useful packages maintained by the Flutter team

5,266 stars Dart Dart 1 file ยท ~6,273 tokens
RAW Doc

File: README.md

Flutter Packages


This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's
first-party packages (i.e., packages developed by the core Flutter team).
Check the packages directory to see all packages.

These packages are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter
repo
.
Issues pertaining to this repository are labeled
"package"
.

Contributing

If you wish to contribute a new package to the Flutter ecosystem, please
see the documentation for developing packages. You can store
your package source code in any GitHub repository (the present repo is only
intended for packages developed by the core Flutter team). Once your package
is ready you can publish
to the pub repository.

If you wish to contribute a change to any of the existing packages in this repo,
please review our contribution guide,
and send a pull request.

Packages

These are the packages hosted in this repository:

Package Pub Points Usage Issues Pull requests
animations
camera
cross_file
cupertino_icons
cupertino_ui
espresso
extension_google_sign_in_as_googleapis_auth
file_selector
flutter_lints
flutter_plugin_android_lifecycle
flutter_svg
flutter_svg_test
go_router
go_router_builder
google_adsense
google_fonts
google_maps_flutter
google_sign_in
image_picker
interactive_media_ads
in_app_purchase
local_auth
material_ui
metrics_center
path_parsing
path_provider
pigeon
pointer_interceptor
plugin_platform_interface
quick_actions
google_identity_services_web
rfw
shared_preferences
two_dimensional_scrollables
url_launcher
vector_graphics
vector_graphics_codec
vector_graphics_compiler
video_player
web_benchmarks
webview_flutter
xdg_directories

File: packages/xdg_directories/README.md

`xdg_directories`

A Dart package for reading XDG directory configuration information on Linux.

Getting Started

On Linux, xdg is a system developed by freedesktop.org, a
project to work on interoperability and shared base technology for free software
desktop environments for Linux.

This Dart package can be used to determine the directory configuration
information defined by xdg, such as where the Documents or Desktop directories
are. These are called "user directories" and are defined in configuration file
in the user's home directory.

See this wiki for
more details of the XDG Base Directory implementation.

To use this package, the basic XDG values for the following are available via a Dart API:

  • dataHome - The single base directory relative to which user-specific data
    files should be written. (Corresponds to $XDG_DATA_HOME).

  • configHome - The a single base directory relative to which user-specific
    configuration files should be written. (Corresponds to $XDG_CONFIG_HOME).

  • dataDirs - The list of preference-ordered base directories relative to
    which data files should be searched. (Corresponds to $XDG_DATA_DIRS).

  • configDirs - The list of preference-ordered base directories relative to
    which configuration files should be searched. (Corresponds to
    $XDG_CONFIG_DIRS).

  • cacheHome - The base directory relative to which user-specific
    non-essential (cached) data should be written. (Corresponds to
    $XDG_CACHE_HOME).

  • runtimeDir - The base directory relative to which user-specific runtime
    files and other file objects should be placed. (Corresponds to
    $XDG_RUNTIME_DIR).

  • getUserDirectoryNames() - Returns a set of the names of user directories
    defined in the xdg configuration files.

  • getUserDirectory(String dirName) - Gets the value of the user dir with the
    given name. Requesting a user dir that doesn't exist returns null. The
    dirName argument is case-insensitive. See this
    wiki
    for more
    details and what values of dirName might be available.


File: packages/web_benchmarks/testing/README.md

`testing` README

How to run the `testing` directory tests

The benchmarks contained in this directory use a client-server model, similar to
what the integration_test package does. In order to run the tests inside testing,
do the following:

  • Install Chrome in a way that tests can find it.

  • Fetch dependencies for the test_app directory inside testing:

    bash
    flutter pub get --directory testing/test_app
  • Fetch dependencies for the web_benchmarks directory:

    bash
    flutter pub get
  • Run the tests with flutter test:

    bash
    $ flutter test testing
    
    00:03 +0: Can run a web benchmark
    Launching Chrome.
    Launching Google Chrome 98.0.4758.102
    
    Waiting for the benchmark to report benchmark profile.
    [CHROME]: [0215/133233.327761:ERROR:socket_posix.cc(150)] bind() failed: Address already in use (98)
    [CHROME]:
    [CHROME]: DevTools listening on ws://[::1]:10000/devtools/browser/4ef82be6-9b68-4fd3-ab90-cd603d25ceb1
    Connecting to DevTools: ws://localhost:10000/devtools/page/21E7271507E9BC796B957E075515520F
    Connected to Chrome tab:  (http://localhost:9999/index.html)
    Launching benchmark "scroll"
    Extracted 299 measured frames.
    Skipped 1 non-measured frames.
    Launching benchmark "page"
    [APP] Testing round 0...
    [APP] Testing round 1...
    [APP] Testing round 2...
    [APP] Testing round 3...
    [APP] Testing round 4...
    [APP] Testing round 5...
    [APP] Testing round 6...
    [APP] Testing round 7...
    [APP] Testing round 8...
    [APP] Testing round 9...
    Extracted 490 measured frames.
    Skipped 0 non-measured frames.
    Launching benchmark "tap"
    [APP] Testing round 0...
    [APP] Testing round 1...
    [APP] Testing round 2...
    [APP] Testing round 3...
    [APP] Testing round 4...
    [APP] Testing round 5...
    [APP] Testing round 6...
    [APP] Testing round 7...
    [APP] Testing round 8...
    [APP] Testing round 9...
    Extracted 299 measured frames.
    Skipped 0 non-measured frames.
    Received profile data
    00:26 +1: All tests passed!

(If the above stops working, take a look at what the web_benchmarks_test Cirrus step
is currently doing, and update this document accordingly!)


File: packages/web_benchmarks/README.md

web_benchmarks

A benchmark harness for Flutter Web apps. Currently only supports running
benchmarks in Chrome.

Writing a benchmark

An example benchmark can be found in testing/test_app/benchmark/web_benchmark_test.dart.

A web benchmark is made of two parts: a client and a server. The client is code
that runs in the browser together with the benchmark code. The server serves the
app's code and assets. Additionally, the server communicates with the browser to
extract the performance traces.

Analyzing benchmark results

After running web benchmarks, you may want to analyze the results or compare
with the results from other benchmark runs. The web_benchmarks package
supports the following analysis operations:

  • compute the delta between two benchmark results
  • compute the average of a set of benchmark results
dart
import 'dart:convert';
import 'dart:io';

import 'package:web_benchmarks/analysis.dart';

void main() {
  final BenchmarkResults baselineResults = _benchmarkResultsFromFile(
    '/path/to/benchmark_baseline.json',
  );
  final BenchmarkResults testResults1 = _benchmarkResultsFromFile('/path/to/benchmark_test_1.json');
  final BenchmarkResults testResults2 = _benchmarkResultsFromFile('/path/to/benchmark_test_2.json');

  // Compute the delta between [baselineResults] and [testResults1].
  final BenchmarkResults delta = computeDelta(baselineResults, testResults1);
  stdout.writeln(delta.toJson());

  // Compute the average of [testResults] and [testResults2].
  final BenchmarkResults average = computeAverage([testResults1, testResults2]);
  stdout.writeln(average.toJson());
}

BenchmarkResults _benchmarkResultsFromFile(String path) {
  final file = File.fromUri(Uri.parse(path));
  final fileContentAsJson = jsonDecode(file.readAsStringSync()) as Map<String, Object?>;
  return BenchmarkResults.parse(fileContentAsJson);
}

File: packages/rfw/example/hello/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

Launch Screen Assets

You can customize the launch screen with your own desired assets by replacing the image files in this directory.

You can also do it by opening your Flutter project's Xcode project with open ios/Runner.xcworkspace, selecting Runner/Assets.xcassets in the Project Navigator and dropping in the desired images.


File: packages/rfw/example/hello/README.md

Hello World for RFW

This example shows the simplest use of the RemoteWidget widget. In
this example, the "remote" widget is hard-coded into the application.


File: packages/rfw/example/local/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

Launch Screen Assets

You can customize the launch screen with your own desired assets by replacing the image files in this directory.

You can also do it by opening your Flutter project's Xcode project with open ios/Runner.xcworkspace, selecting Runner/Assets.xcassets in the Project Navigator and dropping in the desired images.


File: packages/rfw/example/local/README.md

Example of new custom local widgets for RFW

This example shows how one can create custom widgets in an RFW client,
for use by remote widgets.


File: packages/rfw/example/remote/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md

Launch Screen Assets

You can customize the launch screen with your own desired assets by replacing the image files in this directory.

You can also do it by opening your Flutter project's Xcode project with open ios/Runner.xcworkspace, selecting Runner/Assets.xcassets in the Project Navigator and dropping in the desired images.