text
stringlengths 6
13.6M
| id
stringlengths 13
176
| metadata
dict | __index_level_0__
int64 0
1.69k
|
---|---|---|---|
// Copyright 2013 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 'dart:math' as math;
import 'dart:typed_data';
export 'dart:typed_data'
show
ByteData,
Endian,
Float32List,
Float64List,
Int32List,
Int64List,
Uint8List;
/// Write-only buffer for incrementally building a [ByteData] instance.
///
/// A WriteBuffer instance can be used only once. Attempts to reuse will result
/// in [StateError]s being thrown.
///
/// The byte order used is [Endian.host] throughout.
class WriteBuffer {
/// Creates an interface for incrementally building a [ByteData] instance.
/// [startCapacity] determines the start size of the [WriteBuffer] in bytes.
/// The closer that value is to the real size used, the better the
/// performance.
factory WriteBuffer({int startCapacity = 8}) {
assert(startCapacity > 0);
final ByteData eightBytes = ByteData(8);
final Uint8List eightBytesAsList = eightBytes.buffer.asUint8List();
return WriteBuffer._(
Uint8List(startCapacity), eightBytes, eightBytesAsList);
}
WriteBuffer._(this._buffer, this._eightBytes, this._eightBytesAsList);
Uint8List _buffer;
int _currentSize = 0;
bool _isDone = false;
final ByteData _eightBytes;
final Uint8List _eightBytesAsList;
static final Uint8List _zeroBuffer = Uint8List(8);
void _add(int byte) {
if (_currentSize == _buffer.length) {
_resize();
}
_buffer[_currentSize] = byte;
_currentSize += 1;
}
void _append(Uint8List other) {
final int newSize = _currentSize + other.length;
if (newSize >= _buffer.length) {
_resize(newSize);
}
_buffer.setRange(_currentSize, newSize, other);
_currentSize += other.length;
}
void _addAll(Uint8List data, [int start = 0, int? end]) {
final int newEnd = end ?? _eightBytesAsList.length;
final int newSize = _currentSize + (newEnd - start);
if (newSize >= _buffer.length) {
_resize(newSize);
}
_buffer.setRange(_currentSize, newSize, data);
_currentSize = newSize;
}
void _resize([int? requiredLength]) {
final int doubleLength = _buffer.length * 2;
final int newLength = math.max(requiredLength ?? 0, doubleLength);
final Uint8List newBuffer = Uint8List(newLength);
newBuffer.setRange(0, _buffer.length, _buffer);
_buffer = newBuffer;
}
/// Write a Uint8 into the buffer.
void putUint8(int byte) {
assert(!_isDone);
_add(byte);
}
/// Write a Uint16 into the buffer.
void putUint16(int value, {Endian? endian}) {
assert(!_isDone);
_eightBytes.setUint16(0, value, endian ?? Endian.host);
_addAll(_eightBytesAsList, 0, 2);
}
/// Write a Uint32 into the buffer.
void putUint32(int value, {Endian? endian}) {
assert(!_isDone);
_eightBytes.setUint32(0, value, endian ?? Endian.host);
_addAll(_eightBytesAsList, 0, 4);
}
/// Write an Int32 into the buffer.
void putInt32(int value, {Endian? endian}) {
assert(!_isDone);
_eightBytes.setInt32(0, value, endian ?? Endian.host);
_addAll(_eightBytesAsList, 0, 4);
}
/// Write an Int64 into the buffer.
void putInt64(int value, {Endian? endian}) {
assert(!_isDone);
_eightBytes.setInt64(0, value, endian ?? Endian.host);
_addAll(_eightBytesAsList, 0, 8);
}
/// Write an Float64 into the buffer.
void putFloat64(double value, {Endian? endian}) {
assert(!_isDone);
_alignTo(8);
_eightBytes.setFloat64(0, value, endian ?? Endian.host);
_addAll(_eightBytesAsList);
}
/// Write all the values from a [Uint8List] into the buffer.
void putUint8List(Uint8List list) {
assert(!_isDone);
_append(list);
}
/// Write all the values from an [Int32List] into the buffer.
void putInt32List(Int32List list) {
assert(!_isDone);
_alignTo(4);
_append(list.buffer.asUint8List(list.offsetInBytes, 4 * list.length));
}
/// Write all the values from an [Int64List] into the buffer.
void putInt64List(Int64List list) {
assert(!_isDone);
_alignTo(8);
_append(list.buffer.asUint8List(list.offsetInBytes, 8 * list.length));
}
/// Write all the values from a [Float32List] into the buffer.
void putFloat32List(Float32List list) {
assert(!_isDone);
_alignTo(4);
_append(list.buffer.asUint8List(list.offsetInBytes, 4 * list.length));
}
/// Write all the values from a [Float64List] into the buffer.
void putFloat64List(Float64List list) {
assert(!_isDone);
_alignTo(8);
_append(list.buffer.asUint8List(list.offsetInBytes, 8 * list.length));
}
void _alignTo(int alignment) {
assert(!_isDone);
final int mod = _currentSize % alignment;
if (mod != 0) {
_addAll(_zeroBuffer, 0, alignment - mod);
}
}
/// Finalize and return the written [ByteData].
ByteData done() {
if (_isDone) {
throw StateError(
'done() must not be called more than once on the same $runtimeType.');
}
final ByteData result = _buffer.buffer.asByteData(0, _currentSize);
_buffer = Uint8List(0);
_isDone = true;
return result;
}
}
/// Read-only buffer for reading sequentially from a [ByteData] instance.
///
/// The byte order used is [Endian.host] throughout.
class ReadBuffer {
/// Creates a [ReadBuffer] for reading from the specified [data].
ReadBuffer(this.data);
/// The underlying data being read.
final ByteData data;
/// The position to read next.
int _position = 0;
/// Whether the buffer has data remaining to read.
bool get hasRemaining => _position < data.lengthInBytes;
/// Reads a Uint8 from the buffer.
int getUint8() {
return data.getUint8(_position++);
}
/// Reads a Uint16 from the buffer.
int getUint16({Endian? endian}) {
final int value = data.getUint16(_position, endian ?? Endian.host);
_position += 2;
return value;
}
/// Reads a Uint32 from the buffer.
int getUint32({Endian? endian}) {
final int value = data.getUint32(_position, endian ?? Endian.host);
_position += 4;
return value;
}
/// Reads an Int32 from the buffer.
int getInt32({Endian? endian}) {
final int value = data.getInt32(_position, endian ?? Endian.host);
_position += 4;
return value;
}
/// Reads an Int64 from the buffer.
int getInt64({Endian? endian}) {
final int value = data.getInt64(_position, endian ?? Endian.host);
_position += 8;
return value;
}
/// Reads a Float64 from the buffer.
double getFloat64({Endian? endian}) {
_alignTo(8);
final double value = data.getFloat64(_position, endian ?? Endian.host);
_position += 8;
return value;
}
/// Reads the given number of Uint8s from the buffer.
Uint8List getUint8List(int length) {
final Uint8List list =
data.buffer.asUint8List(data.offsetInBytes + _position, length);
_position += length;
return list;
}
/// Reads the given number of Int32s from the buffer.
Int32List getInt32List(int length) {
_alignTo(4);
final Int32List list =
data.buffer.asInt32List(data.offsetInBytes + _position, length);
_position += 4 * length;
return list;
}
/// Reads the given number of Int64s from the buffer.
Int64List getInt64List(int length) {
_alignTo(8);
final Int64List list =
data.buffer.asInt64List(data.offsetInBytes + _position, length);
_position += 8 * length;
return list;
}
/// Reads the given number of Float32s from the buffer
Float32List getFloat32List(int length) {
_alignTo(4);
final Float32List list =
data.buffer.asFloat32List(data.offsetInBytes + _position, length);
_position += 4 * length;
return list;
}
/// Reads the given number of Float64s from the buffer.
Float64List getFloat64List(int length) {
_alignTo(8);
final Float64List list =
data.buffer.asFloat64List(data.offsetInBytes + _position, length);
_position += 8 * length;
return list;
}
void _alignTo(int alignment) {
final int mod = _position % alignment;
if (mod != 0) {
_position += alignment - mod;
}
}
}
| packages/packages/standard_message_codec/lib/src/serialization.dart/0 | {
"file_path": "packages/packages/standard_message_codec/lib/src/serialization.dart",
"repo_id": "packages",
"token_count": 3041
} | 1,086 |
#include "ephemeral/Flutter-Generated.xcconfig"
| packages/packages/two_dimensional_scrollables/example/macos/Flutter/Flutter-Debug.xcconfig/0 | {
"file_path": "packages/packages/two_dimensional_scrollables/example/macos/Flutter/Flutter-Debug.xcconfig",
"repo_id": "packages",
"token_count": 19
} | 1,087 |
<?code-excerpt path-base="example"?>
# url_launcher
[](https://pub.dev/packages/url_launcher)
A Flutter plugin for launching a URL.
| | Android | iOS | Linux | macOS | Web | Windows |
|-------------|---------|-------|-------|--------|-----|-------------|
| **Support** | SDK 16+ | 12.0+ | Any | 10.14+ | Any | Windows 10+ |
## Usage
To use this plugin, add `url_launcher` as a [dependency in your pubspec.yaml file](https://flutter.dev/platform-plugins/).
### Example
<?code-excerpt "lib/basic.dart (basic-example)"?>
```dart
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
final Uri _url = Uri.parse('https://flutter.dev');
void main() => runApp(
const MaterialApp(
home: Material(
child: Center(
child: ElevatedButton(
onPressed: _launchUrl,
child: Text('Show Flutter homepage'),
),
),
),
),
);
Future<void> _launchUrl() async {
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}
```
See the example app for more complex examples.
## Configuration
### iOS
Add any URL schemes passed to `canLaunchUrl` as `LSApplicationQueriesSchemes`
entries in your Info.plist file, otherwise it will return false.
Example:
```xml
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sms</string>
<string>tel</string>
</array>
```
See [`-[UIApplication canOpenURL:]`](https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl) for more details.
### Android
Add any URL schemes passed to `canLaunchUrl` as `<queries>` entries in your
`AndroidManifest.xml`, otherwise it will return false in most cases starting
on Android 11 (API 30) or higher. Checking for
`supportsLaunchMode(LaunchMode.inAppBrowserView)` also requires
a `<queries>` entry to return anything but false. A `<queries>`
element must be added to your manifest as a child of the root element.
Example:
<?code-excerpt "android/app/src/main/AndroidManifest.xml (android-queries)" plaster="none"?>
```xml
<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
<!-- If your app checks for SMS support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent>
<!-- If your app checks for call support -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
<!-- If your application checks for inAppBrowserView launch mode support -->
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
```
See
[the Android documentation](https://developer.android.com/training/package-visibility/use-cases)
for examples of other queries.
### Web
Some web browsers may have limitations (e.g. a launch must be triggered by a
user action). Check
[package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform)
for more web-specific information.
## Supported URL schemes
The provided URL is passed directly to the host platform for handling. The
supported URL schemes therefore depend on the platform and installed apps.
Commonly used schemes include:
| Scheme | Example | Action |
|:---|:---|:---|
| `https:<URL>` | `https://flutter.dev` | Open `<URL>` in the default browser |
| `mailto:<email address>?subject=<subject>&body=<body>` | `mailto:[email protected]?subject=News&body=New%20plugin` | Create email to `<email address>` in the default email app |
| `tel:<phone number>` | `tel:+1-555-010-999` | Make a phone call to `<phone number>` using the default phone app |
| `sms:<phone number>` | `sms:5550101234` | Send an SMS message to `<phone number>` using the default messaging app |
| `file:<path>` | `file:/home` | Open file or folder using default app association, supported on desktop platforms |
More details can be found here for [iOS](https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html)
and [Android](https://developer.android.com/guide/components/intents-common.html)
URL schemes are only supported if there are apps installed on the device that can
support them. For example, iOS simulators don't have a default email or phone
apps installed, so can't open `tel:` or `mailto:` links.
### Checking supported schemes
If you need to know at runtime whether a scheme is guaranteed to work before
using it (for instance, to adjust your UI based on what is available), you can
check with [`canLaunchUrl`](https://pub.dev/documentation/url_launcher/latest/url_launcher/canLaunchUrl.html).
However, `canLaunchUrl` can return false even if `launchUrl` would work in
some circumstances (in web applications, on mobile without the necessary
configuration as described above, etc.), so in cases where you can provide
fallback behavior it is better to use `launchUrl` directly and handle failure.
For example, a UI button that would have sent feedback email using a `mailto` URL
might instead open a web-based feedback form using an `https` URL on failure,
rather than disabling the button if `canLaunchUrl` returns false for `mailto`.
### Encoding URLs
URLs must be properly encoded, especially when including spaces or other special
characters. In general this is handled automatically by the
[`Uri` class](https://api.dart.dev/dart-core/Uri-class.html).
**However**, for any scheme other than `http` or `https`, you should use the
`query` parameter and the `encodeQueryParameters` function shown below rather
than `Uri`'s `queryParameters` constructor argument for any query parameters,
due to [a bug](https://github.com/dart-lang/sdk/issues/43838) in the way `Uri`
encodes query parameters. Using `queryParameters` will result in spaces being
converted to `+` in many cases.
<?code-excerpt "lib/encoding.dart (encode-query-parameters)"?>
```dart
String? encodeQueryParameters(Map<String, String> params) {
return params.entries
.map((MapEntry<String, String> e) =>
'${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value)}')
.join('&');
}
// ···
final Uri emailLaunchUri = Uri(
scheme: 'mailto',
path: '[email protected]',
query: encodeQueryParameters(<String, String>{
'subject': 'Example Subject & Symbols are allowed!',
}),
);
launchUrl(emailLaunchUri);
```
Encoding for `sms` is slightly different:
<?code-excerpt "lib/encoding.dart (sms)"?>
```dart
final Uri smsLaunchUri = Uri(
scheme: 'sms',
path: '0118 999 881 999 119 7253',
queryParameters: <String, String>{
'body': Uri.encodeComponent('Example Subject & Symbols are allowed!'),
},
);
```
### URLs not handled by `Uri`
In rare cases, you may need to launch a URL that the host system considers
valid, but cannot be expressed by `Uri`. For those cases, alternate APIs using
strings are available by importing `url_launcher_string.dart`.
Using these APIs in any other cases is **strongly discouraged**, as providing
invalid URL strings was a very common source of errors with this plugin's
original APIs.
### File scheme handling
`file:` scheme can be used on desktop platforms: Windows, macOS, and Linux.
We recommend checking first whether the directory or file exists before calling `launchUrl`.
Example:
<?code-excerpt "lib/files.dart (file)"?>
```dart
final String filePath = testFile.absolute.path;
final Uri uri = Uri.file(filePath);
if (!File(uri.toFilePath()).existsSync()) {
throw Exception('$uri does not exist!');
}
if (!await launchUrl(uri)) {
throw Exception('Could not launch $uri');
}
```
#### macOS file access configuration
If you need to access files outside of your application's sandbox, you will need to have the necessary
[entitlements](https://docs.flutter.dev/desktop#entitlements-and-the-app-sandbox).
## Browser vs in-app handling
On some platforms, web URLs can be launched either in an in-app web view, or
in the default browser. The default behavior depends on the platform (see
[`launchUrl`](https://pub.dev/documentation/url_launcher/latest/url_launcher/launchUrl.html)
for details), but a specific mode can be used on supported platforms by
passing a `LaunchMode`.
Platforms that do no support a requested `LaunchMode` will
automatically fall back to a supported mode (usually `platformDefault`). If
your application needs to avoid that fallback behavior, however, you can check
if the current platform supports a given mode with `supportsLaunchMode` before
calling `launchUrl`.
| packages/packages/url_launcher/url_launcher/README.md/0 | {
"file_path": "packages/packages/url_launcher/url_launcher/README.md",
"repo_id": "packages",
"token_count": 2687
} | 1,088 |
// Copyright 2013 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.
// Run this example with: flutter run -t lib/basic.dart -d emulator
// This file is used to extract code samples for the README.md file.
// Run update-excerpts if you modify this file.
// #docregion basic-example
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
final Uri _url = Uri.parse('https://flutter.dev');
void main() => runApp(
const MaterialApp(
home: Material(
child: Center(
child: ElevatedButton(
onPressed: _launchUrl,
child: Text('Show Flutter homepage'),
),
),
),
),
);
Future<void> _launchUrl() async {
if (!await launchUrl(_url)) {
throw Exception('Could not launch $_url');
}
}
// #enddocregion basic-example
| packages/packages/url_launcher/url_launcher/example/lib/basic.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher/example/lib/basic.dart",
"repo_id": "packages",
"token_count": 358
} | 1,089 |
// Copyright 2013 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:url_launcher_platform_interface/url_launcher_platform_interface.dart';
import 'types.dart';
/// Converts an (app-facing) [WebViewConfiguration] to a (platform interface)
/// [InAppWebViewConfiguration].
InAppWebViewConfiguration convertConfiguration(WebViewConfiguration config) {
return InAppWebViewConfiguration(
enableJavaScript: config.enableJavaScript,
enableDomStorage: config.enableDomStorage,
headers: config.headers,
);
}
/// Converts an (app-facing) [LaunchMode] to a (platform interface)
/// [PreferredLaunchMode].
PreferredLaunchMode convertLaunchMode(LaunchMode mode) {
switch (mode) {
case LaunchMode.platformDefault:
return PreferredLaunchMode.platformDefault;
case LaunchMode.inAppBrowserView:
return PreferredLaunchMode.inAppBrowserView;
case LaunchMode.inAppWebView:
return PreferredLaunchMode.inAppWebView;
case LaunchMode.externalApplication:
return PreferredLaunchMode.externalApplication;
case LaunchMode.externalNonBrowserApplication:
return PreferredLaunchMode.externalNonBrowserApplication;
}
}
| packages/packages/url_launcher/url_launcher/lib/src/type_conversion.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher/lib/src/type_conversion.dart",
"repo_id": "packages",
"token_count": 367
} | 1,090 |
// Copyright 2013 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:pigeon/pigeon.dart';
@ConfigurePigeon(PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
javaOptions: JavaOptions(package: 'io.flutter.plugins.urllauncher'),
javaOut: 'android/src/main/java/io/flutter/plugins/urllauncher/Messages.java',
copyrightHeader: 'pigeons/copyright.txt',
))
/// Configuration options for an in-app WebView.
class WebViewOptions {
const WebViewOptions({
required this.enableJavaScript,
required this.enableDomStorage,
this.headers = const <String, String>{},
});
final bool enableJavaScript;
final bool enableDomStorage;
// TODO(stuartmorgan): Declare these as non-nullable generics once
// https://github.com/flutter/flutter/issues/97848 is fixed. In practice,
// the values will never be null, and the native implementation assumes that.
final Map<String?, String?> headers;
}
/// Configuration options for in-app browser views.
class BrowserOptions {
BrowserOptions({required this.showTitle});
/// Whether or not to show the webpage title.
final bool showTitle;
}
@HostApi()
abstract class UrlLauncherApi {
/// Returns true if the URL can definitely be launched.
bool canLaunchUrl(String url);
/// Opens the URL externally, returning true if successful.
bool launchUrl(String url, Map<String, String> headers);
/// Opens the URL in an in-app Custom Tab or WebView, returning true if it
/// opens successfully.
bool openUrlInApp(
String url,
bool allowCustomTab,
WebViewOptions webViewOptions,
BrowserOptions browserOptions,
);
bool supportsCustomTabs();
/// Closes the view opened by [openUrlInSafariViewController].
void closeWebView();
}
| packages/packages/url_launcher/url_launcher_android/pigeons/messages.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_android/pigeons/messages.dart",
"repo_id": "packages",
"token_count": 554
} | 1,091 |
// Copyright 2013 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 Flutter
import SafariServices
typealias OpenInSafariCompletionHandler = (Result<InAppLoadResult, Error>) -> Void
/// A session responsible for launching a URL in Safari and handling its events.
final class URLLaunchSession: NSObject, SFSafariViewControllerDelegate {
private let completion: OpenInSafariCompletionHandler
private let url: URL
/// The Safari view controller used for displaying the URL.
let safariViewController: SFSafariViewController
// A closure to be executed after the Safari view controller finishes.
var didFinish: (() -> Void)?
/// Initializes a new URLLaunchSession with the provided URL and completion handler.
///
/// - Parameters:
/// - url: The URL to be opened in Safari.
/// - completion: The completion handler to be called after attempting to open the URL.
init(url: URL, completion: @escaping OpenInSafariCompletionHandler) {
self.url = url
self.completion = completion
self.safariViewController = SFSafariViewController(url: url)
super.init()
self.safariViewController.delegate = self
}
/// Called when the Safari view controller completes the initial load.
///
/// - Parameters:
/// - controller: The Safari view controller.
/// - didLoadSuccessfully: Indicates if the initial load was successful.
func safariViewController(
_ controller: SFSafariViewController,
didCompleteInitialLoad didLoadSuccessfully: Bool
) {
if didLoadSuccessfully {
completion(.success(.success))
} else {
completion(.success(.failedToLoad))
}
}
/// Called when the user finishes using the Safari view controller.
///
/// - Parameter controller: The Safari view controller.
func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
controller.dismiss(animated: true, completion: nil)
didFinish?()
}
/// Closes the Safari view controller.
func close() {
safariViewControllerDidFinish(safariViewController)
}
}
| packages/packages/url_launcher/url_launcher_ios/ios/Classes/URLLaunchSession.swift/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_ios/ios/Classes/URLLaunchSession.swift",
"repo_id": "packages",
"token_count": 610
} | 1,092 |
// Copyright 2013 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 'dart:async';
import 'package:flutter/services.dart';
import 'package:url_launcher_platform_interface/link.dart';
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
const MethodChannel _channel =
MethodChannel('plugins.flutter.io/url_launcher_linux');
/// An implementation of [UrlLauncherPlatform] for Linux.
class UrlLauncherLinux extends UrlLauncherPlatform {
/// Registers this class as the default instance of [UrlLauncherPlatform].
static void registerWith() {
UrlLauncherPlatform.instance = UrlLauncherLinux();
}
@override
final LinkDelegate? linkDelegate = null;
@override
Future<bool> canLaunch(String url) async {
return (await _channel.invokeMethod<bool>('canLaunch', url)) ?? false;
}
@override
Future<bool> launch(
String url, {
required bool useSafariVC,
required bool useWebView,
required bool enableJavaScript,
required bool enableDomStorage,
required bool universalLinksOnly,
required Map<String, String> headers,
String? webOnlyWindowName,
}) {
// None of the options are supported, so they don't need to be converted to
// LaunchOptions.
return launchUrl(url, const LaunchOptions());
}
@override
Future<bool> launchUrl(String url, LaunchOptions options) async {
return (await _channel.invokeMethod<bool>('launch', url)) ?? false;
}
@override
Future<bool> supportsMode(PreferredLaunchMode mode) async {
return mode == PreferredLaunchMode.platformDefault ||
mode == PreferredLaunchMode.externalApplication;
}
@override
Future<bool> supportsCloseForMode(PreferredLaunchMode mode) async {
// No supported mode is closeable.
return false;
}
}
| packages/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart",
"repo_id": "packages",
"token_count": 581
} | 1,093 |
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'url_launcher_macos'
s.version = '0.0.1'
s.summary = 'Flutter macos plugin for launching a URL.'
s.description = <<-DESC
A macOS implementation of the url_launcher plugin.
DESC
s.homepage = 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos'
s.license = { :type => 'BSD', :file => '../LICENSE' }
s.author = { 'Flutter Team' => '[email protected]' }
s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos' }
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.14'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
end
| packages/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec",
"repo_id": "packages",
"token_count": 427
} | 1,094 |
// Copyright 2013 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_test/flutter_test.dart';
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
void main() {
test('LaunchOptions have default InAppBrowserConfiguration when not passed',
() {
expect(
const LaunchOptions().browserConfiguration,
const InAppBrowserConfiguration(),
);
});
test('passing non-default InAppBrowserConfiguration to LaunchOptions works',
() {
const InAppBrowserConfiguration browserConfiguration =
InAppBrowserConfiguration(showTitle: true);
const LaunchOptions launchOptions = LaunchOptions(
browserConfiguration: browserConfiguration,
);
expect(launchOptions.browserConfiguration, browserConfiguration);
});
}
| packages/packages/url_launcher/url_launcher_platform_interface/test/launch_options_test.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_platform_interface/test/launch_options_test.dart",
"repo_id": "packages",
"token_count": 261
} | 1,095 |
// Copyright 2013 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 'dart:async';
import 'dart:ui_web' as ui_web;
import 'package:flutter/foundation.dart' show kDebugMode, visibleForTesting;
import 'package:flutter_web_plugins/flutter_web_plugins.dart' show Registrar;
import 'package:url_launcher_platform_interface/link.dart';
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
import 'package:web/web.dart' as html;
import 'src/link.dart';
const Set<String> _safariTargetTopSchemes = <String>{
'mailto',
'tel',
'sms',
};
String? _getUrlScheme(String url) => Uri.tryParse(url)?.scheme;
bool _isSafariTargetTopScheme(String? scheme) =>
_safariTargetTopSchemes.contains(scheme);
// The set of schemes that are explicitly disallowed by the plugin.
const Set<String> _disallowedSchemes = <String>{
'javascript',
};
bool _isDisallowedScheme(String? scheme) => _disallowedSchemes.contains(scheme);
bool _navigatorIsSafari(html.Navigator navigator) =>
navigator.userAgent.contains('Safari') &&
!navigator.userAgent.contains('Chrome');
/// The web implementation of [UrlLauncherPlatform].
///
/// This class implements the `package:url_launcher` functionality for the web.
class UrlLauncherPlugin extends UrlLauncherPlatform {
/// A constructor that allows tests to override the window object used by the plugin.
UrlLauncherPlugin({@visibleForTesting html.Window? debugWindow})
: _window = debugWindow ?? html.window {
_isSafari = _navigatorIsSafari(_window.navigator);
}
final html.Window _window;
bool _isSafari = false;
// The set of schemes that can be handled by the plugin.
static final Set<String> _supportedSchemes = <String>{
'http',
'https',
}.union(_safariTargetTopSchemes);
/// Registers this class as the default instance of [UrlLauncherPlatform].
static void registerWith(Registrar registrar) {
UrlLauncherPlatform.instance = UrlLauncherPlugin();
ui_web.platformViewRegistry
.registerViewFactory(linkViewType, linkViewFactory, isVisible: false);
}
@override
LinkDelegate get linkDelegate {
return (LinkInfo linkInfo) => WebLinkDelegate(linkInfo);
}
/// Opens the given [url] in the specified [webOnlyWindowName].
///
/// Returns the newly created window.
@visibleForTesting
html.Window? openNewWindow(String url, {String? webOnlyWindowName}) {
final String? scheme = _getUrlScheme(url);
// Actively disallow opening some schemes, like javascript.
// See https://github.com/flutter/flutter/issues/136657
if (_isDisallowedScheme(scheme)) {
if (kDebugMode) {
print('Disallowed URL with scheme: $scheme');
}
return null;
}
// Some schemes need to be opened on the _top window context on Safari.
// See https://github.com/flutter/flutter/issues/51461
final String target = webOnlyWindowName ??
((_isSafari && _isSafariTargetTopScheme(scheme)) ? '_top' : '');
// ignore: unsafe_html
return _window.open(url, target, 'noopener,noreferrer');
}
@override
Future<bool> canLaunch(String url) {
return Future<bool>.value(_supportedSchemes.contains(_getUrlScheme(url)));
}
@override
Future<bool> launch(
String url, {
bool useSafariVC = false,
bool useWebView = false,
bool enableJavaScript = false,
bool enableDomStorage = false,
bool universalLinksOnly = false,
Map<String, String> headers = const <String, String>{},
String? webOnlyWindowName,
}) async {
return launchUrl(url, LaunchOptions(webOnlyWindowName: webOnlyWindowName));
}
@override
Future<bool> launchUrl(String url, LaunchOptions options) async {
final String? windowName = options.webOnlyWindowName;
return openNewWindow(url, webOnlyWindowName: windowName) != null;
}
@override
Future<bool> supportsMode(PreferredLaunchMode mode) async {
// Web doesn't allow any control over the destination beyond
// webOnlyWindowName, so don't claim support for any mode beyond default.
return mode == PreferredLaunchMode.platformDefault;
}
@override
Future<bool> supportsCloseForMode(PreferredLaunchMode mode) async {
// No supported mode is closeable.
return false;
}
}
| packages/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart",
"repo_id": "packages",
"token_count": 1430
} | 1,096 |
// Copyright 2013 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.
#include <flutter/method_call.h>
#include <flutter/method_result_functions.h>
#include <flutter/standard_method_codec.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <windows.h>
#include <memory>
#include <optional>
#include <string>
#include "messages.g.h"
#include "url_launcher_plugin.h"
namespace url_launcher_windows {
namespace test {
namespace {
using flutter::EncodableMap;
using flutter::EncodableValue;
using ::testing::DoAll;
using ::testing::Pointee;
using ::testing::Return;
using ::testing::SetArgPointee;
class MockSystemApis : public SystemApis {
public:
MOCK_METHOD(LSTATUS, RegCloseKey, (HKEY key), (override));
MOCK_METHOD(LSTATUS, RegQueryValueExW,
(HKEY key, LPCWSTR value_name, LPDWORD type, LPBYTE data,
LPDWORD data_size),
(override));
MOCK_METHOD(LSTATUS, RegOpenKeyExW,
(HKEY key, LPCWSTR sub_key, DWORD options, REGSAM desired,
PHKEY result),
(override));
MOCK_METHOD(HINSTANCE, ShellExecuteW,
(HWND hwnd, LPCWSTR operation, LPCWSTR file, LPCWSTR parameters,
LPCWSTR directory, int show_flags),
(override));
};
} // namespace
TEST(UrlLauncherPlugin, CanLaunchSuccessTrue) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return success values from the registery commands.
HKEY fake_key = reinterpret_cast<HKEY>(1);
EXPECT_CALL(*system, RegOpenKeyExW)
.WillOnce(DoAll(SetArgPointee<4>(fake_key), Return(ERROR_SUCCESS)));
EXPECT_CALL(*system, RegQueryValueExW).WillOnce(Return(ERROR_SUCCESS));
EXPECT_CALL(*system, RegCloseKey(fake_key)).WillOnce(Return(ERROR_SUCCESS));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.CanLaunchUrl("https://some.url.com");
ASSERT_FALSE(result.has_error());
EXPECT_TRUE(result.value());
}
TEST(UrlLauncherPlugin, CanLaunchQueryFailure) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return success values from the registery commands, except for the query,
// to simulate a scheme that is in the registry, but has no URL handler.
HKEY fake_key = reinterpret_cast<HKEY>(1);
EXPECT_CALL(*system, RegOpenKeyExW)
.WillOnce(DoAll(SetArgPointee<4>(fake_key), Return(ERROR_SUCCESS)));
EXPECT_CALL(*system, RegQueryValueExW).WillOnce(Return(ERROR_FILE_NOT_FOUND));
EXPECT_CALL(*system, RegCloseKey(fake_key)).WillOnce(Return(ERROR_SUCCESS));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.CanLaunchUrl("https://some.url.com");
ASSERT_FALSE(result.has_error());
EXPECT_FALSE(result.value());
}
TEST(UrlLauncherPlugin, CanLaunchHandlesOpenFailure) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return failure for opening.
EXPECT_CALL(*system, RegOpenKeyExW).WillOnce(Return(ERROR_BAD_PATHNAME));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.CanLaunchUrl("https://some.url.com");
ASSERT_FALSE(result.has_error());
EXPECT_FALSE(result.value());
}
TEST(UrlLauncherPlugin, LaunchReportsSuccess) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return a success value (>32) from launching.
EXPECT_CALL(*system, ShellExecuteW)
.WillOnce(Return(reinterpret_cast<HINSTANCE>(33)));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.LaunchUrl("https://some.url.com");
ASSERT_FALSE(result.has_error());
EXPECT_TRUE(result.value());
}
TEST(UrlLauncherPlugin, LaunchReportsFailure) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return error 31 from launching, indicating no handler.
EXPECT_CALL(*system, ShellExecuteW)
.WillOnce(Return(reinterpret_cast<HINSTANCE>(SE_ERR_NOASSOC)));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.LaunchUrl("https://some.url.com");
ASSERT_FALSE(result.has_error());
EXPECT_FALSE(result.value());
}
TEST(UrlLauncherPlugin, LaunchReportsError) {
std::unique_ptr<MockSystemApis> system = std::make_unique<MockSystemApis>();
// Return a failure value (<=32) from launching.
EXPECT_CALL(*system, ShellExecuteW)
.WillOnce(Return(reinterpret_cast<HINSTANCE>(32)));
UrlLauncherPlugin plugin(std::move(system));
ErrorOr<bool> result = plugin.LaunchUrl("https://some.url.com");
EXPECT_TRUE(result.has_error());
}
} // namespace test
} // namespace url_launcher_windows
| packages/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp/0 | {
"file_path": "packages/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp",
"repo_id": "packages",
"token_count": 1737
} | 1,097 |
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
| packages/packages/video_player/video_player/example/macos/Runner/Configs/Release.xcconfig/0 | {
"file_path": "packages/packages/video_player/video_player/example/macos/Runner/Configs/Release.xcconfig",
"repo_id": "packages",
"token_count": 32
} | 1,098 |
// Copyright 2013 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_test/flutter_test.dart';
import 'package:video_player/video_player.dart';
import 'package:video_player_platform_interface/video_player_platform_interface.dart';
import 'video_player_test.dart' show FakeVideoPlayerPlatform;
void main() {
// This test needs to run first and therefore needs to be the only test
// in this file.
test('plugin initialized', () async {
TestWidgetsFlutterBinding.ensureInitialized();
final FakeVideoPlayerPlatform fakeVideoPlayerPlatform =
FakeVideoPlayerPlatform();
VideoPlayerPlatform.instance = fakeVideoPlayerPlatform;
final VideoPlayerController controller = VideoPlayerController.networkUrl(
Uri.parse('https://127.0.0.1'),
);
await controller.initialize();
expect(fakeVideoPlayerPlatform.calls.first, 'init');
});
}
| packages/packages/video_player/video_player/test/video_player_initialization_test.dart/0 | {
"file_path": "packages/packages/video_player/video_player/test/video_player_initialization_test.dart",
"repo_id": "packages",
"token_count": 294
} | 1,099 |
// Copyright 2013 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.
package io.flutter.plugins.videoplayer;
import android.content.Context;
import android.os.Build;
import android.util.LongSparseArray;
import androidx.annotation.NonNull;
import io.flutter.FlutterInjector;
import io.flutter.Log;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
import io.flutter.plugins.videoplayer.Messages.AndroidVideoPlayerApi;
import io.flutter.plugins.videoplayer.Messages.CreateMessage;
import io.flutter.plugins.videoplayer.Messages.LoopingMessage;
import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage;
import io.flutter.plugins.videoplayer.Messages.PlaybackSpeedMessage;
import io.flutter.plugins.videoplayer.Messages.PositionMessage;
import io.flutter.plugins.videoplayer.Messages.TextureMessage;
import io.flutter.plugins.videoplayer.Messages.VolumeMessage;
import io.flutter.view.TextureRegistry;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
/** Android platform implementation of the VideoPlayerPlugin. */
public class VideoPlayerPlugin implements FlutterPlugin, AndroidVideoPlayerApi {
private static final String TAG = "VideoPlayerPlugin";
private final LongSparseArray<VideoPlayer> videoPlayers = new LongSparseArray<>();
private FlutterState flutterState;
private final VideoPlayerOptions options = new VideoPlayerOptions();
/** Register this with the v2 embedding for the plugin to respond to lifecycle callbacks. */
public VideoPlayerPlugin() {}
@SuppressWarnings("deprecation")
private VideoPlayerPlugin(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
this.flutterState =
new FlutterState(
registrar.context(),
registrar.messenger(),
registrar::lookupKeyForAsset,
registrar::lookupKeyForAsset,
registrar.textures());
flutterState.startListening(this, registrar.messenger());
}
/** Registers this with the stable v1 embedding. Will not respond to lifecycle events. */
@SuppressWarnings("deprecation")
public static void registerWith(
@NonNull io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
final VideoPlayerPlugin plugin = new VideoPlayerPlugin(registrar);
registrar.addViewDestroyListener(
view -> {
plugin.onDestroy();
return false; // We are not interested in assuming ownership of the NativeView.
});
}
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory());
} catch (KeyManagementException | NoSuchAlgorithmException e) {
Log.w(
TAG,
"Failed to enable TLSv1.1 and TLSv1.2 Protocols for API level 19 and below.\n"
+ "For more information about Socket Security, please consult the following link:\n"
+ "https://developer.android.com/reference/javax/net/ssl/SSLSocket",
e);
}
}
final FlutterInjector injector = FlutterInjector.instance();
this.flutterState =
new FlutterState(
binding.getApplicationContext(),
binding.getBinaryMessenger(),
injector.flutterLoader()::getLookupKeyForAsset,
injector.flutterLoader()::getLookupKeyForAsset,
binding.getTextureRegistry());
flutterState.startListening(this, binding.getBinaryMessenger());
}
@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
if (flutterState == null) {
Log.wtf(TAG, "Detached from the engine before registering to it.");
}
flutterState.stopListening(binding.getBinaryMessenger());
flutterState = null;
initialize();
}
private void disposeAllPlayers() {
for (int i = 0; i < videoPlayers.size(); i++) {
videoPlayers.valueAt(i).dispose();
}
videoPlayers.clear();
}
private void onDestroy() {
// The whole FlutterView is being destroyed. Here we release resources acquired for all
// instances
// of VideoPlayer. Once https://github.com/flutter/flutter/issues/19358 is resolved this may
// be replaced with just asserting that videoPlayers.isEmpty().
// https://github.com/flutter/flutter/issues/20989 tracks this.
disposeAllPlayers();
}
public void initialize() {
disposeAllPlayers();
}
public @NonNull TextureMessage create(@NonNull CreateMessage arg) {
TextureRegistry.SurfaceTextureEntry handle =
flutterState.textureRegistry.createSurfaceTexture();
EventChannel eventChannel =
new EventChannel(
flutterState.binaryMessenger, "flutter.io/videoPlayer/videoEvents" + handle.id());
VideoPlayer player;
if (arg.getAsset() != null) {
String assetLookupKey;
if (arg.getPackageName() != null) {
assetLookupKey =
flutterState.keyForAssetAndPackageName.get(arg.getAsset(), arg.getPackageName());
} else {
assetLookupKey = flutterState.keyForAsset.get(arg.getAsset());
}
player =
new VideoPlayer(
flutterState.applicationContext,
eventChannel,
handle,
"asset:///" + assetLookupKey,
null,
new HashMap<>(),
options);
} else {
Map<String, String> httpHeaders = arg.getHttpHeaders();
player =
new VideoPlayer(
flutterState.applicationContext,
eventChannel,
handle,
arg.getUri(),
arg.getFormatHint(),
httpHeaders,
options);
}
videoPlayers.put(handle.id(), player);
return new TextureMessage.Builder().setTextureId(handle.id()).build();
}
public void dispose(@NonNull TextureMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.dispose();
videoPlayers.remove(arg.getTextureId());
}
public void setLooping(@NonNull LoopingMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.setLooping(arg.getIsLooping());
}
public void setVolume(@NonNull VolumeMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.setVolume(arg.getVolume());
}
public void setPlaybackSpeed(@NonNull PlaybackSpeedMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.setPlaybackSpeed(arg.getSpeed());
}
public void play(@NonNull TextureMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.play();
}
public @NonNull PositionMessage position(@NonNull TextureMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
PositionMessage result =
new PositionMessage.Builder()
.setPosition(player.getPosition())
.setTextureId(arg.getTextureId())
.build();
player.sendBufferingUpdate();
return result;
}
public void seekTo(@NonNull PositionMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.seekTo(arg.getPosition().intValue());
}
public void pause(@NonNull TextureMessage arg) {
VideoPlayer player = videoPlayers.get(arg.getTextureId());
player.pause();
}
@Override
public void setMixWithOthers(@NonNull MixWithOthersMessage arg) {
options.mixWithOthers = arg.getMixWithOthers();
}
private interface KeyForAssetFn {
String get(String asset);
}
private interface KeyForAssetAndPackageName {
String get(String asset, String packageName);
}
private static final class FlutterState {
final Context applicationContext;
final BinaryMessenger binaryMessenger;
final KeyForAssetFn keyForAsset;
final KeyForAssetAndPackageName keyForAssetAndPackageName;
final TextureRegistry textureRegistry;
FlutterState(
Context applicationContext,
BinaryMessenger messenger,
KeyForAssetFn keyForAsset,
KeyForAssetAndPackageName keyForAssetAndPackageName,
TextureRegistry textureRegistry) {
this.applicationContext = applicationContext;
this.binaryMessenger = messenger;
this.keyForAsset = keyForAsset;
this.keyForAssetAndPackageName = keyForAssetAndPackageName;
this.textureRegistry = textureRegistry;
}
void startListening(VideoPlayerPlugin methodCallHandler, BinaryMessenger messenger) {
AndroidVideoPlayerApi.setup(messenger, methodCallHandler);
}
void stopListening(BinaryMessenger messenger) {
AndroidVideoPlayerApi.setup(messenger, null);
}
}
}
| packages/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java/0 | {
"file_path": "packages/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java",
"repo_id": "packages",
"token_count": 3215
} | 1,100 |
// Copyright 2013 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.
// Autogenerated from Pigeon (v9.2.5), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';
class TextureMessage {
TextureMessage({
required this.textureId,
});
int textureId;
Object encode() {
return <Object?>[
textureId,
];
}
static TextureMessage decode(Object result) {
result as List<Object?>;
return TextureMessage(
textureId: result[0]! as int,
);
}
}
class LoopingMessage {
LoopingMessage({
required this.textureId,
required this.isLooping,
});
int textureId;
bool isLooping;
Object encode() {
return <Object?>[
textureId,
isLooping,
];
}
static LoopingMessage decode(Object result) {
result as List<Object?>;
return LoopingMessage(
textureId: result[0]! as int,
isLooping: result[1]! as bool,
);
}
}
class VolumeMessage {
VolumeMessage({
required this.textureId,
required this.volume,
});
int textureId;
double volume;
Object encode() {
return <Object?>[
textureId,
volume,
];
}
static VolumeMessage decode(Object result) {
result as List<Object?>;
return VolumeMessage(
textureId: result[0]! as int,
volume: result[1]! as double,
);
}
}
class PlaybackSpeedMessage {
PlaybackSpeedMessage({
required this.textureId,
required this.speed,
});
int textureId;
double speed;
Object encode() {
return <Object?>[
textureId,
speed,
];
}
static PlaybackSpeedMessage decode(Object result) {
result as List<Object?>;
return PlaybackSpeedMessage(
textureId: result[0]! as int,
speed: result[1]! as double,
);
}
}
class PositionMessage {
PositionMessage({
required this.textureId,
required this.position,
});
int textureId;
int position;
Object encode() {
return <Object?>[
textureId,
position,
];
}
static PositionMessage decode(Object result) {
result as List<Object?>;
return PositionMessage(
textureId: result[0]! as int,
position: result[1]! as int,
);
}
}
class CreateMessage {
CreateMessage({
this.asset,
this.uri,
this.packageName,
this.formatHint,
required this.httpHeaders,
});
String? asset;
String? uri;
String? packageName;
String? formatHint;
Map<String?, String?> httpHeaders;
Object encode() {
return <Object?>[
asset,
uri,
packageName,
formatHint,
httpHeaders,
];
}
static CreateMessage decode(Object result) {
result as List<Object?>;
return CreateMessage(
asset: result[0] as String?,
uri: result[1] as String?,
packageName: result[2] as String?,
formatHint: result[3] as String?,
httpHeaders:
(result[4] as Map<Object?, Object?>?)!.cast<String?, String?>(),
);
}
}
class MixWithOthersMessage {
MixWithOthersMessage({
required this.mixWithOthers,
});
bool mixWithOthers;
Object encode() {
return <Object?>[
mixWithOthers,
];
}
static MixWithOthersMessage decode(Object result) {
result as List<Object?>;
return MixWithOthersMessage(
mixWithOthers: result[0]! as bool,
);
}
}
class _AndroidVideoPlayerApiCodec extends StandardMessageCodec {
const _AndroidVideoPlayerApiCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is CreateMessage) {
buffer.putUint8(128);
writeValue(buffer, value.encode());
} else if (value is LoopingMessage) {
buffer.putUint8(129);
writeValue(buffer, value.encode());
} else if (value is MixWithOthersMessage) {
buffer.putUint8(130);
writeValue(buffer, value.encode());
} else if (value is PlaybackSpeedMessage) {
buffer.putUint8(131);
writeValue(buffer, value.encode());
} else if (value is PositionMessage) {
buffer.putUint8(132);
writeValue(buffer, value.encode());
} else if (value is TextureMessage) {
buffer.putUint8(133);
writeValue(buffer, value.encode());
} else if (value is VolumeMessage) {
buffer.putUint8(134);
writeValue(buffer, value.encode());
} else {
super.writeValue(buffer, value);
}
}
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
case 128:
return CreateMessage.decode(readValue(buffer)!);
case 129:
return LoopingMessage.decode(readValue(buffer)!);
case 130:
return MixWithOthersMessage.decode(readValue(buffer)!);
case 131:
return PlaybackSpeedMessage.decode(readValue(buffer)!);
case 132:
return PositionMessage.decode(readValue(buffer)!);
case 133:
return TextureMessage.decode(readValue(buffer)!);
case 134:
return VolumeMessage.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
}
}
}
class AndroidVideoPlayerApi {
/// Constructor for [AndroidVideoPlayerApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
AndroidVideoPlayerApi({BinaryMessenger? binaryMessenger})
: _binaryMessenger = binaryMessenger;
final BinaryMessenger? _binaryMessenger;
static const MessageCodec<Object?> codec = _AndroidVideoPlayerApiCodec();
Future<void> initialize() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.initialize', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList = await channel.send(null) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<TextureMessage> create(CreateMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.create', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else if (replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (replyList[0] as TextureMessage?)!;
}
}
Future<void> dispose(TextureMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.dispose', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> setLooping(LoopingMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> setVolume(VolumeMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> setPlaybackSpeed(PlaybackSpeedMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> play(TextureMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.play', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<PositionMessage> position(TextureMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.position', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else if (replyList[0] == null) {
throw PlatformException(
code: 'null-error',
message: 'Host platform returned null value for non-null return value.',
);
} else {
return (replyList[0] as PositionMessage?)!;
}
}
Future<void> seekTo(PositionMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> pause(TextureMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.pause', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
Future<void> setMixWithOthers(MixWithOthersMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers', codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_msg]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}
}
| packages/packages/video_player/video_player_android/lib/src/messages.g.dart/0 | {
"file_path": "packages/packages/video_player/video_player_android/lib/src/messages.g.dart",
"repo_id": "packages",
"token_count": 5700
} | 1,101 |
// Copyright 2013 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:collection/collection.dart';
import 'server.dart';
export 'src/benchmark_result.dart';
/// Returns the average of the benchmark results in [results].
///
/// Each element in [results] is expected to have identical benchmark names and
/// metrics; otherwise, an [Exception] will be thrown.
BenchmarkResults computeAverage(List<BenchmarkResults> results) {
if (results.isEmpty) {
throw ArgumentError('Cannot take average of empty list.');
}
final BenchmarkResults totalSum = results.reduce(
(BenchmarkResults sum, BenchmarkResults next) => sum._sumWith(next),
);
final BenchmarkResults average = totalSum;
for (final String benchmark in totalSum.scores.keys) {
final List<BenchmarkScore> scoresForBenchmark = totalSum.scores[benchmark]!;
for (int i = 0; i < scoresForBenchmark.length; i++) {
final BenchmarkScore score = scoresForBenchmark[i];
final double averageValue = score.value / results.length;
average.scores[benchmark]![i] =
BenchmarkScore(metric: score.metric, value: averageValue);
}
}
return average;
}
/// Computes the delta for each matching metric in [test] and [baseline], and
/// returns a new [BenchmarkResults] object where each [BenchmarkScore] contains
/// a [delta] value.
BenchmarkResults computeDelta(
BenchmarkResults baseline,
BenchmarkResults test,
) {
final Map<String, List<BenchmarkScore>> delta =
<String, List<BenchmarkScore>>{};
for (final String benchmarkName in test.scores.keys) {
final List<BenchmarkScore> testScores = test.scores[benchmarkName]!;
final List<BenchmarkScore>? baselineScores = baseline.scores[benchmarkName];
delta[benchmarkName] = testScores.map<BenchmarkScore>(
(BenchmarkScore testScore) {
final BenchmarkScore? baselineScore = baselineScores?.firstWhereOrNull(
(BenchmarkScore s) => s.metric == testScore.metric);
return testScore._copyWith(
delta: baselineScore == null
? null
: (testScore.value - baselineScore.value).toDouble(),
);
},
).toList();
}
return BenchmarkResults(delta);
}
extension _AnalysisExtension on BenchmarkResults {
/// Sums this [BenchmarkResults] instance with [other] by adding the values
/// of each matching benchmark score.
///
/// Returns a [BenchmarkResults] object with the summed values.
///
/// When [throwExceptionOnMismatch] is true (default), the set of benchmark
/// names and metric names in [other] are expected to be identical to those in
/// [scores], or else an [Exception] will be thrown.
BenchmarkResults _sumWith(
BenchmarkResults other, {
bool throwExceptionOnMismatch = true,
}) {
final Map<String, List<BenchmarkScore>> sum =
<String, List<BenchmarkScore>>{};
for (final String benchmark in scores.keys) {
// Look up this benchmark in [other].
final List<BenchmarkScore>? matchingBenchmark = other.scores[benchmark];
if (matchingBenchmark == null) {
if (throwExceptionOnMismatch) {
throw Exception(
'Cannot sum benchmarks because [other] is missing an entry for '
'benchmark "$benchmark".',
);
}
continue;
}
final List<BenchmarkScore> scoresForBenchmark = scores[benchmark]!;
sum[benchmark] =
scoresForBenchmark.map<BenchmarkScore>((BenchmarkScore score) {
// Look up this score in the [matchingBenchmark] from [other].
final BenchmarkScore? matchingScore = matchingBenchmark
.firstWhereOrNull((BenchmarkScore s) => s.metric == score.metric);
if (matchingScore == null && throwExceptionOnMismatch) {
throw Exception(
'Cannot sum benchmarks because benchmark "$benchmark" is missing '
'a score for metric ${score.metric}.',
);
}
return score._copyWith(
value: matchingScore == null
? score.value
: score.value + matchingScore.value,
);
}).toList();
}
return BenchmarkResults(sum);
}
}
extension _CopyExtension on BenchmarkScore {
BenchmarkScore _copyWith({String? metric, num? value, num? delta}) =>
BenchmarkScore(
metric: metric ?? this.metric,
value: value ?? this.value,
delta: delta ?? this.delta,
);
}
| packages/packages/web_benchmarks/lib/analysis.dart/0 | {
"file_path": "packages/packages/web_benchmarks/lib/analysis.dart",
"repo_id": "packages",
"token_count": 1613
} | 1,102 |
// Copyright 2013 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 'dart:convert' show JsonEncoder;
import 'dart:io';
import 'package:test/test.dart';
import 'package:web_benchmarks/server.dart';
import 'package:web_benchmarks/src/common.dart';
Future<void> main() async {
test('Can run a web benchmark', () async {
await _runBenchmarks(
benchmarkNames: <String>['scroll', 'page', 'tap'],
entryPoint: 'lib/benchmarks/runner.dart',
);
}, timeout: Timeout.none);
test('Can run a web benchmark with an alternate initial page', () async {
await _runBenchmarks(
benchmarkNames: <String>['simple'],
entryPoint: 'lib/benchmarks/runner_simple.dart',
initialPage: 'index.html#about',
);
}, timeout: Timeout.none);
test(
'Can run a web benchmark with wasm',
() async {
await _runBenchmarks(
benchmarkNames: <String>['simple'],
entryPoint: 'lib/benchmarks/runner_simple.dart',
compilationOptions: const CompilationOptions(useWasm: true),
);
},
skip: true, // https://github.com/flutter/flutter/issues/142809
timeout: Timeout.none,
);
}
Future<void> _runBenchmarks({
required List<String> benchmarkNames,
required String entryPoint,
String initialPage = defaultInitialPage,
CompilationOptions compilationOptions = const CompilationOptions(),
}) async {
final BenchmarkResults taskResult = await serveWebBenchmark(
benchmarkAppDirectory: Directory('testing/test_app'),
entryPoint: entryPoint,
treeShakeIcons: false,
initialPage: initialPage,
compilationOptions: compilationOptions,
);
for (final String benchmarkName in benchmarkNames) {
for (final String metricName in <String>[
'preroll_frame',
'apply_frame',
'drawFrameDuration',
]) {
for (final String valueName in <String>[
'average',
'outlierAverage',
'outlierRatio',
'noise',
]) {
expect(
taskResult.scores[benchmarkName]!.where((BenchmarkScore score) =>
score.metric == '$metricName.$valueName'),
hasLength(1),
);
}
}
expect(
taskResult.scores[benchmarkName]!.where(
(BenchmarkScore score) => score.metric == 'totalUiFrame.average'),
hasLength(1),
);
}
expect(
const JsonEncoder.withIndent(' ').convert(taskResult.toJson()),
isA<String>(),
);
}
| packages/packages/web_benchmarks/testing/web_benchmarks_test.dart/0 | {
"file_path": "packages/packages/web_benchmarks/testing/web_benchmarks_test.dart",
"repo_id": "packages",
"token_count": 949
} | 1,103 |
// Copyright 2013 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.
// This test is run using `flutter drive` by the CI (see /script/tool/README.md
// in this repository for details on driving that tooling manually), but can
// also be run using `flutter test` directly during development.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart';
import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';
Future<void> main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final HttpServer server = await HttpServer.bind(InternetAddress.anyIPv4, 0);
unawaited(server.forEach((HttpRequest request) {
if (request.uri.path == '/hello.txt') {
request.response.writeln('Hello, world.');
} else if (request.uri.path == '/secondary.txt') {
request.response.writeln('How are you today?');
} else if (request.uri.path == '/headers') {
request.response.writeln('${request.headers}');
} else if (request.uri.path == '/favicon.ico') {
request.response.statusCode = HttpStatus.notFound;
} else if (request.uri.path == '/http-basic-authentication') {
final List<String>? authHeader =
request.headers[HttpHeaders.authorizationHeader];
if (authHeader != null) {
final String encodedCredential = authHeader.first.split(' ')[1];
final String credential =
String.fromCharCodes(base64Decode(encodedCredential));
if (credential == 'user:password') {
request.response.writeln('Authorized');
} else {
request.response.headers.add(
HttpHeaders.wwwAuthenticateHeader, 'Basic realm="Test realm"');
request.response.statusCode = HttpStatus.unauthorized;
}
} else {
request.response.headers
.add(HttpHeaders.wwwAuthenticateHeader, 'Basic realm="Test realm"');
request.response.statusCode = HttpStatus.unauthorized;
}
} else {
fail('unexpected request: ${request.method} ${request.uri}');
}
request.response.close();
}));
final String prefixUrl = 'http://${server.address.address}:${server.port}';
final String primaryUrl = '$prefixUrl/hello.txt';
final String secondaryUrl = '$prefixUrl/secondary.txt';
final String headersUrl = '$prefixUrl/headers';
final String basicAuthUrl = '$prefixUrl/http-basic-authentication';
testWidgets('loadRequest', (WidgetTester tester) async {
final Completer<void> pageFinished = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageFinished.complete()),
));
unawaited(controller.loadRequest(Uri.parse(primaryUrl)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageFinished.future;
final String? currentUrl = await controller.currentUrl();
expect(currentUrl, primaryUrl);
});
testWidgets('runJavaScriptReturningResult', (WidgetTester tester) async {
final Completer<void> pageFinished = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageFinished.complete()),
));
unawaited(controller.loadRequest(Uri.parse(primaryUrl)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageFinished.future;
await expectLater(
controller.runJavaScriptReturningResult('1 + 1'),
completion(2),
);
});
testWidgets('loadRequest with headers', (WidgetTester tester) async {
final Map<String, String> headers = <String, String>{
'test_header': 'flutter_test_header'
};
final StreamController<String> pageLoads = StreamController<String>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (String url) => pageLoads.add(url)),
));
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(headersUrl), headers: headers));
await pageLoads.stream.firstWhere((String url) => url == headersUrl);
final String content = await controller.runJavaScriptReturningResult(
'document.documentElement.innerText',
) as String;
expect(content.contains('flutter_test_header'), isTrue);
});
testWidgets('JavascriptChannel', (WidgetTester tester) async {
final Completer<void> pageFinished = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageFinished.complete()),
));
final Completer<String> channelCompleter = Completer<String>();
await controller.addJavaScriptChannel(
'Echo',
onMessageReceived: (JavaScriptMessage message) {
channelCompleter.complete(message.message);
},
);
await controller.loadHtmlString(
'data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+',
);
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageFinished.future;
await controller.runJavaScript('Echo.postMessage("hello");');
await expectLater(channelCompleter.future, completion('hello'));
});
testWidgets('resize webview', (WidgetTester tester) async {
final Completer<void> initialResizeCompleter = Completer<void>();
final Completer<void> buttonTapResizeCompleter = Completer<void>();
final Completer<void> onPageFinished = Completer<void>();
bool resizeButtonTapped = false;
await tester.pumpWidget(ResizableWebView(
onResize: () {
if (resizeButtonTapped) {
buttonTapResizeCompleter.complete();
} else {
initialResizeCompleter.complete();
}
},
onPageFinished: () => onPageFinished.complete(),
));
await onPageFinished.future;
// Wait for a potential call to resize after page is loaded.
await initialResizeCompleter.future.timeout(
const Duration(seconds: 3),
onTimeout: () => null,
);
resizeButtonTapped = true;
await tester.tap(find.byKey(const ValueKey<String>('resizeButton')));
await tester.pumpAndSettle();
await expectLater(buttonTapResizeCompleter.future, completes);
});
testWidgets('set custom userAgent', (WidgetTester tester) async {
final Completer<void> pageFinished = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageFinished.complete(),
)));
unawaited(controller.setUserAgent('Custom_User_Agent1'));
unawaited(controller.loadRequest(Uri.parse('about:blank')));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageFinished.future;
final String? customUserAgent = await controller.getUserAgent();
expect(customUserAgent, 'Custom_User_Agent1');
});
group('Video playback policy', () {
late String videoTestBase64;
setUpAll(() async {
final ByteData videoData =
await rootBundle.load('assets/sample_video.mp4');
final String base64VideoData =
base64Encode(Uint8List.view(videoData.buffer));
final String videoTest = '''
<!DOCTYPE html><html>
<head><title>Video auto play</title>
<script type="text/javascript">
function play() {
var video = document.getElementById("video");
video.play();
video.addEventListener('timeupdate', videoTimeUpdateHandler, false);
}
function videoTimeUpdateHandler(e) {
var video = document.getElementById("video");
VideoTestTime.postMessage(video.currentTime);
}
function isPaused() {
var video = document.getElementById("video");
return video.paused;
}
function isFullScreen() {
var video = document.getElementById("video");
return video.webkitDisplayingFullscreen;
}
</script>
</head>
<body onload="play();">
<video controls playsinline autoplay id="video">
<source src="data:video/mp4;charset=utf-8;base64,$base64VideoData">
</video>
</body>
</html>
''';
videoTestBase64 = base64Encode(const Utf8Encoder().convert(videoTest));
});
testWidgets('Auto media playback', (WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
late PlatformWebViewControllerCreationParams params;
if (defaultTargetPlatform == TargetPlatform.iOS) {
params = WebKitWebViewControllerCreationParams(
mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
);
} else {
params = const PlatformWebViewControllerCreationParams();
}
WebViewController controller =
WebViewController.fromPlatformCreationParams(params);
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageLoaded.complete()),
));
if (controller.platform is AndroidWebViewController) {
unawaited((controller.platform as AndroidWebViewController)
.setMediaPlaybackRequiresUserGesture(false));
}
await controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$videoTestBase64'),
);
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
bool isPaused =
await controller.runJavaScriptReturningResult('isPaused();') as bool;
expect(isPaused, false);
pageLoaded = Completer<void>();
controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageLoaded.complete()),
));
unawaited(controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$videoTestBase64'),
));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
isPaused =
await controller.runJavaScriptReturningResult('isPaused();') as bool;
expect(isPaused, true);
});
testWidgets('Video plays inline', (WidgetTester tester) async {
final Completer<void> pageLoaded = Completer<void>();
final Completer<void> videoPlaying = Completer<void>();
late PlatformWebViewControllerCreationParams params;
if (defaultTargetPlatform == TargetPlatform.iOS) {
params = WebKitWebViewControllerCreationParams(
mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
allowsInlineMediaPlayback: true,
);
} else {
params = const PlatformWebViewControllerCreationParams();
}
final WebViewController controller =
WebViewController.fromPlatformCreationParams(params);
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageLoaded.complete()),
));
unawaited(controller.addJavaScriptChannel(
'VideoTestTime',
onMessageReceived: (JavaScriptMessage message) {
final double currentTime = double.parse(message.message);
// Let it play for at least 1 second to make sure the related video's properties are set.
if (currentTime > 1 && !videoPlaying.isCompleted) {
videoPlaying.complete(null);
}
},
));
if (controller.platform is AndroidWebViewController) {
unawaited((controller.platform as AndroidWebViewController)
.setMediaPlaybackRequiresUserGesture(false));
}
await controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$videoTestBase64'),
);
await tester.pumpWidget(WebViewWidget(controller: controller));
await tester.pumpAndSettle();
await pageLoaded.future;
// Makes sure we get the correct event that indicates the video is actually playing.
await videoPlaying.future;
final bool fullScreen = await controller
.runJavaScriptReturningResult('isFullScreen();') as bool;
expect(fullScreen, false);
});
});
group('Audio playback policy', () {
late String audioTestBase64;
setUpAll(() async {
final ByteData audioData =
await rootBundle.load('assets/sample_audio.ogg');
final String base64AudioData =
base64Encode(Uint8List.view(audioData.buffer));
final String audioTest = '''
<!DOCTYPE html><html>
<head><title>Audio auto play</title>
<script type="text/javascript">
function play() {
var audio = document.getElementById("audio");
audio.play();
}
function isPaused() {
var audio = document.getElementById("audio");
return audio.paused;
}
</script>
</head>
<body onload="play();">
<audio controls id="audio">
<source src="data:audio/ogg;charset=utf-8;base64,$base64AudioData">
</audio>
</body>
</html>
''';
audioTestBase64 = base64Encode(const Utf8Encoder().convert(audioTest));
});
testWidgets('Auto media playback', (WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
late PlatformWebViewControllerCreationParams params;
if (defaultTargetPlatform == TargetPlatform.iOS) {
params = WebKitWebViewControllerCreationParams(
mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
);
} else {
params = const PlatformWebViewControllerCreationParams();
}
WebViewController controller =
WebViewController.fromPlatformCreationParams(params);
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageLoaded.complete()),
));
if (controller.platform is AndroidWebViewController) {
unawaited((controller.platform as AndroidWebViewController)
.setMediaPlaybackRequiresUserGesture(false));
}
await controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$audioTestBase64'),
);
await tester.pumpWidget(WebViewWidget(controller: controller));
await tester.pumpAndSettle();
await pageLoaded.future;
bool isPaused =
await controller.runJavaScriptReturningResult('isPaused();') as bool;
expect(isPaused, false);
pageLoaded = Completer<void>();
controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onPageFinished: (_) => pageLoaded.complete()),
));
unawaited(controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$audioTestBase64'),
));
await tester.pumpWidget(WebViewWidget(controller: controller));
await tester.pumpAndSettle();
await pageLoaded.future;
isPaused =
await controller.runJavaScriptReturningResult('isPaused();') as bool;
expect(isPaused, true);
});
});
testWidgets('getTitle', (WidgetTester tester) async {
const String getTitleTest = '''
<!DOCTYPE html><html>
<head><title>Some title</title>
</head>
<body>
</body>
</html>
''';
final String getTitleTestBase64 =
base64Encode(const Utf8Encoder().convert(getTitleTest));
final Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
)));
unawaited(controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,$getTitleTestBase64'),
));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
// On at least iOS, it does not appear to be guaranteed that the native
// code has the title when the page load completes. Execute some JavaScript
// before checking the title to ensure that the page has been fully parsed
// and processed.
await controller.runJavaScript('1;');
final String? title = await controller.getTitle();
expect(title, 'Some title');
});
group('Programmatic Scroll', () {
testWidgets('setAndGetScrollPosition', (WidgetTester tester) async {
const String scrollTestPage = '''
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 100%;
width: 100%;
}
#container{
width:5000px;
height:5000px;
}
</style>
</head>
<body>
<div id="container"/>
</body>
</html>
''';
final String scrollTestPageBase64 =
base64Encode(const Utf8Encoder().convert(scrollTestPage));
final Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
ScrollPositionChange? recordedPosition;
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
)));
unawaited(controller.setOnScrollPositionChange(
(ScrollPositionChange contentOffsetChange) {
recordedPosition = contentOffsetChange;
}));
unawaited(controller.loadRequest(Uri.parse(
'data:text/html;charset=utf-8;base64,$scrollTestPageBase64',
)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
await tester.pumpAndSettle(const Duration(seconds: 3));
Offset scrollPos = await controller.getScrollPosition();
// Check scrollTo()
const int X_SCROLL = 123;
const int Y_SCROLL = 321;
// Get the initial position; this ensures that scrollTo is actually
// changing something, but also gives the native view's scroll position
// time to settle.
expect(scrollPos.dx, isNot(X_SCROLL));
expect(scrollPos.dy, isNot(Y_SCROLL));
expect(recordedPosition?.x, isNot(X_SCROLL));
expect(recordedPosition?.y, isNot(Y_SCROLL));
await controller.scrollTo(X_SCROLL, Y_SCROLL);
scrollPos = await controller.getScrollPosition();
expect(scrollPos.dx, X_SCROLL);
expect(scrollPos.dy, Y_SCROLL);
expect(recordedPosition?.x, X_SCROLL);
expect(recordedPosition?.y, Y_SCROLL);
// Check scrollBy() (on top of scrollTo())
await controller.scrollBy(X_SCROLL, Y_SCROLL);
scrollPos = await controller.getScrollPosition();
expect(scrollPos.dx, X_SCROLL * 2);
expect(scrollPos.dy, Y_SCROLL * 2);
expect(recordedPosition?.x, X_SCROLL * 2);
expect(recordedPosition?.y, Y_SCROLL * 2);
});
});
group('NavigationDelegate', () {
const String blankPage = '<!DOCTYPE html><head></head><body></body></html>';
final String blankPageEncoded = 'data:text/html;charset=utf-8;base64,'
'${base64Encode(const Utf8Encoder().convert(blankPage))}';
testWidgets('can allow requests', (WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
onNavigationRequest: (NavigationRequest navigationRequest) {
return (navigationRequest.url.contains('youtube.com'))
? NavigationDecision.prevent
: NavigationDecision.navigate;
},
)));
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(blankPageEncoded)));
await pageLoaded.future; // Wait for initial page load.
pageLoaded = Completer<void>();
await controller.runJavaScript('location.href = "$secondaryUrl"');
await pageLoaded.future; // Wait for the next page load.
final String? currentUrl = await controller.currentUrl();
expect(currentUrl, secondaryUrl);
});
testWidgets('onWebResourceError', (WidgetTester tester) async {
final Completer<WebResourceError> errorCompleter =
Completer<WebResourceError>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(
NavigationDelegate(onWebResourceError: (WebResourceError error) {
errorCompleter.complete(error);
})));
unawaited(
controller.loadRequest(Uri.parse('https://www.notawebsite..com')));
await tester.pumpWidget(WebViewWidget(controller: controller));
final WebResourceError error = await errorCompleter.future;
expect(error, isNotNull);
});
testWidgets('onWebResourceError is not called with valid url',
(WidgetTester tester) async {
final Completer<WebResourceError> errorCompleter =
Completer<WebResourceError>();
final Completer<void> pageFinishCompleter = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageFinishCompleter.complete(),
onWebResourceError: (WebResourceError error) {
errorCompleter.complete(error);
},
)));
unawaited(controller.loadRequest(
Uri.parse('data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+'),
));
await tester.pumpWidget(WebViewWidget(controller: controller));
expect(errorCompleter.future, doesNotComplete);
await pageFinishCompleter.future;
});
testWidgets('can block requests', (WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
onNavigationRequest: (NavigationRequest navigationRequest) {
return (navigationRequest.url.contains('youtube.com'))
? NavigationDecision.prevent
: NavigationDecision.navigate;
})));
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(blankPageEncoded)));
await pageLoaded.future; // Wait for initial page load.
pageLoaded = Completer<void>();
await controller
.runJavaScript('location.href = "https://www.youtube.com/"');
// There should never be any second page load, since our new URL is
// blocked. Still wait for a potential page change for some time in order
// to give the test a chance to fail.
await pageLoaded.future
.timeout(const Duration(milliseconds: 500), onTimeout: () => '');
final String? currentUrl = await controller.currentUrl();
expect(currentUrl, isNot(contains('youtube.com')));
});
testWidgets('supports asynchronous decisions', (WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
onNavigationRequest: (NavigationRequest navigationRequest) async {
NavigationDecision decision = NavigationDecision.prevent;
decision = await Future<NavigationDecision>.delayed(
const Duration(milliseconds: 10),
() => NavigationDecision.navigate);
return decision;
})));
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(blankPageEncoded)));
await pageLoaded.future; // Wait for initial page load.
pageLoaded = Completer<void>();
await controller.runJavaScript('location.href = "$secondaryUrl"');
await pageLoaded.future; // Wait for second page to load.
final String? currentUrl = await controller.currentUrl();
expect(currentUrl, secondaryUrl);
});
testWidgets('can receive url changes', (WidgetTester tester) async {
final Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
)));
unawaited(controller.loadRequest(Uri.parse(blankPageEncoded)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
final Completer<String> urlChangeCompleter = Completer<String>();
await controller.setNavigationDelegate(NavigationDelegate(
onUrlChange: (UrlChange change) {
urlChangeCompleter.complete(change.url);
},
));
await controller.runJavaScript('location.href = "$primaryUrl"');
await expectLater(urlChangeCompleter.future, completion(primaryUrl));
});
testWidgets('can receive updates to history state',
(WidgetTester tester) async {
final Completer<void> pageLoaded = Completer<void>();
final NavigationDelegate navigationDelegate = NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
);
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(navigationDelegate));
unawaited(controller.loadRequest(Uri.parse(primaryUrl)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoaded.future;
final Completer<String> urlChangeCompleter = Completer<String>();
await controller.setNavigationDelegate(NavigationDelegate(
onUrlChange: (UrlChange change) {
urlChangeCompleter.complete(change.url);
},
));
await controller.runJavaScript(
'window.history.pushState({}, "", "secondary.txt");',
);
await expectLater(urlChangeCompleter.future, completion(secondaryUrl));
});
testWidgets('can receive HTTP basic auth requests',
(WidgetTester tester) async {
final Completer<void> authRequested = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(
controller.setNavigationDelegate(
NavigationDelegate(
onHttpAuthRequest: (HttpAuthRequest request) =>
authRequested.complete(),
),
),
);
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(basicAuthUrl)));
await expectLater(authRequested.future, completes);
});
testWidgets('can authenticate to HTTP basic auth requests',
(WidgetTester tester) async {
final WebViewController controller = WebViewController();
final Completer<void> pageFinished = Completer<void>();
unawaited(
controller.setNavigationDelegate(
NavigationDelegate(
onHttpAuthRequest: (HttpAuthRequest request) => request.onProceed(
const WebViewCredential(
user: 'user',
password: 'password',
),
),
onPageFinished: (_) => pageFinished.complete(),
onWebResourceError: (_) => fail('Authentication failed'),
),
),
);
await tester.pumpWidget(WebViewWidget(controller: controller));
unawaited(controller.loadRequest(Uri.parse(basicAuthUrl)));
await expectLater(pageFinished.future, completes);
});
});
testWidgets('target _blank opens in same window',
(WidgetTester tester) async {
final Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await controller.runJavaScript('window.open("$primaryUrl", "_blank")');
await pageLoaded.future;
final String? currentUrl = await controller.currentUrl();
expect(currentUrl, primaryUrl);
});
testWidgets(
'can open new window and go back',
(WidgetTester tester) async {
Completer<void> pageLoaded = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoaded.complete(),
)));
unawaited(controller.loadRequest(Uri.parse(primaryUrl)));
await tester.pumpWidget(WebViewWidget(controller: controller));
expect(controller.currentUrl(), completion(primaryUrl));
await pageLoaded.future;
pageLoaded = Completer<void>();
await controller.runJavaScript('window.open("$secondaryUrl")');
await pageLoaded.future;
pageLoaded = Completer<void>();
expect(controller.currentUrl(), completion(secondaryUrl));
expect(controller.canGoBack(), completion(true));
await controller.goBack();
await pageLoaded.future;
await expectLater(controller.currentUrl(), completion(primaryUrl));
},
);
testWidgets(
'clearLocalStorage',
(WidgetTester tester) async {
Completer<void> pageLoadCompleter = Completer<void>();
final WebViewController controller = WebViewController();
unawaited(controller.setJavaScriptMode(JavaScriptMode.unrestricted));
unawaited(controller.setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => pageLoadCompleter.complete(),
)));
unawaited(controller.loadRequest(Uri.parse(primaryUrl)));
await tester.pumpWidget(WebViewWidget(controller: controller));
await pageLoadCompleter.future;
pageLoadCompleter = Completer<void>();
await controller.runJavaScript('localStorage.setItem("myCat", "Tom");');
final String myCatItem = await controller.runJavaScriptReturningResult(
'localStorage.getItem("myCat");',
) as String;
expect(myCatItem, _webViewString('Tom'));
await controller.clearLocalStorage();
// Reload page to have changes take effect.
await controller.reload();
await pageLoadCompleter.future;
late final String? nullItem;
try {
nullItem = await controller.runJavaScriptReturningResult(
'localStorage.getItem("myCat");',
) as String;
} catch (exception) {
if (defaultTargetPlatform == TargetPlatform.iOS &&
exception is ArgumentError &&
(exception.message as String).contains(
'Result of JavaScript execution returned a `null` value.')) {
nullItem = '<null>';
}
}
expect(nullItem, _webViewNull());
},
);
}
// JavaScript `null` evaluate to different string values on Android and iOS.
// This utility method returns the string boolean value of the current platform.
String _webViewNull() {
if (defaultTargetPlatform == TargetPlatform.iOS) {
return '<null>';
}
return 'null';
}
// JavaScript String evaluate to different string values on Android and iOS.
// This utility method returns the string boolean value of the current platform.
String _webViewString(String value) {
if (defaultTargetPlatform == TargetPlatform.iOS) {
return value;
}
return '"$value"';
}
class ResizableWebView extends StatefulWidget {
const ResizableWebView({
super.key,
required this.onResize,
required this.onPageFinished,
});
final VoidCallback onResize;
final VoidCallback onPageFinished;
@override
State<StatefulWidget> createState() => ResizableWebViewState();
}
class ResizableWebViewState extends State<ResizableWebView> {
late final WebViewController controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(NavigationDelegate(
onPageFinished: (_) => widget.onPageFinished(),
))
..addJavaScriptChannel(
'Resize',
onMessageReceived: (_) {
widget.onResize();
},
)
..loadRequest(
Uri.parse(
'data:text/html;charset=utf-8;base64,${base64Encode(const Utf8Encoder().convert(resizePage))}',
),
);
double webViewWidth = 200;
double webViewHeight = 200;
static const String resizePage = '''
<!DOCTYPE html><html>
<head><title>Resize test</title>
<script type="text/javascript">
function onResize() {
Resize.postMessage("resize");
}
function onLoad() {
window.onresize = onResize;
}
</script>
</head>
<body onload="onLoad();" bgColor="blue">
</body>
</html>
''';
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.ltr,
child: Column(
children: <Widget>[
SizedBox(
width: webViewWidth,
height: webViewHeight,
child: WebViewWidget(controller: controller)),
TextButton(
key: const Key('resizeButton'),
onPressed: () {
setState(() {
webViewWidth += 100.0;
webViewHeight += 100.0;
});
},
child: const Text('ResizeButton'),
),
],
),
);
}
}
| packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart",
"repo_id": "packages",
"token_count": 13540
} | 1,104 |
// Copyright 2013 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/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
import 'webview_controller.dart';
/// Displays a native WebView as a Widget.
///
/// ## Platform-Specific Features
/// This class contains an underlying implementation provided by the current
/// platform. Once a platform implementation is imported, the examples below
/// can be followed to use features provided by a platform's implementation.
///
/// {@macro webview_flutter.WebViewWidget.fromPlatformCreationParams}
///
/// Below is an example of accessing the platform-specific implementation for
/// iOS and Android:
///
/// ```dart
/// final WebViewController controller = WebViewController();
///
/// final WebViewWidget webViewWidget = WebViewWidget(controller: controller);
///
/// if (WebViewPlatform.instance is WebKitWebViewPlatform) {
/// final WebKitWebViewWidget webKitWidget =
/// webViewWidget.platform as WebKitWebViewWidget;
/// } else if (WebViewPlatform.instance is AndroidWebViewPlatform) {
/// final AndroidWebViewWidget androidWidget =
/// webViewWidget.platform as AndroidWebViewWidget;
/// }
/// ```
class WebViewWidget extends StatelessWidget {
/// Constructs a [WebViewWidget].
///
/// See [WebViewWidget.fromPlatformCreationParams] for setting parameters for
/// a specific platform.
WebViewWidget({
Key? key,
required WebViewController controller,
TextDirection layoutDirection = TextDirection.ltr,
Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers =
const <Factory<OneSequenceGestureRecognizer>>{},
}) : this.fromPlatformCreationParams(
key: key,
params: PlatformWebViewWidgetCreationParams(
controller: controller.platform,
layoutDirection: layoutDirection,
gestureRecognizers: gestureRecognizers,
),
);
/// Constructs a [WebViewWidget] from creation params for a specific platform.
///
/// {@template webview_flutter.WebViewWidget.fromPlatformCreationParams}
/// Below is an example of setting platform-specific creation parameters for
/// iOS and Android:
///
/// ```dart
/// final WebViewController controller = WebViewController();
///
/// PlatformWebViewWidgetCreationParams params =
/// PlatformWebViewWidgetCreationParams(
/// controller: controller.platform,
/// layoutDirection: TextDirection.ltr,
/// gestureRecognizers: const <Factory<OneSequenceGestureRecognizer>>{},
/// );
///
/// if (WebViewPlatform.instance is WebKitWebViewPlatform) {
/// params = WebKitWebViewWidgetCreationParams
/// .fromPlatformWebViewWidgetCreationParams(
/// params,
/// );
/// } else if (WebViewPlatform.instance is AndroidWebViewPlatform) {
/// params = AndroidWebViewWidgetCreationParams
/// .fromPlatformWebViewWidgetCreationParams(
/// params,
/// );
/// }
///
/// final WebViewWidget webViewWidget =
/// WebViewWidget.fromPlatformCreationParams(
/// params: params,
/// );
/// ```
/// {@endtemplate}
WebViewWidget.fromPlatformCreationParams({
Key? key,
required PlatformWebViewWidgetCreationParams params,
}) : this.fromPlatform(key: key, platform: PlatformWebViewWidget(params));
/// Constructs a [WebViewWidget] from a specific platform implementation.
WebViewWidget.fromPlatform({super.key, required this.platform});
/// Implementation of [PlatformWebViewWidget] for the current platform.
final PlatformWebViewWidget platform;
/// The layout direction to use for the embedded WebView.
late final TextDirection layoutDirection = platform.params.layoutDirection;
/// Specifies which gestures should be consumed by the web view.
///
/// It is possible for other gesture recognizers to be competing with the web
/// view on pointer events, e.g. if the web view is inside a [ListView] the
/// [ListView] will want to handle vertical drags. The web view will claim
/// gestures that are recognized by any of the recognizers on this list.
///
/// When `gestureRecognizers` is empty (default), the web view will only
/// handle pointer events for gestures that were not claimed by any other
/// gesture recognizer.
late final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers =
platform.params.gestureRecognizers;
@override
Widget build(BuildContext context) {
return platform.build(context);
}
}
| packages/packages/webview_flutter/webview_flutter/lib/src/webview_widget.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter/lib/src/webview_widget.dart",
"repo_id": "packages",
"token_count": 1398
} | 1,105 |
// Copyright 2013 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.
package io.flutter.plugins.webviewflutter;
import android.webkit.GeolocationPermissions;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.GeolocationPermissionsCallbackFlutterApi;
/**
* Flutter API implementation for `GeolocationPermissionsCallback`.
*
* <p>This class may handle adding native instances that are attached to a Dart instance or passing
* arguments of callbacks methods to a Dart instance.
*/
public class GeolocationPermissionsCallbackFlutterApiImpl {
// To ease adding additional methods, this value is added prematurely.
@SuppressWarnings({"unused", "FieldCanBeLocal"})
private final BinaryMessenger binaryMessenger;
private final InstanceManager instanceManager;
private GeolocationPermissionsCallbackFlutterApi api;
/**
* Constructs a {@link GeolocationPermissionsCallbackFlutterApiImpl}.
*
* @param binaryMessenger used to communicate with Dart over asynchronous messages
* @param instanceManager maintains instances stored to communicate with attached Dart objects
*/
public GeolocationPermissionsCallbackFlutterApiImpl(
@NonNull BinaryMessenger binaryMessenger, @NonNull InstanceManager instanceManager) {
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
api = new GeolocationPermissionsCallbackFlutterApi(binaryMessenger);
}
/**
* Stores the `GeolocationPermissionsCallback` instance and notifies Dart to create and store a
* new `GeolocationPermissionsCallback` instance that is attached to this one. If `instance` has
* already been added, this method does nothing.
*/
public void create(
@NonNull GeolocationPermissions.Callback instance,
@NonNull GeolocationPermissionsCallbackFlutterApi.Reply<Void> callback) {
if (!instanceManager.containsInstance(instance)) {
api.create(instanceManager.addHostCreatedInstance(instance), callback);
}
}
/**
* Sets the Flutter API used to send messages to Dart.
*
* <p>This is only visible for testing.
*/
@VisibleForTesting
void setApi(@NonNull GeolocationPermissionsCallbackFlutterApi api) {
this.api = api;
}
}
| packages/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeolocationPermissionsCallbackFlutterApiImpl.java/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/GeolocationPermissionsCallbackFlutterApiImpl.java",
"repo_id": "packages",
"token_count": 694
} | 1,106 |
// Copyright 2013 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.
package io.flutter.plugins.webviewflutter;
import android.annotation.SuppressLint;
import android.os.Build;
import android.webkit.HttpAuthHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.webkit.WebResourceErrorCompat;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.WebViewClientFlutterApi;
import java.util.HashMap;
import java.util.Objects;
/**
* Flutter Api implementation for {@link WebViewClient}.
*
* <p>Passes arguments of callbacks methods from a {@link WebViewClient} to Dart.
*/
public class WebViewClientFlutterApiImpl extends WebViewClientFlutterApi {
// To ease adding additional methods, this value is added prematurely.
@SuppressWarnings({"unused", "FieldCanBeLocal"})
private final BinaryMessenger binaryMessenger;
private final InstanceManager instanceManager;
private final WebViewFlutterApiImpl webViewFlutterApi;
@RequiresApi(api = Build.VERSION_CODES.M)
static GeneratedAndroidWebView.WebResourceErrorData createWebResourceErrorData(
WebResourceError error) {
return new GeneratedAndroidWebView.WebResourceErrorData.Builder()
.setErrorCode((long) error.getErrorCode())
.setDescription(error.getDescription().toString())
.build();
}
@SuppressLint("RequiresFeature")
static GeneratedAndroidWebView.WebResourceErrorData createWebResourceErrorData(
WebResourceErrorCompat error) {
return new GeneratedAndroidWebView.WebResourceErrorData.Builder()
.setErrorCode((long) error.getErrorCode())
.setDescription(error.getDescription().toString())
.build();
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
static GeneratedAndroidWebView.WebResourceRequestData createWebResourceRequestData(
WebResourceRequest request) {
final GeneratedAndroidWebView.WebResourceRequestData.Builder requestData =
new GeneratedAndroidWebView.WebResourceRequestData.Builder()
.setUrl(request.getUrl().toString())
.setIsForMainFrame(request.isForMainFrame())
.setHasGesture(request.hasGesture())
.setMethod(request.getMethod())
.setRequestHeaders(
request.getRequestHeaders() != null
? request.getRequestHeaders()
: new HashMap<>());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
requestData.setIsRedirect(request.isRedirect());
}
return requestData.build();
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
static GeneratedAndroidWebView.WebResourceResponseData createWebResourceResponseData(
WebResourceResponse response) {
final GeneratedAndroidWebView.WebResourceResponseData.Builder responseData =
new GeneratedAndroidWebView.WebResourceResponseData.Builder()
.setStatusCode((long) response.getStatusCode());
return responseData.build();
}
/**
* Creates a Flutter api that sends messages to Dart.
*
* @param binaryMessenger handles sending messages to Dart
* @param instanceManager maintains instances stored to communicate with Dart objects
*/
public WebViewClientFlutterApiImpl(
@NonNull BinaryMessenger binaryMessenger, @NonNull InstanceManager instanceManager) {
super(binaryMessenger);
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
webViewFlutterApi = new WebViewFlutterApiImpl(binaryMessenger, instanceManager);
}
/** Passes arguments from {@link WebViewClient#onPageStarted} to Dart. */
public void onPageStarted(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull String urlArg,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
onPageStarted(getIdentifierForClient(webViewClient), webViewIdentifier, urlArg, callback);
}
/** Passes arguments from {@link WebViewClient#onPageFinished} to Dart. */
public void onPageFinished(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull String urlArg,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
onPageFinished(getIdentifierForClient(webViewClient), webViewIdentifier, urlArg, callback);
}
/** Passes arguments from {@link WebViewClient#onReceivedHttpError} to Dart. */
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onReceivedHttpError(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull WebResourceRequest request,
@NonNull WebResourceResponse response,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier = instanceManager.getIdentifierForStrongReference(webView);
onReceivedHttpError(
getIdentifierForClient(webViewClient),
webViewIdentifier,
createWebResourceRequestData(request),
createWebResourceResponseData(response),
callback);
}
/**
* Passes arguments from {@link WebViewClient#onReceivedError(WebView, WebResourceRequest,
* WebResourceError)} to Dart.
*/
@RequiresApi(api = Build.VERSION_CODES.M)
public void onReceivedRequestError(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull WebResourceRequest request,
@NonNull WebResourceError error,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
onReceivedRequestError(
getIdentifierForClient(webViewClient),
webViewIdentifier,
createWebResourceRequestData(request),
createWebResourceErrorData(error),
callback);
}
/**
* Passes arguments from {@link androidx.webkit.WebViewClientCompat#onReceivedError(WebView,
* WebResourceRequest, WebResourceError)} to Dart.
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onReceivedRequestError(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull WebResourceRequest request,
@NonNull WebResourceErrorCompat error,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
onReceivedRequestError(
getIdentifierForClient(webViewClient),
webViewIdentifier,
createWebResourceRequestData(request),
createWebResourceErrorData(error),
callback);
}
/**
* Passes arguments from {@link WebViewClient#onReceivedError(WebView, int, String, String)} to
* Dart.
*/
public void onReceivedError(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull Long errorCodeArg,
@NonNull String descriptionArg,
@NonNull String failingUrlArg,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
onReceivedError(
getIdentifierForClient(webViewClient),
webViewIdentifier,
errorCodeArg,
descriptionArg,
failingUrlArg,
callback);
}
/**
* Passes arguments from {@link WebViewClient#shouldOverrideUrlLoading(WebView,
* WebResourceRequest)} to Dart.
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void requestLoading(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull WebResourceRequest request,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
requestLoading(
getIdentifierForClient(webViewClient),
webViewIdentifier,
createWebResourceRequestData(request),
callback);
}
/**
* Passes arguments from {@link WebViewClient#shouldOverrideUrlLoading(WebView, String)} to Dart.
*/
public void urlLoading(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull String urlArg,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
urlLoading(getIdentifierForClient(webViewClient), webViewIdentifier, urlArg, callback);
}
/** Passes arguments from {@link WebViewClient#doUpdateVisitedHistory} to Dart. */
public void doUpdateVisitedHistory(
@NonNull WebViewClient webViewClient,
@NonNull WebView webView,
@NonNull String url,
boolean isReload,
@NonNull Reply<Void> callback) {
webViewFlutterApi.create(webView, reply -> {});
final Long webViewIdentifier =
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webView));
doUpdateVisitedHistory(
getIdentifierForClient(webViewClient), webViewIdentifier, url, isReload, callback);
}
/** Passes arguments from {@link WebViewClient#onReceivedHttpAuthRequest} to Dart. */
public void onReceivedHttpAuthRequest(
@NonNull WebViewClient webViewClient,
@NonNull WebView webview,
@NonNull HttpAuthHandler httpAuthHandler,
@NonNull String host,
@NonNull String realm,
@NonNull Reply<Void> callback) {
new HttpAuthHandlerFlutterApiImpl(binaryMessenger, instanceManager)
.create(httpAuthHandler, reply -> {});
onReceivedHttpAuthRequest(
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webViewClient)),
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(webview)),
Objects.requireNonNull(instanceManager.getIdentifierForStrongReference(httpAuthHandler)),
host,
realm,
callback);
}
private long getIdentifierForClient(WebViewClient webViewClient) {
final Long identifier = instanceManager.getIdentifierForStrongReference(webViewClient);
if (identifier == null) {
throw new IllegalStateException("Could not find identifier for WebViewClient.");
}
return identifier;
}
}
| packages/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java",
"repo_id": "packages",
"token_count": 3804
} | 1,107 |
// Copyright 2013 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 'android_webview.dart' as android_webview;
/// Handles constructing objects and calling static methods for the Android
/// WebView native library.
///
/// This class provides dependency injection for the implementations of the
/// platform interface classes. Improving the ease of unit testing and/or
/// overriding the underlying Android WebView classes.
///
/// By default each function calls the default constructor of the WebView class
/// it intends to return.
class AndroidWebViewProxy {
/// Constructs a [AndroidWebViewProxy].
const AndroidWebViewProxy({
this.createAndroidWebView = android_webview.WebView.new,
this.createAndroidWebChromeClient = android_webview.WebChromeClient.new,
this.createAndroidWebViewClient = android_webview.WebViewClient.new,
this.createFlutterAssetManager = android_webview.FlutterAssetManager.new,
this.createJavaScriptChannel = android_webview.JavaScriptChannel.new,
this.createDownloadListener = android_webview.DownloadListener.new,
});
/// Constructs a [android_webview.WebView].
final android_webview.WebView Function({
void Function(int left, int top, int oldLeft, int oldTop)? onScrollChanged,
}) createAndroidWebView;
/// Constructs a [android_webview.WebChromeClient].
final android_webview.WebChromeClient Function({
void Function(android_webview.WebView webView, int progress)?
onProgressChanged,
Future<List<String>> Function(
android_webview.WebView webView,
android_webview.FileChooserParams params,
)? onShowFileChooser,
void Function(
android_webview.WebChromeClient instance,
android_webview.PermissionRequest request,
)? onPermissionRequest,
Future<void> Function(String origin,
android_webview.GeolocationPermissionsCallback callback)?
onGeolocationPermissionsShowPrompt,
void Function(android_webview.WebChromeClient instance)?
onGeolocationPermissionsHidePrompt,
void Function(android_webview.WebChromeClient instance,
android_webview.ConsoleMessage message)?
onConsoleMessage,
void Function(
android_webview.WebChromeClient instance,
android_webview.View view,
android_webview.CustomViewCallback callback)?
onShowCustomView,
void Function(android_webview.WebChromeClient instance)? onHideCustomView,
Future<void> Function(String url, String message)? onJsAlert,
Future<bool> Function(String url, String message)? onJsConfirm,
Future<String> Function(String url, String message, String defaultValue)?
onJsPrompt,
}) createAndroidWebChromeClient;
/// Constructs a [android_webview.WebViewClient].
final android_webview.WebViewClient Function({
void Function(android_webview.WebView webView, String url)? onPageStarted,
void Function(android_webview.WebView webView, String url)? onPageFinished,
void Function(
android_webview.WebView webView,
android_webview.WebResourceRequest request,
android_webview.WebResourceResponse response,
)? onReceivedHttpError,
void Function(
android_webview.WebView webView,
android_webview.WebResourceRequest request,
android_webview.WebResourceError error,
)? onReceivedRequestError,
@Deprecated('Only called on Android version < 23.')
void Function(
android_webview.WebView webView,
int errorCode,
String description,
String failingUrl,
)? onReceivedError,
void Function(
android_webview.WebView webView,
android_webview.WebResourceRequest request,
)? requestLoading,
void Function(android_webview.WebView webView, String url)? urlLoading,
void Function(android_webview.WebView webView, String url, bool isReload)?
doUpdateVisitedHistory,
void Function(
android_webview.WebView webView,
android_webview.HttpAuthHandler handler,
String host,
String realm,
)? onReceivedHttpAuthRequest,
}) createAndroidWebViewClient;
/// Constructs a [android_webview.FlutterAssetManager].
final android_webview.FlutterAssetManager Function()
createFlutterAssetManager;
/// Constructs a [android_webview.JavaScriptChannel].
final android_webview.JavaScriptChannel Function(
String channelName, {
required void Function(String) postMessage,
}) createJavaScriptChannel;
/// Constructs a [android_webview.DownloadListener].
final android_webview.DownloadListener Function({
required void Function(
String url,
String userAgent,
String contentDisposition,
String mimetype,
int contentLength,
) onDownloadStart,
}) createDownloadListener;
/// Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application.
///
/// This flag can be enabled in order to facilitate debugging of web layouts
/// and JavaScript code running inside WebViews. Please refer to
/// [android_webview.WebView] documentation for the debugging guide. The
/// default is false.
///
/// See [android_webview.WebView].setWebContentsDebuggingEnabled.
Future<void> setWebContentsDebuggingEnabled(bool enabled) {
return android_webview.WebView.setWebContentsDebuggingEnabled(enabled);
}
}
| packages/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_android/lib/src/android_proxy.dart",
"repo_id": "packages",
"token_count": 1715
} | 1,108 |
// Copyright 2013 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:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/src/android_webview.g.dart',
dartTestOut: 'test/test_android_webview.g.dart',
dartOptions: DartOptions(copyrightHeader: <String>[
'Copyright 2013 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.',
]),
javaOut:
'android/src/main/java/io/flutter/plugins/webviewflutter/GeneratedAndroidWebView.java',
javaOptions: JavaOptions(
package: 'io.flutter.plugins.webviewflutter',
className: 'GeneratedAndroidWebView',
copyrightHeader: <String>[
'Copyright 2013 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.',
],
),
),
)
/// Host API for managing the native `InstanceManager`.
@HostApi(dartHostTestHandler: 'TestInstanceManagerHostApi')
abstract class InstanceManagerHostApi {
/// Clear the native `InstanceManager`.
///
/// This is typically only used after a hot restart.
void clear();
}
/// Mode of how to select files for a file chooser.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams.
enum FileChooserMode {
/// Open single file and requires that the file exists before allowing the
/// user to pick it.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN.
open,
/// Similar to [open] but allows multiple files to be selected.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_OPEN_MULTIPLE.
openMultiple,
/// Allows picking a nonexistent file and saving it.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams#MODE_SAVE.
save,
}
/// Indicates the type of message logged to the console.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel.
enum ConsoleMessageLevel {
/// Indicates a message is logged for debugging.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#DEBUG.
debug,
/// Indicates a message is provided as an error.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#ERROR.
error,
/// Indicates a message is provided as a basic log message.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#LOG.
log,
/// Indicates a message is provided as a tip.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#TIP.
tip,
/// Indicates a message is provided as a warning.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel#WARNING.
warning,
/// Indicates a message with an unknown level.
///
/// This does not represent an actual value provided by the platform and only
/// indicates a value was provided that isn't currently supported.
unknown,
}
class WebResourceRequestData {
WebResourceRequestData(
this.url,
this.isForMainFrame,
this.isRedirect,
this.hasGesture,
this.method,
this.requestHeaders,
);
String url;
bool isForMainFrame;
bool? isRedirect;
bool hasGesture;
String method;
Map<String?, String?> requestHeaders;
}
class WebResourceResponseData {
WebResourceResponseData(
this.statusCode,
);
int statusCode;
}
class WebResourceErrorData {
WebResourceErrorData(this.errorCode, this.description);
int errorCode;
String description;
}
class WebViewPoint {
WebViewPoint(this.x, this.y);
int x;
int y;
}
/// Represents a JavaScript console message from WebCore.
///
/// See https://developer.android.com/reference/android/webkit/ConsoleMessage
class ConsoleMessage {
late int lineNumber;
late String message;
late ConsoleMessageLevel level;
late String sourceId;
}
/// Handles methods calls to the native Java Object class.
///
/// Also handles calls to remove the reference to an instance with `dispose`.
///
/// See https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html.
@HostApi(dartHostTestHandler: 'TestJavaObjectHostApi')
abstract class JavaObjectHostApi {
void dispose(int identifier);
}
/// Handles callbacks methods for the native Java Object class.
///
/// See https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html.
@FlutterApi()
abstract class JavaObjectFlutterApi {
void dispose(int identifier);
}
/// Host API for `CookieManager`.
///
/// This class may handle instantiating and adding native object instances that
/// are attached to a Dart instance or handle method calls on the associated
/// native class or an instance of the class.
@HostApi(dartHostTestHandler: 'TestCookieManagerHostApi')
abstract class CookieManagerHostApi {
/// Handles attaching `CookieManager.instance` to a native instance.
void attachInstance(int instanceIdentifier);
/// Handles Dart method `CookieManager.setCookie`.
void setCookie(int identifier, String url, String value);
/// Handles Dart method `CookieManager.removeAllCookies`.
@async
bool removeAllCookies(int identifier);
/// Handles Dart method `CookieManager.setAcceptThirdPartyCookies`.
void setAcceptThirdPartyCookies(
int identifier,
int webViewIdentifier,
bool accept,
);
}
@HostApi(dartHostTestHandler: 'TestWebViewHostApi')
abstract class WebViewHostApi {
void create(int instanceId);
void loadData(
int instanceId,
String data,
String? mimeType,
String? encoding,
);
void loadDataWithBaseUrl(
int instanceId,
String? baseUrl,
String data,
String? mimeType,
String? encoding,
String? historyUrl,
);
void loadUrl(
int instanceId,
String url,
Map<String, String> headers,
);
void postUrl(
int instanceId,
String url,
Uint8List data,
);
String? getUrl(int instanceId);
bool canGoBack(int instanceId);
bool canGoForward(int instanceId);
void goBack(int instanceId);
void goForward(int instanceId);
void reload(int instanceId);
void clearCache(int instanceId, bool includeDiskFiles);
@async
String? evaluateJavascript(
int instanceId,
String javascriptString,
);
String? getTitle(int instanceId);
void scrollTo(int instanceId, int x, int y);
void scrollBy(int instanceId, int x, int y);
int getScrollX(int instanceId);
int getScrollY(int instanceId);
WebViewPoint getScrollPosition(int instanceId);
void setWebContentsDebuggingEnabled(bool enabled);
void setWebViewClient(int instanceId, int webViewClientInstanceId);
void addJavaScriptChannel(int instanceId, int javaScriptChannelInstanceId);
void removeJavaScriptChannel(int instanceId, int javaScriptChannelInstanceId);
void setDownloadListener(int instanceId, int? listenerInstanceId);
void setWebChromeClient(int instanceId, int? clientInstanceId);
void setBackgroundColor(int instanceId, int color);
}
/// Flutter API for `WebView`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/webkit/WebView.
@FlutterApi()
abstract class WebViewFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int identifier);
void onScrollChanged(
int webViewInstanceId,
int left,
int top,
int oldLeft,
int oldTop,
);
}
@HostApi(dartHostTestHandler: 'TestWebSettingsHostApi')
abstract class WebSettingsHostApi {
void create(int instanceId, int webViewInstanceId);
void setDomStorageEnabled(int instanceId, bool flag);
void setJavaScriptCanOpenWindowsAutomatically(int instanceId, bool flag);
void setSupportMultipleWindows(int instanceId, bool support);
void setJavaScriptEnabled(int instanceId, bool flag);
void setUserAgentString(int instanceId, String? userAgentString);
void setMediaPlaybackRequiresUserGesture(int instanceId, bool require);
void setSupportZoom(int instanceId, bool support);
void setLoadWithOverviewMode(int instanceId, bool overview);
void setUseWideViewPort(int instanceId, bool use);
void setDisplayZoomControls(int instanceId, bool enabled);
void setBuiltInZoomControls(int instanceId, bool enabled);
void setAllowFileAccess(int instanceId, bool enabled);
void setTextZoom(int instanceId, int textZoom);
String getUserAgentString(int instanceId);
}
@HostApi(dartHostTestHandler: 'TestJavaScriptChannelHostApi')
abstract class JavaScriptChannelHostApi {
void create(int instanceId, String channelName);
}
@FlutterApi()
abstract class JavaScriptChannelFlutterApi {
void postMessage(int instanceId, String message);
}
@HostApi(dartHostTestHandler: 'TestWebViewClientHostApi')
abstract class WebViewClientHostApi {
void create(int instanceId);
void setSynchronousReturnValueForShouldOverrideUrlLoading(
int instanceId,
bool value,
);
}
@FlutterApi()
abstract class WebViewClientFlutterApi {
void onPageStarted(int instanceId, int webViewInstanceId, String url);
void onPageFinished(int instanceId, int webViewInstanceId, String url);
void onReceivedHttpError(
int instanceId,
int webViewInstanceId,
WebResourceRequestData request,
WebResourceResponseData response,
);
void onReceivedRequestError(
int instanceId,
int webViewInstanceId,
WebResourceRequestData request,
WebResourceErrorData error,
);
void onReceivedError(
int instanceId,
int webViewInstanceId,
int errorCode,
String description,
String failingUrl,
);
void requestLoading(
int instanceId,
int webViewInstanceId,
WebResourceRequestData request,
);
void urlLoading(int instanceId, int webViewInstanceId, String url);
void doUpdateVisitedHistory(
int instanceId,
int webViewInstanceId,
String url,
bool isReload,
);
void onReceivedHttpAuthRequest(
int instanceId,
int webViewInstanceId,
int httpAuthHandlerInstanceId,
String host,
String realm,
);
}
@HostApi(dartHostTestHandler: 'TestDownloadListenerHostApi')
abstract class DownloadListenerHostApi {
void create(int instanceId);
}
@FlutterApi()
abstract class DownloadListenerFlutterApi {
void onDownloadStart(
int instanceId,
String url,
String userAgent,
String contentDisposition,
String mimetype,
int contentLength,
);
}
@HostApi(dartHostTestHandler: 'TestWebChromeClientHostApi')
abstract class WebChromeClientHostApi {
void create(int instanceId);
void setSynchronousReturnValueForOnShowFileChooser(
int instanceId,
bool value,
);
void setSynchronousReturnValueForOnConsoleMessage(
int instanceId,
bool value,
);
void setSynchronousReturnValueForOnJsAlert(
int instanceId,
bool value,
);
void setSynchronousReturnValueForOnJsConfirm(
int instanceId,
bool value,
);
void setSynchronousReturnValueForOnJsPrompt(
int instanceId,
bool value,
);
}
@HostApi(dartHostTestHandler: 'TestAssetManagerHostApi')
abstract class FlutterAssetManagerHostApi {
List<String> list(String path);
String getAssetFilePathByName(String name);
}
@FlutterApi()
abstract class WebChromeClientFlutterApi {
void onProgressChanged(int instanceId, int webViewInstanceId, int progress);
@async
List<String> onShowFileChooser(
int instanceId,
int webViewInstanceId,
int paramsInstanceId,
);
/// Callback to Dart function `WebChromeClient.onPermissionRequest`.
void onPermissionRequest(int instanceId, int requestInstanceId);
/// Callback to Dart function `WebChromeClient.onShowCustomView`.
void onShowCustomView(
int instanceId,
int viewIdentifier,
int callbackIdentifier,
);
/// Callback to Dart function `WebChromeClient.onHideCustomView`.
void onHideCustomView(int instanceId);
/// Callback to Dart function `WebChromeClient.onGeolocationPermissionsShowPrompt`.
void onGeolocationPermissionsShowPrompt(
int instanceId,
int paramsInstanceId,
String origin,
);
/// Callback to Dart function `WebChromeClient.onGeolocationPermissionsHidePrompt`.
void onGeolocationPermissionsHidePrompt(int identifier);
/// Callback to Dart function `WebChromeClient.onConsoleMessage`.
void onConsoleMessage(int instanceId, ConsoleMessage message);
@async
void onJsAlert(int instanceId, String url, String message);
@async
bool onJsConfirm(int instanceId, String url, String message);
@async
String onJsPrompt(
int instanceId, String url, String message, String defaultValue);
}
@HostApi(dartHostTestHandler: 'TestWebStorageHostApi')
abstract class WebStorageHostApi {
void create(int instanceId);
void deleteAllData(int instanceId);
}
/// Handles callbacks methods for the native Java FileChooserParams class.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.FileChooserParams.
@FlutterApi()
abstract class FileChooserParamsFlutterApi {
void create(
int instanceId,
bool isCaptureEnabled,
List<String> acceptTypes,
FileChooserMode mode,
String? filenameHint,
);
}
/// Host API for `PermissionRequest`.
///
/// This class may handle instantiating and adding native object instances that
/// are attached to a Dart instance or handle method calls on the associated
/// native class or an instance of the class.
///
/// See https://developer.android.com/reference/android/webkit/PermissionRequest.
@HostApi(dartHostTestHandler: 'TestPermissionRequestHostApi')
abstract class PermissionRequestHostApi {
/// Handles Dart method `PermissionRequest.grant`.
void grant(int instanceId, List<String> resources);
/// Handles Dart method `PermissionRequest.deny`.
void deny(int instanceId);
}
/// Flutter API for `PermissionRequest`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/webkit/PermissionRequest.
@FlutterApi()
abstract class PermissionRequestFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int instanceId, List<String> resources);
}
/// Host API for `CustomViewCallback`.
///
/// This class may handle instantiating and adding native object instances that
/// are attached to a Dart instance or handle method calls on the associated
/// native class or an instance of the class.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback.
@HostApi(dartHostTestHandler: 'TestCustomViewCallbackHostApi')
abstract class CustomViewCallbackHostApi {
/// Handles Dart method `CustomViewCallback.onCustomViewHidden`.
void onCustomViewHidden(int identifier);
}
/// Flutter API for `CustomViewCallback`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/webkit/WebChromeClient.CustomViewCallback.
@FlutterApi()
abstract class CustomViewCallbackFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int identifier);
}
/// Flutter API for `View`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/view/View.
@FlutterApi()
abstract class ViewFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int identifier);
}
/// Host API for `GeolocationPermissionsCallback`.
///
/// This class may handle instantiating and adding native object instances that
/// are attached to a Dart instance or handle method calls on the associated
/// native class or an instance of the class.
///
/// See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback.
@HostApi(dartHostTestHandler: 'TestGeolocationPermissionsCallbackHostApi')
abstract class GeolocationPermissionsCallbackHostApi {
/// Handles Dart method `GeolocationPermissionsCallback.invoke`.
void invoke(int instanceId, String origin, bool allow, bool retain);
}
/// Flutter API for `GeolocationPermissionsCallback`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/webkit/GeolocationPermissions.Callback.
@FlutterApi()
abstract class GeolocationPermissionsCallbackFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int instanceId);
}
/// Host API for `HttpAuthHandler`.
///
/// This class may handle instantiating and adding native object instances that
/// are attached to a Dart instance or handle method calls on the associated
/// native class or an instance of the class.
///
/// See https://developer.android.com/reference/android/webkit/HttpAuthHandler.
@HostApi(dartHostTestHandler: 'TestHttpAuthHandlerHostApi')
abstract class HttpAuthHandlerHostApi {
/// Handles Dart method `HttpAuthHandler.useHttpAuthUsernamePassword`.
bool useHttpAuthUsernamePassword(int instanceId);
/// Handles Dart method `HttpAuthHandler.cancel`.
void cancel(int instanceId);
/// Handles Dart method `HttpAuthHandler.proceed`.
void proceed(int instanceId, String username, String password);
}
/// Flutter API for `HttpAuthHandler`.
///
/// This class may handle instantiating and adding Dart instances that are
/// attached to a native instance or receiving callback methods from an
/// overridden native class.
///
/// See https://developer.android.com/reference/android/webkit/HttpAuthHandler.
@FlutterApi()
abstract class HttpAuthHandlerFlutterApi {
/// Create a new Dart instance and add it to the `InstanceManager`.
void create(int instanceId);
}
| packages/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart",
"repo_id": "packages",
"token_count": 5519
} | 1,109 |
// Mocks generated by Mockito 5.4.4 from annotations
// in webview_flutter_android/test/legacy/webview_android_widget_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i5;
import 'dart:typed_data' as _i7;
import 'dart:ui' as _i3;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i6;
import 'package:webview_flutter_android/src/android_webview.dart' as _i2;
import 'package:webview_flutter_android/src/legacy/webview_android_widget.dart'
as _i8;
import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart'
as _i4;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeWebSettings_0 extends _i1.SmartFake implements _i2.WebSettings {
_FakeWebSettings_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeWebStorage_1 extends _i1.SmartFake implements _i2.WebStorage {
_FakeWebStorage_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeOffset_2 extends _i1.SmartFake implements _i3.Offset {
_FakeOffset_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeWebView_3 extends _i1.SmartFake implements _i2.WebView {
_FakeWebView_3(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeDownloadListener_4 extends _i1.SmartFake
implements _i2.DownloadListener {
_FakeDownloadListener_4(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeJavascriptChannelRegistry_5 extends _i1.SmartFake
implements _i4.JavascriptChannelRegistry {
_FakeJavascriptChannelRegistry_5(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeJavaScriptChannel_6 extends _i1.SmartFake
implements _i2.JavaScriptChannel {
_FakeJavaScriptChannel_6(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeWebChromeClient_7 extends _i1.SmartFake
implements _i2.WebChromeClient {
_FakeWebChromeClient_7(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
class _FakeWebViewClient_8 extends _i1.SmartFake implements _i2.WebViewClient {
_FakeWebViewClient_8(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
/// A class which mocks [FlutterAssetManager].
///
/// See the documentation for Mockito's code generation for more information.
class MockFlutterAssetManager extends _i1.Mock
implements _i2.FlutterAssetManager {
MockFlutterAssetManager() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<List<String?>> list(String? path) => (super.noSuchMethod(
Invocation.method(
#list,
[path],
),
returnValue: _i5.Future<List<String?>>.value(<String?>[]),
) as _i5.Future<List<String?>>);
@override
_i5.Future<String> getAssetFilePathByName(String? name) =>
(super.noSuchMethod(
Invocation.method(
#getAssetFilePathByName,
[name],
),
returnValue: _i5.Future<String>.value(_i6.dummyValue<String>(
this,
Invocation.method(
#getAssetFilePathByName,
[name],
),
)),
) as _i5.Future<String>);
}
/// A class which mocks [WebSettings].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebSettings extends _i1.Mock implements _i2.WebSettings {
MockWebSettings() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<void> setDomStorageEnabled(bool? flag) => (super.noSuchMethod(
Invocation.method(
#setDomStorageEnabled,
[flag],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setJavaScriptCanOpenWindowsAutomatically(bool? flag) =>
(super.noSuchMethod(
Invocation.method(
#setJavaScriptCanOpenWindowsAutomatically,
[flag],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSupportMultipleWindows(bool? support) =>
(super.noSuchMethod(
Invocation.method(
#setSupportMultipleWindows,
[support],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setJavaScriptEnabled(bool? flag) => (super.noSuchMethod(
Invocation.method(
#setJavaScriptEnabled,
[flag],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setUserAgentString(String? userAgentString) =>
(super.noSuchMethod(
Invocation.method(
#setUserAgentString,
[userAgentString],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setMediaPlaybackRequiresUserGesture(bool? require) =>
(super.noSuchMethod(
Invocation.method(
#setMediaPlaybackRequiresUserGesture,
[require],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSupportZoom(bool? support) => (super.noSuchMethod(
Invocation.method(
#setSupportZoom,
[support],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setLoadWithOverviewMode(bool? overview) =>
(super.noSuchMethod(
Invocation.method(
#setLoadWithOverviewMode,
[overview],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setUseWideViewPort(bool? use) => (super.noSuchMethod(
Invocation.method(
#setUseWideViewPort,
[use],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setDisplayZoomControls(bool? enabled) => (super.noSuchMethod(
Invocation.method(
#setDisplayZoomControls,
[enabled],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setBuiltInZoomControls(bool? enabled) => (super.noSuchMethod(
Invocation.method(
#setBuiltInZoomControls,
[enabled],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setAllowFileAccess(bool? enabled) => (super.noSuchMethod(
Invocation.method(
#setAllowFileAccess,
[enabled],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setTextZoom(int? textZoom) => (super.noSuchMethod(
Invocation.method(
#setTextZoom,
[textZoom],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<String> getUserAgentString() => (super.noSuchMethod(
Invocation.method(
#getUserAgentString,
[],
),
returnValue: _i5.Future<String>.value(_i6.dummyValue<String>(
this,
Invocation.method(
#getUserAgentString,
[],
),
)),
) as _i5.Future<String>);
@override
_i2.WebSettings copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeWebSettings_0(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.WebSettings);
}
/// A class which mocks [WebStorage].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebStorage extends _i1.Mock implements _i2.WebStorage {
MockWebStorage() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<void> deleteAllData() => (super.noSuchMethod(
Invocation.method(
#deleteAllData,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i2.WebStorage copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeWebStorage_1(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.WebStorage);
}
/// A class which mocks [WebView].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebView extends _i1.Mock implements _i2.WebView {
MockWebView() {
_i1.throwOnMissingStub(this);
}
@override
_i2.WebSettings get settings => (super.noSuchMethod(
Invocation.getter(#settings),
returnValue: _FakeWebSettings_0(
this,
Invocation.getter(#settings),
),
) as _i2.WebSettings);
@override
_i5.Future<void> loadData({
required String? data,
String? mimeType,
String? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
#loadData,
[],
{
#data: data,
#mimeType: mimeType,
#encoding: encoding,
},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> loadDataWithBaseUrl({
String? baseUrl,
required String? data,
String? mimeType,
String? encoding,
String? historyUrl,
}) =>
(super.noSuchMethod(
Invocation.method(
#loadDataWithBaseUrl,
[],
{
#baseUrl: baseUrl,
#data: data,
#mimeType: mimeType,
#encoding: encoding,
#historyUrl: historyUrl,
},
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> loadUrl(
String? url,
Map<String, String>? headers,
) =>
(super.noSuchMethod(
Invocation.method(
#loadUrl,
[
url,
headers,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> postUrl(
String? url,
_i7.Uint8List? data,
) =>
(super.noSuchMethod(
Invocation.method(
#postUrl,
[
url,
data,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<String?> getUrl() => (super.noSuchMethod(
Invocation.method(
#getUrl,
[],
),
returnValue: _i5.Future<String?>.value(),
) as _i5.Future<String?>);
@override
_i5.Future<bool> canGoBack() => (super.noSuchMethod(
Invocation.method(
#canGoBack,
[],
),
returnValue: _i5.Future<bool>.value(false),
) as _i5.Future<bool>);
@override
_i5.Future<bool> canGoForward() => (super.noSuchMethod(
Invocation.method(
#canGoForward,
[],
),
returnValue: _i5.Future<bool>.value(false),
) as _i5.Future<bool>);
@override
_i5.Future<void> goBack() => (super.noSuchMethod(
Invocation.method(
#goBack,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> goForward() => (super.noSuchMethod(
Invocation.method(
#goForward,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> reload() => (super.noSuchMethod(
Invocation.method(
#reload,
[],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> clearCache(bool? includeDiskFiles) => (super.noSuchMethod(
Invocation.method(
#clearCache,
[includeDiskFiles],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<String?> evaluateJavascript(String? javascriptString) =>
(super.noSuchMethod(
Invocation.method(
#evaluateJavascript,
[javascriptString],
),
returnValue: _i5.Future<String?>.value(),
) as _i5.Future<String?>);
@override
_i5.Future<String?> getTitle() => (super.noSuchMethod(
Invocation.method(
#getTitle,
[],
),
returnValue: _i5.Future<String?>.value(),
) as _i5.Future<String?>);
@override
_i5.Future<void> scrollTo(
int? x,
int? y,
) =>
(super.noSuchMethod(
Invocation.method(
#scrollTo,
[
x,
y,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> scrollBy(
int? x,
int? y,
) =>
(super.noSuchMethod(
Invocation.method(
#scrollBy,
[
x,
y,
],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<int> getScrollX() => (super.noSuchMethod(
Invocation.method(
#getScrollX,
[],
),
returnValue: _i5.Future<int>.value(0),
) as _i5.Future<int>);
@override
_i5.Future<int> getScrollY() => (super.noSuchMethod(
Invocation.method(
#getScrollY,
[],
),
returnValue: _i5.Future<int>.value(0),
) as _i5.Future<int>);
@override
_i5.Future<_i3.Offset> getScrollPosition() => (super.noSuchMethod(
Invocation.method(
#getScrollPosition,
[],
),
returnValue: _i5.Future<_i3.Offset>.value(_FakeOffset_2(
this,
Invocation.method(
#getScrollPosition,
[],
),
)),
) as _i5.Future<_i3.Offset>);
@override
_i5.Future<void> setWebViewClient(_i2.WebViewClient? webViewClient) =>
(super.noSuchMethod(
Invocation.method(
#setWebViewClient,
[webViewClient],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> addJavaScriptChannel(
_i2.JavaScriptChannel? javaScriptChannel) =>
(super.noSuchMethod(
Invocation.method(
#addJavaScriptChannel,
[javaScriptChannel],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> removeJavaScriptChannel(
_i2.JavaScriptChannel? javaScriptChannel) =>
(super.noSuchMethod(
Invocation.method(
#removeJavaScriptChannel,
[javaScriptChannel],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setDownloadListener(_i2.DownloadListener? listener) =>
(super.noSuchMethod(
Invocation.method(
#setDownloadListener,
[listener],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setWebChromeClient(_i2.WebChromeClient? client) =>
(super.noSuchMethod(
Invocation.method(
#setWebChromeClient,
[client],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setBackgroundColor(_i3.Color? color) => (super.noSuchMethod(
Invocation.method(
#setBackgroundColor,
[color],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i2.WebView copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeWebView_3(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.WebView);
}
/// A class which mocks [WebResourceRequest].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebResourceRequest extends _i1.Mock
implements _i2.WebResourceRequest {
MockWebResourceRequest() {
_i1.throwOnMissingStub(this);
}
@override
String get url => (super.noSuchMethod(
Invocation.getter(#url),
returnValue: _i6.dummyValue<String>(
this,
Invocation.getter(#url),
),
) as String);
@override
bool get isForMainFrame => (super.noSuchMethod(
Invocation.getter(#isForMainFrame),
returnValue: false,
) as bool);
@override
bool get hasGesture => (super.noSuchMethod(
Invocation.getter(#hasGesture),
returnValue: false,
) as bool);
@override
String get method => (super.noSuchMethod(
Invocation.getter(#method),
returnValue: _i6.dummyValue<String>(
this,
Invocation.getter(#method),
),
) as String);
@override
Map<String, String> get requestHeaders => (super.noSuchMethod(
Invocation.getter(#requestHeaders),
returnValue: <String, String>{},
) as Map<String, String>);
}
/// A class which mocks [DownloadListener].
///
/// See the documentation for Mockito's code generation for more information.
class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener {
MockDownloadListener() {
_i1.throwOnMissingStub(this);
}
@override
void Function(
String,
String,
String,
String,
int,
) get onDownloadStart => (super.noSuchMethod(
Invocation.getter(#onDownloadStart),
returnValue: (
String url,
String userAgent,
String contentDisposition,
String mimetype,
int contentLength,
) {},
) as void Function(
String,
String,
String,
String,
int,
));
@override
_i2.DownloadListener copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeDownloadListener_4(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.DownloadListener);
}
/// A class which mocks [WebViewAndroidJavaScriptChannel].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewAndroidJavaScriptChannel extends _i1.Mock
implements _i8.WebViewAndroidJavaScriptChannel {
MockWebViewAndroidJavaScriptChannel() {
_i1.throwOnMissingStub(this);
}
@override
_i4.JavascriptChannelRegistry get javascriptChannelRegistry =>
(super.noSuchMethod(
Invocation.getter(#javascriptChannelRegistry),
returnValue: _FakeJavascriptChannelRegistry_5(
this,
Invocation.getter(#javascriptChannelRegistry),
),
) as _i4.JavascriptChannelRegistry);
@override
String get channelName => (super.noSuchMethod(
Invocation.getter(#channelName),
returnValue: _i6.dummyValue<String>(
this,
Invocation.getter(#channelName),
),
) as String);
@override
void Function(String) get postMessage => (super.noSuchMethod(
Invocation.getter(#postMessage),
returnValue: (String message) {},
) as void Function(String));
@override
_i2.JavaScriptChannel copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeJavaScriptChannel_6(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.JavaScriptChannel);
}
/// A class which mocks [WebChromeClient].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebChromeClient extends _i1.Mock implements _i2.WebChromeClient {
MockWebChromeClient() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<void> setSynchronousReturnValueForOnShowFileChooser(bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForOnShowFileChooser,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSynchronousReturnValueForOnConsoleMessage(bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForOnConsoleMessage,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSynchronousReturnValueForOnJsAlert(bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForOnJsAlert,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSynchronousReturnValueForOnJsConfirm(bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForOnJsConfirm,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i5.Future<void> setSynchronousReturnValueForOnJsPrompt(bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForOnJsPrompt,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i2.WebChromeClient copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeWebChromeClient_7(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.WebChromeClient);
}
/// A class which mocks [WebViewClient].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewClient extends _i1.Mock implements _i2.WebViewClient {
MockWebViewClient() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<void> setSynchronousReturnValueForShouldOverrideUrlLoading(
bool? value) =>
(super.noSuchMethod(
Invocation.method(
#setSynchronousReturnValueForShouldOverrideUrlLoading,
[value],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@override
_i2.WebViewClient copy() => (super.noSuchMethod(
Invocation.method(
#copy,
[],
),
returnValue: _FakeWebViewClient_8(
this,
Invocation.method(
#copy,
[],
),
),
) as _i2.WebViewClient);
}
/// A class which mocks [JavascriptChannelRegistry].
///
/// See the documentation for Mockito's code generation for more information.
class MockJavascriptChannelRegistry extends _i1.Mock
implements _i4.JavascriptChannelRegistry {
MockJavascriptChannelRegistry() {
_i1.throwOnMissingStub(this);
}
@override
Map<String, _i4.JavascriptChannel> get channels => (super.noSuchMethod(
Invocation.getter(#channels),
returnValue: <String, _i4.JavascriptChannel>{},
) as Map<String, _i4.JavascriptChannel>);
@override
void onJavascriptChannelMessage(
String? channel,
String? message,
) =>
super.noSuchMethod(
Invocation.method(
#onJavascriptChannelMessage,
[
channel,
message,
],
),
returnValueForMissingStub: null,
);
@override
void updateJavascriptChannelsFromSet(Set<_i4.JavascriptChannel>? channels) =>
super.noSuchMethod(
Invocation.method(
#updateJavascriptChannelsFromSet,
[channels],
),
returnValueForMissingStub: null,
);
}
/// A class which mocks [WebViewPlatformCallbacksHandler].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewPlatformCallbacksHandler extends _i1.Mock
implements _i4.WebViewPlatformCallbacksHandler {
MockWebViewPlatformCallbacksHandler() {
_i1.throwOnMissingStub(this);
}
@override
_i5.FutureOr<bool> onNavigationRequest({
required String? url,
required bool? isForMainFrame,
}) =>
(super.noSuchMethod(
Invocation.method(
#onNavigationRequest,
[],
{
#url: url,
#isForMainFrame: isForMainFrame,
},
),
returnValue: _i5.Future<bool>.value(false),
) as _i5.FutureOr<bool>);
@override
void onPageStarted(String? url) => super.noSuchMethod(
Invocation.method(
#onPageStarted,
[url],
),
returnValueForMissingStub: null,
);
@override
void onPageFinished(String? url) => super.noSuchMethod(
Invocation.method(
#onPageFinished,
[url],
),
returnValueForMissingStub: null,
);
@override
void onProgress(int? progress) => super.noSuchMethod(
Invocation.method(
#onProgress,
[progress],
),
returnValueForMissingStub: null,
);
@override
void onWebResourceError(_i4.WebResourceError? error) => super.noSuchMethod(
Invocation.method(
#onWebResourceError,
[error],
),
returnValueForMissingStub: null,
);
}
/// A class which mocks [WebViewProxy].
///
/// See the documentation for Mockito's code generation for more information.
class MockWebViewProxy extends _i1.Mock implements _i8.WebViewProxy {
MockWebViewProxy() {
_i1.throwOnMissingStub(this);
}
@override
_i2.WebView createWebView() => (super.noSuchMethod(
Invocation.method(
#createWebView,
[],
),
returnValue: _FakeWebView_3(
this,
Invocation.method(
#createWebView,
[],
),
),
) as _i2.WebView);
@override
_i2.WebViewClient createWebViewClient({
void Function(
_i2.WebView,
String,
)? onPageStarted,
void Function(
_i2.WebView,
String,
)? onPageFinished,
void Function(
_i2.WebView,
_i2.WebResourceRequest,
_i2.WebResourceError,
)? onReceivedRequestError,
void Function(
_i2.WebView,
int,
String,
String,
)? onReceivedError,
void Function(
_i2.WebView,
_i2.WebResourceRequest,
)? requestLoading,
void Function(
_i2.WebView,
String,
)? urlLoading,
}) =>
(super.noSuchMethod(
Invocation.method(
#createWebViewClient,
[],
{
#onPageStarted: onPageStarted,
#onPageFinished: onPageFinished,
#onReceivedRequestError: onReceivedRequestError,
#onReceivedError: onReceivedError,
#requestLoading: requestLoading,
#urlLoading: urlLoading,
},
),
returnValue: _FakeWebViewClient_8(
this,
Invocation.method(
#createWebViewClient,
[],
{
#onPageStarted: onPageStarted,
#onPageFinished: onPageFinished,
#onReceivedRequestError: onReceivedRequestError,
#onReceivedError: onReceivedError,
#requestLoading: requestLoading,
#urlLoading: urlLoading,
},
),
),
) as _i2.WebViewClient);
@override
_i5.Future<void> setWebContentsDebuggingEnabled(bool? enabled) =>
(super.noSuchMethod(
Invocation.method(
#setWebContentsDebuggingEnabled,
[enabled],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
}
| packages/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart",
"repo_id": "packages",
"token_count": 14395
} | 1,110 |
// Copyright 2013 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.
/// Describes the state of JavaScript support in a given web view.
enum JavascriptMode {
/// JavaScript execution is disabled.
disabled,
/// JavaScript execution is not restricted.
unrestricted,
}
| packages/packages/webview_flutter/webview_flutter_platform_interface/lib/src/legacy/types/javascript_mode.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_platform_interface/lib/src/legacy/types/javascript_mode.dart",
"repo_id": "packages",
"token_count": 89
} | 1,111 |
// Copyright 2013 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/foundation.dart';
/// A message that was sent by JavaScript code running in a [WebView].
///
/// Platform specific implementations can add additional fields by extending
/// this class and providing a factory method that takes the
/// [JavaScriptMessage] as a parameter.
///
/// {@tool sample}
/// This example demonstrates how to extend the [JavaScriptMessage] to
/// provide additional platform specific parameters.
///
/// When extending [JavaScriptMessage] additional parameters should always
/// accept `null` or have a default value to prevent breaking changes.
///
/// ```dart
/// @immutable
/// class WKWebViewScriptMessage extends JavaScriptMessage {
/// WKWebViewScriptMessage._(
/// JavaScriptMessage javaScriptMessage,
/// this.extraData,
/// ) : super(javaScriptMessage.message);
///
/// factory WKWebViewScriptMessage.fromJavaScripMessage(
/// JavaScriptMessage javaScripMessage, {
/// String? extraData,
/// }) {
/// return WKWebViewScriptMessage._(
/// javaScriptMessage,
/// extraData: extraData,
/// );
/// }
///
/// final String? extraData;
/// }
/// ```
/// {@end-tool}
@immutable
class JavaScriptMessage {
/// Creates a new JavaScript message object.
const JavaScriptMessage({
required this.message,
});
/// The contents of the message that was sent by the JavaScript code.
final String message;
}
| packages/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/javascript_message.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/javascript_message.dart",
"repo_id": "packages",
"token_count": 440
} | 1,112 |
// Copyright 2013 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.
// ignore_for_file: unnecessary_statements
import 'package:flutter_test/flutter_test.dart';
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart'
as main_file;
void main() {
test(
'ensures webview_flutter_platform_interface.dart exports classes in types directory',
() {
main_file.JavaScriptConsoleMessage;
main_file.JavaScriptLogLevel;
main_file.JavaScriptMessage;
main_file.JavaScriptMode;
main_file.LoadRequestMethod;
main_file.NavigationDecision;
main_file.NavigationRequest;
main_file.NavigationRequestCallback;
main_file.PageEventCallback;
main_file.PlatformNavigationDelegateCreationParams;
main_file.PlatformWebViewControllerCreationParams;
main_file.PlatformWebViewCookieManagerCreationParams;
main_file.PlatformWebViewPermissionRequest;
main_file.PlatformWebViewWidgetCreationParams;
main_file.ProgressCallback;
main_file.WebViewPermissionResourceType;
main_file.WebResourceRequest;
main_file.WebResourceResponse;
main_file.WebResourceError;
main_file.WebResourceErrorCallback;
main_file.WebViewCookie;
main_file.WebResourceErrorType;
main_file.UrlChange;
},
);
}
| packages/packages/webview_flutter/webview_flutter_platform_interface/test/webview_flutter_platform_interface_export_test.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_platform_interface/test/webview_flutter_platform_interface_export_test.dart",
"repo_id": "packages",
"token_count": 517
} | 1,113 |
// Copyright 2013 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 'dart:convert';
import 'dart:html';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
import 'package:webview_flutter_web/webview_flutter_web.dart';
import 'web_webview_controller_test.mocks.dart';
@GenerateMocks(<Type>[], customMocks: <MockSpec<Object>>[
MockSpec<HttpRequest>(onMissingStub: OnMissingStub.returnDefault),
MockSpec<HttpRequestFactory>(onMissingStub: OnMissingStub.returnDefault),
])
void main() {
WidgetsFlutterBinding.ensureInitialized();
group('WebWebViewController', () {
group('WebWebViewControllerCreationParams', () {
test('sets iFrame fields', () {
final WebWebViewControllerCreationParams params =
WebWebViewControllerCreationParams();
expect(params.iFrame.id, contains('webView'));
expect(params.iFrame.style.width, '100%');
expect(params.iFrame.style.height, '100%');
expect(params.iFrame.style.border, 'none');
});
});
group('loadHtmlString', () {
test('loadHtmlString loads html into iframe', () async {
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams());
await controller.loadHtmlString('test html');
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
'data:text/html;charset=utf-8,${Uri.encodeFull('test html')}',
);
});
test('loadHtmlString escapes "#" correctly', () async {
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams());
await controller.loadHtmlString('#');
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
contains('%23'),
);
});
});
group('loadRequest', () {
test('throws ArgumentError on missing scheme', () async {
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams());
await expectLater(
() async => controller.loadRequest(
LoadRequestParams(uri: Uri.parse('flutter.dev')),
),
throwsA(const TypeMatcher<ArgumentError>()));
});
test('skips XHR for simple GETs (no headers, no data)', () async {
final MockHttpRequestFactory mockHttpRequestFactory =
MockHttpRequestFactory();
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams(
httpRequestFactory: mockHttpRequestFactory,
));
when(mockHttpRequestFactory.request(
any,
method: anyNamed('method'),
requestHeaders: anyNamed('requestHeaders'),
sendData: anyNamed('sendData'),
)).thenThrow(
StateError('The `request` method should not have been called.'));
await controller.loadRequest(LoadRequestParams(
uri: Uri.parse('https://flutter.dev'),
));
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
'https://flutter.dev/',
);
});
test('makes request and loads response into iframe', () async {
final MockHttpRequestFactory mockHttpRequestFactory =
MockHttpRequestFactory();
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams(
httpRequestFactory: mockHttpRequestFactory,
));
final MockHttpRequest mockHttpRequest = MockHttpRequest();
when(mockHttpRequest.getResponseHeader('content-type'))
.thenReturn('text/plain');
when(mockHttpRequest.responseText).thenReturn('test data');
when(mockHttpRequestFactory.request(
any,
method: anyNamed('method'),
requestHeaders: anyNamed('requestHeaders'),
sendData: anyNamed('sendData'),
)).thenAnswer((_) => Future<HttpRequest>.value(mockHttpRequest));
await controller.loadRequest(LoadRequestParams(
uri: Uri.parse('https://flutter.dev'),
method: LoadRequestMethod.post,
body: Uint8List.fromList('test body'.codeUnits),
headers: const <String, String>{'Foo': 'Bar'},
));
verify(mockHttpRequestFactory.request(
'https://flutter.dev',
method: 'post',
requestHeaders: <String, String>{'Foo': 'Bar'},
sendData: Uint8List.fromList('test body'.codeUnits),
));
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
'data:;charset=utf-8,${Uri.encodeFull('test data')}',
);
});
test('parses content-type response header correctly', () async {
final MockHttpRequestFactory mockHttpRequestFactory =
MockHttpRequestFactory();
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams(
httpRequestFactory: mockHttpRequestFactory,
));
final Encoding iso = Encoding.getByName('latin1')!;
final MockHttpRequest mockHttpRequest = MockHttpRequest();
when(mockHttpRequest.responseText)
.thenReturn(String.fromCharCodes(iso.encode('España')));
when(mockHttpRequest.getResponseHeader('content-type'))
.thenReturn('Text/HTmL; charset=latin1');
when(mockHttpRequestFactory.request(
any,
method: anyNamed('method'),
requestHeaders: anyNamed('requestHeaders'),
sendData: anyNamed('sendData'),
)).thenAnswer((_) => Future<HttpRequest>.value(mockHttpRequest));
await controller.loadRequest(LoadRequestParams(
uri: Uri.parse('https://flutter.dev'),
method: LoadRequestMethod.post,
));
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
'data:text/html;charset=iso-8859-1,Espa%F1a',
);
});
test('escapes "#" correctly', () async {
final MockHttpRequestFactory mockHttpRequestFactory =
MockHttpRequestFactory();
final WebWebViewController controller =
WebWebViewController(WebWebViewControllerCreationParams(
httpRequestFactory: mockHttpRequestFactory,
));
final MockHttpRequest mockHttpRequest = MockHttpRequest();
when(mockHttpRequest.getResponseHeader('content-type'))
.thenReturn('text/html');
when(mockHttpRequest.responseText).thenReturn('#');
when(mockHttpRequestFactory.request(
any,
method: anyNamed('method'),
requestHeaders: anyNamed('requestHeaders'),
sendData: anyNamed('sendData'),
)).thenAnswer((_) => Future<HttpRequest>.value(mockHttpRequest));
await controller.loadRequest(LoadRequestParams(
uri: Uri.parse('https://flutter.dev'),
method: LoadRequestMethod.post,
body: Uint8List.fromList('test body'.codeUnits),
headers: const <String, String>{'Foo': 'Bar'},
));
expect(
(controller.params as WebWebViewControllerCreationParams).iFrame.src,
contains('%23'),
);
});
});
});
}
| packages/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.dart",
"repo_id": "packages",
"token_count": 3140
} | 1,114 |
// Copyright 2013 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 Flutter;
@import XCTest;
@import webview_flutter_wkwebview;
#import <OCMock/OCMock.h>
@interface FWFURLAuthenticationChallengeHostApiTests : XCTestCase
@end
@implementation FWFURLAuthenticationChallengeHostApiTests
- (void)testFlutterApiCreate {
FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init];
FWFURLAuthenticationChallengeFlutterApiImpl *flutterApi =
[[FWFURLAuthenticationChallengeFlutterApiImpl alloc]
initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger))
instanceManager:instanceManager];
flutterApi.api = OCMClassMock([FWFNSUrlAuthenticationChallengeFlutterApi class]);
NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:@"host"
port:0
protocol:nil
realm:@"realm"
authenticationMethod:nil];
NSURLAuthenticationChallenge *mockChallenge = OCMClassMock([NSURLAuthenticationChallenge class]);
OCMStub([mockChallenge protectionSpace]).andReturn(protectionSpace);
[flutterApi createWithInstance:mockChallenge
protectionSpace:protectionSpace
completion:^(FlutterError *error){
}];
long identifier = [instanceManager identifierWithStrongReferenceForInstance:mockChallenge];
long protectionSpaceIdentifier =
[instanceManager identifierWithStrongReferenceForInstance:protectionSpace];
OCMVerify([flutterApi.api createWithIdentifier:identifier
protectionSpaceIdentifier:protectionSpaceIdentifier
completion:OCMOCK_ANY]);
}
@end
| packages/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLAuthenticationChallengeHostApiTests.m/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLAuthenticationChallengeHostApiTests.m",
"repo_id": "packages",
"token_count": 932
} | 1,115 |
// Copyright 2013 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 <Flutter/Flutter.h>
#import <Foundation/Foundation.h>
#import "FWFDataConverters.h"
#import "FWFGeneratedWebKitApis.h"
#import "FWFInstanceManager.h"
NS_ASSUME_NONNULL_BEGIN
/// Host API implementation for `NSURLCredential`.
///
/// This class may handle instantiating and adding native object instances that are attached to a
/// Dart instance or method calls on the associated native class or an instance of the class.
@interface FWFURLCredentialHostApiImpl : NSObject <FWFNSUrlCredentialHostApi>
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger
instanceManager:(FWFInstanceManager *)instanceManager;
@end
NS_ASSUME_NONNULL_END
| packages/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFURLCredentialHostApi.h/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFURLCredentialHostApi.h",
"repo_id": "packages",
"token_count": 276
} | 1,116 |
framework module webview_flutter_wkwebview {
umbrella header "webview-umbrella.h"
export *
module * { export * }
explicit module Test {
header "FWFInstanceManager_Test.h"
}
}
| packages/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FlutterWebView.modulemap/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FlutterWebView.modulemap",
"repo_id": "packages",
"token_count": 67
} | 1,117 |
// Copyright 2013 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 'common/instance_manager.dart';
import 'foundation/foundation.dart';
import 'ui_kit/ui_kit.dart';
import 'web_kit/web_kit.dart';
// This convenience method was added because Dart doesn't support constant
// function literals: https://github.com/dart-lang/language/issues/1048.
WKWebsiteDataStore _defaultWebsiteDataStore() =>
WKWebsiteDataStore.defaultDataStore;
/// Handles constructing objects and calling static methods for the WebKit
/// native library.
///
/// This class provides dependency injection for the implementations of the
/// platform interface classes. Improving the ease of unit testing and/or
/// overriding the underlying WebKit classes.
///
/// By default each function calls the default constructor of the WebKit class
/// it intends to return.
class WebKitProxy {
/// Constructs a [WebKitProxy].
const WebKitProxy({
this.createWebView = WKWebView.new,
this.createWebViewConfiguration = WKWebViewConfiguration.new,
this.createScriptMessageHandler = WKScriptMessageHandler.new,
this.defaultWebsiteDataStore = _defaultWebsiteDataStore,
this.createNavigationDelegate = WKNavigationDelegate.new,
this.createUIDelegate = WKUIDelegate.new,
this.createUIScrollViewDelegate = UIScrollViewDelegate.new,
});
/// Constructs a [WKWebView].
final WKWebView Function(
WKWebViewConfiguration configuration, {
void Function(
String keyPath,
NSObject object,
Map<NSKeyValueChangeKey, Object?> change,
)? observeValue,
InstanceManager? instanceManager,
}) createWebView;
/// Constructs a [WKWebViewConfiguration].
final WKWebViewConfiguration Function({
InstanceManager? instanceManager,
}) createWebViewConfiguration;
/// Constructs a [WKScriptMessageHandler].
final WKScriptMessageHandler Function({
required void Function(
WKUserContentController userContentController,
WKScriptMessage message,
) didReceiveScriptMessage,
}) createScriptMessageHandler;
/// The default [WKWebsiteDataStore].
final WKWebsiteDataStore Function() defaultWebsiteDataStore;
/// Constructs a [WKNavigationDelegate].
final WKNavigationDelegate Function({
void Function(WKWebView webView, String? url)? didFinishNavigation,
void Function(WKWebView webView, String? url)?
didStartProvisionalNavigation,
Future<WKNavigationActionPolicy> Function(
WKWebView webView,
WKNavigationAction navigationAction,
)? decidePolicyForNavigationAction,
Future<WKNavigationResponsePolicy> Function(
WKWebView webView,
WKNavigationResponse navigationResponse,
)? decidePolicyForNavigationResponse,
void Function(WKWebView webView, NSError error)? didFailNavigation,
void Function(WKWebView webView, NSError error)?
didFailProvisionalNavigation,
void Function(WKWebView webView)? webViewWebContentProcessDidTerminate,
void Function(
WKWebView webView,
NSUrlAuthenticationChallenge challenge,
void Function(
NSUrlSessionAuthChallengeDisposition disposition,
NSUrlCredential? credential,
) completionHandler,
)? didReceiveAuthenticationChallenge,
}) createNavigationDelegate;
/// Constructs a [WKUIDelegate].
final WKUIDelegate Function({
void Function(
WKWebView webView,
WKWebViewConfiguration configuration,
WKNavigationAction navigationAction,
)? onCreateWebView,
Future<WKPermissionDecision> Function(
WKUIDelegate instance,
WKWebView webView,
WKSecurityOrigin origin,
WKFrameInfo frame,
WKMediaCaptureType type,
)? requestMediaCapturePermission,
Future<void> Function(
String message,
WKFrameInfo frame,
)? runJavaScriptAlertDialog,
Future<bool> Function(
String message,
WKFrameInfo frame,
)? runJavaScriptConfirmDialog,
Future<String> Function(
String prompt,
String defaultText,
WKFrameInfo frame,
)? runJavaScriptTextInputDialog,
InstanceManager? instanceManager,
}) createUIDelegate;
/// Constructs a [UIScrollViewDelegate].
final UIScrollViewDelegate Function({
void Function(
UIScrollView scrollView,
double x,
double y,
)? scrollViewDidScroll,
}) createUIScrollViewDelegate;
}
| packages/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart/0 | {
"file_path": "packages/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart",
"repo_id": "packages",
"token_count": 1464
} | 1,118 |
# Currently missing: https://github.com/flutter/flutter/issues/82211
- file_selector
# Waiting on https://github.com/flutter/flutter/issues/145149
- google_maps_flutter
| packages/script/configs/exclude_integration_web.yaml/0 | {
"file_path": "packages/script/configs/exclude_integration_web.yaml",
"repo_id": "packages",
"token_count": 56
} | 1,119 |
// Copyright 2013 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:file/file.dart';
import 'package:platform/platform.dart';
import 'process_runner.dart';
import 'repository_package.dart';
const String _gradleWrapperWindows = 'gradlew.bat';
const String _gradleWrapperNonWindows = 'gradlew';
/// A utility class for interacting with Gradle projects.
class GradleProject {
/// Creates an instance that runs commands for [project] with the given
/// [processRunner].
GradleProject(
this.flutterProject, {
this.processRunner = const ProcessRunner(),
this.platform = const LocalPlatform(),
});
/// The directory of a Flutter project to run Gradle commands in.
final RepositoryPackage flutterProject;
/// The [ProcessRunner] used to run commands. Overridable for testing.
final ProcessRunner processRunner;
/// The platform that commands are being run on.
final Platform platform;
/// The project's 'android' directory.
Directory get androidDirectory =>
flutterProject.platformDirectory(FlutterPlatform.android);
/// The path to the Gradle wrapper file for the project.
File get gradleWrapper => androidDirectory.childFile(
platform.isWindows ? _gradleWrapperWindows : _gradleWrapperNonWindows);
/// Whether or not the project is ready to have Gradle commands run on it
/// (i.e., whether the `flutter` tool has generated the necessary files).
bool isConfigured() => gradleWrapper.existsSync();
/// Runs a `gradlew` command with the given parameters.
Future<int> runCommand(
String task, {
List<String> additionalTasks = const <String>[],
List<String> arguments = const <String>[],
}) {
return processRunner.runAndStream(
gradleWrapper.path,
<String>[task, ...additionalTasks, ...arguments],
workingDir: androidDirectory,
);
}
}
| packages/script/tool/lib/src/common/gradle.dart/0 | {
"file_path": "packages/script/tool/lib/src/common/gradle.dart",
"repo_id": "packages",
"token_count": 569
} | 1,120 |
// Copyright 2013 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:file/file.dart';
import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';
import 'common/file_utils.dart';
import 'common/git_version_finder.dart';
import 'common/output_utils.dart';
import 'common/package_looping_command.dart';
import 'common/plugin_utils.dart';
import 'common/repository_package.dart';
/// A command to check that PRs don't violate repository best practices that
/// have been established to avoid breakages that building and testing won't
/// catch.
class FederationSafetyCheckCommand extends PackageLoopingCommand {
/// Creates an instance of the safety check command.
FederationSafetyCheckCommand(
super.packagesDir, {
super.processRunner,
super.platform,
super.gitDir,
});
// A map of package name (as defined by the directory name of the package)
// to a list of changed Dart files in that package, as Posix paths relative to
// the package root.
//
// This only considers top-level packages, not subpackages such as example/.
final Map<String, List<String>> _changedDartFiles = <String, List<String>>{};
// The set of *_platform_interface packages that will have public code changes
// published.
final Set<String> _modifiedAndPublishedPlatformInterfacePackages = <String>{};
// The set of conceptual plugins (not packages) that have changes.
final Set<String> _changedPlugins = <String>{};
static const String _platformInterfaceSuffix = '_platform_interface';
@override
final String name = 'federation-safety-check';
@override
List<String> get aliases => <String>['check-federation-safety'];
@override
final String description =
'Checks that the change does not violate repository rules around changes '
'to federated plugin packages.';
@override
bool get hasLongOutput => false;
@override
Future<void> initializeRun() async {
final GitVersionFinder gitVersionFinder = await retrieveVersionFinder();
final String baseSha = await gitVersionFinder.getBaseSha();
print('Validating changes relative to "$baseSha"\n');
for (final String path in await gitVersionFinder.getChangedFiles()) {
// Git output always uses Posix paths.
final List<String> allComponents = p.posix.split(path);
final int packageIndex = allComponents.indexOf('packages');
if (packageIndex == -1) {
continue;
}
final List<String> relativeComponents =
allComponents.sublist(packageIndex + 1);
// The package name is either the directory directly under packages/, or
// the directory under that in the case of a federated plugin.
String packageName = relativeComponents.removeAt(0);
// Count the top-level plugin as changed.
_changedPlugins.add(packageName);
if (relativeComponents[0] == packageName ||
(relativeComponents.length > 1 &&
relativeComponents[0].startsWith('${packageName}_'))) {
packageName = relativeComponents.removeAt(0);
}
if (relativeComponents.last.endsWith('.dart') &&
!await _changeIsCommentOnly(gitVersionFinder, path)) {
_changedDartFiles[packageName] ??= <String>[];
_changedDartFiles[packageName]!
.add(p.posix.joinAll(relativeComponents));
}
if (packageName.endsWith(_platformInterfaceSuffix) &&
relativeComponents.first == 'pubspec.yaml' &&
await _packageWillBePublished(path)) {
_modifiedAndPublishedPlatformInterfacePackages.add(packageName);
}
}
}
@override
Future<PackageResult> runForPackage(RepositoryPackage package) async {
if (!isFlutterPlugin(package)) {
return PackageResult.skip('Not a plugin.');
}
if (!package.isFederated) {
return PackageResult.skip('Not a federated plugin.');
}
if (package.isPlatformInterface) {
// As the leaf nodes in the graph, a published package interface change is
// assumed to be correct, and other changes are validated against that.
return PackageResult.skip(
'Platform interface changes are not validated.');
}
// Uses basename to match _changedPackageFiles.
final String basePackageName = package.directory.parent.basename;
final String platformInterfacePackageName =
'$basePackageName$_platformInterfaceSuffix';
final List<String> changedPlatformInterfaceFiles =
_changedDartFiles[platformInterfacePackageName] ?? <String>[];
if (!_modifiedAndPublishedPlatformInterfacePackages
.contains(platformInterfacePackageName)) {
print('No published changes for $platformInterfacePackageName.');
return PackageResult.success();
}
if (!changedPlatformInterfaceFiles
.any((String path) => path.startsWith('lib/'))) {
print('No public code changes for $platformInterfacePackageName.');
return PackageResult.success();
}
final List<String> changedPackageFiles =
_changedDartFiles[package.directory.basename] ?? <String>[];
if (changedPackageFiles.isEmpty) {
print('No Dart changes.');
return PackageResult.success();
}
// If the change would be flagged, but it appears to be a mass change
// rather than a plugin-specific change, allow it with a warning.
//
// This is a tradeoff between safety and convenience; forcing mass changes
// to be split apart is not ideal, and the assumption is that reviewers are
// unlikely to accidentally approve a PR that is supposed to be changing a
// single plugin, but touches other plugins (vs accidentally approving a
// PR that changes multiple parts of a single plugin, which is a relatively
// easy mistake to make).
//
// 3 is chosen to minimize the chances of accidentally letting something
// through (vs 2, which could be a single-plugin change with one stray
// change to another file accidentally included), while not setting too
// high a bar for detecting mass changes. This can be tuned if there are
// issues with false positives or false negatives.
const int massChangePluginThreshold = 3;
if (_changedPlugins.length >= massChangePluginThreshold) {
logWarning('Ignoring potentially dangerous change, as this appears '
'to be a mass change.');
return PackageResult.success();
}
printError('Dart changes are not allowed to other packages in '
'$basePackageName in the same PR as changes to public Dart code in '
'$platformInterfacePackageName, as this can cause accidental breaking '
'changes to be missed by automated checks. Please split the changes to '
'these two packages into separate PRs.\n\n'
'If you believe that this is a false positive, please file a bug.');
return PackageResult.fail(
<String>['$platformInterfacePackageName changed.']);
}
Future<bool> _packageWillBePublished(
String pubspecRepoRelativePosixPath) async {
final File pubspecFile = childFileWithSubcomponents(
packagesDir.parent, p.posix.split(pubspecRepoRelativePosixPath));
if (!pubspecFile.existsSync()) {
// If the package was deleted, nothing will be published.
return false;
}
final Pubspec pubspec = Pubspec.parse(pubspecFile.readAsStringSync());
if (pubspec.publishTo == 'none') {
return false;
}
final GitVersionFinder gitVersionFinder = await retrieveVersionFinder();
final Version? previousVersion =
await gitVersionFinder.getPackageVersion(pubspecRepoRelativePosixPath);
if (previousVersion == null) {
// The plugin is new, so it will be published.
return true;
}
return pubspec.version != previousVersion;
}
Future<bool> _changeIsCommentOnly(
GitVersionFinder git, String repoPath) async {
final List<String> diff = await git.getDiffContents(targetPath: repoPath);
final RegExp changeLine = RegExp(r'^[+-] ');
// This will not catch /**/-style comments, but false negatives are fine
// (and in practice, we almost never use that comment style in Dart code).
final RegExp commentLine = RegExp(r'^[+-]\s*//');
bool foundComment = false;
for (final String line in diff) {
if (!changeLine.hasMatch(line) ||
line.startsWith('--- ') ||
line.startsWith('+++ ')) {
continue;
}
if (!commentLine.hasMatch(line)) {
return false;
}
foundComment = true;
}
// Only return true if a comment change was found, as a fail-safe against
// against having the wrong (e.g., incorrectly empty) diff output.
return foundComment;
}
}
| packages/script/tool/lib/src/federation_safety_check_command.dart/0 | {
"file_path": "packages/script/tool/lib/src/federation_safety_check_command.dart",
"repo_id": "packages",
"token_count": 2853
} | 1,121 |
// Copyright 2013 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:file/file.dart';
import 'package:yaml/yaml.dart';
import 'common/core.dart';
import 'common/output_utils.dart';
import 'common/package_looping_command.dart';
import 'common/repository_package.dart';
const String _instructionWikiUrl =
'https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages';
/// A command to enforce README conventions across the repository.
class ReadmeCheckCommand extends PackageLoopingCommand {
/// Creates an instance of the README check command.
ReadmeCheckCommand(
super.packagesDir, {
super.processRunner,
super.platform,
super.gitDir,
}) {
argParser.addFlag(_requireExcerptsArg,
help: 'Require that Dart code blocks be managed by code-excerpt.');
}
static const String _requireExcerptsArg = 'require-excerpts';
// Standardized capitalizations for platforms that a plugin can support.
static const Map<String, String> _standardPlatformNames = <String, String>{
'android': 'Android',
'ios': 'iOS',
'linux': 'Linux',
'macos': 'macOS',
'web': 'Web',
'windows': 'Windows',
};
@override
final String name = 'readme-check';
@override
List<String> get aliases => <String>['check-readme'];
@override
final String description =
'Checks that READMEs follow repository conventions.';
@override
bool get hasLongOutput => false;
@override
Future<PackageResult> runForPackage(RepositoryPackage package) async {
final List<String> errors = _validateReadme(package.readmeFile,
mainPackage: package, isExample: false);
for (final RepositoryPackage packageToCheck in package.getExamples()) {
errors.addAll(_validateReadme(packageToCheck.readmeFile,
mainPackage: package, isExample: true));
}
// If there's an example/README.md for a multi-example package, validate
// that as well, as it will be shown on pub.dev.
final Directory exampleDir = package.directory.childDirectory('example');
final File exampleDirReadme = exampleDir.childFile('README.md');
if (exampleDir.existsSync() && !isPackage(exampleDir)) {
errors.addAll(_validateReadme(exampleDirReadme,
mainPackage: package, isExample: true));
}
return errors.isEmpty
? PackageResult.success()
: PackageResult.fail(errors);
}
List<String> _validateReadme(File readme,
{required RepositoryPackage mainPackage, required bool isExample}) {
if (!readme.existsSync()) {
if (isExample) {
print('${indentation}No README for '
'${getRelativePosixPath(readme.parent, from: mainPackage.directory)}');
return <String>[];
} else {
printError('${indentation}No README found at '
'${getRelativePosixPath(readme, from: mainPackage.directory)}');
return <String>['Missing README.md'];
}
}
print('${indentation}Checking '
'${getRelativePosixPath(readme, from: mainPackage.directory)}...');
final List<String> readmeLines = readme.readAsLinesSync();
final List<String> errors = <String>[];
final String? blockValidationError =
_validateCodeBlocks(readmeLines, mainPackage: mainPackage);
if (blockValidationError != null) {
errors.add(blockValidationError);
}
errors.addAll(_validateBoilerplate(readmeLines,
mainPackage: mainPackage, isExample: isExample));
// Check if this is the main readme for a plugin, and if so enforce extra
// checks.
if (!isExample) {
final Pubspec pubspec = mainPackage.parsePubspec();
final bool isPlugin = pubspec.flutter?['plugin'] != null;
if (isPlugin && (!mainPackage.isFederated || mainPackage.isAppFacing)) {
final String? error = _validateSupportedPlatforms(readmeLines, pubspec);
if (error != null) {
errors.add(error);
}
}
}
return errors;
}
/// Validates that code blocks (``` ... ```) follow repository standards.
String? _validateCodeBlocks(
List<String> readmeLines, {
required RepositoryPackage mainPackage,
}) {
final RegExp codeBlockDelimiterPattern = RegExp(r'^\s*```\s*([^ ]*)\s*');
const String excerptTagStart = '<?code-excerpt ';
final List<int> missingLanguageLines = <int>[];
final List<int> missingExcerptLines = <int>[];
bool inBlock = false;
for (int i = 0; i < readmeLines.length; ++i) {
final RegExpMatch? match =
codeBlockDelimiterPattern.firstMatch(readmeLines[i]);
if (match == null) {
continue;
}
if (inBlock) {
inBlock = false;
continue;
}
inBlock = true;
final int humanReadableLineNumber = i + 1;
// Ensure that there's a language tag.
final String infoString = match[1] ?? '';
if (infoString.isEmpty) {
missingLanguageLines.add(humanReadableLineNumber);
continue;
}
// Check for code-excerpt usage if requested.
if (getBoolArg(_requireExcerptsArg) && infoString == 'dart') {
if (i == 0 || !readmeLines[i - 1].trim().startsWith(excerptTagStart)) {
missingExcerptLines.add(humanReadableLineNumber);
}
}
}
String? errorSummary;
if (missingLanguageLines.isNotEmpty) {
for (final int lineNumber in missingLanguageLines) {
printError('${indentation}Code block at line $lineNumber is missing '
'a language identifier.');
}
printError(
'\n${indentation}For each block listed above, add a language tag to '
'the opening block. For instance, for Dart code, use:\n'
'${indentation * 2}```dart\n');
errorSummary = 'Missing language identifier for code block';
}
if (missingExcerptLines.isNotEmpty) {
for (final int lineNumber in missingExcerptLines) {
printError('${indentation}Dart code block at line $lineNumber is not '
'managed by code-excerpt.');
}
printError(
'\n${indentation}For each block listed above, add <?code-excerpt ...> '
'tag on the previous line, as explained at\n'
'$_instructionWikiUrl');
errorSummary ??= 'Missing code-excerpt management for code block';
}
return errorSummary;
}
/// Validates that the plugin has a supported platforms table following the
/// expected format, returning an error string if any issues are found.
String? _validateSupportedPlatforms(
List<String> readmeLines, Pubspec pubspec) {
// Example table following expected format:
// | | Android | iOS | Web |
// |----------------|---------|----------|------------------------|
// | **Support** | SDK 21+ | iOS 10+* | [See `camera_web `][1] |
final int detailsLineNumber = readmeLines
.indexWhere((String line) => line.startsWith('| **Support**'));
if (detailsLineNumber == -1) {
return 'No OS support table found';
}
final int osLineNumber = detailsLineNumber - 2;
if (osLineNumber < 0 || !readmeLines[osLineNumber].startsWith('|')) {
return 'OS support table does not have the expected header format';
}
// Utility method to convert an iterable of strings to a case-insensitive
// sorted, comma-separated string of its elements.
String sortedListString(Iterable<String> entries) {
final List<String> entryList = entries.toList();
entryList.sort(
(String a, String b) => a.toLowerCase().compareTo(b.toLowerCase()));
return entryList.join(', ');
}
// Validate that the supported OS lists match.
final YamlMap pluginSection = pubspec.flutter!['plugin'] as YamlMap;
final dynamic platformsEntry = pluginSection['platforms'];
if (platformsEntry == null) {
logWarning('Plugin not support any platforms');
return null;
}
final YamlMap platformSupportMaps = platformsEntry as YamlMap;
final Set<String> actuallySupportedPlatform =
platformSupportMaps.keys.toSet().cast<String>();
final Iterable<String> documentedPlatforms = readmeLines[osLineNumber]
.split('|')
.map((String entry) => entry.trim())
.where((String entry) => entry.isNotEmpty);
final Set<String> documentedPlatformsLowercase =
documentedPlatforms.map((String entry) => entry.toLowerCase()).toSet();
if (actuallySupportedPlatform.length != documentedPlatforms.length ||
actuallySupportedPlatform
.intersection(documentedPlatformsLowercase)
.length !=
actuallySupportedPlatform.length) {
printError('''
${indentation}OS support table does not match supported platforms:
${indentation * 2}Actual: ${sortedListString(actuallySupportedPlatform)}
${indentation * 2}Documented: ${sortedListString(documentedPlatformsLowercase)}
''');
return 'Incorrect OS support table';
}
// Enforce a standard set of capitalizations for the OS headings.
final Iterable<String> incorrectCapitalizations = documentedPlatforms
.toSet()
.difference(_standardPlatformNames.values.toSet());
if (incorrectCapitalizations.isNotEmpty) {
final Iterable<String> expectedVersions = incorrectCapitalizations
.map((String name) => _standardPlatformNames[name.toLowerCase()]!);
printError('''
${indentation}Incorrect OS capitalization: ${sortedListString(incorrectCapitalizations)}
${indentation * 2}Please use standard capitalizations: ${sortedListString(expectedVersions)}
''');
return 'Incorrect OS support formatting';
}
// TODO(stuartmorgan): Add validation that the minimums in the table are
// consistent with what the current implementations require. See
// https://github.com/flutter/flutter/issues/84200
return null;
}
/// Validates [readmeLines], outputing error messages for any issue and
/// returning an array of error summaries (if any).
///
/// Returns an empty array if validation passes.
List<String> _validateBoilerplate(
List<String> readmeLines, {
required RepositoryPackage mainPackage,
required bool isExample,
}) {
final List<String> errors = <String>[];
if (_containsTemplateFlutterBoilerplate(readmeLines)) {
printError('${indentation}The boilerplate section about getting started '
'with Flutter should not be left in.');
errors.add('Contains template boilerplate');
}
// Enforce a repository-standard message in implementation plugin examples,
// since they aren't typical examples, which has been a source of
// confusion for plugin clients who find them.
if (isExample && mainPackage.isPlatformImplementation) {
if (_containsExampleBoilerplate(readmeLines)) {
printError('${indentation}The boilerplate should not be left in for a '
"federated plugin implementation package's example.");
errors.add('Contains template boilerplate');
}
if (!_containsImplementationExampleExplanation(readmeLines)) {
printError('${indentation}The example README for a platform '
'implementation package should warn readers about its intended '
'use. Please copy the example README from another implementation '
'package in this repository.');
errors.add('Missing implementation package example warning');
}
}
return errors;
}
/// Returns true if the README still has unwanted parts of the boilerplate
/// from the `flutter create` templates.
bool _containsTemplateFlutterBoilerplate(List<String> readmeLines) {
return readmeLines.any((String line) =>
line.contains('For help getting started with Flutter'));
}
/// Returns true if the README still has the generic description of an
/// example from the `flutter create` templates.
bool _containsExampleBoilerplate(List<String> readmeLines) {
return readmeLines
.any((String line) => line.contains('Demonstrates how to use the'));
}
/// Returns true if the README contains the repository-standard explanation of
/// the purpose of a federated plugin implementation's example.
bool _containsImplementationExampleExplanation(List<String> readmeLines) {
return (readmeLines.contains('# Platform Implementation Test App') &&
readmeLines.any(
(String line) => line.contains('This is a test app for'))) ||
(readmeLines.contains('# Platform Implementation Test Apps') &&
readmeLines.any(
(String line) => line.contains('These are test apps for')));
}
}
| packages/script/tool/lib/src/readme_check_command.dart/0 | {
"file_path": "packages/script/tool/lib/src/readme_check_command.dart",
"repo_id": "packages",
"token_count": 4504
} | 1,122 |
// Copyright 2013 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:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_plugin_tools/src/common/core.dart';
import 'package:flutter_plugin_tools/src/common/package_command.dart';
import 'package:git/git.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';
import '../mocks.dart';
import '../util.dart';
import 'package_command_test.mocks.dart';
@GenerateMocks(<Type>[GitDir])
void main() {
late RecordingProcessRunner processRunner;
late SamplePackageCommand command;
late CommandRunner<void> runner;
late FileSystem fileSystem;
late MockPlatform mockPlatform;
late Directory packagesDir;
late Directory thirdPartyPackagesDir;
setUp(() {
fileSystem = MemoryFileSystem();
mockPlatform = MockPlatform();
packagesDir = createPackagesDirectory(fileSystem: fileSystem);
thirdPartyPackagesDir = packagesDir.parent
.childDirectory('third_party')
.childDirectory('packages');
final MockGitDir gitDir = MockGitDir();
when(gitDir.runCommand(any, throwOnError: anyNamed('throwOnError')))
.thenAnswer((Invocation invocation) {
final List<String> arguments =
invocation.positionalArguments[0]! as List<String>;
// Attach the first argument to the command to make targeting the mock
// results easier.
final String gitCommand = arguments.removeAt(0);
return processRunner.run('git-$gitCommand', arguments);
});
processRunner = RecordingProcessRunner();
command = SamplePackageCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
gitDir: gitDir,
);
runner =
CommandRunner<void>('common_command', 'Test for common functionality');
runner.addCommand(command);
});
group('plugin iteration', () {
test('all plugins from file system', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner, <String>['sample']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
});
test('includes both plugins and packages', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final RepositoryPackage package3 =
createFakePackage('package3', packagesDir);
final RepositoryPackage package4 =
createFakePackage('package4', packagesDir);
await runCapturingPrint(runner, <String>['sample']);
expect(
command.plugins,
unorderedEquals(<String>[
plugin1.path,
plugin2.path,
package3.path,
package4.path,
]));
});
test('includes packages without source', () async {
final RepositoryPackage package =
createFakePackage('package', packagesDir);
package.libDirectory.deleteSync(recursive: true);
await runCapturingPrint(runner, <String>['sample']);
expect(
command.plugins,
unorderedEquals(<String>[
package.path,
]));
});
test('all plugins includes third_party/packages', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final RepositoryPackage plugin3 =
createFakePlugin('plugin3', thirdPartyPackagesDir);
await runCapturingPrint(runner, <String>['sample']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path, plugin3.path]));
});
test('--packages limits packages', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
createFakePackage('package3', packagesDir);
final RepositoryPackage package4 =
createFakePackage('package4', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--packages=plugin1,package4']);
expect(
command.plugins,
unorderedEquals(<String>[
plugin1.path,
package4.path,
]));
});
test('--plugins acts as an alias to --packages', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
createFakePackage('package3', packagesDir);
final RepositoryPackage package4 =
createFakePackage('package4', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--plugins=plugin1,package4']);
expect(
command.plugins,
unorderedEquals(<String>[
plugin1.path,
package4.path,
]));
});
test('exclude packages when packages flag is specified', () async {
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--packages=plugin1,plugin2',
'--exclude=plugin1'
]);
expect(command.plugins, unorderedEquals(<String>[plugin2.path]));
});
test("exclude packages when packages flag isn't specified", () async {
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--exclude=plugin1,plugin2']);
expect(command.plugins, unorderedEquals(<String>[]));
});
test('exclude federated plugins when packages flag is specified', () async {
createFakePlugin('plugin1', packagesDir.childDirectory('federated'));
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--packages=federated/plugin1,plugin2',
'--exclude=federated/plugin1'
]);
expect(command.plugins, unorderedEquals(<String>[plugin2.path]));
});
test('exclude entire federated plugins when packages flag is specified',
() async {
createFakePlugin('plugin1', packagesDir.childDirectory('federated'));
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--packages=federated/plugin1,plugin2',
'--exclude=federated'
]);
expect(command.plugins, unorderedEquals(<String>[plugin2.path]));
});
test('exclude accepts config files', () async {
createFakePlugin('plugin1', packagesDir);
final File configFile = packagesDir.childFile('exclude.yaml');
configFile.writeAsStringSync('- plugin1');
await runCapturingPrint(runner, <String>[
'sample',
'--packages=plugin1',
'--exclude=${configFile.path}'
]);
expect(command.plugins, unorderedEquals(<String>[]));
});
test('filter-packages-to accepts config files', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final File configFile = packagesDir.childFile('exclude.yaml');
configFile.writeAsStringSync('- plugin1');
await runCapturingPrint(runner, <String>[
'sample',
'--packages=plugin1,plugin2',
'--filter-packages-to=${configFile.path}'
]);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test(
'explicitly specifying the plugin (group) name of a federated plugin '
'should include all plugins in the group', () async {
final Directory pluginGroup = packagesDir.childDirectory('plugin1');
final RepositoryPackage appFacingPackage =
createFakePlugin('plugin1', pluginGroup);
final RepositoryPackage platformInterfacePackage =
createFakePlugin('plugin1_platform_interface', pluginGroup);
final RepositoryPackage implementationPackage =
createFakePlugin('plugin1_web', pluginGroup);
await runCapturingPrint(runner, <String>['sample', '--packages=plugin1']);
expect(
command.plugins,
unorderedEquals(<String>[
appFacingPackage.path,
platformInterfacePackage.path,
implementationPackage.path
]));
});
test(
'specifying the app-facing package of a federated plugin with '
'--exact-match-only should only include only that package', () async {
final Directory pluginGroup = packagesDir.childDirectory('plugin1');
final RepositoryPackage appFacingPackage =
createFakePlugin('plugin1', pluginGroup);
createFakePlugin('plugin1_platform_interface', pluginGroup);
createFakePlugin('plugin1_web', pluginGroup);
await runCapturingPrint(runner,
<String>['sample', '--packages=plugin1', '--exact-match-only']);
expect(command.plugins, unorderedEquals(<String>[appFacingPackage.path]));
});
test(
'specifying the app-facing package of a federated plugin using its '
'fully qualified name should include only that package', () async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1/plugin1.dart
''')),
];
final Directory pluginGroup = packagesDir.childDirectory('plugin1');
final RepositoryPackage appFacingPackage =
createFakePlugin('plugin1', pluginGroup);
createFakePlugin('plugin1_platform_interface', pluginGroup);
createFakePlugin('plugin1_web', pluginGroup);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--packages=plugin1/plugin1']);
expect(command.plugins, unorderedEquals(<String>[appFacingPackage.path]));
});
test(
'specifying a package of a federated plugin by its name should '
'include only that package', () async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1/plugin1.dart
''')),
];
final Directory pluginGroup = packagesDir.childDirectory('plugin1');
createFakePlugin('plugin1', pluginGroup);
final RepositoryPackage platformInterfacePackage =
createFakePlugin('plugin1_platform_interface', pluginGroup);
createFakePlugin('plugin1_web', pluginGroup);
await runCapturingPrint(runner, <String>[
'sample',
'--base-sha=main',
'--packages=plugin1_platform_interface'
]);
expect(command.plugins,
unorderedEquals(<String>[platformInterfacePackage.path]));
});
test('returns subpackages after the enclosing package', () async {
final SamplePackageCommand localCommand = SamplePackageCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
gitDir: MockGitDir(),
includeSubpackages: true,
);
final CommandRunner<void> localRunner =
CommandRunner<void>('common_command', 'subpackage testing');
localRunner.addCommand(localCommand);
final RepositoryPackage package =
createFakePackage('apackage', packagesDir);
await runCapturingPrint(localRunner, <String>['sample']);
expect(
localCommand.plugins,
containsAllInOrder(<String>[
package.path,
getExampleDir(package).path,
]));
});
group('conflicting package selection', () {
test('does not allow --packages with --run-on-changed-packages',
() async {
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--run-on-changed-packages',
'--packages=plugin1',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Only one of the package selection arguments')
]));
});
test('does not allow --packages with --packages-for-branch', () async {
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--packages-for-branch',
'--packages=plugin1',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Only one of the package selection arguments')
]));
});
test('does not allow --packages with --current-package', () async {
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--current-package',
'--packages=plugin1',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Only one of the package selection arguments')
]));
});
test(
'does not allow --run-on-changed-packages with --packages-for-branch',
() async {
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--packages-for-branch',
'--packages=plugin1',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Only one of the package selection arguments')
]));
});
});
group('current-package', () {
test('throws when run from outside of the packages directory', () async {
fileSystem.currentDirectory = packagesDir.parent;
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--current-package',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('--current-package can only be used within a repository '
'package or package group')
]));
});
test('throws when run directly in the packages directory', () async {
fileSystem.currentDirectory = packagesDir;
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'sample',
'--current-package',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('--current-package can only be used within a repository '
'package or package group')
]));
});
test('runs on a package when run from the package directory', () async {
final RepositoryPackage package =
createFakePlugin('a_package', packagesDir);
createFakePlugin('another_package', packagesDir);
fileSystem.currentDirectory = package.directory;
await runCapturingPrint(
runner, <String>['sample', '--current-package']);
expect(command.plugins, unorderedEquals(<String>[package.path]));
});
test('runs only app-facing package of a federated plugin', () async {
const String pluginName = 'foo';
final Directory groupDir = packagesDir.childDirectory(pluginName);
final RepositoryPackage package =
createFakePlugin(pluginName, groupDir);
createFakePlugin('${pluginName}_someplatform', groupDir);
createFakePackage('${pluginName}_platform_interface', groupDir);
fileSystem.currentDirectory = package.directory;
await runCapturingPrint(
runner, <String>['sample', '--current-package']);
expect(command.plugins, unorderedEquals(<String>[package.path]));
});
test('runs on a package when run from a package example directory',
() async {
final RepositoryPackage package = createFakePlugin(
'a_package', packagesDir,
examples: <String>['a', 'b', 'c']);
createFakePlugin('another_package', packagesDir);
fileSystem.currentDirectory = package.getExamples().first.directory;
await runCapturingPrint(
runner, <String>['sample', '--current-package']);
expect(command.plugins, unorderedEquals(<String>[package.path]));
});
test('runs on a package group when run from the group directory',
() async {
final Directory pluginGroup = packagesDir.childDirectory('a_plugin');
final RepositoryPackage plugin1 =
createFakePlugin('a_plugin_foo', pluginGroup);
final RepositoryPackage plugin2 =
createFakePlugin('a_plugin_bar', pluginGroup);
createFakePlugin('unrelated_plugin', packagesDir);
fileSystem.currentDirectory = pluginGroup;
await runCapturingPrint(
runner, <String>['sample', '--current-package']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
});
});
group('test run-on-changed-packages', () {
test('all plugins should be tested if there are no changes.', () async {
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
});
test(
'all plugins should be tested if there are no plugin related changes.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'AUTHORS')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
});
test('all plugins should be tested if .ci.yaml changes', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.ci.yaml
packages/plugin1/CHANGELOG
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for all packages, since a file has changed '
'that could affect the entire repository.')
]));
});
test('all plugins should be tested if anything in .ci/ changes',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.ci/Dockerfile
packages/plugin1/CHANGELOG
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for all packages, since a file has changed '
'that could affect the entire repository.')
]));
});
test('all plugins should be tested if anything in script/ changes.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
script/tool/bin/flutter_plugin_tools.dart
packages/plugin1/CHANGELOG
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for all packages, since a file has changed '
'that could affect the entire repository.')
]));
});
test('all plugins should be tested if the root analysis options change.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
analysis_options.yaml
packages/plugin1/CHANGELOG
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for all packages, since a file has changed '
'that could affect the entire repository.')
]));
});
test('all plugins should be tested if formatting options change.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.clang-format
packages/plugin1/CHANGELOG
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for all packages, since a file has changed '
'that could affect the entire repository.')
]));
});
test('Only changed plugin should be tested.', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Running for all packages that have diffs relative to "main"'),
]));
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test('multiple files in one plugin should also test the plugin',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1.dart
packages/plugin1/ios/plugin1.m
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test('multiple plugins changed should test all the changed plugins',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1.dart
packages/plugin2/ios/plugin2.m
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins,
unorderedEquals(<String>[plugin1.path, plugin2.path]));
});
test(
'multiple plugins inside the same plugin group changed should output the plugin group name',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1/plugin1.dart
packages/plugin1/plugin1_platform_interface/plugin1_platform_interface.dart
packages/plugin1/plugin1_web/plugin1_web.dart
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test(
'changing one plugin in a federated group should only include that plugin',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1/plugin1.dart
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin1_platform_interface',
packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin1_web', packagesDir.childDirectory('plugin1'));
await runCapturingPrint(runner,
<String>['sample', '--base-sha=main', '--run-on-changed-packages']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test('honors --exclude flag', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1.dart
packages/plugin2/ios/plugin2.m
packages/plugin3/plugin3.dart
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--exclude=plugin2,plugin3',
'--base-sha=main',
'--run-on-changed-packages'
]);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test('honors --filter-packages-to flag', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/plugin1/plugin1.dart
packages/plugin2/ios/plugin2.m
packages/plugin3/plugin3.dart
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--filter-packages-to=plugin1',
'--base-sha=main',
'--run-on-changed-packages'
]);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test(
'honors --filter-packages-to flag when a file is changed that makes '
'all packages potentially changed', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.ci.yaml
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--filter-packages-to=plugin1',
'--base-sha=main',
'--run-on-changed-packages'
]);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
test('--filter-packages-to handles federated plugin groups', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/a_plugin/a_plugin/lib/foo.dart
packages/a_plugin/a_plugin_impl/lib/foo.dart
packages/a_plugin/a_plugin_platform_interface/lib/foo.dart
''')),
];
final Directory groupDir = packagesDir.childDirectory('a_plugin');
final RepositoryPackage plugin1 =
createFakePlugin('a_plugin', groupDir);
final RepositoryPackage plugin2 =
createFakePlugin('a_plugin_impl', groupDir);
final RepositoryPackage plugin3 =
createFakePlugin('a_plugin_platform_interface', groupDir);
await runCapturingPrint(runner, <String>[
'sample',
'--filter-packages-to=a_plugin',
'--base-sha=main',
'--run-on-changed-packages'
]);
expect(
command.plugins,
unorderedEquals(
<String>[plugin1.path, plugin2.path, plugin3.path]));
});
test('--filter-packages-to and --exclude work together', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.ci.yaml
''')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir.childDirectory('plugin1'));
createFakePlugin('plugin2', packagesDir);
createFakePlugin('plugin3', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--filter-packages-to=plugin1,plugin2',
'--exclude=plugin2',
'--base-sha=main',
'--run-on-changed-packages'
]);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
});
});
group('test run-on-dirty-packages', () {
test('no packages should be tested if there are no changes.', () async {
createFakePackage('a_package', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--run-on-dirty-packages']);
expect(command.plugins, unorderedEquals(<String>[]));
});
test(
'no packages should be tested if there are no plugin related changes.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'AUTHORS')),
];
createFakePackage('a_package', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--run-on-dirty-packages']);
expect(command.plugins, unorderedEquals(<String>[]));
});
test('no packages should be tested even if special repo files change.',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
.ci.yaml
.ci/Dockerfile
.clang-format
analysis_options.yaml
script/tool/bin/flutter_plugin_tools.dart
''')),
];
createFakePackage('a_package', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--run-on-dirty-packages']);
expect(command.plugins, unorderedEquals(<String>[]));
});
test('Only changed packages should be tested.', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(
MockProcess(stdout: 'packages/a_package/lib/a_package.dart')),
];
final RepositoryPackage packageA =
createFakePackage('a_package', packagesDir);
createFakePlugin('b_package', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--run-on-dirty-packages']);
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Running for all packages that have uncommitted changes'),
]));
expect(command.plugins, unorderedEquals(<String>[packageA.path]));
});
test('multiple packages changed should test all the changed packages',
() async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/a_package/lib/a_package.dart
packages/b_package/lib/src/foo.dart
''')),
];
final RepositoryPackage packageA =
createFakePackage('a_package', packagesDir);
final RepositoryPackage packageB =
createFakePackage('b_package', packagesDir);
createFakePackage('c_package', packagesDir);
await runCapturingPrint(
runner, <String>['sample', '--run-on-dirty-packages']);
expect(command.plugins,
unorderedEquals(<String>[packageA.path, packageB.path]));
});
test('honors --exclude flag', () async {
processRunner.mockProcessesForExecutable['git-diff'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: '''
packages/a_package/lib/a_package.dart
packages/b_package/lib/src/foo.dart
''')),
];
final RepositoryPackage packageA =
createFakePackage('a_package', packagesDir);
createFakePackage('b_package', packagesDir);
createFakePackage('c_package', packagesDir);
await runCapturingPrint(runner, <String>[
'sample',
'--exclude=b_package',
'--run-on-dirty-packages'
]);
expect(command.plugins, unorderedEquals(<String>[packageA.path]));
});
});
});
group('--packages-for-branch', () {
test('only tests changed packages relative to the merge base on a branch',
() async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'a-branch')),
];
processRunner.mockProcessesForExecutable['git-merge-base'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1), <String>['--is-ancestor']),
FakeProcessInfo(MockProcess(stdout: 'abc123'),
<String>['--fork-point']), // finding merge base
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('--packages-for-branch: running on branch "a-branch"'),
contains(
'Running for all packages that have diffs relative to "abc123"'),
]));
// Ensure that it's diffing against the merge-base.
expect(
processRunner.recordedCalls,
contains(
const ProcessCall(
'git-diff', <String>['--name-only', 'abc123', 'HEAD'], null),
));
});
test('only tests changed packages relative to the previous commit on main',
() async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'main')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('--packages-for-branch: running on default branch.'),
contains(
'--packages-for-branch: using parent commit as the diff base'),
contains(
'Running for all packages that have diffs relative to "HEAD~"'),
]));
// Ensure that it's diffing against the prior commit.
expect(
processRunner.recordedCalls,
contains(
const ProcessCall(
'git-diff', <String>['--name-only', 'HEAD~', 'HEAD'], null),
));
});
test(
'only tests changed packages relative to the previous commit if '
'running on a specific hash from main', () async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'HEAD')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'--packages-for-branch: running on a commit from default branch.'),
contains(
'--packages-for-branch: using parent commit as the diff base'),
contains(
'Running for all packages that have diffs relative to "HEAD~"'),
]));
// Ensure that it's diffing against the prior commit.
expect(
processRunner.recordedCalls,
contains(
const ProcessCall(
'git-diff', <String>['--name-only', 'HEAD~', 'HEAD'], null),
));
});
test(
'only tests changed packages relative to the previous commit if '
'running on a specific hash from origin/main', () async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'HEAD')),
];
processRunner.mockProcessesForExecutable['git-merge-base'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 128), <String>[
'--is-ancestor',
'HEAD',
'main'
]), // Fail with a non-1 exit code for 'main'
FakeProcessInfo(MockProcess(), <String>[
'--is-ancestor',
'HEAD',
'origin/main'
]), // Succeed for the variant.
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'--packages-for-branch: running on a commit from default branch.'),
contains(
'--packages-for-branch: using parent commit as the diff base'),
contains(
'Running for all packages that have diffs relative to "HEAD~"'),
]));
// Ensure that it's diffing against the prior commit.
expect(
processRunner.recordedCalls,
contains(
const ProcessCall(
'git-diff', <String>['--name-only', 'HEAD~', 'HEAD'], null),
));
});
test(
'only tests changed packages relative to the previous commit on master',
() async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'master')),
];
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir);
createFakePlugin('plugin2', packagesDir);
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch']);
expect(command.plugins, unorderedEquals(<String>[plugin1.path]));
expect(
output,
containsAllInOrder(<Matcher>[
contains('--packages-for-branch: running on default branch.'),
contains(
'--packages-for-branch: using parent commit as the diff base'),
contains(
'Running for all packages that have diffs relative to "HEAD~"'),
]));
// Ensure that it's diffing against the prior commit.
expect(
processRunner.recordedCalls,
contains(
const ProcessCall(
'git-diff', <String>['--name-only', 'HEAD~', 'HEAD'], null),
));
});
test('throws if getting the branch fails', () async {
processRunner.mockProcessesForExecutable['git-diff'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(stdout: 'packages/plugin1/plugin1.dart')),
];
processRunner.mockProcessesForExecutable['git-rev-parse'] =
<FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1)),
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['sample', '--packages-for-branch'],
errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Unable to determine branch'),
]));
});
});
group('sharding', () {
test('distributes evenly when evenly divisible', () async {
final List<List<RepositoryPackage>> expectedShards =
<List<RepositoryPackage>>[
<RepositoryPackage>[
createFakePackage('package1', packagesDir),
createFakePackage('package2', packagesDir),
createFakePackage('package3', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package4', packagesDir),
createFakePackage('package5', packagesDir),
createFakePackage('package6', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package7', packagesDir),
createFakePackage('package8', packagesDir),
createFakePackage('package9', packagesDir),
],
];
for (int i = 0; i < expectedShards.length; ++i) {
final SamplePackageCommand localCommand = SamplePackageCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
gitDir: MockGitDir(),
);
final CommandRunner<void> localRunner =
CommandRunner<void>('common_command', 'Shard testing');
localRunner.addCommand(localCommand);
await runCapturingPrint(localRunner, <String>[
'sample',
'--shardIndex=$i',
'--shardCount=3',
]);
expect(
localCommand.plugins,
unorderedEquals(expectedShards[i]
.map((RepositoryPackage package) => package.path)
.toList()));
}
});
test('distributes as evenly as possible when not evenly divisible',
() async {
final List<List<RepositoryPackage>> expectedShards =
<List<RepositoryPackage>>[
<RepositoryPackage>[
createFakePackage('package1', packagesDir),
createFakePackage('package2', packagesDir),
createFakePackage('package3', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package4', packagesDir),
createFakePackage('package5', packagesDir),
createFakePackage('package6', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package7', packagesDir),
createFakePackage('package8', packagesDir),
],
];
for (int i = 0; i < expectedShards.length; ++i) {
final SamplePackageCommand localCommand = SamplePackageCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
gitDir: MockGitDir(),
);
final CommandRunner<void> localRunner =
CommandRunner<void>('common_command', 'Shard testing');
localRunner.addCommand(localCommand);
await runCapturingPrint(localRunner, <String>[
'sample',
'--shardIndex=$i',
'--shardCount=3',
]);
expect(
localCommand.plugins,
unorderedEquals(expectedShards[i]
.map((RepositoryPackage package) => package.path)
.toList()));
}
});
// In CI (which is the use case for sharding) we often want to run muliple
// commands on the same set of packages, but the exclusion lists for those
// commands may be different. In those cases we still want all the commands
// to operate on a consistent set of plugins.
//
// E.g., some commands require running build-examples in a previous step;
// excluding some plugins from the later step shouldn't change what's tested
// in each shard, as it may no longer align with what was built.
test('counts excluded plugins when sharding', () async {
final List<List<RepositoryPackage>> expectedShards =
<List<RepositoryPackage>>[
<RepositoryPackage>[
createFakePackage('package1', packagesDir),
createFakePackage('package2', packagesDir),
createFakePackage('package3', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package4', packagesDir),
createFakePackage('package5', packagesDir),
createFakePackage('package6', packagesDir),
],
<RepositoryPackage>[
createFakePackage('package7', packagesDir),
],
];
// These would be in the last shard, but are excluded.
createFakePackage('package8', packagesDir);
createFakePackage('package9', packagesDir);
for (int i = 0; i < expectedShards.length; ++i) {
final SamplePackageCommand localCommand = SamplePackageCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
gitDir: MockGitDir(),
);
final CommandRunner<void> localRunner =
CommandRunner<void>('common_command', 'Shard testing');
localRunner.addCommand(localCommand);
await runCapturingPrint(localRunner, <String>[
'sample',
'--shardIndex=$i',
'--shardCount=3',
'--exclude=package8,package9',
]);
expect(
localCommand.plugins,
unorderedEquals(expectedShards[i]
.map((RepositoryPackage package) => package.path)
.toList()));
}
});
});
}
class SamplePackageCommand extends PackageCommand {
SamplePackageCommand(
super.packagesDir, {
super.processRunner,
super.platform,
super.gitDir,
this.includeSubpackages = false,
});
final List<String> plugins = <String>[];
final bool includeSubpackages;
@override
final String name = 'sample';
@override
final String description = 'sample command';
@override
Future<void> run() async {
final Stream<PackageEnumerationEntry> packages = includeSubpackages
? getTargetPackagesAndSubpackages()
: getTargetPackages();
await for (final PackageEnumerationEntry entry in packages) {
plugins.add(entry.package.path);
}
}
}
| packages/script/tool/test/common/package_command_test.dart/0 | {
"file_path": "packages/script/tool/test/common/package_command_test.dart",
"repo_id": "packages",
"token_count": 20996
} | 1,123 |
// Copyright 2013 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:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_plugin_tools/src/common/core.dart';
import 'package:flutter_plugin_tools/src/common/file_utils.dart';
import 'package:flutter_plugin_tools/src/firebase_test_lab_command.dart';
import 'package:path/path.dart' as p;
import 'package:test/test.dart';
import 'mocks.dart';
import 'util.dart';
void main() {
group('FirebaseTestLabCommand', () {
FileSystem fileSystem;
late MockPlatform mockPlatform;
late Directory packagesDir;
late CommandRunner<void> runner;
late RecordingProcessRunner processRunner;
setUp(() {
fileSystem = MemoryFileSystem();
mockPlatform = MockPlatform();
packagesDir = createPackagesDirectory(fileSystem: fileSystem);
processRunner = RecordingProcessRunner();
final FirebaseTestLabCommand command = FirebaseTestLabCommand(
packagesDir,
processRunner: processRunner,
platform: mockPlatform,
);
runner = CommandRunner<void>(
'firebase_test_lab_command', 'Test for $FirebaseTestLabCommand');
runner.addCommand(command);
});
void writeJavaTestFile(RepositoryPackage plugin, String relativeFilePath,
{String runnerClass = 'FlutterTestRunner'}) {
childFileWithSubcomponents(
plugin.directory, p.posix.split(relativeFilePath))
.writeAsStringSync('''
@DartIntegrationTest
@RunWith($runnerClass.class)
public class MainActivityTest {
@Rule
public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class);
}
''');
}
test('fails if gcloud auth fails', () async {
processRunner.mockProcessesForExecutable['gcloud'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1), <String>['auth'])
];
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
Error? commandError;
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--service-key=/path/to/key',
], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Unable to activate gcloud account.'),
]));
});
test('retries gcloud set', () async {
processRunner.mockProcessesForExecutable['gcloud'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(), <String>['auth']),
FakeProcessInfo(MockProcess(exitCode: 1), <String>['config']),
];
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--service-key=/path/to/key',
'--project=a-project'
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Warning: gcloud config set returned a non-zero exit code. Continuing anyway.'),
]));
});
test('only runs gcloud configuration once', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin1 =
createFakePlugin('plugin1', packagesDir, extraFiles: <String>[
'test/plugin_test.dart',
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin1, javaTestFileRelativePath);
final RepositoryPackage plugin2 =
createFakePlugin('plugin2', packagesDir, extraFiles: <String>[
'test/plugin_test.dart',
'example/integration_test/bar_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin2, javaTestFileRelativePath);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--project=a-project',
'--service-key=/path/to/key',
'--device',
'model=redfin,version=30',
'--device',
'model=seoul,version=26',
'--test-run-id',
'testRunId',
'--build-id',
'buildId',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin1'),
contains('Firebase project configured.'),
contains('Testing example/integration_test/foo_test.dart...'),
contains('Running for plugin2'),
contains('Testing example/integration_test/bar_test.dart...'),
]),
);
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'gcloud',
'auth activate-service-account --key-file=/path/to/key'
.split(' '),
null),
ProcessCall(
'gcloud', 'config set project a-project'.split(' '), null),
ProcessCall(
'/packages/plugin1/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
'/packages/plugin1/example/android'),
ProcessCall(
'/packages/plugin1/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin1/example/integration_test/foo_test.dart'
.split(' '),
'/packages/plugin1/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin1/buildId/testRunId/example/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin1/example'),
ProcessCall(
'/packages/plugin2/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
'/packages/plugin2/example/android'),
ProcessCall(
'/packages/plugin2/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin2/example/integration_test/bar_test.dart'
.split(' '),
'/packages/plugin2/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin2/buildId/testRunId/example/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin2/example'),
]),
);
});
test('runs integration tests', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'test/plugin_test.dart',
'example/integration_test/bar_test.dart',
'example/integration_test/foo_test.dart',
'example/integration_test/should_not_run.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
'--device',
'model=seoul,version=26',
'--test-run-id',
'testRunId',
'--build-id',
'buildId',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('Testing example/integration_test/bar_test.dart...'),
contains('Testing example/integration_test/foo_test.dart...'),
]),
);
expect(output, isNot(contains('test/plugin_test.dart')));
expect(output,
isNot(contains('example/integration_test/should_not_run.dart')));
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/integration_test/bar_test.dart'
.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin/example'),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/integration_test/foo_test.dart'
.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example/1/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin/example'),
]),
);
});
test('runs for all examples', () async {
const List<String> examples = <String>['example1', 'example2'];
const String javaTestFileExampleRelativePath =
'android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin = createFakePlugin('plugin', packagesDir,
examples: examples,
extraFiles: <String>[
for (final String example in examples) ...<String>[
'example/$example/integration_test/a_test.dart',
'example/$example/android/gradlew',
'example/$example/$javaTestFileExampleRelativePath',
],
]);
for (final String example in examples) {
writeJavaTestFile(
plugin, 'example/$example/$javaTestFileExampleRelativePath');
}
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
'--device',
'model=seoul,version=26',
'--test-run-id',
'testRunId',
'--build-id',
'buildId',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Testing example/example1/integration_test/a_test.dart...'),
contains('Testing example/example2/integration_test/a_test.dart...'),
]),
);
expect(
processRunner.recordedCalls,
containsAll(<ProcessCall>[
ProcessCall(
'/packages/plugin/example/example1/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/example1/integration_test/a_test.dart'
.split(' '),
'/packages/plugin/example/example1/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example1/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin/example/example1'),
ProcessCall(
'/packages/plugin/example/example2/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/example2/integration_test/a_test.dart'
.split(' '),
'/packages/plugin/example/example2/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example2/0/ --device model=redfin,version=30 --device model=seoul,version=26'
.split(' '),
'/packages/plugin/example/example2'),
]),
);
});
test('fails if a test fails twice', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/bar_test.dart',
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
processRunner.mockProcessesForExecutable['gcloud'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1),
<String>['firebase', 'test']), // integration test #1
FakeProcessInfo(MockProcess(exitCode: 1),
<String>['firebase', 'test']), // integration test #1 retry
FakeProcessInfo(
MockProcess(), <String>['firebase', 'test']), // integration test #2
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Testing example/integration_test/bar_test.dart...'),
contains('Testing example/integration_test/foo_test.dart...'),
contains('plugin:\n'
' example/integration_test/bar_test.dart failed tests'),
]),
);
});
test('passes with warning if a test fails once, then passes on retry',
() async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/bar_test.dart',
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
processRunner.mockProcessesForExecutable['gcloud'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1),
<String>['firebase', 'test']), // integration test #1
FakeProcessInfo(MockProcess(),
<String>['firebase', 'test']), // integration test #1 retry
FakeProcessInfo(
MockProcess(), <String>['firebase', 'test']), // integration test #2
];
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Testing example/integration_test/bar_test.dart...'),
contains('bar_test.dart failed on attempt 1. Retrying...'),
contains('Testing example/integration_test/foo_test.dart...'),
contains('Ran for 1 package(s) (1 with warnings)'),
]),
);
});
test('fails for plugins with no androidTest directory', () async {
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
'example/android/gradlew',
]);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('No androidTest directory found.'),
contains('The following packages had errors:'),
contains('plugin:\n'
' No tests ran (use --exclude if this is intentional).'),
]),
);
});
test('skips for non-plugin packages with no androidTest directory',
() async {
createFakePackage('a_package', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
'example/android/gradlew',
]);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for a_package'),
contains('No androidTest directory found.'),
contains('No examples support Android.'),
contains('Skipped 1 package'),
]),
);
});
test('fails for packages with no integration test files', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('No integration tests were run'),
contains('The following packages had errors:'),
contains('plugin:\n'
' No tests ran (use --exclude if this is intentional).'),
]),
);
});
test('fails for packages with no integration_test runner', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'test/plugin_test.dart',
'example/integration_test/bar_test.dart',
'example/integration_test/foo_test.dart',
'example/integration_test/should_not_run.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
// Use the wrong @RunWith annotation.
writeJavaTestFile(plugin, javaTestFileRelativePath,
runnerClass: 'AndroidJUnit4.class');
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('No integration_test runner found. '
'See the integration_test package README for setup instructions.'),
contains('plugin:\n'
' No integration_test runner.'),
]),
);
});
test('supports kotlin implementation of integration_test runner', () async {
const String kotlinTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.kt';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'test/plugin_test.dart',
'example/integration_test/foo_test.dart',
'example/android/gradlew',
kotlinTestFileRelativePath,
]);
// Kotlin equivalent of the test runner
childFileWithSubcomponents(
plugin.directory, p.posix.split(kotlinTestFileRelativePath))
.writeAsStringSync('''
@DartIntegrationTest
@RunWith(FlutterTestRunner::class)
class MainActivityTest {
@JvmField @Rule var rule = ActivityTestRule(MainActivity::class.java)
}
''');
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('Testing example/integration_test/foo_test.dart...'),
contains('Ran for 1 package')
]),
);
});
test('skips packages with no android directory', () async {
createFakePackage('package', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
]);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for package'),
contains('No examples support Android'),
]),
);
expect(output,
isNot(contains('Testing example/integration_test/foo_test.dart...')));
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[]),
);
});
test('builds if gradlew is missing', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
final List<String> output = await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
'--test-run-id',
'testRunId',
'--build-id',
'buildId',
]);
expect(
output,
containsAllInOrder(<Matcher>[
contains('Running for plugin'),
contains('Running flutter build apk...'),
contains('Testing example/integration_test/foo_test.dart...'),
]),
);
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'flutter',
'build apk --config-only'.split(' '),
'/packages/plugin/example/android',
),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true'.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/integration_test/foo_test.dart'
.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example/0/ --device model=redfin,version=30'
.split(' '),
'/packages/plugin/example'),
]),
);
});
test('fails if building to generate gradlew fails', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(exitCode: 1), <String>['build'])
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Unable to build example apk'),
]));
});
test('fails if assembleAndroidTest fails', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
final String gradlewPath = plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.childFile('gradlew')
.path;
processRunner.mockProcessesForExecutable[gradlewPath] = <FakeProcessInfo>[
FakeProcessInfo(
MockProcess(exitCode: 1), <String>['app:assembleAndroidTest']),
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Unable to assemble androidTest'),
]));
});
test('fails if assembleDebug fails', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
final String gradlewPath = plugin
.getExamples()
.first
.platformDirectory(FlutterPlatform.android)
.childFile('gradlew')
.path;
processRunner.mockProcessesForExecutable[gradlewPath] = <FakeProcessInfo>[
FakeProcessInfo(MockProcess(), <String>['app:assembleAndroidTest']),
FakeProcessInfo(MockProcess(exitCode: 1), <String>['app:assembleDebug'])
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner,
<String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
],
errorHandler: (Error e) {
commandError = e;
},
);
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Could not build example/integration_test/foo_test.dart'),
contains('The following packages had errors:'),
contains(' plugin:\n'
' example/integration_test/foo_test.dart failed to build'),
]));
});
test('experimental flag', () async {
const String javaTestFileRelativePath =
'example/android/app/src/androidTest/MainActivityTest.java';
final RepositoryPackage plugin =
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
'example/integration_test/foo_test.dart',
'example/android/gradlew',
javaTestFileRelativePath,
]);
writeJavaTestFile(plugin, javaTestFileRelativePath);
await runCapturingPrint(runner, <String>[
'firebase-test-lab',
'--results-bucket=a_bucket',
'--device',
'model=redfin,version=30',
'--test-run-id',
'testRunId',
'--build-id',
'buildId',
'--enable-experiment=exp1',
]);
expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleAndroidTest -Pverbose=true -Pextra-front-end-options=--enable-experiment%3Dexp1 -Pextra-gen-snapshot-options=--enable-experiment%3Dexp1'
.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'/packages/plugin/example/android/gradlew',
'app:assembleDebug -Pverbose=true -Ptarget=/packages/plugin/example/integration_test/foo_test.dart -Pextra-front-end-options=--enable-experiment%3Dexp1 -Pextra-gen-snapshot-options=--enable-experiment%3Dexp1'
.split(' '),
'/packages/plugin/example/android'),
ProcessCall(
'gcloud',
'firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk --timeout 7m --results-bucket=gs://a_bucket --results-dir=plugins_android_test/plugin/buildId/testRunId/example/0/ --device model=redfin,version=30'
.split(' '),
'/packages/plugin/example'),
]),
);
});
});
}
| packages/script/tool/test/firebase_test_lab_command_test.dart/0 | {
"file_path": "packages/script/tool/test/firebase_test_lab_command_test.dart",
"repo_id": "packages",
"token_count": 14220
} | 1,124 |
// Copyright 2013 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:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_plugin_tools/src/common/core.dart';
import 'package:flutter_plugin_tools/src/repo_package_info_check_command.dart';
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';
import 'common/package_command_test.mocks.dart';
import 'util.dart';
void main() {
late CommandRunner<void> runner;
late FileSystem fileSystem;
late Directory root;
late Directory packagesDir;
setUp(() {
fileSystem = MemoryFileSystem();
root = fileSystem.currentDirectory;
packagesDir = root.childDirectory('packages');
final MockGitDir gitDir = MockGitDir();
when(gitDir.path).thenReturn(root.path);
final RepoPackageInfoCheckCommand command = RepoPackageInfoCheckCommand(
packagesDir,
gitDir: gitDir,
);
runner = CommandRunner<void>(
'dependabot_test', 'Test for $RepoPackageInfoCheckCommand');
runner.addCommand(command);
});
String readmeTableHeader() {
return '''
| Package | Pub | Points | Popularity | Issues | Pull requests |
|---------|-----|--------|------------|--------|---------------|
''';
}
void writeCodeOwners(List<RepositoryPackage> ownedPackages) {
final List<String> subpaths = ownedPackages
.map((RepositoryPackage p) => p.isFederated
? <String>[p.directory.parent.basename, p.directory.basename]
.join('/')
: p.directory.basename)
.toList();
root.childFile('CODEOWNERS').writeAsStringSync('''
${subpaths.map((String subpath) => 'packages/$subpath/** @someone').join('\n')}
''');
}
String readmeTableEntry(String packageName) {
final String encodedTag = Uri.encodeComponent('p: $packageName');
return '| [$packageName](./packages/$packageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
}
test('passes for correct README coverage', () async {
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
${readmeTableEntry('a_package')}
''');
writeCodeOwners(packages);
final List<String> output =
await runCapturingPrint(runner, <String>['repo-package-info-check']);
expect(output,
containsAllInOrder(<Matcher>[contains('Ran for 1 package(s)')]));
});
test('passes for federated plugins with only app-facing package listed',
() async {
const String pluginName = 'foo';
final Directory pluginDir = packagesDir.childDirectory(pluginName);
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePlugin(pluginName, pluginDir),
createFakePlugin('${pluginName}_platform_interface', pluginDir),
createFakePlugin('${pluginName}_android', pluginDir),
createFakePlugin('${pluginName}_ios', pluginDir),
];
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
${readmeTableEntry(pluginName)}
''');
writeCodeOwners(packages);
final List<String> output =
await runCapturingPrint(runner, <String>['repo-package-info-check']);
expect(output,
containsAllInOrder(<Matcher>[contains('Ran for 4 package(s)')]));
});
test('fails for unexpected README table entry', () async {
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
${readmeTableEntry('another_package')}
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Unknown package "another_package" in root README.md table'),
]));
});
test('fails for missing README table entry', () async {
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
createFakePackage('another_package', packagesDir),
];
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
${readmeTableEntry('another_package')}
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Missing repo root README.md table entry'),
contains('a_package:\n'
' Missing repo root README.md table entry')
]));
});
test('fails for unexpected format in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry = '| [$packageName](./packages/$packageName/) | '
'Some random text | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Invalid repo root README.md table entry: "Some random text"'),
contains('a_package:\n'
' Invalid root README.md table entry')
]));
});
test('fails for incorrect source link in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
const String incorrectPackageName = 'a_pakage';
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry =
'| [$packageName](./packages/$incorrectPackageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Incorrect link in root README.md table: "./packages/$incorrectPackageName/"'),
contains('a_package:\n'
' Incorrect link in root README.md table')
]));
});
test('fails for incorrect packages/* link in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
const String incorrectPackageName = 'a_pakage';
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry = '| [$packageName](./packages/$packageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$incorrectPackageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Incorrect link in root README.md table: "https://pub.dev/packages/$incorrectPackageName/score"'),
contains('a_package:\n'
' Incorrect link in root README.md table')
]));
});
test('fails for incorrect labels/* link in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
final String incorrectTag = Uri.encodeComponent('p: a_pakage');
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry = '| [$packageName](./packages/$packageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$incorrectTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Incorrect link in root README.md table: "https://github.com/flutter/flutter/labels/$incorrectTag"'),
contains('a_package:\n'
' Incorrect link in root README.md table')
]));
});
test('fails for incorrect packages/* anchor in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
const String incorrectPackageName = 'a_pakage';
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry = '| [$packageName](./packages/$packageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Incorrect anchor in root README.md table: ""'),
contains('a_package:\n'
' Incorrect anchor in root README.md table')
]));
});
test('fails for incorrect tag query anchor in README table entry', () async {
const String packageName = 'a_package';
final String encodedTag = Uri.encodeComponent('p: $packageName');
final String incorrectTag = Uri.encodeComponent('p: a_pakage');
final List<RepositoryPackage> packages = <RepositoryPackage>[
createFakePackage('a_package', packagesDir),
];
final String entry = '| [$packageName](./packages/$packageName/) | '
'[](https://pub.dev/packages/$packageName) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://pub.dev/packages/$packageName/score) | '
'[](https://github.com/flutter/flutter/labels/$encodedTag) | '
'[](https://github.com/flutter/packages/labels/$encodedTag) |';
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
$entry
''');
writeCodeOwners(packages);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains(
'Incorrect anchor in root README.md table: "'),
contains('a_package:\n'
' Incorrect anchor in root README.md table')
]));
});
test('fails for missing CODEOWNER', () async {
const String packageName = 'a_package';
createFakePackage(packageName, packagesDir);
root.childFile('README.md').writeAsStringSync('''
${readmeTableHeader()}
${readmeTableEntry(packageName)}
''');
writeCodeOwners(<RepositoryPackage>[]);
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['repo-package-info-check'], errorHandler: (Error e) {
commandError = e;
});
expect(commandError, isA<ToolExit>());
expect(
output,
containsAllInOrder(<Matcher>[
contains('Missing CODEOWNERS entry.'),
contains('a_package:\n'
' Missing CODEOWNERS entry')
]));
});
}
| packages/script/tool/test/repo_package_info_check_command_test.dart/0 | {
"file_path": "packages/script/tool/test/repo_package_info_check_command_test.dart",
"repo_id": "packages",
"token_count": 6515
} | 1,125 |
<!DOCTYPE html>
<!-- Copyright 2013 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. -->
<html>
<head>
<title>Cupertino Icons 1.0.0 Gallery</title>
<link href="css/icons.css" rel="stylesheet" type="text/css" />
<style>
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
body {
background: #fff;
color: #333;
font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0;
}
header {
border-bottom: 1px solid #eee;
margin-bottom: 20px;
overflow: hidden;
padding: 20px 0;
height: 60px;
display: flex;
align-items: center;
}
header h1 {
font-size: 21px;
font-weight: 400;
flex: 1;
}
.search-bar {
position: relative;
}
.search-bar>i {
position: absolute;
left: 7px;
top: 4px;
font-size: 22px;
}
.search-bar>input {
width: 200px;
outline: none;
font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
border: 1px solid #ccc;
border-radius: 5px;
padding: 3px 5px 3px 30px;
}
.content .hidden {
display: none;
}
.center {
margin-left: auto;
margin-right: auto;
max-width: 80%;
}
.icons {
overflow: hidden;
}
.content .icon-cell .cupertino-icons {
cursor: pointer;
}
.content {
padding-bottom: 250px;
}
.icons .icon-cell {
float: left;
width: calc(100% / 7);
text-align: center;
height: 100px;
margin-top: 30px;
}
@media (max-width: 1200px) {
.icons .icon-cell {
width: calc(100% / 5);
}
}
@media (max-width: 900px) {
.icons .icon-cell {
width: calc(100% / 4);
}
}
.icons .icon-name,
.icons .icon-size {
display: block;
font-size: 13.5px;
color: #666;
margin-top: 10px;
padding: 0px 10px;
word-break: break-all;
}
@media (max-width: 1200px) {
.icons .icon-name {
font-size: 12px;
}
}
@media (max-width: 900px) {
.icons .icon-name {
font-size: 11px;
}
}
.cupertino-icons.size-14 {
font-size: 14px;
}
.cupertino-icons.size-20 {
font-size: 20px;
}
.cupertino-icons.size-24 {
font-size: 24px;
}
.cupertino-icons.size-28 {
font-size: 28px;
}
.cupertino-icons.size-32 {
font-size: 32px;
}
.cupertino-icons.size-56 {
font-size: 56px;
}
.cupertino-icons.size-112 {
font-size: 112px;
}
.icon-preview {
box-shadow: 0px -10px 20px rgba(0,0,0,0.3);
background: #fff;
position: fixed;
bottom: 0;
left: 50%;
margin-left: -480px;
z-index: 100;
width: 960px;
display: none;
}
@media (max-width: 960px) {
.icon-preview {
left: 0;
width: 100%;
margin-left: 0;
}
}
.icon-preview .icons {
font-size: 0;
padding-bottom: 10px;
}
.icon-preview .icon-cell {
float: none;
display: inline-block;
margin: 0;
vertical-align: bottom;
height: auto;
}
.icon-preview .icon-preview-name {
font-size: 18px;
padding: 10px;
border-bottom: 1px solid #eee;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="center">
<header>
<h1>Cupertino Icons 1.0.0 Gallery</h1>
<div class="search-bar">
<i class="cupertino-icons">search</i>
<input placeholder="Search..." />
</div>
</header>
<div class="content">
<div class="icons">
<div class="icon-cell">
<i class="cupertino-icons size-28">airplane</i>
<span class="icon-name">airplane</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">alarm</i>
<span class="icon-name">alarm</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">alarm_fill</i>
<span class="icon-name">alarm_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">alt</i>
<span class="icon-name">alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ant</i>
<span class="icon-name">ant</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ant_circle</i>
<span class="icon-name">ant_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ant_circle_fill</i>
<span class="icon-name">ant_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ant_fill</i>
<span class="icon-name">ant_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">antenna_radiowaves_left_right</i>
<span class="icon-name">antenna_radiowaves_left_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">app</i>
<span class="icon-name">app</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">app_badge</i>
<span class="icon-name">app_badge</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">app_badge_fill</i>
<span class="icon-name">app_badge_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">app_fill</i>
<span class="icon-name">app_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">archivebox</i>
<span class="icon-name">archivebox</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">archivebox_fill</i>
<span class="icon-name">archivebox_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_2_circlepath</i>
<span class="icon-name">arrow_2_circlepath</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_2_circlepath_circle</i>
<span class="icon-name">arrow_2_circlepath_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_2_circlepath_circle_fill</i>
<span class="icon-name">arrow_2_circlepath_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_2_squarepath</i>
<span class="icon-name">arrow_2_squarepath</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_3_trianglepath</i>
<span class="icon-name">arrow_3_trianglepath</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_branch</i>
<span class="icon-name">arrow_branch</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_clockwise</i>
<span class="icon-name">arrow_clockwise</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_clockwise_circle</i>
<span class="icon-name">arrow_clockwise_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_clockwise_circle_fill</i>
<span class="icon-name">arrow_clockwise_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_counterclockwise</i>
<span class="icon-name">arrow_counterclockwise</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_counterclockwise_circle</i>
<span class="icon-name">arrow_counterclockwise_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_counterclockwise_circle_fill</i>
<span class="icon-name">arrow_counterclockwise_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down</i>
<span class="icon-name">arrow_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_circle</i>
<span class="icon-name">arrow_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_circle_fill</i>
<span class="icon-name">arrow_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_doc</i>
<span class="icon-name">arrow_down_doc</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_doc_fill</i>
<span class="icon-name">arrow_down_doc_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_left</i>
<span class="icon-name">arrow_down_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_left_circle</i>
<span class="icon-name">arrow_down_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_left_circle_fill</i>
<span class="icon-name">arrow_down_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_left_square</i>
<span class="icon-name">arrow_down_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_left_square_fill</i>
<span class="icon-name">arrow_down_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right</i>
<span class="icon-name">arrow_down_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right_arrow_up_left</i>
<span class="icon-name">arrow_down_right_arrow_up_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right_circle</i>
<span class="icon-name">arrow_down_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right_circle_fill</i>
<span class="icon-name">arrow_down_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right_square</i>
<span class="icon-name">arrow_down_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_right_square_fill</i>
<span class="icon-name">arrow_down_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_square</i>
<span class="icon-name">arrow_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_square_fill</i>
<span class="icon-name">arrow_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_to_line</i>
<span class="icon-name">arrow_down_to_line</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_down_to_line_alt</i>
<span class="icon-name">arrow_down_to_line_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left</i>
<span class="icon-name">arrow_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_circle</i>
<span class="icon-name">arrow_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_circle_fill</i>
<span class="icon-name">arrow_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_right</i>
<span class="icon-name">arrow_left_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_right_circle</i>
<span class="icon-name">arrow_left_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_right_circle_fill</i>
<span class="icon-name">arrow_left_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_right_square</i>
<span class="icon-name">arrow_left_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_right_square_fill</i>
<span class="icon-name">arrow_left_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_square</i>
<span class="icon-name">arrow_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_square_fill</i>
<span class="icon-name">arrow_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_to_line</i>
<span class="icon-name">arrow_left_to_line</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_left_to_line_alt</i>
<span class="icon-name">arrow_left_to_line_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_merge</i>
<span class="icon-name">arrow_merge</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right</i>
<span class="icon-name">arrow_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_arrow_left</i>
<span class="icon-name">arrow_right_arrow_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_arrow_left_circle</i>
<span class="icon-name">arrow_right_arrow_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_arrow_left_circle_fill</i>
<span class="icon-name">arrow_right_arrow_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_arrow_left_square</i>
<span class="icon-name">arrow_right_arrow_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_arrow_left_square_fill</i>
<span class="icon-name">arrow_right_arrow_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_circle</i>
<span class="icon-name">arrow_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_circle_fill</i>
<span class="icon-name">arrow_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_square</i>
<span class="icon-name">arrow_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_square_fill</i>
<span class="icon-name">arrow_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_to_line</i>
<span class="icon-name">arrow_right_to_line</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_right_to_line_alt</i>
<span class="icon-name">arrow_right_to_line_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_swap</i>
<span class="icon-name">arrow_swap</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_down_left</i>
<span class="icon-name">arrow_turn_down_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_down_right</i>
<span class="icon-name">arrow_turn_down_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_left_down</i>
<span class="icon-name">arrow_turn_left_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_left_up</i>
<span class="icon-name">arrow_turn_left_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_right_down</i>
<span class="icon-name">arrow_turn_right_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_right_up</i>
<span class="icon-name">arrow_turn_right_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_up_left</i>
<span class="icon-name">arrow_turn_up_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_turn_up_right</i>
<span class="icon-name">arrow_turn_up_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up</i>
<span class="icon-name">arrow_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_arrow_down</i>
<span class="icon-name">arrow_up_arrow_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_arrow_down_circle</i>
<span class="icon-name">arrow_up_arrow_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_arrow_down_circle_fill</i>
<span class="icon-name">arrow_up_arrow_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_arrow_down_square</i>
<span class="icon-name">arrow_up_arrow_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_arrow_down_square_fill</i>
<span class="icon-name">arrow_up_arrow_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_bin</i>
<span class="icon-name">arrow_up_bin</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_bin_fill</i>
<span class="icon-name">arrow_up_bin_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_circle</i>
<span class="icon-name">arrow_up_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_circle_fill</i>
<span class="icon-name">arrow_up_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_doc</i>
<span class="icon-name">arrow_up_doc</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_doc_fill</i>
<span class="icon-name">arrow_up_doc_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_down</i>
<span class="icon-name">arrow_up_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_down_circle</i>
<span class="icon-name">arrow_up_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_down_circle_fill</i>
<span class="icon-name">arrow_up_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_down_square</i>
<span class="icon-name">arrow_up_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_down_square_fill</i>
<span class="icon-name">arrow_up_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left</i>
<span class="icon-name">arrow_up_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left_arrow_down_right</i>
<span class="icon-name">arrow_up_left_arrow_down_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left_circle</i>
<span class="icon-name">arrow_up_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left_circle_fill</i>
<span class="icon-name">arrow_up_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left_square</i>
<span class="icon-name">arrow_up_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_left_square_fill</i>
<span class="icon-name">arrow_up_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right</i>
<span class="icon-name">arrow_up_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_circle</i>
<span class="icon-name">arrow_up_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_circle_fill</i>
<span class="icon-name">arrow_up_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_diamond</i>
<span class="icon-name">arrow_up_right_diamond</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_diamond_fill</i>
<span class="icon-name">arrow_up_right_diamond_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_square</i>
<span class="icon-name">arrow_up_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_right_square_fill</i>
<span class="icon-name">arrow_up_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_square</i>
<span class="icon-name">arrow_up_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_square_fill</i>
<span class="icon-name">arrow_up_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_to_line</i>
<span class="icon-name">arrow_up_to_line</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_up_to_line_alt</i>
<span class="icon-name">arrow_up_to_line_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_down</i>
<span class="icon-name">arrow_uturn_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_down_circle</i>
<span class="icon-name">arrow_uturn_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_down_circle_fill</i>
<span class="icon-name">arrow_uturn_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_down_square</i>
<span class="icon-name">arrow_uturn_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_down_square_fill</i>
<span class="icon-name">arrow_uturn_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_left</i>
<span class="icon-name">arrow_uturn_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_left_circle</i>
<span class="icon-name">arrow_uturn_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_left_circle_fill</i>
<span class="icon-name">arrow_uturn_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_left_square</i>
<span class="icon-name">arrow_uturn_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_left_square_fill</i>
<span class="icon-name">arrow_uturn_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_right</i>
<span class="icon-name">arrow_uturn_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_right_circle</i>
<span class="icon-name">arrow_uturn_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_right_circle_fill</i>
<span class="icon-name">arrow_uturn_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_right_square</i>
<span class="icon-name">arrow_uturn_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_right_square_fill</i>
<span class="icon-name">arrow_uturn_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_up</i>
<span class="icon-name">arrow_uturn_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_up_circle</i>
<span class="icon-name">arrow_uturn_up_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_up_circle_fill</i>
<span class="icon-name">arrow_uturn_up_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_up_square</i>
<span class="icon-name">arrow_uturn_up_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrow_uturn_up_square_fill</i>
<span class="icon-name">arrow_uturn_up_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left</i>
<span class="icon-name">arrowshape_turn_up_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left_2</i>
<span class="icon-name">arrowshape_turn_up_left_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left_2_fill</i>
<span class="icon-name">arrowshape_turn_up_left_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left_circle</i>
<span class="icon-name">arrowshape_turn_up_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left_circle_fill</i>
<span class="icon-name">arrowshape_turn_up_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_left_fill</i>
<span class="icon-name">arrowshape_turn_up_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_right</i>
<span class="icon-name">arrowshape_turn_up_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_right_circle</i>
<span class="icon-name">arrowshape_turn_up_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_right_circle_fill</i>
<span class="icon-name">arrowshape_turn_up_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowshape_turn_up_right_fill</i>
<span class="icon-name">arrowshape_turn_up_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down</i>
<span class="icon-name">arrowtriangle_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down_circle</i>
<span class="icon-name">arrowtriangle_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down_circle_fill</i>
<span class="icon-name">arrowtriangle_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down_fill</i>
<span class="icon-name">arrowtriangle_down_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down_square</i>
<span class="icon-name">arrowtriangle_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_down_square_fill</i>
<span class="icon-name">arrowtriangle_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left</i>
<span class="icon-name">arrowtriangle_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left_circle</i>
<span class="icon-name">arrowtriangle_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left_circle_fill</i>
<span class="icon-name">arrowtriangle_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left_fill</i>
<span class="icon-name">arrowtriangle_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left_square</i>
<span class="icon-name">arrowtriangle_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_left_square_fill</i>
<span class="icon-name">arrowtriangle_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right</i>
<span class="icon-name">arrowtriangle_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right_circle</i>
<span class="icon-name">arrowtriangle_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right_circle_fill</i>
<span class="icon-name">arrowtriangle_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right_fill</i>
<span class="icon-name">arrowtriangle_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right_square</i>
<span class="icon-name">arrowtriangle_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_right_square_fill</i>
<span class="icon-name">arrowtriangle_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up</i>
<span class="icon-name">arrowtriangle_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up_circle</i>
<span class="icon-name">arrowtriangle_up_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up_circle_fill</i>
<span class="icon-name">arrowtriangle_up_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up_fill</i>
<span class="icon-name">arrowtriangle_up_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up_square</i>
<span class="icon-name">arrowtriangle_up_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">arrowtriangle_up_square_fill</i>
<span class="icon-name">arrowtriangle_up_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">asterisk_circle</i>
<span class="icon-name">asterisk_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">asterisk_circle_fill</i>
<span class="icon-name">asterisk_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">at</i>
<span class="icon-name">at</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">at_badge_minus</i>
<span class="icon-name">at_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">at_badge_plus</i>
<span class="icon-name">at_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">at_circle</i>
<span class="icon-name">at_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">at_circle_fill</i>
<span class="icon-name">at_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward</i>
<span class="icon-name">backward</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward_end</i>
<span class="icon-name">backward_end</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward_end_alt</i>
<span class="icon-name">backward_end_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward_end_alt_fill</i>
<span class="icon-name">backward_end_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward_end_fill</i>
<span class="icon-name">backward_end_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">backward_fill</i>
<span class="icon-name">backward_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">badge_plus_radiowaves_right</i>
<span class="icon-name">badge_plus_radiowaves_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag</i>
<span class="icon-name">bag</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag_badge_minus</i>
<span class="icon-name">bag_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag_badge_plus</i>
<span class="icon-name">bag_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag_fill</i>
<span class="icon-name">bag_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag_fill_badge_minus</i>
<span class="icon-name">bag_fill_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bag_fill_badge_plus</i>
<span class="icon-name">bag_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bandage</i>
<span class="icon-name">bandage</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bandage_fill</i>
<span class="icon-name">bandage_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">barcode</i>
<span class="icon-name">barcode</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">barcode_viewfinder</i>
<span class="icon-name">barcode_viewfinder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bars</i>
<span class="icon-name">bars</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">battery_0</i>
<span class="icon-name">battery_0</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">battery_100</i>
<span class="icon-name">battery_100</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">battery_25</i>
<span class="icon-name">battery_25</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bed_double</i>
<span class="icon-name">bed_double</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bed_double_fill</i>
<span class="icon-name">bed_double_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell</i>
<span class="icon-name">bell</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell_circle</i>
<span class="icon-name">bell_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell_circle_fill</i>
<span class="icon-name">bell_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell_fill</i>
<span class="icon-name">bell_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell_slash</i>
<span class="icon-name">bell_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bell_slash_fill</i>
<span class="icon-name">bell_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bin_xmark</i>
<span class="icon-name">bin_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bin_xmark_fill</i>
<span class="icon-name">bin_xmark_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bitcoin</i>
<span class="icon-name">bitcoin</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bitcoin_circle</i>
<span class="icon-name">bitcoin_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bitcoin_circle_fill</i>
<span class="icon-name">bitcoin_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bluetooth</i>
<span class="icon-name">bluetooth</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bold</i>
<span class="icon-name">bold</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bold_italic_underline</i>
<span class="icon-name">bold_italic_underline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bold_underline</i>
<span class="icon-name">bold_underline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt</i>
<span class="icon-name">bolt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_badge_a</i>
<span class="icon-name">bolt_badge_a</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_badge_a_fill</i>
<span class="icon-name">bolt_badge_a_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_circle</i>
<span class="icon-name">bolt_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_circle_fill</i>
<span class="icon-name">bolt_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_fill</i>
<span class="icon-name">bolt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_horizontal</i>
<span class="icon-name">bolt_horizontal</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_horizontal_circle</i>
<span class="icon-name">bolt_horizontal_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_horizontal_circle_fill</i>
<span class="icon-name">bolt_horizontal_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_horizontal_fill</i>
<span class="icon-name">bolt_horizontal_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_slash</i>
<span class="icon-name">bolt_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bolt_slash_fill</i>
<span class="icon-name">bolt_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">book</i>
<span class="icon-name">book</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">book_circle</i>
<span class="icon-name">book_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">book_circle_fill</i>
<span class="icon-name">book_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">book_fill</i>
<span class="icon-name">book_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bookmark</i>
<span class="icon-name">bookmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bookmark_fill</i>
<span class="icon-name">bookmark_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">briefcase</i>
<span class="icon-name">briefcase</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">briefcase_fill</i>
<span class="icon-name">briefcase_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_left</i>
<span class="icon-name">bubble_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_left_bubble_right</i>
<span class="icon-name">bubble_left_bubble_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_left_bubble_right_fill</i>
<span class="icon-name">bubble_left_bubble_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_left_fill</i>
<span class="icon-name">bubble_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_middle_bottom</i>
<span class="icon-name">bubble_middle_bottom</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_middle_bottom_fill</i>
<span class="icon-name">bubble_middle_bottom_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_middle_top</i>
<span class="icon-name">bubble_middle_top</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_middle_top_fill</i>
<span class="icon-name">bubble_middle_top_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_right</i>
<span class="icon-name">bubble_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bubble_right_fill</i>
<span class="icon-name">bubble_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">building_2_fill</i>
<span class="icon-name">building_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">burn</i>
<span class="icon-name">burn</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">burst</i>
<span class="icon-name">burst</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">burst_fill</i>
<span class="icon-name">burst_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">bus</i>
<span class="icon-name">bus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar</i>
<span class="icon-name">calendar</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar_badge_minus</i>
<span class="icon-name">calendar_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar_badge_plus</i>
<span class="icon-name">calendar_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar_circle</i>
<span class="icon-name">calendar_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar_circle_fill</i>
<span class="icon-name">calendar_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">calendar_today</i>
<span class="icon-name">calendar_today</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera</i>
<span class="icon-name">camera</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_circle</i>
<span class="icon-name">camera_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_circle_fill</i>
<span class="icon-name">camera_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_fill</i>
<span class="icon-name">camera_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_on_rectangle</i>
<span class="icon-name">camera_on_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_on_rectangle_fill</i>
<span class="icon-name">camera_on_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_rotate</i>
<span class="icon-name">camera_rotate</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_rotate_fill</i>
<span class="icon-name">camera_rotate_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">camera_viewfinder</i>
<span class="icon-name">camera_viewfinder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">capslock</i>
<span class="icon-name">capslock</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">capslock_fill</i>
<span class="icon-name">capslock_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">capsule</i>
<span class="icon-name">capsule</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">capsule_fill</i>
<span class="icon-name">capsule_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">captions_bubble</i>
<span class="icon-name">captions_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">captions_bubble_fill</i>
<span class="icon-name">captions_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">car</i>
<span class="icon-name">car</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">car_detailed</i>
<span class="icon-name">car_detailed</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">car_fill</i>
<span class="icon-name">car_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart</i>
<span class="icon-name">cart</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart_badge_minus</i>
<span class="icon-name">cart_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart_badge_plus</i>
<span class="icon-name">cart_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart_fill</i>
<span class="icon-name">cart_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart_fill_badge_minus</i>
<span class="icon-name">cart_fill_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cart_fill_badge_plus</i>
<span class="icon-name">cart_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar</i>
<span class="icon-name">chart_bar</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_alt_fill</i>
<span class="icon-name">chart_bar_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_circle</i>
<span class="icon-name">chart_bar_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_circle_fill</i>
<span class="icon-name">chart_bar_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_fill</i>
<span class="icon-name">chart_bar_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_square</i>
<span class="icon-name">chart_bar_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_bar_square_fill</i>
<span class="icon-name">chart_bar_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_pie</i>
<span class="icon-name">chart_pie</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chart_pie_fill</i>
<span class="icon-name">chart_pie_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble</i>
<span class="icon-name">chat_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble_2</i>
<span class="icon-name">chat_bubble_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble_2_fill</i>
<span class="icon-name">chat_bubble_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble_fill</i>
<span class="icon-name">chat_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble_text</i>
<span class="icon-name">chat_bubble_text</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chat_bubble_text_fill</i>
<span class="icon-name">chat_bubble_text_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark</i>
<span class="icon-name">checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_alt</i>
<span class="icon-name">checkmark_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_alt_circle</i>
<span class="icon-name">checkmark_alt_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_alt_circle_fill</i>
<span class="icon-name">checkmark_alt_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_circle</i>
<span class="icon-name">checkmark_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_circle_fill</i>
<span class="icon-name">checkmark_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_rectangle</i>
<span class="icon-name">checkmark_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_rectangle_fill</i>
<span class="icon-name">checkmark_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_seal</i>
<span class="icon-name">checkmark_seal</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_seal_fill</i>
<span class="icon-name">checkmark_seal_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_shield</i>
<span class="icon-name">checkmark_shield</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_shield_fill</i>
<span class="icon-name">checkmark_shield_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_square</i>
<span class="icon-name">checkmark_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">checkmark_square_fill</i>
<span class="icon-name">checkmark_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_back</i>
<span class="icon-name">chevron_back</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_compact_down</i>
<span class="icon-name">chevron_compact_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_compact_left</i>
<span class="icon-name">chevron_compact_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_compact_right</i>
<span class="icon-name">chevron_compact_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_compact_up</i>
<span class="icon-name">chevron_compact_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_down</i>
<span class="icon-name">chevron_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_down_circle</i>
<span class="icon-name">chevron_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_down_circle_fill</i>
<span class="icon-name">chevron_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_down_square</i>
<span class="icon-name">chevron_down_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_down_square_fill</i>
<span class="icon-name">chevron_down_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_forward</i>
<span class="icon-name">chevron_forward</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left</i>
<span class="icon-name">chevron_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_2</i>
<span class="icon-name">chevron_left_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_circle</i>
<span class="icon-name">chevron_left_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_circle_fill</i>
<span class="icon-name">chevron_left_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_slash_chevron_right</i>
<span class="icon-name">chevron_left_slash_chevron_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_square</i>
<span class="icon-name">chevron_left_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_left_square_fill</i>
<span class="icon-name">chevron_left_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right</i>
<span class="icon-name">chevron_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right_2</i>
<span class="icon-name">chevron_right_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right_circle</i>
<span class="icon-name">chevron_right_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right_circle_fill</i>
<span class="icon-name">chevron_right_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right_square</i>
<span class="icon-name">chevron_right_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_right_square_fill</i>
<span class="icon-name">chevron_right_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up</i>
<span class="icon-name">chevron_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up_chevron_down</i>
<span class="icon-name">chevron_up_chevron_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up_circle</i>
<span class="icon-name">chevron_up_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up_circle_fill</i>
<span class="icon-name">chevron_up_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up_square</i>
<span class="icon-name">chevron_up_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">chevron_up_square_fill</i>
<span class="icon-name">chevron_up_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle</i>
<span class="icon-name">circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_bottomthird_split</i>
<span class="icon-name">circle_bottomthird_split</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_fill</i>
<span class="icon-name">circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_grid_3x3</i>
<span class="icon-name">circle_grid_3x3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_grid_3x3_fill</i>
<span class="icon-name">circle_grid_3x3_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_grid_hex</i>
<span class="icon-name">circle_grid_hex</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_grid_hex_fill</i>
<span class="icon-name">circle_grid_hex_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_lefthalf_fill</i>
<span class="icon-name">circle_lefthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">circle_righthalf_fill</i>
<span class="icon-name">circle_righthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">clear</i>
<span class="icon-name">clear</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">clear_fill</i>
<span class="icon-name">clear_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">clock</i>
<span class="icon-name">clock</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">clock_fill</i>
<span class="icon-name">clock_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud</i>
<span class="icon-name">cloud</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_bolt</i>
<span class="icon-name">cloud_bolt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_bolt_fill</i>
<span class="icon-name">cloud_bolt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_bolt_rain</i>
<span class="icon-name">cloud_bolt_rain</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_bolt_rain_fill</i>
<span class="icon-name">cloud_bolt_rain_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_download</i>
<span class="icon-name">cloud_download</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_download_fill</i>
<span class="icon-name">cloud_download_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_drizzle</i>
<span class="icon-name">cloud_drizzle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_drizzle_fill</i>
<span class="icon-name">cloud_drizzle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_fill</i>
<span class="icon-name">cloud_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_fog</i>
<span class="icon-name">cloud_fog</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_fog_fill</i>
<span class="icon-name">cloud_fog_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_hail</i>
<span class="icon-name">cloud_hail</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_hail_fill</i>
<span class="icon-name">cloud_hail_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_heavyrain</i>
<span class="icon-name">cloud_heavyrain</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_heavyrain_fill</i>
<span class="icon-name">cloud_heavyrain_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon</i>
<span class="icon-name">cloud_moon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon_bolt</i>
<span class="icon-name">cloud_moon_bolt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon_bolt_fill</i>
<span class="icon-name">cloud_moon_bolt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon_fill</i>
<span class="icon-name">cloud_moon_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon_rain</i>
<span class="icon-name">cloud_moon_rain</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_moon_rain_fill</i>
<span class="icon-name">cloud_moon_rain_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_rain</i>
<span class="icon-name">cloud_rain</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_rain_fill</i>
<span class="icon-name">cloud_rain_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sleet</i>
<span class="icon-name">cloud_sleet</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sleet_fill</i>
<span class="icon-name">cloud_sleet_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_snow</i>
<span class="icon-name">cloud_snow</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_snow_fill</i>
<span class="icon-name">cloud_snow_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun</i>
<span class="icon-name">cloud_sun</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun_bolt</i>
<span class="icon-name">cloud_sun_bolt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun_bolt_fill</i>
<span class="icon-name">cloud_sun_bolt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun_fill</i>
<span class="icon-name">cloud_sun_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun_rain</i>
<span class="icon-name">cloud_sun_rain</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_sun_rain_fill</i>
<span class="icon-name">cloud_sun_rain_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_upload</i>
<span class="icon-name">cloud_upload</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cloud_upload_fill</i>
<span class="icon-name">cloud_upload_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">color_filter</i>
<span class="icon-name">color_filter</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">color_filter_fill</i>
<span class="icon-name">color_filter_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">command</i>
<span class="icon-name">command</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">compass</i>
<span class="icon-name">compass</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">compass_fill</i>
<span class="icon-name">compass_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">control</i>
<span class="icon-name">control</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">creditcard</i>
<span class="icon-name">creditcard</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">creditcard_fill</i>
<span class="icon-name">creditcard_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">crop</i>
<span class="icon-name">crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">crop_rotate</i>
<span class="icon-name">crop_rotate</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cube</i>
<span class="icon-name">cube</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cube_box</i>
<span class="icon-name">cube_box</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cube_box_fill</i>
<span class="icon-name">cube_box_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cube_fill</i>
<span class="icon-name">cube_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">cursor_rays</i>
<span class="icon-name">cursor_rays</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">decrease_indent</i>
<span class="icon-name">decrease_indent</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">decrease_quotelevel</i>
<span class="icon-name">decrease_quotelevel</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">delete_left</i>
<span class="icon-name">delete_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">delete_left_fill</i>
<span class="icon-name">delete_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">delete_right</i>
<span class="icon-name">delete_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">delete_right_fill</i>
<span class="icon-name">delete_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">desktopcomputer</i>
<span class="icon-name">desktopcomputer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">device_desktop</i>
<span class="icon-name">device_desktop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">device_laptop</i>
<span class="icon-name">device_laptop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">device_phone_landscape</i>
<span class="icon-name">device_phone_landscape</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">device_phone_portrait</i>
<span class="icon-name">device_phone_portrait</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dial</i>
<span class="icon-name">dial</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dial_fill</i>
<span class="icon-name">dial_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">divide</i>
<span class="icon-name">divide</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">divide_circle</i>
<span class="icon-name">divide_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">divide_circle_fill</i>
<span class="icon-name">divide_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">divide_square</i>
<span class="icon-name">divide_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">divide_square_fill</i>
<span class="icon-name">divide_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc</i>
<span class="icon-name">doc</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_append</i>
<span class="icon-name">doc_append</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_chart</i>
<span class="icon-name">doc_chart</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_chart_fill</i>
<span class="icon-name">doc_chart_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_checkmark</i>
<span class="icon-name">doc_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_checkmark_fill</i>
<span class="icon-name">doc_checkmark_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_circle</i>
<span class="icon-name">doc_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_circle_fill</i>
<span class="icon-name">doc_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_fill</i>
<span class="icon-name">doc_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_on_clipboard</i>
<span class="icon-name">doc_on_clipboard</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_on_clipboard_fill</i>
<span class="icon-name">doc_on_clipboard_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_on_doc</i>
<span class="icon-name">doc_on_doc</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_on_doc_fill</i>
<span class="icon-name">doc_on_doc_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_person</i>
<span class="icon-name">doc_person</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_person_fill</i>
<span class="icon-name">doc_person_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_plaintext</i>
<span class="icon-name">doc_plaintext</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_richtext</i>
<span class="icon-name">doc_richtext</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_text</i>
<span class="icon-name">doc_text</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_text_fill</i>
<span class="icon-name">doc_text_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_text_search</i>
<span class="icon-name">doc_text_search</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">doc_text_viewfinder</i>
<span class="icon-name">doc_text_viewfinder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dot_radiowaves_left_right</i>
<span class="icon-name">dot_radiowaves_left_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dot_radiowaves_right</i>
<span class="icon-name">dot_radiowaves_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dot_square</i>
<span class="icon-name">dot_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">dot_square_fill</i>
<span class="icon-name">dot_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">download_circle</i>
<span class="icon-name">download_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">download_circle_fill</i>
<span class="icon-name">download_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">drop</i>
<span class="icon-name">drop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">drop_fill</i>
<span class="icon-name">drop_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">drop_triangle</i>
<span class="icon-name">drop_triangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">drop_triangle_fill</i>
<span class="icon-name">drop_triangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ear</i>
<span class="icon-name">ear</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eject</i>
<span class="icon-name">eject</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eject_fill</i>
<span class="icon-name">eject_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipses_bubble</i>
<span class="icon-name">ellipses_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipses_bubble_fill</i>
<span class="icon-name">ellipses_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis</i>
<span class="icon-name">ellipsis</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis_circle</i>
<span class="icon-name">ellipsis_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis_circle_fill</i>
<span class="icon-name">ellipsis_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis_vertical</i>
<span class="icon-name">ellipsis_vertical</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis_vertical_circle</i>
<span class="icon-name">ellipsis_vertical_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ellipsis_vertical_circle_fill</i>
<span class="icon-name">ellipsis_vertical_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope</i>
<span class="icon-name">envelope</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_badge</i>
<span class="icon-name">envelope_badge</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_badge_fill</i>
<span class="icon-name">envelope_badge_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_circle</i>
<span class="icon-name">envelope_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_circle_fill</i>
<span class="icon-name">envelope_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_fill</i>
<span class="icon-name">envelope_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_open</i>
<span class="icon-name">envelope_open</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">envelope_open_fill</i>
<span class="icon-name">envelope_open_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">equal</i>
<span class="icon-name">equal</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">equal_circle</i>
<span class="icon-name">equal_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">equal_circle_fill</i>
<span class="icon-name">equal_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">equal_square</i>
<span class="icon-name">equal_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">equal_square_fill</i>
<span class="icon-name">equal_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">escape</i>
<span class="icon-name">escape</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark</i>
<span class="icon-name">exclamationmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_bubble</i>
<span class="icon-name">exclamationmark_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_bubble_fill</i>
<span class="icon-name">exclamationmark_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_circle</i>
<span class="icon-name">exclamationmark_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_circle_fill</i>
<span class="icon-name">exclamationmark_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_octagon</i>
<span class="icon-name">exclamationmark_octagon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_octagon_fill</i>
<span class="icon-name">exclamationmark_octagon_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_shield</i>
<span class="icon-name">exclamationmark_shield</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_shield_fill</i>
<span class="icon-name">exclamationmark_shield_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_square</i>
<span class="icon-name">exclamationmark_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_square_fill</i>
<span class="icon-name">exclamationmark_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_triangle</i>
<span class="icon-name">exclamationmark_triangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">exclamationmark_triangle_fill</i>
<span class="icon-name">exclamationmark_triangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eye</i>
<span class="icon-name">eye</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eye_fill</i>
<span class="icon-name">eye_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eye_slash</i>
<span class="icon-name">eye_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eye_slash_fill</i>
<span class="icon-name">eye_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eyedropper</i>
<span class="icon-name">eyedropper</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eyedropper_full</i>
<span class="icon-name">eyedropper_full</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eyedropper_halffull</i>
<span class="icon-name">eyedropper_halffull</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">eyeglasses</i>
<span class="icon-name">eyeglasses</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">f_cursive</i>
<span class="icon-name">f_cursive</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">f_cursive_circle</i>
<span class="icon-name">f_cursive_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">f_cursive_circle_fill</i>
<span class="icon-name">f_cursive_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">film</i>
<span class="icon-name">film</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">film_fill</i>
<span class="icon-name">film_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag</i>
<span class="icon-name">flag</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag_circle</i>
<span class="icon-name">flag_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag_circle_fill</i>
<span class="icon-name">flag_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag_fill</i>
<span class="icon-name">flag_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag_slash</i>
<span class="icon-name">flag_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flag_slash_fill</i>
<span class="icon-name">flag_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flame</i>
<span class="icon-name">flame</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flame_fill</i>
<span class="icon-name">flame_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">floppy_disk</i>
<span class="icon-name">floppy_disk</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flowchart</i>
<span class="icon-name">flowchart</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">flowchart_fill</i>
<span class="icon-name">flowchart_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder</i>
<span class="icon-name">folder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_badge_minus</i>
<span class="icon-name">folder_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_badge_person_crop</i>
<span class="icon-name">folder_badge_person_crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_badge_plus</i>
<span class="icon-name">folder_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_circle</i>
<span class="icon-name">folder_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_circle_fill</i>
<span class="icon-name">folder_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_fill</i>
<span class="icon-name">folder_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_fill_badge_minus</i>
<span class="icon-name">folder_fill_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_fill_badge_person_crop</i>
<span class="icon-name">folder_fill_badge_person_crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">folder_fill_badge_plus</i>
<span class="icon-name">folder_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward</i>
<span class="icon-name">forward</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward_end</i>
<span class="icon-name">forward_end</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward_end_alt</i>
<span class="icon-name">forward_end_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward_end_alt_fill</i>
<span class="icon-name">forward_end_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward_end_fill</i>
<span class="icon-name">forward_end_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">forward_fill</i>
<span class="icon-name">forward_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">function</i>
<span class="icon-name">function</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">fx</i>
<span class="icon-name">fx</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gamecontroller</i>
<span class="icon-name">gamecontroller</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gamecontroller_alt_fill</i>
<span class="icon-name">gamecontroller_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gamecontroller_fill</i>
<span class="icon-name">gamecontroller_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gauge</i>
<span class="icon-name">gauge</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gauge_badge_minus</i>
<span class="icon-name">gauge_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gauge_badge_plus</i>
<span class="icon-name">gauge_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gear</i>
<span class="icon-name">gear</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gear_alt</i>
<span class="icon-name">gear_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gear_alt_fill</i>
<span class="icon-name">gear_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gift</i>
<span class="icon-name">gift</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gift_alt</i>
<span class="icon-name">gift_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gift_alt_fill</i>
<span class="icon-name">gift_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gift_fill</i>
<span class="icon-name">gift_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">globe</i>
<span class="icon-name">globe</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward</i>
<span class="icon-name">gobackward</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_10</i>
<span class="icon-name">gobackward_10</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_15</i>
<span class="icon-name">gobackward_15</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_30</i>
<span class="icon-name">gobackward_30</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_45</i>
<span class="icon-name">gobackward_45</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_60</i>
<span class="icon-name">gobackward_60</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_75</i>
<span class="icon-name">gobackward_75</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_90</i>
<span class="icon-name">gobackward_90</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">gobackward_minus</i>
<span class="icon-name">gobackward_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward</i>
<span class="icon-name">goforward</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_10</i>
<span class="icon-name">goforward_10</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_15</i>
<span class="icon-name">goforward_15</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_30</i>
<span class="icon-name">goforward_30</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_45</i>
<span class="icon-name">goforward_45</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_60</i>
<span class="icon-name">goforward_60</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_75</i>
<span class="icon-name">goforward_75</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_90</i>
<span class="icon-name">goforward_90</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">goforward_plus</i>
<span class="icon-name">goforward_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">graph_circle</i>
<span class="icon-name">graph_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">graph_circle_fill</i>
<span class="icon-name">graph_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">graph_square</i>
<span class="icon-name">graph_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">graph_square_fill</i>
<span class="icon-name">graph_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">greaterthan</i>
<span class="icon-name">greaterthan</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">greaterthan_circle</i>
<span class="icon-name">greaterthan_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">greaterthan_circle_fill</i>
<span class="icon-name">greaterthan_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">greaterthan_square</i>
<span class="icon-name">greaterthan_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">greaterthan_square_fill</i>
<span class="icon-name">greaterthan_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">grid</i>
<span class="icon-name">grid</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">grid_circle</i>
<span class="icon-name">grid_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">grid_circle_fill</i>
<span class="icon-name">grid_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">guitars</i>
<span class="icon-name">guitars</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hammer</i>
<span class="icon-name">hammer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hammer_fill</i>
<span class="icon-name">hammer_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_draw</i>
<span class="icon-name">hand_draw</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_draw_fill</i>
<span class="icon-name">hand_draw_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_point_left</i>
<span class="icon-name">hand_point_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_point_left_fill</i>
<span class="icon-name">hand_point_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_point_right</i>
<span class="icon-name">hand_point_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_point_right_fill</i>
<span class="icon-name">hand_point_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_raised</i>
<span class="icon-name">hand_raised</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_raised_fill</i>
<span class="icon-name">hand_raised_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_raised_slash</i>
<span class="icon-name">hand_raised_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_raised_slash_fill</i>
<span class="icon-name">hand_raised_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_thumbsdown</i>
<span class="icon-name">hand_thumbsdown</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_thumbsdown_fill</i>
<span class="icon-name">hand_thumbsdown_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_thumbsup</i>
<span class="icon-name">hand_thumbsup</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hand_thumbsup_fill</i>
<span class="icon-name">hand_thumbsup_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hare</i>
<span class="icon-name">hare</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hare_fill</i>
<span class="icon-name">hare_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">headphones</i>
<span class="icon-name">headphones</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart</i>
<span class="icon-name">heart</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_circle</i>
<span class="icon-name">heart_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_circle_fill</i>
<span class="icon-name">heart_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_fill</i>
<span class="icon-name">heart_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_slash</i>
<span class="icon-name">heart_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_slash_circle</i>
<span class="icon-name">heart_slash_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_slash_circle_fill</i>
<span class="icon-name">heart_slash_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">heart_slash_fill</i>
<span class="icon-name">heart_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">helm</i>
<span class="icon-name">helm</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hexagon</i>
<span class="icon-name">hexagon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hexagon_fill</i>
<span class="icon-name">hexagon_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hifispeaker</i>
<span class="icon-name">hifispeaker</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hifispeaker_fill</i>
<span class="icon-name">hifispeaker_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hourglass</i>
<span class="icon-name">hourglass</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hourglass_bottomhalf_fill</i>
<span class="icon-name">hourglass_bottomhalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hourglass_tophalf_fill</i>
<span class="icon-name">hourglass_tophalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">house</i>
<span class="icon-name">house</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">house_alt</i>
<span class="icon-name">house_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">house_alt_fill</i>
<span class="icon-name">house_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">house_fill</i>
<span class="icon-name">house_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">hurricane</i>
<span class="icon-name">hurricane</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">increase_indent</i>
<span class="icon-name">increase_indent</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">increase_quotelevel</i>
<span class="icon-name">increase_quotelevel</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">infinite</i>
<span class="icon-name">infinite</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">info</i>
<span class="icon-name">info</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">info_circle</i>
<span class="icon-name">info_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">info_circle_fill</i>
<span class="icon-name">info_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">italic</i>
<span class="icon-name">italic</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">keyboard</i>
<span class="icon-name">keyboard</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">keyboard_chevron_compact_down</i>
<span class="icon-name">keyboard_chevron_compact_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lab_flask</i>
<span class="icon-name">lab_flask</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lab_flask_solid</i>
<span class="icon-name">lab_flask_solid</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">largecircle_fill_circle</i>
<span class="icon-name">largecircle_fill_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lasso</i>
<span class="icon-name">lasso</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">layers</i>
<span class="icon-name">layers</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">layers_alt</i>
<span class="icon-name">layers_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">layers_alt_fill</i>
<span class="icon-name">layers_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">layers_fill</i>
<span class="icon-name">layers_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">leaf_arrow_circlepath</i>
<span class="icon-name">leaf_arrow_circlepath</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lessthan</i>
<span class="icon-name">lessthan</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lessthan_circle</i>
<span class="icon-name">lessthan_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lessthan_circle_fill</i>
<span class="icon-name">lessthan_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lessthan_square</i>
<span class="icon-name">lessthan_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lessthan_square_fill</i>
<span class="icon-name">lessthan_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">light_max</i>
<span class="icon-name">light_max</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">light_min</i>
<span class="icon-name">light_min</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lightbulb</i>
<span class="icon-name">lightbulb</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lightbulb_fill</i>
<span class="icon-name">lightbulb_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lightbulb_slash</i>
<span class="icon-name">lightbulb_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lightbulb_slash_fill</i>
<span class="icon-name">lightbulb_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">line_horizontal_3</i>
<span class="icon-name">line_horizontal_3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">line_horizontal_3_decrease</i>
<span class="icon-name">line_horizontal_3_decrease</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">line_horizontal_3_decrease_circle</i>
<span class="icon-name">line_horizontal_3_decrease_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">line_horizontal_3_decrease_circle_fill</i>
<span class="icon-name">line_horizontal_3_decrease_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">link</i>
<span class="icon-name">link</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">link_circle</i>
<span class="icon-name">link_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">link_circle_fill</i>
<span class="icon-name">link_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_bullet</i>
<span class="icon-name">list_bullet</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_bullet_below_rectangle</i>
<span class="icon-name">list_bullet_below_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_bullet_indent</i>
<span class="icon-name">list_bullet_indent</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_dash</i>
<span class="icon-name">list_dash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_number</i>
<span class="icon-name">list_number</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">list_number_rtl</i>
<span class="icon-name">list_number_rtl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location</i>
<span class="icon-name">location</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_circle</i>
<span class="icon-name">location_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_circle_fill</i>
<span class="icon-name">location_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_fill</i>
<span class="icon-name">location_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_north</i>
<span class="icon-name">location_north</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_north_fill</i>
<span class="icon-name">location_north_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_north_line</i>
<span class="icon-name">location_north_line</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_north_line_fill</i>
<span class="icon-name">location_north_line_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_slash</i>
<span class="icon-name">location_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">location_slash_fill</i>
<span class="icon-name">location_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock</i>
<span class="icon-name">lock</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_circle</i>
<span class="icon-name">lock_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_circle_fill</i>
<span class="icon-name">lock_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_fill</i>
<span class="icon-name">lock_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_open</i>
<span class="icon-name">lock_open</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_open_fill</i>
<span class="icon-name">lock_open_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_rotation</i>
<span class="icon-name">lock_rotation</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_rotation_open</i>
<span class="icon-name">lock_rotation_open</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_shield</i>
<span class="icon-name">lock_shield</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_shield_fill</i>
<span class="icon-name">lock_shield_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_slash</i>
<span class="icon-name">lock_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">lock_slash_fill</i>
<span class="icon-name">lock_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">macwindow</i>
<span class="icon-name">macwindow</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">map</i>
<span class="icon-name">map</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">map_fill</i>
<span class="icon-name">map_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">map_pin</i>
<span class="icon-name">map_pin</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">map_pin_ellipse</i>
<span class="icon-name">map_pin_ellipse</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">map_pin_slash</i>
<span class="icon-name">map_pin_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">memories</i>
<span class="icon-name">memories</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">memories_badge_minus</i>
<span class="icon-name">memories_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">memories_badge_plus</i>
<span class="icon-name">memories_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">metronome</i>
<span class="icon-name">metronome</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic</i>
<span class="icon-name">mic</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic_circle</i>
<span class="icon-name">mic_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic_circle_fill</i>
<span class="icon-name">mic_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic_fill</i>
<span class="icon-name">mic_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic_slash</i>
<span class="icon-name">mic_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">mic_slash_fill</i>
<span class="icon-name">mic_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus</i>
<span class="icon-name">minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_circle</i>
<span class="icon-name">minus_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_circle_fill</i>
<span class="icon-name">minus_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_rectangle</i>
<span class="icon-name">minus_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_rectangle_fill</i>
<span class="icon-name">minus_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_slash_plus</i>
<span class="icon-name">minus_slash_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_square</i>
<span class="icon-name">minus_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">minus_square_fill</i>
<span class="icon-name">minus_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_dollar</i>
<span class="icon-name">money_dollar</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_dollar_circle</i>
<span class="icon-name">money_dollar_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_dollar_circle_fill</i>
<span class="icon-name">money_dollar_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_euro</i>
<span class="icon-name">money_euro</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_euro_circle</i>
<span class="icon-name">money_euro_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_euro_circle_fill</i>
<span class="icon-name">money_euro_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_pound</i>
<span class="icon-name">money_pound</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_pound_circle</i>
<span class="icon-name">money_pound_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_pound_circle_fill</i>
<span class="icon-name">money_pound_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_rubl</i>
<span class="icon-name">money_rubl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_rubl_circle</i>
<span class="icon-name">money_rubl_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_rubl_circle_fill</i>
<span class="icon-name">money_rubl_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_yen</i>
<span class="icon-name">money_yen</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_yen_circle</i>
<span class="icon-name">money_yen_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">money_yen_circle_fill</i>
<span class="icon-name">money_yen_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon</i>
<span class="icon-name">moon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_circle</i>
<span class="icon-name">moon_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_circle_fill</i>
<span class="icon-name">moon_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_fill</i>
<span class="icon-name">moon_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_stars</i>
<span class="icon-name">moon_stars</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_stars_fill</i>
<span class="icon-name">moon_stars_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_zzz</i>
<span class="icon-name">moon_zzz</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">moon_zzz_fill</i>
<span class="icon-name">moon_zzz_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">move</i>
<span class="icon-name">move</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">multiply</i>
<span class="icon-name">multiply</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">multiply_circle</i>
<span class="icon-name">multiply_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">multiply_circle_fill</i>
<span class="icon-name">multiply_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">multiply_square</i>
<span class="icon-name">multiply_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">multiply_square_fill</i>
<span class="icon-name">multiply_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_albums</i>
<span class="icon-name">music_albums</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_albums_fill</i>
<span class="icon-name">music_albums_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_house</i>
<span class="icon-name">music_house</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_house_fill</i>
<span class="icon-name">music_house_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_mic</i>
<span class="icon-name">music_mic</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_note</i>
<span class="icon-name">music_note</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_note_2</i>
<span class="icon-name">music_note_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">music_note_list</i>
<span class="icon-name">music_note_list</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">news</i>
<span class="icon-name">news</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">news_solid</i>
<span class="icon-name">news_solid</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">nosign</i>
<span class="icon-name">nosign</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">number</i>
<span class="icon-name">number</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">number_circle</i>
<span class="icon-name">number_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">number_circle_fill</i>
<span class="icon-name">number_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">number_square</i>
<span class="icon-name">number_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">number_square_fill</i>
<span class="icon-name">number_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">option</i>
<span class="icon-name">option</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paintbrush</i>
<span class="icon-name">paintbrush</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paintbrush_fill</i>
<span class="icon-name">paintbrush_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pano</i>
<span class="icon-name">pano</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pano_fill</i>
<span class="icon-name">pano_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paperclip</i>
<span class="icon-name">paperclip</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paperplane</i>
<span class="icon-name">paperplane</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paperplane_fill</i>
<span class="icon-name">paperplane_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paragraph</i>
<span class="icon-name">paragraph</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause</i>
<span class="icon-name">pause</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause_circle</i>
<span class="icon-name">pause_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause_circle_fill</i>
<span class="icon-name">pause_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause_fill</i>
<span class="icon-name">pause_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause_rectangle</i>
<span class="icon-name">pause_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pause_rectangle_fill</i>
<span class="icon-name">pause_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">paw</i>
<span class="icon-name">paw</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil</i>
<span class="icon-name">pencil</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil_circle</i>
<span class="icon-name">pencil_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil_circle_fill</i>
<span class="icon-name">pencil_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil_ellipsis_rectangle</i>
<span class="icon-name">pencil_ellipsis_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil_outline</i>
<span class="icon-name">pencil_outline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pencil_slash</i>
<span class="icon-name">pencil_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">percent</i>
<span class="icon-name">percent</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person</i>
<span class="icon-name">person</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_2</i>
<span class="icon-name">person_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_2_alt</i>
<span class="icon-name">person_2_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_2_fill</i>
<span class="icon-name">person_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_2_square_stack</i>
<span class="icon-name">person_2_square_stack</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_2_square_stack_fill</i>
<span class="icon-name">person_2_square_stack_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_3</i>
<span class="icon-name">person_3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_3_fill</i>
<span class="icon-name">person_3_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_alt</i>
<span class="icon-name">person_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_alt_circle</i>
<span class="icon-name">person_alt_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_alt_circle_fill</i>
<span class="icon-name">person_alt_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_badge_minus</i>
<span class="icon-name">person_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_badge_minus_fill</i>
<span class="icon-name">person_badge_minus_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_badge_plus</i>
<span class="icon-name">person_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_badge_plus_fill</i>
<span class="icon-name">person_badge_plus_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_circle</i>
<span class="icon-name">person_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_circle_fill</i>
<span class="icon-name">person_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle</i>
<span class="icon-name">person_crop_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_badge_checkmark</i>
<span class="icon-name">person_crop_circle_badge_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_badge_exclam</i>
<span class="icon-name">person_crop_circle_badge_exclam</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_badge_minus</i>
<span class="icon-name">person_crop_circle_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_badge_plus</i>
<span class="icon-name">person_crop_circle_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_badge_xmark</i>
<span class="icon-name">person_crop_circle_badge_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill</i>
<span class="icon-name">person_crop_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill_badge_checkmark</i>
<span class="icon-name">person_crop_circle_fill_badge_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill_badge_exclam</i>
<span class="icon-name">person_crop_circle_fill_badge_exclam</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill_badge_minus</i>
<span class="icon-name">person_crop_circle_fill_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill_badge_plus</i>
<span class="icon-name">person_crop_circle_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_circle_fill_badge_xmark</i>
<span class="icon-name">person_crop_circle_fill_badge_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_rectangle</i>
<span class="icon-name">person_crop_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_rectangle_fill</i>
<span class="icon-name">person_crop_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_square</i>
<span class="icon-name">person_crop_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_crop_square_fill</i>
<span class="icon-name">person_crop_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">person_fill</i>
<span class="icon-name">person_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">personalhotspot</i>
<span class="icon-name">personalhotspot</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">perspective</i>
<span class="icon-name">perspective</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone</i>
<span class="icon-name">phone</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_arrow_down_left</i>
<span class="icon-name">phone_arrow_down_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_arrow_right</i>
<span class="icon-name">phone_arrow_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_arrow_up_right</i>
<span class="icon-name">phone_arrow_up_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_badge_plus</i>
<span class="icon-name">phone_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_circle</i>
<span class="icon-name">phone_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_circle_fill</i>
<span class="icon-name">phone_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_down</i>
<span class="icon-name">phone_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_down_circle</i>
<span class="icon-name">phone_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_down_circle_fill</i>
<span class="icon-name">phone_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_down_fill</i>
<span class="icon-name">phone_down_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_fill</i>
<span class="icon-name">phone_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_fill_arrow_down_left</i>
<span class="icon-name">phone_fill_arrow_down_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_fill_arrow_right</i>
<span class="icon-name">phone_fill_arrow_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_fill_arrow_up_right</i>
<span class="icon-name">phone_fill_arrow_up_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">phone_fill_badge_plus</i>
<span class="icon-name">phone_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">photo</i>
<span class="icon-name">photo</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">photo_fill</i>
<span class="icon-name">photo_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">photo_fill_on_rectangle_fill</i>
<span class="icon-name">photo_fill_on_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">photo_on_rectangle</i>
<span class="icon-name">photo_on_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">piano</i>
<span class="icon-name">piano</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pin</i>
<span class="icon-name">pin</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pin_fill</i>
<span class="icon-name">pin_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pin_slash</i>
<span class="icon-name">pin_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">pin_slash_fill</i>
<span class="icon-name">pin_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">placemark</i>
<span class="icon-name">placemark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">placemark_fill</i>
<span class="icon-name">placemark_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play</i>
<span class="icon-name">play</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play_circle</i>
<span class="icon-name">play_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play_circle_fill</i>
<span class="icon-name">play_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play_fill</i>
<span class="icon-name">play_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play_rectangle</i>
<span class="icon-name">play_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">play_rectangle_fill</i>
<span class="icon-name">play_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">playpause</i>
<span class="icon-name">playpause</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">playpause_fill</i>
<span class="icon-name">playpause_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus</i>
<span class="icon-name">plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_app</i>
<span class="icon-name">plus_app</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_app_fill</i>
<span class="icon-name">plus_app_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_bubble</i>
<span class="icon-name">plus_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_bubble_fill</i>
<span class="icon-name">plus_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_circle</i>
<span class="icon-name">plus_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_circle_fill</i>
<span class="icon-name">plus_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_rectangle</i>
<span class="icon-name">plus_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_rectangle_fill</i>
<span class="icon-name">plus_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_rectangle_fill_on_rectangle_fill</i>
<span class="icon-name">plus_rectangle_fill_on_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_rectangle_on_rectangle</i>
<span class="icon-name">plus_rectangle_on_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_slash_minus</i>
<span class="icon-name">plus_slash_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_square</i>
<span class="icon-name">plus_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_square_fill</i>
<span class="icon-name">plus_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_square_fill_on_square_fill</i>
<span class="icon-name">plus_square_fill_on_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plus_square_on_square</i>
<span class="icon-name">plus_square_on_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plusminus</i>
<span class="icon-name">plusminus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plusminus_circle</i>
<span class="icon-name">plusminus_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">plusminus_circle_fill</i>
<span class="icon-name">plusminus_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">power</i>
<span class="icon-name">power</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">printer</i>
<span class="icon-name">printer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">printer_fill</i>
<span class="icon-name">printer_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">projective</i>
<span class="icon-name">projective</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">purchased</i>
<span class="icon-name">purchased</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">purchased_circle</i>
<span class="icon-name">purchased_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">purchased_circle_fill</i>
<span class="icon-name">purchased_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">qrcode</i>
<span class="icon-name">qrcode</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">qrcode_viewfinder</i>
<span class="icon-name">qrcode_viewfinder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question</i>
<span class="icon-name">question</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_circle</i>
<span class="icon-name">question_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_circle_fill</i>
<span class="icon-name">question_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_diamond</i>
<span class="icon-name">question_diamond</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_diamond_fill</i>
<span class="icon-name">question_diamond_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_square</i>
<span class="icon-name">question_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">question_square_fill</i>
<span class="icon-name">question_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">quote_bubble</i>
<span class="icon-name">quote_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">quote_bubble_fill</i>
<span class="icon-name">quote_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">radiowaves_left</i>
<span class="icon-name">radiowaves_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">radiowaves_right</i>
<span class="icon-name">radiowaves_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rays</i>
<span class="icon-name">rays</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">recordingtape</i>
<span class="icon-name">recordingtape</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle</i>
<span class="icon-name">rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_3_offgrid</i>
<span class="icon-name">rectangle_3_offgrid</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_3_offgrid_fill</i>
<span class="icon-name">rectangle_3_offgrid_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_arrow_up_right_arrow_down_left</i>
<span class="icon-name">rectangle_arrow_up_right_arrow_down_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_arrow_up_right_arrow_down_left_slash</i>
<span class="icon-name">rectangle_arrow_up_right_arrow_down_left_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_badge_checkmark</i>
<span class="icon-name">rectangle_badge_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_badge_xmark</i>
<span class="icon-name">rectangle_badge_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_compress_vertical</i>
<span class="icon-name">rectangle_compress_vertical</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_dock</i>
<span class="icon-name">rectangle_dock</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_expand_vertical</i>
<span class="icon-name">rectangle_expand_vertical</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_fill</i>
<span class="icon-name">rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_fill_badge_checkmark</i>
<span class="icon-name">rectangle_fill_badge_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_fill_badge_xmark</i>
<span class="icon-name">rectangle_fill_badge_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_fill_on_rectangle_angled_fill</i>
<span class="icon-name">rectangle_fill_on_rectangle_angled_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_fill_on_rectangle_fill</i>
<span class="icon-name">rectangle_fill_on_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_1x2</i>
<span class="icon-name">rectangle_grid_1x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_1x2_fill</i>
<span class="icon-name">rectangle_grid_1x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_2x2</i>
<span class="icon-name">rectangle_grid_2x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_2x2_fill</i>
<span class="icon-name">rectangle_grid_2x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_3x2</i>
<span class="icon-name">rectangle_grid_3x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_grid_3x2_fill</i>
<span class="icon-name">rectangle_grid_3x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_on_rectangle</i>
<span class="icon-name">rectangle_on_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_on_rectangle_angled</i>
<span class="icon-name">rectangle_on_rectangle_angled</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_paperclip</i>
<span class="icon-name">rectangle_paperclip</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_split_3x1</i>
<span class="icon-name">rectangle_split_3x1</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_split_3x1_fill</i>
<span class="icon-name">rectangle_split_3x1_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_split_3x3</i>
<span class="icon-name">rectangle_split_3x3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_split_3x3_fill</i>
<span class="icon-name">rectangle_split_3x3_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack</i>
<span class="icon-name">rectangle_stack</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_badge_minus</i>
<span class="icon-name">rectangle_stack_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_badge_person_crop</i>
<span class="icon-name">rectangle_stack_badge_person_crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_badge_plus</i>
<span class="icon-name">rectangle_stack_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_fill</i>
<span class="icon-name">rectangle_stack_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_fill_badge_minus</i>
<span class="icon-name">rectangle_stack_fill_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_fill_badge_person_crop</i>
<span class="icon-name">rectangle_stack_fill_badge_person_crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_fill_badge_plus</i>
<span class="icon-name">rectangle_stack_fill_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_person_crop</i>
<span class="icon-name">rectangle_stack_person_crop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rectangle_stack_person_crop_fill</i>
<span class="icon-name">rectangle_stack_person_crop_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">repeat</i>
<span class="icon-name">repeat</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">repeat_1</i>
<span class="icon-name">repeat_1</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">resize</i>
<span class="icon-name">resize</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">resize_h</i>
<span class="icon-name">resize_h</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">resize_v</i>
<span class="icon-name">resize_v</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">return_icon</i>
<span class="icon-name">return_icon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rhombus</i>
<span class="icon-name">rhombus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rhombus_fill</i>
<span class="icon-name">rhombus_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rocket</i>
<span class="icon-name">rocket</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rocket_fill</i>
<span class="icon-name">rocket_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rosette</i>
<span class="icon-name">rosette</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rotate_left</i>
<span class="icon-name">rotate_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rotate_left_fill</i>
<span class="icon-name">rotate_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rotate_right</i>
<span class="icon-name">rotate_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">rotate_right_fill</i>
<span class="icon-name">rotate_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">scissors</i>
<span class="icon-name">scissors</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">scissors_alt</i>
<span class="icon-name">scissors_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">scope</i>
<span class="icon-name">scope</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">scribble</i>
<span class="icon-name">scribble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">search</i>
<span class="icon-name">search</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">search_circle</i>
<span class="icon-name">search_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">search_circle_fill</i>
<span class="icon-name">search_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">selection_pin_in_out</i>
<span class="icon-name">selection_pin_in_out</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shield</i>
<span class="icon-name">shield</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shield_fill</i>
<span class="icon-name">shield_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shield_lefthalf_fill</i>
<span class="icon-name">shield_lefthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shield_slash</i>
<span class="icon-name">shield_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shield_slash_fill</i>
<span class="icon-name">shield_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shift</i>
<span class="icon-name">shift</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shift_fill</i>
<span class="icon-name">shift_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">shuffle</i>
<span class="icon-name">shuffle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sidebar_left</i>
<span class="icon-name">sidebar_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sidebar_right</i>
<span class="icon-name">sidebar_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">signature</i>
<span class="icon-name">signature</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">skew</i>
<span class="icon-name">skew</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">slash_circle</i>
<span class="icon-name">slash_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">slash_circle_fill</i>
<span class="icon-name">slash_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">slider_horizontal_3</i>
<span class="icon-name">slider_horizontal_3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">slider_horizontal_below_rectangle</i>
<span class="icon-name">slider_horizontal_below_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">slowmo</i>
<span class="icon-name">slowmo</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smallcircle_circle</i>
<span class="icon-name">smallcircle_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smallcircle_circle_fill</i>
<span class="icon-name">smallcircle_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smallcircle_fill_circle</i>
<span class="icon-name">smallcircle_fill_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smallcircle_fill_circle_fill</i>
<span class="icon-name">smallcircle_fill_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smiley</i>
<span class="icon-name">smiley</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smiley_fill</i>
<span class="icon-name">smiley_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smoke</i>
<span class="icon-name">smoke</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">smoke_fill</i>
<span class="icon-name">smoke_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">snow</i>
<span class="icon-name">snow</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_down</i>
<span class="icon-name">sort_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_down_circle</i>
<span class="icon-name">sort_down_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_down_circle_fill</i>
<span class="icon-name">sort_down_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_up</i>
<span class="icon-name">sort_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_up_circle</i>
<span class="icon-name">sort_up_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sort_up_circle_fill</i>
<span class="icon-name">sort_up_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sparkles</i>
<span class="icon-name">sparkles</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker</i>
<span class="icon-name">speaker</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_1</i>
<span class="icon-name">speaker_1</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_1_fill</i>
<span class="icon-name">speaker_1_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_2</i>
<span class="icon-name">speaker_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_2_fill</i>
<span class="icon-name">speaker_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_3</i>
<span class="icon-name">speaker_3</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_3_fill</i>
<span class="icon-name">speaker_3_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_fill</i>
<span class="icon-name">speaker_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_slash</i>
<span class="icon-name">speaker_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_slash_fill</i>
<span class="icon-name">speaker_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_slash_fill_rtl</i>
<span class="icon-name">speaker_slash_fill_rtl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_slash_rtl</i>
<span class="icon-name">speaker_slash_rtl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_zzz</i>
<span class="icon-name">speaker_zzz</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_zzz_fill</i>
<span class="icon-name">speaker_zzz_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_zzz_fill_rtl</i>
<span class="icon-name">speaker_zzz_fill_rtl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speaker_zzz_rtl</i>
<span class="icon-name">speaker_zzz_rtl</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">speedometer</i>
<span class="icon-name">speedometer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sportscourt</i>
<span class="icon-name">sportscourt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sportscourt_fill</i>
<span class="icon-name">sportscourt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square</i>
<span class="icon-name">square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_down</i>
<span class="icon-name">square_arrow_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_down_fill</i>
<span class="icon-name">square_arrow_down_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_down_on_square</i>
<span class="icon-name">square_arrow_down_on_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_down_on_square_fill</i>
<span class="icon-name">square_arrow_down_on_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_left</i>
<span class="icon-name">square_arrow_left</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_left_fill</i>
<span class="icon-name">square_arrow_left_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_right</i>
<span class="icon-name">square_arrow_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_right_fill</i>
<span class="icon-name">square_arrow_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_up</i>
<span class="icon-name">square_arrow_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_up_fill</i>
<span class="icon-name">square_arrow_up_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_up_on_square</i>
<span class="icon-name">square_arrow_up_on_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_arrow_up_on_square_fill</i>
<span class="icon-name">square_arrow_up_on_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_favorites</i>
<span class="icon-name">square_favorites</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_favorites_alt</i>
<span class="icon-name">square_favorites_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_favorites_alt_fill</i>
<span class="icon-name">square_favorites_alt_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_favorites_fill</i>
<span class="icon-name">square_favorites_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_fill</i>
<span class="icon-name">square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_fill_line_vertical_square</i>
<span class="icon-name">square_fill_line_vertical_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_fill_line_vertical_square_fill</i>
<span class="icon-name">square_fill_line_vertical_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_fill_on_circle_fill</i>
<span class="icon-name">square_fill_on_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_fill_on_square_fill</i>
<span class="icon-name">square_fill_on_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_grid_2x2</i>
<span class="icon-name">square_grid_2x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_grid_2x2_fill</i>
<span class="icon-name">square_grid_2x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_grid_3x2</i>
<span class="icon-name">square_grid_3x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_grid_3x2_fill</i>
<span class="icon-name">square_grid_3x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_grid_4x3_fill</i>
<span class="icon-name">square_grid_4x3_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_lefthalf_fill</i>
<span class="icon-name">square_lefthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_line_vertical_square</i>
<span class="icon-name">square_line_vertical_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_line_vertical_square_fill</i>
<span class="icon-name">square_line_vertical_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_list</i>
<span class="icon-name">square_list</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_list_fill</i>
<span class="icon-name">square_list_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_on_circle</i>
<span class="icon-name">square_on_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_on_square</i>
<span class="icon-name">square_on_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_pencil</i>
<span class="icon-name">square_pencil</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_pencil_fill</i>
<span class="icon-name">square_pencil_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_righthalf_fill</i>
<span class="icon-name">square_righthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_1x2</i>
<span class="icon-name">square_split_1x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_1x2_fill</i>
<span class="icon-name">square_split_1x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_2x1</i>
<span class="icon-name">square_split_2x1</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_2x1_fill</i>
<span class="icon-name">square_split_2x1_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_2x2</i>
<span class="icon-name">square_split_2x2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_split_2x2_fill</i>
<span class="icon-name">square_split_2x2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack</i>
<span class="icon-name">square_stack</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_down_dottedline</i>
<span class="icon-name">square_stack_3d_down_dottedline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_down_right</i>
<span class="icon-name">square_stack_3d_down_right</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_down_right_fill</i>
<span class="icon-name">square_stack_3d_down_right_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_up</i>
<span class="icon-name">square_stack_3d_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_up_fill</i>
<span class="icon-name">square_stack_3d_up_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_up_slash</i>
<span class="icon-name">square_stack_3d_up_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_3d_up_slash_fill</i>
<span class="icon-name">square_stack_3d_up_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">square_stack_fill</i>
<span class="icon-name">square_stack_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">squares_below_rectangle</i>
<span class="icon-name">squares_below_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star</i>
<span class="icon-name">star</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_circle</i>
<span class="icon-name">star_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_circle_fill</i>
<span class="icon-name">star_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_fill</i>
<span class="icon-name">star_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_lefthalf_fill</i>
<span class="icon-name">star_lefthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_slash</i>
<span class="icon-name">star_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">star_slash_fill</i>
<span class="icon-name">star_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">staroflife</i>
<span class="icon-name">staroflife</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">staroflife_fill</i>
<span class="icon-name">staroflife_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stop</i>
<span class="icon-name">stop</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stop_circle</i>
<span class="icon-name">stop_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stop_circle_fill</i>
<span class="icon-name">stop_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stop_fill</i>
<span class="icon-name">stop_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stopwatch</i>
<span class="icon-name">stopwatch</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">stopwatch_fill</i>
<span class="icon-name">stopwatch_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">strikethrough</i>
<span class="icon-name">strikethrough</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_club</i>
<span class="icon-name">suit_club</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_club_fill</i>
<span class="icon-name">suit_club_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_diamond</i>
<span class="icon-name">suit_diamond</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_diamond_fill</i>
<span class="icon-name">suit_diamond_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_heart</i>
<span class="icon-name">suit_heart</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_heart_fill</i>
<span class="icon-name">suit_heart_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_spade</i>
<span class="icon-name">suit_spade</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">suit_spade_fill</i>
<span class="icon-name">suit_spade_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sum</i>
<span class="icon-name">sum</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_dust</i>
<span class="icon-name">sun_dust</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_dust_fill</i>
<span class="icon-name">sun_dust_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_haze</i>
<span class="icon-name">sun_haze</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_haze_fill</i>
<span class="icon-name">sun_haze_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_max</i>
<span class="icon-name">sun_max</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_max_fill</i>
<span class="icon-name">sun_max_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_min</i>
<span class="icon-name">sun_min</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sun_min_fill</i>
<span class="icon-name">sun_min_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sunrise</i>
<span class="icon-name">sunrise</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sunrise_fill</i>
<span class="icon-name">sunrise_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sunset</i>
<span class="icon-name">sunset</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">sunset_fill</i>
<span class="icon-name">sunset_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">t_bubble</i>
<span class="icon-name">t_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">t_bubble_fill</i>
<span class="icon-name">t_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">table</i>
<span class="icon-name">table</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">table_badge_more</i>
<span class="icon-name">table_badge_more</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">table_badge_more_fill</i>
<span class="icon-name">table_badge_more_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">table_fill</i>
<span class="icon-name">table_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tag</i>
<span class="icon-name">tag</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tag_circle</i>
<span class="icon-name">tag_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tag_circle_fill</i>
<span class="icon-name">tag_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tag_fill</i>
<span class="icon-name">tag_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_aligncenter</i>
<span class="icon-name">text_aligncenter</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_alignleft</i>
<span class="icon-name">text_alignleft</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_alignright</i>
<span class="icon-name">text_alignright</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_append</i>
<span class="icon-name">text_append</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_badge_checkmark</i>
<span class="icon-name">text_badge_checkmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_badge_minus</i>
<span class="icon-name">text_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_badge_plus</i>
<span class="icon-name">text_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_badge_star</i>
<span class="icon-name">text_badge_star</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_badge_xmark</i>
<span class="icon-name">text_badge_xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_bubble</i>
<span class="icon-name">text_bubble</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_bubble_fill</i>
<span class="icon-name">text_bubble_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_cursor</i>
<span class="icon-name">text_cursor</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_insert</i>
<span class="icon-name">text_insert</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_justify</i>
<span class="icon-name">text_justify</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_justifyleft</i>
<span class="icon-name">text_justifyleft</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_justifyright</i>
<span class="icon-name">text_justifyright</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">text_quote</i>
<span class="icon-name">text_quote</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textbox</i>
<span class="icon-name">textbox</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat</i>
<span class="icon-name">textformat</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_123</i>
<span class="icon-name">textformat_123</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_abc</i>
<span class="icon-name">textformat_abc</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_abc_dottedunderline</i>
<span class="icon-name">textformat_abc_dottedunderline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_alt</i>
<span class="icon-name">textformat_alt</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_size</i>
<span class="icon-name">textformat_size</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_subscript</i>
<span class="icon-name">textformat_subscript</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">textformat_superscript</i>
<span class="icon-name">textformat_superscript</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">thermometer</i>
<span class="icon-name">thermometer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">thermometer_snowflake</i>
<span class="icon-name">thermometer_snowflake</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">thermometer_sun</i>
<span class="icon-name">thermometer_sun</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ticket</i>
<span class="icon-name">ticket</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">ticket_fill</i>
<span class="icon-name">ticket_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tickets</i>
<span class="icon-name">tickets</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tickets_fill</i>
<span class="icon-name">tickets_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">timelapse</i>
<span class="icon-name">timelapse</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">timer</i>
<span class="icon-name">timer</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">timer_fill</i>
<span class="icon-name">timer_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">today</i>
<span class="icon-name">today</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">today_fill</i>
<span class="icon-name">today_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tornado</i>
<span class="icon-name">tornado</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tortoise</i>
<span class="icon-name">tortoise</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tortoise_fill</i>
<span class="icon-name">tortoise_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">train_style_one</i>
<span class="icon-name">train_style_one</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">train_style_two</i>
<span class="icon-name">train_style_two</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tram_fill</i>
<span class="icon-name">tram_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash</i>
<span class="icon-name">trash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash_circle</i>
<span class="icon-name">trash_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash_circle_fill</i>
<span class="icon-name">trash_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash_fill</i>
<span class="icon-name">trash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash_slash</i>
<span class="icon-name">trash_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">trash_slash_fill</i>
<span class="icon-name">trash_slash_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray</i>
<span class="icon-name">tray</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_2</i>
<span class="icon-name">tray_2</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_2_fill</i>
<span class="icon-name">tray_2_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_arrow_down</i>
<span class="icon-name">tray_arrow_down</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_arrow_down_fill</i>
<span class="icon-name">tray_arrow_down_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_arrow_up</i>
<span class="icon-name">tray_arrow_up</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_arrow_up_fill</i>
<span class="icon-name">tray_arrow_up_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_fill</i>
<span class="icon-name">tray_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_full</i>
<span class="icon-name">tray_full</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tray_full_fill</i>
<span class="icon-name">tray_full_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tree</i>
<span class="icon-name">tree</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">triangle</i>
<span class="icon-name">triangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">triangle_fill</i>
<span class="icon-name">triangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">triangle_lefthalf_fill</i>
<span class="icon-name">triangle_lefthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">triangle_righthalf_fill</i>
<span class="icon-name">triangle_righthalf_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tropicalstorm</i>
<span class="icon-name">tropicalstorm</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tuningfork</i>
<span class="icon-name">tuningfork</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv</i>
<span class="icon-name">tv</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv_circle</i>
<span class="icon-name">tv_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv_circle_fill</i>
<span class="icon-name">tv_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv_fill</i>
<span class="icon-name">tv_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv_music_note</i>
<span class="icon-name">tv_music_note</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">tv_music_note_fill</i>
<span class="icon-name">tv_music_note_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">uiwindow_split_2x1</i>
<span class="icon-name">uiwindow_split_2x1</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">umbrella</i>
<span class="icon-name">umbrella</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">umbrella_fill</i>
<span class="icon-name">umbrella_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">underline</i>
<span class="icon-name">underline</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">upload_circle</i>
<span class="icon-name">upload_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">upload_circle_fill</i>
<span class="icon-name">upload_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">videocam</i>
<span class="icon-name">videocam</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">videocam_circle</i>
<span class="icon-name">videocam_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">videocam_circle_fill</i>
<span class="icon-name">videocam_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">videocam_fill</i>
<span class="icon-name">videocam_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">view_2d</i>
<span class="icon-name">view_2d</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">view_3d</i>
<span class="icon-name">view_3d</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">viewfinder</i>
<span class="icon-name">viewfinder</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">viewfinder_circle</i>
<span class="icon-name">viewfinder_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">viewfinder_circle_fill</i>
<span class="icon-name">viewfinder_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wand_rays</i>
<span class="icon-name">wand_rays</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wand_rays_inverse</i>
<span class="icon-name">wand_rays_inverse</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wand_stars</i>
<span class="icon-name">wand_stars</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wand_stars_inverse</i>
<span class="icon-name">wand_stars_inverse</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform</i>
<span class="icon-name">waveform</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_circle</i>
<span class="icon-name">waveform_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_circle_fill</i>
<span class="icon-name">waveform_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_path</i>
<span class="icon-name">waveform_path</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_path_badge_minus</i>
<span class="icon-name">waveform_path_badge_minus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_path_badge_plus</i>
<span class="icon-name">waveform_path_badge_plus</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">waveform_path_ecg</i>
<span class="icon-name">waveform_path_ecg</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wifi</i>
<span class="icon-name">wifi</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wifi_exclamationmark</i>
<span class="icon-name">wifi_exclamationmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wifi_slash</i>
<span class="icon-name">wifi_slash</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wind</i>
<span class="icon-name">wind</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wind_snow</i>
<span class="icon-name">wind_snow</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wrench</i>
<span class="icon-name">wrench</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">wrench_fill</i>
<span class="icon-name">wrench_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark</i>
<span class="icon-name">xmark</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_circle</i>
<span class="icon-name">xmark_circle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_circle_fill</i>
<span class="icon-name">xmark_circle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_octagon</i>
<span class="icon-name">xmark_octagon</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_octagon_fill</i>
<span class="icon-name">xmark_octagon_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_rectangle</i>
<span class="icon-name">xmark_rectangle</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_rectangle_fill</i>
<span class="icon-name">xmark_rectangle_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_seal</i>
<span class="icon-name">xmark_seal</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_seal_fill</i>
<span class="icon-name">xmark_seal_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_shield</i>
<span class="icon-name">xmark_shield</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_shield_fill</i>
<span class="icon-name">xmark_shield_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_square</i>
<span class="icon-name">xmark_square</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">xmark_square_fill</i>
<span class="icon-name">xmark_square_fill</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">zoom_in</i>
<span class="icon-name">zoom_in</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">zoom_out</i>
<span class="icon-name">zoom_out</span>
</div>
<div class="icon-cell">
<i class="cupertino-icons size-28">zzz</i>
<span class="icon-name">zzz</span>
</div>
</div>
</div>
</div>
<div class="icon-preview">
<div class="icon-preview-name">Icon: <b>home</b></div>
<div class="icons">
<div class="icon-cell">
<div class="cupertino-icons size-14">home</div>
<div class="icon-size">14px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-20">home</div>
<div class="icon-size">20px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-24">home</div>
<div class="icon-size">24px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-28">home</div>
<div class="icon-size">28px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-32">home</div>
<div class="icon-size">32px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-56">home</div>
<div class="icon-size">56px</div>
</div>
<div class="icon-cell">
<div class="cupertino-icons size-112">home</div>
<div class="icon-size">112px</div>
</div>
</div>
</div>
<script>
var icons = document.querySelectorAll('.content .cupertino-icons');
var searchMap = {};
function showPreview(e) {
var icon = e.target.textContent;
var previewIcons = document.querySelectorAll('.icon-preview .cupertino-icons');
for (var j = 0; j < previewIcons.length; j++) {
previewIcons[j].textContent = icon;
}
document.querySelector('.icon-preview').style.display = 'block';
document.querySelector('.icon-preview-name b').textContent = icon;
}
function normalizeName(text) {
return text.toLowerCase().replace(/[^a-z]/, '');
}
for (var i = 0; i < icons.length; i++) {
icons[i].addEventListener('click', showPreview);
searchMap[normalizeName(icons[i].textContent)] = icons[i].parentElement;
}
var searchBar = document.querySelector('header .search-bar');
function search(e) {
for (var name in searchMap) {
if (searchMatches(e.target.value, name)) {
searchMap[name].classList.remove('hidden');
} else {
searchMap[name].classList.add('hidden');
}
}
}
searchBar.addEventListener('input', search);
function searchMatches(needle, haystack) {
if (needle === '') return true;
for (var word of needle.split(' ')) {
if (haystack.indexOf(normalizeName(word)) < 0) {
return false;
}
}
return true;
}
</script>
</body>
</html>
| packages/third_party/packages/cupertino_icons/index.html/0 | {
"file_path": "packages/third_party/packages/cupertino_icons/index.html",
"repo_id": "packages",
"token_count": 69592
} | 1,126 |
module.exports = {
root: true,
env: {
es6: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'google',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: [ 'tsconfig.json', 'tsconfig.dev.json' ],
tsconfigRootDir: __dirname,
sourceType: 'module',
},
ignorePatterns: [
'/lib/**/*', // Ignore built files.
],
plugins: [
'@typescript-eslint',
'import',
],
rules: {
'quotes': [ 'error', 'single' ],
'array-bracket-spacing': [ 'error', 'always' ],
'object-curly-spacing': [ 'error', 'always' ],
'max-len': [ 'error', { code: 130, tabWidth: 2 } ],
'indent': [ 'error', 2 ],
'no-unused-vars': [ 'warn' ],
'new-cap': [ 'warn' ],
'require-jsdoc': [ 0 ],
},
};
| photobooth/functions/.eslintrc.js/0 | {
"file_path": "photobooth/functions/.eslintrc.js",
"repo_id": "photobooth",
"token_count": 403
} | 1,127 |
{
"compilerOptions": {
"esModuleInterop": true,
"module": "commonjs",
"noImplicitReturns": true,
"noImplicitAny": false,
"noUnusedLocals": true,
"outDir": "lib",
"resolveJsonModule": true,
"noUnusedParameters": true,
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
]
}
| photobooth/functions/tsconfig.json/0 | {
"file_path": "photobooth/functions/tsconfig.json",
"repo_id": "photobooth",
"token_count": 168
} | 1,128 |
{
"@@locale": "id",
"landingPageHeading": "Selamat Datang di I\u2215O Photo Booth",
"landingPageSubheading": "Berfotolah dan bagikan dengan orang-orang!",
"landingPageTakePhotoButtonText": "Mulai",
"footerMadeWithText": "Dibuat dengan ",
"footerMadeWithFlutterLinkText": "Flutter",
"footerMadeWithFirebaseLinkText": "Firebase",
"footerGoogleIOLinkText": "Google I\u2215O",
"footerCodelabLinkText": "Codelab",
"footerHowItsMadeLinkText": "Bagaimana Ini Dibuat",
"footerTermsOfServiceLinkText": "Syarat Layanan",
"footerPrivacyPolicyLinkText": "Kebijakan Privasi",
"sharePageHeading": "Bagikan foto Anda dengan orang-orang!",
"sharePageSubheading": "Bagikan foto Anda dengan orang-orang!",
"sharePageSuccessHeading": "Foto Dibagikan!",
"sharePageSuccessSubheading": "Terima kasih telah menggunnakan aplikasi web Flutter kami! Foto Anda telah dibagikan dengan URL unik ini",
"sharePageSuccessCaption1": "Foto Anda di URL itu akan tersedia selama 30 hari sebelum kemudian akan otomatis terhapus. Untuk permohonan penghapusan lebih awal, harap hubungi ",
"sharePageSuccessCaption2": "[email protected]",
"sharePageSuccessCaption3": " dan pastikan untuk mencantumkan URL unik Anda pada permohonan.",
"sharePageRetakeButtonText": "Ambill foto baru",
"sharePageShareButtonText": "Bagikan",
"sharePageDownloadButtonText": "Unduh",
"socialMediaShareLinkText": "Baru saja mengambil swafoto di #IOPhotoBooth. Sampai jumpa di #GoogleIO!",
"previewPageCameraNotAllowedText": "Anda menolak izin kamera. Harap berikan izin akses untuk dapat menggunakan aplikasi.",
"sharePageSocialMediaShareClarification1": "Jika Anda meimilih untuk membagikan foto di media sosial, foto Anda akan tersedia di URL unik selama 30 hari sebelum kemudian akan otomatis terhapus. Foto yang tidak dibagikan, tidak akan disimpan. Untuk permohonan penghapusan lebih awal, harap hubungi ",
"sharePageSocialMediaShareClarification2": "[email protected]",
"sharePageSocialMediaShareClarification3": " dan pastikan untuk mencantumkan URL unik Anda pada permohonan.",
"sharePageCopyLinkButton": "Salin",
"sharePageLinkedCopiedButton": "Berhasil disalin",
"sharePageErrorHeading": "Kami mengalami kendala memproses gambar Anda",
"sharePageErrorSubheading": "Pastikan perangkat dan peramban Anda dalam versi terkini. Jika masalah ini berlanjut, harap kontak [email protected].",
"shareDialogHeading": "Bagikan foto Anda!",
"shareDialogSubheading": "Kabari semua orang Anda sedang di Google I\u2215O dengan membagikan foto & memperbarui foto profil Anda selama acara!",
"shareErrorDialogHeading": "Ups!",
"shareErrorDialogTryAgainButton": "Kembali",
"shareErrorDialogSubheading": "Terdapat masalah dan kami tidak dapat memuat foto anda.",
"sharePageProgressOverlayHeading": "Kami membuat foto Anda menjadi sempurna dengan Flutter! ",
"sharePageProgressOverlaySubheading": "Tolong jangan tutup tab ini.",
"shareDialogTwitterButtonText": "Twitter",
"shareDialogFacebookButtonText": "Facebook",
"photoBoothCameraAccessDeniedHeadline": "Akses kamera ditolak",
"photoBoothCameraAccessDeniedSubheadline": "Untuk mengambil foto, Anda harus memberi peramban izin akses ke kamera.",
"photoBoothCameraNotFoundHeadline": "Kami tidak dapat menemukan kamera Anda",
"photoBoothCameraNotFoundSubheadline1": "Sepertinya perangkat Anda tidak memiliki kamera atau sedang tidak berfungsi.",
"photoBoothCameraNotFoundSubheadline2": "Untuk mengambil foto, harap kunjungi kembali I\u2215O Photo Booth dari perangkat dedngan kamera.",
"photoBoothCameraErrorHeadline": "Ups! Terdapat masalah",
"photoBoothCameraErrorSubheadline1": "Harap muat ulang peramban dan coba lagi.",
"photoBoothCameraErrorSubheadline2": "Jika masalah ini berlanjut, harap kontak [email protected]",
"photoBoothCameraNotSupportedHeadline": "Ups! Terdapat masalah",
"photoBoothCameraNotSupportedSubheadline": "Harap pastikan perangkat dan peramban Anda dalam versi terkini.",
"stickersDrawerTitle": "Tambah Properti",
"openStickersTooltip": "Tambah Properti",
"retakeButtonTooltip": "Ambil Ulang",
"charactersCaptionText": "Tambahkan Teman",
"sharePageLearnMoreAboutTextPart1": "Pelajari lebih lanjut tentang ",
"sharePageLearnMoreAboutTextPart2": " dan ",
"sharePageLearnMoreAboutTextPart3": " atau langsung kunjungi ",
"sharePageLearnMoreAboutTextPart4": "kode sumber terbuka",
"goToGoogleIOButtonText": "Pergi ke Google I\u2215O",
"clearStickersDialogHeading": "Bersihkan semua properti?",
"clearStickersDialogSubheading": "Apakah Anda ingin menghapus semua properti dari layar?",
"clearStickersDialogCancelButtonText": "Tidak, kembali lagi",
"clearStickersDialogConfirmButtonText": "Ya, bersihkan semua properti",
"propsReminderText": "Tambahkan beberapa properti",
"stickersNextConfirmationHeading": "Sudah siap untuk melihat foto akhir?",
"stickersNextConfirmationSubheading": "Setelah menginggalkan halaman ini Anda tidak akan bisa membuat perubahan",
"stickersNextConfirmationCancelButtonText": "Tidak, Saya masih membuat",
"stickersNextConfirmationConfirmButtonText": "Ya, tampilkan",
"stickersRetakeConfirmationHeading": "Apa Anda yakin?",
"stickersRetakeConfirmationSubheading": "Mengambil ulang foto akan menghapus semua properti yang telah Anda tambahkan",
"stickersRetakeConfirmationCancelButtonText": "Tidak, tetap di sini",
"stickersRetakeConfirmationConfirmButtonText": "Ya, ambil ulang foto",
"shareRetakeConfirmationHeading": "Sudah siap untuk mengambil foto baru?",
"shareRetakeConfirmationSubheading": "Ingat untuk mengunduh atau membagikan foto ini terlebih dahulu",
"shareRetakeConfirmationCancelButtonText": "Tidak, tetap di sini",
"shareRetakeConfirmationConfirmButtonText": "Ya, ambil ulang foto",
"shutterButtonLabelText": "Ambil foto",
"stickersNextButtonLabelText": "Buat foto akhir",
"dashButtonLabelText": "Tambahkan teman dash",
"sparkyButtonLabelText": "Tambahkan teman sparky",
"dinoButtonLabelText": "Tambahkan teman dino",
"androidButtonLabelText": "Tambahkan teman android jetpack",
"addStickersButtonLabelText": "Tambahkan properti",
"retakePhotoButtonLabelText": "Ambil ulang foto",
"clearAllStickersButtonLabelText": "Bersihkan semua properti"
}
| photobooth/lib/l10n/arb/app_id.arb/0 | {
"file_path": "photobooth/lib/l10n/arb/app_id.arb",
"repo_id": "photobooth",
"token_count": 2402
} | 1,129 |
// ignore_for_file: avoid_print
import 'dart:async';
import 'package:authentication_repository/authentication_repository.dart';
import 'package:bloc/bloc.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:io_photobooth/app/app.dart';
import 'package:io_photobooth/app/app_bloc_observer.dart';
import 'package:io_photobooth/firebase_options.dart';
import 'package:io_photobooth/landing/loading_indicator_io.dart'
if (dart.library.html) 'landing/loading_indicator_web.dart';
import 'package:photobooth_ui/photobooth_ui.dart';
import 'package:photos_repository/photos_repository.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Bloc.observer = AppBlocObserver();
FlutterError.onError = (details) {
print(details.exceptionAsString());
print(details.stack);
};
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
final authenticationRepository = AuthenticationRepository(
firebaseAuth: FirebaseAuth.instance,
);
final photosRepository = PhotosRepository(
firebaseStorage: FirebaseStorage.instance,
);
unawaited(
authenticationRepository.signInAnonymously(),
);
unawaited(
Future.wait([
Flame.images.load('android_spritesheet.png'),
Flame.images.load('dash_spritesheet.png'),
Flame.images.load('dino_spritesheet.png'),
Flame.images.load('sparky_spritesheet.png'),
Flame.images.load('photo_frame_spritesheet_landscape.jpg'),
Flame.images.load('photo_frame_spritesheet_portrait.png'),
Flame.images.load('photo_indicator_spritesheet.png'),
]),
);
runZonedGuarded(
() => runApp(
App(
authenticationRepository: authenticationRepository,
photosRepository: photosRepository,
),
),
(error, stackTrace) {
print(error);
print(stackTrace);
},
);
SchedulerBinding.instance.addPostFrameCallback(
(_) => removeLoadingIndicator(),
);
}
| photobooth/lib/main.dart/0 | {
"file_path": "photobooth/lib/main.dart",
"repo_id": "photobooth",
"token_count": 810
} | 1,130 |
import 'package:flutter/material.dart';
import 'package:io_photobooth/photobooth/photobooth.dart';
import 'package:photobooth_ui/photobooth_ui.dart';
/// A widget that displays [CharactersLayer] and [StickersLayer] on top of
/// the raw [image] took from the camera.
class PhotoboothPhoto extends StatelessWidget {
const PhotoboothPhoto({
required this.image,
super.key,
});
final String image;
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: [
PreviewImage(data: image),
const CharactersLayer(),
const StickersLayer(),
],
);
}
}
| photobooth/lib/photobooth/widgets/photobooth_photo.dart/0 | {
"file_path": "photobooth/lib/photobooth/widgets/photobooth_photo.dart",
"repo_id": "photobooth",
"token_count": 235
} | 1,131 |
import 'dart:async';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:io_photobooth/photobooth/photobooth.dart';
import 'package:photobooth_ui/photobooth_ui.dart';
class AnimatedPhotoboothPhoto extends StatefulWidget {
const AnimatedPhotoboothPhoto({
required this.image,
super.key,
});
final CameraImage? image;
@override
State<AnimatedPhotoboothPhoto> createState() =>
_AnimatedPhotoboothPhotoState();
}
class _AnimatedPhotoboothPhotoState extends State<AnimatedPhotoboothPhoto> {
late final Timer timer;
var _isPhotoVisible = false;
@override
void initState() {
super.initState();
timer = Timer(const Duration(seconds: 2), () {
setState(() {
_isPhotoVisible = true;
});
});
}
@override
void dispose() {
timer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
final aspectRatio = context.select(
(PhotoboothBloc bloc) => bloc.state.aspectRatio,
);
if (aspectRatio <= PhotoboothAspectRatio.portrait) {
return AnimatedPhotoboothPhotoPortrait(
image: widget.image,
isPhotoVisible: _isPhotoVisible,
);
} else {
return AnimatedPhotoboothPhotoLandscape(
image: widget.image,
isPhotoVisible: _isPhotoVisible,
);
}
}
}
@visibleForTesting
class AnimatedPhotoboothPhotoLandscape extends StatelessWidget {
const AnimatedPhotoboothPhotoLandscape({
required this.image,
required this.isPhotoVisible,
super.key,
});
final CameraImage? image;
final bool isPhotoVisible;
static const sprite = AnimatedSprite(
mode: AnimationMode.oneTime,
sprites: Sprites(
asset: 'photo_frame_spritesheet_landscape.jpg',
size: Size(1308, 1038),
frames: 19,
stepTime: 2 / 19,
),
showLoadingIndicator: false,
);
static const aspectRatio = PhotoboothAspectRatio.landscape;
static const left = 129.0;
static const top = 88.0;
static const right = 118.0;
static const bottom = 154.0;
@override
Widget build(BuildContext context) {
final smallPhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.33,
);
final mediumPhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.37,
);
final largePhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.5,
);
final xLargePhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.52,
);
return ResponsiveLayoutBuilder(
small: (context, _) => smallPhoto,
medium: (context, _) => mediumPhoto,
large: (context, _) => largePhoto,
xLarge: (context, _) => xLargePhoto,
);
}
}
@visibleForTesting
class AnimatedPhotoboothPhotoPortrait extends StatelessWidget {
const AnimatedPhotoboothPhotoPortrait({
required this.image,
required this.isPhotoVisible,
super.key,
});
final CameraImage? image;
final bool isPhotoVisible;
static const sprite = AnimatedSprite(
mode: AnimationMode.oneTime,
sprites: Sprites(
asset: 'photo_frame_spritesheet_portrait.png',
size: Size(520, 698),
frames: 38,
stepTime: 0.05,
),
showLoadingIndicator: false,
);
static const aspectRatio = PhotoboothAspectRatio.portrait;
static const left = 93.0;
static const top = 120.0;
static const right = 79.0;
static const bottom = 107.0;
@override
Widget build(BuildContext context) {
final smallPhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.4,
);
final largePhoto = _AnimatedPhotoboothPhoto(
aspectRatio: aspectRatio,
image: image,
isPhotoVisible: isPhotoVisible,
sprite: sprite,
top: top,
left: left,
right: right,
bottom: bottom,
scale: 0.8,
);
return ResponsiveLayoutBuilder(
small: (context, _) => smallPhoto,
large: (context, _) => largePhoto,
);
}
}
class _AnimatedPhotoboothPhoto extends StatelessWidget {
const _AnimatedPhotoboothPhoto({
required this.sprite,
required this.isPhotoVisible,
required this.aspectRatio,
required this.image,
this.top = 0.0,
this.left = 0.0,
this.right = 0.0,
this.bottom = 0.0,
this.scale = 1.0,
});
final AnimatedSprite sprite;
final bool isPhotoVisible;
final double aspectRatio;
final CameraImage? image;
final double top;
final double left;
final double right;
final double bottom;
final double scale;
@override
Widget build(BuildContext context) {
final image = this.image;
return SizedBox(
height: sprite.sprites.size.height * scale,
width: sprite.sprites.size.width * scale,
child: Stack(
fit: StackFit.expand,
children: [
FittedBox(
fit: BoxFit.cover,
child: ConstrainedBox(
constraints: BoxConstraints.loose(sprite.sprites.size),
child: sprite,
),
),
if (image != null)
Positioned(
top: top * scale,
left: left * scale,
right: right * scale,
bottom: bottom * scale,
child: AnimatedOpacity(
duration: const Duration(seconds: 2),
opacity: isPhotoVisible ? 1 : 0,
child: AspectRatio(
aspectRatio: aspectRatio,
child: PhotoboothPhoto(image: image.data),
),
),
),
],
),
);
}
}
| photobooth/lib/share/widgets/animated_photobooth_photo.dart/0 | {
"file_path": "photobooth/lib/share/widgets/animated_photobooth_photo.dart",
"repo_id": "photobooth",
"token_count": 2725
} | 1,132 |
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
part 'stickers_event.dart';
part 'stickers_state.dart';
class StickersBloc extends Bloc<StickersEvent, StickersState> {
StickersBloc() : super(const StickersState()) {
on<StickersDrawerToggled>(
(event, emit) => emit(
state.copyWith(
isDrawerActive: !state.isDrawerActive,
shouldDisplayPropsReminder: false,
),
),
);
on<StickersDrawerTabTapped>(
(event, emit) => emit(
state.copyWith(tabIndex: event.index),
),
);
}
}
| photobooth/lib/stickers/bloc/stickers_bloc.dart/0 | {
"file_path": "photobooth/lib/stickers/bloc/stickers_bloc.dart",
"repo_id": "photobooth",
"token_count": 256
} | 1,133 |
{
"name": "io-photobooth",
"version": "0.1.0",
"private": false,
"dependencies": {},
"scripts": {
"emulate": "npm --prefix ./functions run tsc -w & firebase emulators:start --only hosting,functions,storage",
"api": "npm --prefix ./functions run dev",
"test:functions": "npm --prefix ./functions run test"
}
}
| photobooth/package.json/0 | {
"file_path": "photobooth/package.json",
"repo_id": "photobooth",
"token_count": 128
} | 1,134 |
export 'src/platform_interface/camera_platform.dart';
export 'src/types/types.dart';
| photobooth/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart/0 | {
"file_path": "photobooth/packages/camera/camera_platform_interface/lib/camera_platform_interface.dart",
"repo_id": "photobooth",
"token_count": 28
} | 1,135 |
include: package:very_good_analysis/analysis_options.yaml
linter:
rules:
avoid_web_libraries_in_flutter: false | photobooth/packages/image_compositor/analysis_options.yaml/0 | {
"file_path": "photobooth/packages/image_compositor/analysis_options.yaml",
"repo_id": "photobooth",
"token_count": 41
} | 1,136 |
export 'is_mobile.dart';
| photobooth/packages/photobooth_ui/lib/src/platform/platform.dart/0 | {
"file_path": "photobooth/packages/photobooth_ui/lib/src/platform/platform.dart",
"repo_id": "photobooth",
"token_count": 10
} | 1,137 |
import 'package:flutter/widgets.dart';
import 'package:platform_helper/platform_helper.dart';
/// {@template platform_builder}
/// A builder for mobile and desktop platform
/// {@endtemplate}
class PlatformBuilder extends StatelessWidget {
/// {@macro platform_builder}
PlatformBuilder({
required this.mobile,
required this.desktop,
PlatformHelper? platformHelper,
super.key,
}) : _platformHelper = platformHelper ?? PlatformHelper();
/// [Widget] for mobile.
final Widget mobile;
/// [Widget] for desktop.
final Widget desktop;
final PlatformHelper _platformHelper;
@override
Widget build(BuildContext context) {
return _platformHelper.isMobile ? mobile : desktop;
}
}
| photobooth/packages/photobooth_ui/lib/src/widgets/platform_builder.dart/0 | {
"file_path": "photobooth/packages/photobooth_ui/lib/src/widgets/platform_builder.dart",
"repo_id": "photobooth",
"token_count": 211
} | 1,138 |
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:photobooth_ui/photobooth_ui.dart';
class MockAnimationController extends Mock implements AnimationController {}
void main() {
group('AnimatedPulse', () {
testWidgets('renders with default settings', (tester) async {
await tester.pumpWidget(AnimatedPulse(child: SizedBox()));
/// Pulse Animation
await tester.pump(defaultPulseDuration);
/// Time between pulses
await tester.pump(defaultTimeBetweenPulses);
/// Start new animation
await tester.pump(defaultPulseDuration);
expect(find.byType(CustomPaint), findsOneWidget);
});
testWidgets('renders with custom settings', (tester) async {
const testDuration = Duration(milliseconds: 1);
await tester.pumpWidget(
AnimatedPulse(
pulseDuration: testDuration,
timeBetweenPulses: testDuration,
child: SizedBox(),
),
);
/// Pulse Animation
await tester.pump(testDuration);
/// Time between pulses
await tester.pump(testDuration);
/// Start new animation
await tester.pump(testDuration);
expect(find.byType(CustomPaint), findsOneWidget);
});
});
group('PulsePainter', () {
test('verifies should repaint', () async {
final pulsePainter = PulsePainter(MockAnimationController());
expect(pulsePainter.shouldRepaint(pulsePainter), true);
});
});
}
| photobooth/packages/photobooth_ui/test/src/widgets/animated_pulse_test.dart/0 | {
"file_path": "photobooth/packages/photobooth_ui/test/src/widgets/animated_pulse_test.dart",
"repo_id": "photobooth",
"token_count": 586
} | 1,139 |
/// A library that manages the photo domain.
library photos_repository;
export 'src/photos_repository.dart';
| photobooth/packages/photos_repository/lib/photos_repository.dart/0 | {
"file_path": "photobooth/packages/photos_repository/lib/photos_repository.dart",
"repo_id": "photobooth",
"token_count": 33
} | 1,140 |
name: io_photobooth
description: I/O Photo Booth app.
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.19.0 <3.0.0"
flutter: 3.8.0-14.0.pre.10
dependencies:
analytics:
path: packages/analytics
authentication_repository:
path: packages/authentication_repository
bloc: ^8.1.0
camera:
path: packages/camera/camera
cross_file: ^0.3.3+2
equatable: ^2.0.5
firebase_auth: ^4.2.9
firebase_core: ^2.4.1
firebase_storage: ^11.0.10
flutter:
sdk: flutter
flutter_bloc: ^8.1.1
flutter_localizations:
sdk: flutter
image_compositor:
path: packages/image_compositor
intl: ^0.18.0
just_audio: ^0.9.31
photobooth_ui:
path: packages/photobooth_ui
photos_repository:
path: packages/photos_repository
platform_helper:
path: packages/platform_helper
rxdart: ^0.27.7
uuid: ^3.0.7
very_good_analysis: ^4.0.0+1
dev_dependencies:
bloc_test: ^9.1.0
flutter_test:
sdk: flutter
mocktail: ^0.3.0
mocktail_image_network: ^0.3.1
plugin_platform_interface: ^2.1.3
test: ^1.21.7
url_launcher_platform_interface: ^2.1.1
dependency_overrides:
intl: ^0.18.0
flutter:
uses-material-design: true
generate: true
assets:
- assets/audio/
- assets/backgrounds/
- assets/images/
- assets/icons/
- assets/props/google/
- assets/props/hats/
- assets/props/eyewear/
- assets/props/food/
- assets/props/shapes/
| photobooth/pubspec.yaml/0 | {
"file_path": "photobooth/pubspec.yaml",
"repo_id": "photobooth",
"token_count": 642
} | 1,141 |
// ignore_for_file: prefer_const_constructors
import 'package:flutter_test/flutter_test.dart';
import 'package:io_photobooth/photobooth/photobooth.dart';
import 'package:photobooth_ui/photobooth_ui.dart';
void main() {
group('AnimatedCharacters', () {
group('AnimatedAndroid', () {
test('is an AnimatedSprite', () {
expect(AnimatedAndroid(), isA<AnimatedSprite>());
});
});
group('AnimatedDino', () {
test('is an AnimatedSprite', () {
expect(AnimatedDino(), isA<AnimatedSprite>());
});
});
group('AnimatedDash', () {
test('is an AnimatedSprite', () {
expect(AnimatedDash(), isA<AnimatedSprite>());
});
});
group('AnimatedSparky', () {
test('is an AnimatedSprite', () {
expect(AnimatedSparky(), isA<AnimatedSprite>());
});
});
});
}
| photobooth/test/photobooth/widgets/animated_characters/animated_characters_test.dart/0 | {
"file_path": "photobooth/test/photobooth/widgets/animated_characters/animated_characters_test.dart",
"repo_id": "photobooth",
"token_count": 353
} | 1,142 |
// ignore_for_file: prefer_const_constructors
import 'dart:typed_data';
import 'package:bloc_test/bloc_test.dart';
import 'package:camera/camera.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:io_photobooth/photobooth/photobooth.dart';
import 'package:io_photobooth/share/share.dart';
import 'package:mocktail/mocktail.dart';
import 'package:platform_helper/platform_helper.dart';
import '../../helpers/helpers.dart';
class FakePhotoboothEvent extends Fake implements PhotoboothEvent {}
class FakePhotoboothState extends Fake implements PhotoboothState {}
class MockPhotoboothBloc extends MockBloc<PhotoboothEvent, PhotoboothState>
implements PhotoboothBloc {}
class MockPlatformHelper extends Mock implements PlatformHelper {}
void main() {
const width = 1;
const height = 1;
const data = '';
const image = CameraImage(width: width, height: height, data: data);
final bytes = Uint8List.fromList(transparentImage);
late PhotoboothBloc photoboothBloc;
late PlatformHelper platformHelper;
setUpAll(() {
registerFallbackValue(FakePhotoboothEvent());
registerFallbackValue(FakePhotoboothState());
});
setUp(() {
photoboothBloc = MockPhotoboothBloc();
when(() => photoboothBloc.state).thenReturn(PhotoboothState(image: image));
platformHelper = MockPlatformHelper();
});
group('ShareButton', () {
testWidgets(
'tapping on share photo button opens ShareBottomSheet '
'when platform is mobile', (tester) async {
when(() => platformHelper.isMobile).thenReturn(true);
await tester.pumpApp(
ShareButton(image: bytes),
photoboothBloc: photoboothBloc,
);
await tester.tap(find.byType(ShareButton));
await tester.pumpAndSettle();
expect(find.byType(ShareBottomSheet), findsOneWidget);
});
testWidgets(
'tapping on share photo button opens ShareBottomSheet '
'when platform is not mobile and it is portrait', (tester) async {
when(() => platformHelper.isMobile).thenReturn(false);
tester.setPortraitDisplaySize();
await tester.pumpApp(
ShareButton(
image: bytes,
platformHelper: platformHelper,
),
photoboothBloc: photoboothBloc,
);
await tester.tap(find.byType(ShareButton));
await tester.pumpAndSettle();
expect(find.byType(ShareBottomSheet), findsOneWidget);
});
testWidgets(
'tapping on share photo button opens ShareDialog '
'when platform is not mobile and it is landscape', (tester) async {
when(() => platformHelper.isMobile).thenReturn(false);
tester.setLandscapeDisplaySize();
await tester.pumpApp(
ShareButton(
image: bytes,
platformHelper: platformHelper,
),
photoboothBloc: photoboothBloc,
);
await tester.tap(find.byType(ShareButton));
await tester.pumpAndSettle();
expect(find.byType(ShareDialog), findsOneWidget);
});
});
}
| photobooth/test/share/widgets/share_button_test.dart/0 | {
"file_path": "photobooth/test/share/widgets/share_button_test.dart",
"repo_id": "photobooth",
"token_count": 1125
} | 1,143 |
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
<method v="2" />
</configuration>
</component> | pinball/.idea/runConfigurations/main.xml/0 | {
"file_path": "pinball/.idea/runConfigurations/main.xml",
"repo_id": "pinball",
"token_count": 85
} | 1,144 |
export 'assets_loading_page.dart';
| pinball/lib/assets_manager/views/views.dart/0 | {
"file_path": "pinball/lib/assets_manager/views/views.dart",
"repo_id": "pinball",
"token_count": 12
} | 1,145 |
part of 'game_bloc.dart';
/// Defines bonuses that a player can gain during a PinballGame.
enum GameBonus {
/// Bonus achieved when the ball activates all Google letters.
googleWord,
/// Bonus achieved when the user activates all dash bumpers.
dashNest,
/// Bonus achieved when a ball enters Sparky's computer.
sparkyTurboCharge,
/// Bonus achieved when the ball goes in the dino mouth.
dinoChomp,
/// Bonus achieved when a ball enters the android spaceship.
androidSpaceship,
}
enum GameStatus {
waiting,
playing,
gameOver,
}
extension GameStatusX on GameStatus {
bool get isWaiting => this == GameStatus.waiting;
bool get isPlaying => this == GameStatus.playing;
bool get isGameOver => this == GameStatus.gameOver;
}
/// {@template game_state}
/// Represents the state of the pinball game.
/// {@endtemplate}
class GameState extends Equatable {
/// {@macro game_state}
const GameState({
required this.totalScore,
required this.roundScore,
required this.multiplier,
required this.rounds,
required this.bonusHistory,
required this.status,
}) : assert(totalScore >= 0, "TotalScore can't be negative"),
assert(roundScore >= 0, "Round score can't be negative"),
assert(multiplier > 0, 'Multiplier must be greater than zero'),
assert(rounds >= 0, "Number of rounds can't be negative");
const GameState.initial()
: status = GameStatus.waiting,
totalScore = 0,
roundScore = 0,
multiplier = 1,
rounds = 3,
bonusHistory = const [];
/// The score for the current round of the game.
///
/// Multipliers are only applied to the score for the current round once is
/// lost. Then the [roundScore] is added to the [totalScore] and reset to 0
/// for the next round.
final int roundScore;
/// The total score of the game.
final int totalScore;
/// The current multiplier for the score.
final int multiplier;
/// The number of rounds left in the game.
///
/// When the number of rounds is 0, the game is over.
final int rounds;
/// Holds the history of all the [GameBonus]es earned by the player during a
/// PinballGame.
final List<GameBonus> bonusHistory;
final GameStatus status;
/// The score displayed at the game.
int get displayScore => roundScore + totalScore;
/// The max multiplier in game.
bool get isMaxMultiplier => multiplier == 6;
GameState copyWith({
int? totalScore,
int? roundScore,
int? multiplier,
int? balls,
int? rounds,
List<GameBonus>? bonusHistory,
GameStatus? status,
}) {
assert(
totalScore == null || totalScore >= this.totalScore,
"Total score can't be decreased",
);
return GameState(
totalScore: totalScore ?? this.totalScore,
roundScore: roundScore ?? this.roundScore,
multiplier: multiplier ?? this.multiplier,
rounds: rounds ?? this.rounds,
bonusHistory: bonusHistory ?? this.bonusHistory,
status: status ?? this.status,
);
}
@override
List<Object?> get props => [
totalScore,
roundScore,
multiplier,
rounds,
bonusHistory,
status,
];
}
| pinball/lib/game/bloc/game_state.dart/0 | {
"file_path": "pinball/lib/game/bloc/game_state.dart",
"repo_id": "pinball",
"token_count": 1061
} | 1,146 |
import 'package:flame/components.dart';
import 'package:flutter/material.dart';
import 'package:pinball/game/game.dart';
import 'package:pinball/l10n/l10n.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
import 'package:pinball_ui/pinball_ui.dart';
final _bodyTextPaint = TextPaint(
style: const TextStyle(
fontSize: 1.8,
color: PinballColors.white,
fontFamily: PinballFonts.pixeloidSans,
fontWeight: FontWeight.w400,
),
);
/// {@template initials_submission_failure_display}
/// [Backbox] display for when a failure occurs during initials submission.
/// {@endtemplate}
class InitialsSubmissionFailureDisplay extends Component {
/// {@macro initials_submission_failure_display}
InitialsSubmissionFailureDisplay({
required this.onDismissed,
});
final VoidCallback onDismissed;
@override
Future<void> onLoad() async {
final l10n = readProvider<AppLocalizations>();
await addAll([
ErrorComponent.bold(
label: l10n.initialsErrorTitle,
position: Vector2(0, -20),
),
TextComponent(
text: l10n.initialsErrorMessage,
anchor: Anchor.center,
position: Vector2(0, -12),
textRenderer: _bodyTextPaint,
),
TimerComponent(period: 4, onTick: onDismissed),
]);
}
}
| pinball/lib/game/components/backbox/displays/initials_submission_failure_display.dart/0 | {
"file_path": "pinball/lib/game/components/backbox/displays/initials_submission_failure_display.dart",
"repo_id": "pinball",
"token_count": 515
} | 1,147 |
// ignore_for_file: avoid_renaming_method_parameters
import 'package:flame/components.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flutter/material.dart';
import 'package:pinball/game/behaviors/behaviors.dart';
import 'package:pinball/game/components/flutter_forest/behaviors/behaviors.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
/// {@template flutter_forest}
/// Area positioned at the top right of the board where the [Ball] can bounce
/// off [DashBumper]s.
/// {@endtemplate}
class FlutterForest extends Component with ZIndex {
/// {@macro flutter_forest}
FlutterForest()
: super(
children: [
FlameMultiBlocProvider(
providers: [
FlameBlocProvider<SignpostCubit, SignpostState>(
create: SignpostCubit.new,
),
FlameBlocProvider<DashBumpersCubit, DashBumpersState>(
create: DashBumpersCubit.new,
),
],
children: [
Signpost(
children: [
ScoringContactBehavior(points: Points.fiveThousand),
BumperNoiseBehavior(),
],
)..initialPosition = Vector2(7.95, -58.35),
DashBumper.main(
children: [
ScoringContactBehavior(points: Points.twoHundredThousand),
BumperNoiseBehavior(),
],
)..initialPosition = Vector2(18.55, -59.35),
DashBumper.a(
children: [
ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(),
],
)..initialPosition = Vector2(8.95, -51.95),
DashBumper.b(
children: [
ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(),
],
)..initialPosition = Vector2(21.8, -46.75),
DashAnimatronic(
children: [
AnimatronicLoopingBehavior(animationCoolDown: 11),
],
)..position = Vector2(20, -66),
FlutterForestBonusBehavior(),
],
),
],
) {
zIndex = ZIndexes.flutterForest;
}
/// Creates a [FlutterForest] without any children.
///
/// This can be used for testing [FlutterForest]'s behaviors in isolation.
@visibleForTesting
FlutterForest.test();
}
| pinball/lib/game/components/flutter_forest/flutter_forest.dart/0 | {
"file_path": "pinball/lib/game/components/flutter_forest/flutter_forest.dart",
"repo_id": "pinball",
"token_count": 1360
} | 1,148 |
import 'package:flame/extensions.dart';
import 'package:pinball/game/game.dart';
import 'package:pinball_components/pinball_components.dart' as components;
import 'package:pinball_theme/pinball_theme.dart' hide Assets;
/// Add methods to help loading and caching game assets.
extension PinballGameAssetsX on PinballGame {
/// Returns a list of assets to be loaded
List<Future<Image> Function()> preLoadAssets() {
const dashTheme = DashTheme();
const sparkyTheme = SparkyTheme();
const androidTheme = AndroidTheme();
const dinoTheme = DinoTheme();
return [
() => images.load(components.Assets.images.boardBackground.keyName),
() => images.load(components.Assets.images.ball.flameEffect.keyName),
() => images.load(components.Assets.images.signpost.inactive.keyName),
() => images.load(components.Assets.images.signpost.active1.keyName),
() => images.load(components.Assets.images.signpost.active2.keyName),
() => images.load(components.Assets.images.signpost.active3.keyName),
() => images.load(components.Assets.images.flipper.left.keyName),
() => images.load(components.Assets.images.flipper.right.keyName),
() => images.load(components.Assets.images.baseboard.left.keyName),
() => images.load(components.Assets.images.baseboard.right.keyName),
() => images.load(components.Assets.images.kicker.left.lit.keyName),
() => images.load(components.Assets.images.kicker.left.dimmed.keyName),
() => images.load(components.Assets.images.kicker.right.lit.keyName),
() => images.load(components.Assets.images.kicker.right.dimmed.keyName),
() => images.load(components.Assets.images.slingshot.upper.keyName),
() => images.load(components.Assets.images.slingshot.lower.keyName),
() => images.load(components.Assets.images.launchRamp.ramp.keyName),
() => images.load(
components.Assets.images.launchRamp.foregroundRailing.keyName,
),
() => images.load(
components.Assets.images.launchRamp.backgroundRailing.keyName,
),
() => images.load(components.Assets.images.dino.bottomWall.keyName),
() => images.load(components.Assets.images.dino.topWall.keyName),
() => images.load(components.Assets.images.dino.topWallTunnel.keyName),
() => images.load(components.Assets.images.dino.animatronic.head.keyName),
() =>
images.load(components.Assets.images.dino.animatronic.mouth.keyName),
() => images.load(components.Assets.images.dash.animatronic.keyName),
() => images.load(components.Assets.images.dash.bumper.a.active.keyName),
() =>
images.load(components.Assets.images.dash.bumper.a.inactive.keyName),
() => images.load(components.Assets.images.dash.bumper.b.active.keyName),
() =>
images.load(components.Assets.images.dash.bumper.b.inactive.keyName),
() =>
images.load(components.Assets.images.dash.bumper.main.active.keyName),
() => images
.load(components.Assets.images.dash.bumper.main.inactive.keyName),
() => images.load(components.Assets.images.plunger.plunger.keyName),
() => images.load(components.Assets.images.plunger.rocket.keyName),
() => images.load(components.Assets.images.boundary.bottom.keyName),
() => images.load(components.Assets.images.boundary.outer.keyName),
() => images.load(components.Assets.images.boundary.outerBottom.keyName),
() => images
.load(components.Assets.images.android.spaceship.saucer.keyName),
() => images
.load(components.Assets.images.android.spaceship.animatronic.keyName),
() => images
.load(components.Assets.images.android.spaceship.lightBeam.keyName),
() => images
.load(components.Assets.images.android.ramp.boardOpening.keyName),
() => images.load(
components.Assets.images.android.ramp.railingForeground.keyName,
),
() => images.load(
components.Assets.images.android.ramp.railingBackground.keyName,
),
() => images.load(components.Assets.images.android.ramp.main.keyName),
() => images
.load(components.Assets.images.android.ramp.arrow.inactive.keyName),
() => images.load(
components.Assets.images.android.ramp.arrow.active1.keyName,
),
() => images.load(
components.Assets.images.android.ramp.arrow.active2.keyName,
),
() => images.load(
components.Assets.images.android.ramp.arrow.active3.keyName,
),
() => images.load(
components.Assets.images.android.ramp.arrow.active4.keyName,
),
() => images.load(
components.Assets.images.android.ramp.arrow.active5.keyName,
),
() => images.load(components.Assets.images.android.rail.main.keyName),
() => images.load(components.Assets.images.android.rail.exit.keyName),
() => images.load(components.Assets.images.android.bumper.a.lit.keyName),
() =>
images.load(components.Assets.images.android.bumper.a.dimmed.keyName),
() => images.load(components.Assets.images.android.bumper.b.lit.keyName),
() =>
images.load(components.Assets.images.android.bumper.b.dimmed.keyName),
() =>
images.load(components.Assets.images.android.bumper.cow.lit.keyName),
() => images
.load(components.Assets.images.android.bumper.cow.dimmed.keyName),
() => images.load(components.Assets.images.sparky.computer.top.keyName),
() => images.load(components.Assets.images.sparky.computer.base.keyName),
() => images.load(components.Assets.images.sparky.computer.glow.keyName),
() => images.load(components.Assets.images.sparky.animatronic.keyName),
() => images.load(components.Assets.images.sparky.bumper.a.lit.keyName),
() =>
images.load(components.Assets.images.sparky.bumper.a.dimmed.keyName),
() => images.load(components.Assets.images.sparky.bumper.b.lit.keyName),
() =>
images.load(components.Assets.images.sparky.bumper.b.dimmed.keyName),
() => images.load(components.Assets.images.sparky.bumper.c.lit.keyName),
() =>
images.load(components.Assets.images.sparky.bumper.c.dimmed.keyName),
() => images.load(components.Assets.images.backbox.marquee.keyName),
() =>
images.load(components.Assets.images.backbox.displayDivider.keyName),
() =>
images.load(components.Assets.images.backbox.button.facebook.keyName),
() =>
images.load(components.Assets.images.backbox.button.twitter.keyName),
() => images.load(
components.Assets.images.backbox.displayTitleDecoration.keyName,
),
() =>
images.load(components.Assets.images.googleWord.letter1.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter1.dimmed.keyName),
() =>
images.load(components.Assets.images.googleWord.letter2.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter2.dimmed.keyName),
() =>
images.load(components.Assets.images.googleWord.letter3.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter3.dimmed.keyName),
() =>
images.load(components.Assets.images.googleWord.letter4.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter4.dimmed.keyName),
() =>
images.load(components.Assets.images.googleWord.letter5.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter5.dimmed.keyName),
() =>
images.load(components.Assets.images.googleWord.letter6.lit.keyName),
() => images
.load(components.Assets.images.googleWord.letter6.dimmed.keyName),
() => images
.load(components.Assets.images.googleRollover.left.decal.keyName),
() =>
images.load(components.Assets.images.googleRollover.left.pin.keyName),
() => images
.load(components.Assets.images.googleRollover.right.decal.keyName),
() => images
.load(components.Assets.images.googleRollover.right.pin.keyName),
() => images.load(components.Assets.images.multiball.lit.keyName),
() => images.load(components.Assets.images.multiball.dimmed.keyName),
() => images.load(components.Assets.images.multiplier.x2.lit.keyName),
() => images.load(components.Assets.images.multiplier.x2.dimmed.keyName),
() => images.load(components.Assets.images.multiplier.x3.lit.keyName),
() => images.load(components.Assets.images.multiplier.x3.dimmed.keyName),
() => images.load(components.Assets.images.multiplier.x4.lit.keyName),
() => images.load(components.Assets.images.multiplier.x4.dimmed.keyName),
() => images.load(components.Assets.images.multiplier.x5.lit.keyName),
() => images.load(components.Assets.images.multiplier.x5.dimmed.keyName),
() => images.load(components.Assets.images.multiplier.x6.lit.keyName),
() => images.load(components.Assets.images.multiplier.x6.dimmed.keyName),
() => images.load(components.Assets.images.score.fiveThousand.keyName),
() => images.load(components.Assets.images.score.twentyThousand.keyName),
() => images
.load(components.Assets.images.score.twoHundredThousand.keyName),
() => images.load(components.Assets.images.score.oneMillion.keyName),
() => images.load(components.Assets.images.flapper.backSupport.keyName),
() => images.load(components.Assets.images.flapper.frontSupport.keyName),
() => images.load(components.Assets.images.flapper.flap.keyName),
() => images.load(components.Assets.images.skillShot.decal.keyName),
() => images.load(components.Assets.images.skillShot.pin.keyName),
() => images.load(components.Assets.images.skillShot.lit.keyName),
() => images.load(components.Assets.images.skillShot.dimmed.keyName),
() =>
images.load(components.Assets.images.displayArrows.arrowLeft.keyName),
() => images
.load(components.Assets.images.displayArrows.arrowRight.keyName),
() => images.load(androidTheme.leaderboardIcon.keyName),
() => images.load(androidTheme.ball.keyName),
() => images.load(dashTheme.leaderboardIcon.keyName),
() => images.load(dashTheme.ball.keyName),
() => images.load(dinoTheme.leaderboardIcon.keyName),
() => images.load(dinoTheme.ball.keyName),
() => images.load(sparkyTheme.leaderboardIcon.keyName),
() => images.load(sparkyTheme.ball.keyName),
() => images.load(androidTheme.background.keyName),
() => images.load(dashTheme.background.keyName),
() => images.load(dinoTheme.background.keyName),
() => images.load(sparkyTheme.background.keyName),
];
}
}
| pinball/lib/game/game_assets.dart/0 | {
"file_path": "pinball/lib/game/game_assets.dart",
"repo_id": "pinball",
"token_count": 4550
} | 1,149 |
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pinball/gen/gen.dart';
import 'package:pinball/l10n/l10n.dart';
import 'package:pinball_audio/pinball_audio.dart';
import 'package:pinball_ui/pinball_ui.dart';
import 'package:platform_helper/platform_helper.dart';
enum Control {
left,
right,
down,
a,
d,
s,
space,
}
extension on Control {
bool get isArrow => isDown || isRight || isLeft;
bool get isDown => this == Control.down;
bool get isRight => this == Control.right;
bool get isLeft => this == Control.left;
bool get isSpace => this == Control.space;
String getCharacter(BuildContext context) {
switch (this) {
case Control.a:
return 'A';
case Control.d:
return 'D';
case Control.down:
return '>'; // Will be rotated
case Control.left:
return '<';
case Control.right:
return '>';
case Control.s:
return 'S';
case Control.space:
return context.l10n.space;
}
}
}
class HowToPlayDialog extends StatefulWidget {
const HowToPlayDialog({
Key? key,
required this.onDismissCallback,
}) : super(key: key);
final VoidCallback onDismissCallback;
@override
State<HowToPlayDialog> createState() => _HowToPlayDialogState();
}
class _HowToPlayDialogState extends State<HowToPlayDialog> {
late Timer closeTimer;
@override
void initState() {
super.initState();
closeTimer = Timer(const Duration(seconds: 3), () {
if (mounted) {
Navigator.of(context).pop();
widget.onDismissCallback.call();
}
});
}
@override
void dispose() {
closeTimer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
final isMobile = context.read<PlatformHelper>().isMobile;
final l10n = context.l10n;
return WillPopScope(
onWillPop: () {
widget.onDismissCallback.call();
context
.read<PinballAudioPlayer>()
.play(PinballAudio.ioPinballVoiceOver);
return Future.value(true);
},
child: PinballDialog(
title: l10n.howToPlay,
subtitle: l10n.tipsForFlips,
child: FittedBox(
child: isMobile ? const _MobileBody() : const _DesktopBody(),
),
),
);
}
}
class _MobileBody extends StatelessWidget {
const _MobileBody({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final paddingWidth = MediaQuery.of(context).size.width * 0.15;
final paddingHeight = MediaQuery.of(context).size.height * 0.075;
return Padding(
padding: EdgeInsets.symmetric(
horizontal: paddingWidth,
),
child: Column(
children: [
const _MobileLaunchControls(),
SizedBox(height: paddingHeight),
const _MobileFlipperControls(),
],
),
);
}
}
class _MobileLaunchControls extends StatelessWidget {
const _MobileLaunchControls({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final headline3 = Theme.of(context)
.textTheme
.headline3!
.copyWith(color: PinballColors.white);
return Column(
children: [
Text(l10n.tapAndHoldRocket, style: headline3),
Text.rich(
TextSpan(
children: [
TextSpan(text: '${l10n.to} ', style: headline3),
TextSpan(
text: l10n.launch,
style: headline3.copyWith(color: PinballColors.blue),
),
],
),
),
],
);
}
}
class _MobileFlipperControls extends StatelessWidget {
const _MobileFlipperControls({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final headline3 = Theme.of(context)
.textTheme
.headline3!
.copyWith(color: PinballColors.white);
return Column(
children: [
Text(l10n.tapLeftRightScreen, style: headline3),
Text.rich(
TextSpan(
children: [
TextSpan(text: '${l10n.to} ', style: headline3),
TextSpan(
text: l10n.flip,
style: headline3.copyWith(color: PinballColors.orange),
),
],
),
),
],
);
}
}
class _DesktopBody extends StatelessWidget {
const _DesktopBody({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
children: const [
_DesktopLaunchControls(),
SizedBox(height: 16),
_DesktopFlipperControls(),
],
),
);
}
}
class _DesktopLaunchControls extends StatelessWidget {
const _DesktopLaunchControls({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Column(
children: [
Text(
l10n.launchControls,
style: Theme.of(context).textTheme.headline4,
),
const SizedBox(height: 10),
Wrap(
children: const [
_KeyButton(control: Control.down),
SizedBox(width: 10),
_KeyButton(control: Control.space),
SizedBox(width: 10),
_KeyButton(control: Control.s),
],
)
],
);
}
}
class _DesktopFlipperControls extends StatelessWidget {
const _DesktopFlipperControls({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Column(
children: [
Text(
l10n.flipperControls,
style: Theme.of(context).textTheme.headline4,
),
const SizedBox(height: 10),
Column(
children: [
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: const [
_KeyButton(control: Control.left),
SizedBox(width: 20),
_KeyButton(control: Control.right),
],
),
const SizedBox(height: 8),
Wrap(
children: const [
_KeyButton(control: Control.a),
SizedBox(width: 20),
_KeyButton(control: Control.d),
],
)
],
)
],
);
}
}
class _KeyButton extends StatelessWidget {
const _KeyButton({Key? key, required this.control}) : super(key: key);
final Control control;
@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
final textStyle =
control.isArrow ? textTheme.headline1 : textTheme.headline3;
const height = 60.0;
final width = control.isSpace ? height * 2.83 : height;
return DecoratedBox(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage(
control.isSpace
? Assets.images.components.space.keyName
: Assets.images.components.key.keyName,
),
),
),
child: SizedBox(
width: width,
height: height,
child: Center(
child: RotatedBox(
quarterTurns: control.isDown ? 1 : 0,
child: Text(
control.getCharacter(context),
style: textStyle?.copyWith(color: PinballColors.white),
),
),
),
),
);
}
}
| pinball/lib/how_to_play/widgets/how_to_play_dialog.dart/0 | {
"file_path": "pinball/lib/how_to_play/widgets/how_to_play_dialog.dart",
"repo_id": "pinball",
"token_count": 3547
} | 1,150 |
part of 'start_game_bloc.dart';
/// Defines status of start game flow.
enum StartGameStatus {
/// Initial status.
initial,
/// Selection characters status.
selectCharacter,
/// How to play status.
howToPlay,
/// Play status.
play,
}
/// {@template start_game_state}
/// Represents the state of flow before the game starts.
/// {@endtemplate}
class StartGameState extends Equatable {
/// {@macro start_game_state}
const StartGameState({
required this.status,
});
/// Initial [StartGameState].
const StartGameState.initial() : this(status: StartGameStatus.initial);
/// Status of [StartGameState].
final StartGameStatus status;
/// Creates a copy of [StartGameState].
StartGameState copyWith({
StartGameStatus? status,
}) {
return StartGameState(
status: status ?? this.status,
);
}
@override
List<Object> get props => [status];
}
| pinball/lib/start_game/bloc/start_game_state.dart/0 | {
"file_path": "pinball/lib/start_game/bloc/start_game_state.dart",
"repo_id": "pinball",
"token_count": 284
} | 1,151 |
// ignore_for_file: prefer_const_constructors, cascade_invocations
import 'package:geometry/geometry.dart';
import 'package:test/test.dart';
import 'package:vector_math/vector_math_64.dart';
class Binomial {
Binomial({required this.n, required this.k});
final num n;
final num k;
}
void main() {
group('calculateArc', () {
test('returns by default 100 points as indicated by precision', () {
final points = calculateArc(
center: Vector2.zero(),
radius: 100,
angle: 90,
);
expect(points.length, 100);
});
test('returns as many points as indicated by precision', () {
final points = calculateArc(
center: Vector2.zero(),
radius: 100,
angle: 90,
precision: 50,
);
expect(points.length, 50);
});
});
group('calculateEllipse', () {
test('returns by default 100 points as indicated by precision', () {
final points = calculateEllipse(
center: Vector2.zero(),
majorRadius: 100,
minorRadius: 50,
);
expect(points.length, 100);
});
test('returns as many points as indicated by precision', () {
final points = calculateEllipse(
center: Vector2.zero(),
majorRadius: 100,
minorRadius: 50,
precision: 50,
);
expect(points.length, 50);
});
test('fails if radius not in range', () {
expect(
() => calculateEllipse(
center: Vector2.zero(),
majorRadius: 100,
minorRadius: 150,
),
throwsA(isA<AssertionError>()),
);
expect(
() => calculateEllipse(
center: Vector2.zero(),
majorRadius: 100,
minorRadius: 0,
),
throwsA(isA<AssertionError>()),
);
});
});
group('calculateBezierCurve', () {
test('fails if step not in range', () {
expect(
() => calculateBezierCurve(
controlPoints: [
Vector2(0, 0),
Vector2(10, 10),
],
step: 2,
),
throwsA(isA<AssertionError>()),
);
});
test('fails if not enough control points', () {
expect(
() => calculateBezierCurve(controlPoints: [Vector2.zero()]),
throwsA(isA<AssertionError>()),
);
expect(
() => calculateBezierCurve(controlPoints: []),
throwsA(isA<AssertionError>()),
);
});
test('returns by default 100 points as indicated by step', () {
final points = calculateBezierCurve(
controlPoints: [
Vector2(0, 0),
Vector2(10, 10),
],
);
expect(points.length, 100);
});
test('returns as many points as indicated by step', () {
final points = calculateBezierCurve(
controlPoints: [
Vector2(0, 0),
Vector2(10, 10),
],
step: 0.02,
);
expect(points.length, 50);
});
});
group('binomial', () {
test('fails if k is negative', () {
expect(
() => binomial(1, -1),
throwsA(isA<AssertionError>()),
);
});
test('fails if n is negative', () {
expect(
() => binomial(-1, 1),
throwsA(isA<AssertionError>()),
);
});
test('fails if n < k', () {
expect(
() => binomial(1, 2),
throwsA(isA<AssertionError>()),
);
});
test('for a specific input gives a correct value', () {
final binomialInputsToExpected = {
Binomial(n: 0, k: 0): 1,
Binomial(n: 1, k: 0): 1,
Binomial(n: 1, k: 1): 1,
Binomial(n: 2, k: 0): 1,
Binomial(n: 2, k: 1): 2,
Binomial(n: 2, k: 2): 1,
Binomial(n: 3, k: 0): 1,
Binomial(n: 3, k: 1): 3,
Binomial(n: 3, k: 2): 3,
Binomial(n: 3, k: 3): 1,
Binomial(n: 4, k: 0): 1,
Binomial(n: 4, k: 1): 4,
Binomial(n: 4, k: 2): 6,
Binomial(n: 4, k: 3): 4,
Binomial(n: 4, k: 4): 1,
Binomial(n: 5, k: 0): 1,
Binomial(n: 5, k: 1): 5,
Binomial(n: 5, k: 2): 10,
Binomial(n: 5, k: 3): 10,
Binomial(n: 5, k: 4): 5,
Binomial(n: 5, k: 5): 1,
Binomial(n: 6, k: 0): 1,
Binomial(n: 6, k: 1): 6,
Binomial(n: 6, k: 2): 15,
Binomial(n: 6, k: 3): 20,
Binomial(n: 6, k: 4): 15,
Binomial(n: 6, k: 5): 6,
Binomial(n: 6, k: 6): 1,
};
binomialInputsToExpected.forEach((input, value) {
expect(binomial(input.n, input.k), value);
});
});
});
group('factorial', () {
test('fails if negative number', () {
expect(() => factorial(-1), throwsA(isA<AssertionError>()));
});
test('for a specific input gives a correct value', () {
final factorialInputsToExpected = {
0: 1,
1: 1,
2: 2,
3: 6,
4: 24,
5: 120,
6: 720,
7: 5040,
8: 40320,
9: 362880,
10: 3628800,
11: 39916800,
12: 479001600,
13: 6227020800,
};
factorialInputsToExpected.forEach((input, expected) {
expect(factorial(input), expected);
});
});
});
group('centroid', () {
test('throws AssertionError when vertices are empty', () {
expect(() => centroid([]), throwsA(isA<AssertionError>()));
});
test('is correct when one vertex is given', () {
expect(centroid([Vector2.zero()]), Vector2.zero());
});
test('is correct when two vertex are given', () {
expect(centroid([Vector2.zero(), Vector2(1, 1)]), Vector2(0.5, 0.5));
});
test('is correct when three vertex are given', () {
expect(
centroid([
Vector2.zero(),
Vector2(1, 1),
Vector2(2, 2),
]),
Vector2(1, 1),
);
});
});
}
| pinball/packages/geometry/test/src/geometry_test.dart/0 | {
"file_path": "pinball/packages/geometry/test/src/geometry_test.dart",
"repo_id": "pinball",
"token_count": 2894
} | 1,152 |
/// GENERATED CODE - DO NOT MODIFY BY HAND
/// *****************************************************
/// FlutterGen
/// *****************************************************
import 'package:flutter/widgets.dart';
class $AssetsMusicGen {
const $AssetsMusicGen();
String get background => 'assets/music/background.mp3';
}
class $AssetsSfxGen {
const $AssetsSfxGen();
String get android => 'assets/sfx/android.mp3';
String get bumperA => 'assets/sfx/bumper_a.mp3';
String get bumperB => 'assets/sfx/bumper_b.mp3';
String get cowMoo => 'assets/sfx/cow_moo.mp3';
String get dash => 'assets/sfx/dash.mp3';
String get dino => 'assets/sfx/dino.mp3';
String get flipper => 'assets/sfx/flipper.mp3';
String get gameOverVoiceOver => 'assets/sfx/game_over_voice_over.mp3';
String get google => 'assets/sfx/google.mp3';
String get ioPinballVoiceOver => 'assets/sfx/io_pinball_voice_over.mp3';
String get kickerA => 'assets/sfx/kicker_a.mp3';
String get kickerB => 'assets/sfx/kicker_b.mp3';
String get launcher => 'assets/sfx/launcher.mp3';
String get rollover => 'assets/sfx/rollover.mp3';
String get sparky => 'assets/sfx/sparky.mp3';
}
class Assets {
Assets._();
static const $AssetsMusicGen music = $AssetsMusicGen();
static const $AssetsSfxGen sfx = $AssetsSfxGen();
}
class AssetGenImage extends AssetImage {
const AssetGenImage(String assetName)
: super(assetName, package: 'pinball_audio');
Image image({
Key? key,
ImageFrameBuilder? frameBuilder,
ImageLoadingBuilder? loadingBuilder,
ImageErrorWidgetBuilder? errorBuilder,
String? semanticLabel,
bool excludeFromSemantics = false,
double? width,
double? height,
Color? color,
BlendMode? colorBlendMode,
BoxFit? fit,
AlignmentGeometry alignment = Alignment.center,
ImageRepeat repeat = ImageRepeat.noRepeat,
Rect? centerSlice,
bool matchTextDirection = false,
bool gaplessPlayback = false,
bool isAntiAlias = false,
FilterQuality filterQuality = FilterQuality.low,
}) {
return Image(
key: key,
image: this,
frameBuilder: frameBuilder,
loadingBuilder: loadingBuilder,
errorBuilder: errorBuilder,
semanticLabel: semanticLabel,
excludeFromSemantics: excludeFromSemantics,
width: width,
height: height,
color: color,
colorBlendMode: colorBlendMode,
fit: fit,
alignment: alignment,
repeat: repeat,
centerSlice: centerSlice,
matchTextDirection: matchTextDirection,
gaplessPlayback: gaplessPlayback,
isAntiAlias: isAntiAlias,
filterQuality: filterQuality,
);
}
String get path => assetName;
}
| pinball/packages/pinball_audio/lib/gen/assets.gen.dart/0 | {
"file_path": "pinball/packages/pinball_audio/lib/gen/assets.gen.dart",
"repo_id": "pinball",
"token_count": 964
} | 1,153 |
import 'package:pinball_components/gen/fonts.gen.dart';
const String _fontPath = 'packages/pinball_components';
/// Class with the fonts available on the pinball game
class PinballFonts {
PinballFonts._();
/// Mono variation of the Pixeloid font
static const String pixeloidMono = '$_fontPath/${FontFamily.pixeloidMono}';
/// Sans variation of the Pixeloid font
static const String pixeloidSans = '$_fontPath/${FontFamily.pixeloidSans}';
}
| pinball/packages/pinball_components/lib/gen/pinball_fonts.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/gen/pinball_fonts.dart",
"repo_id": "pinball",
"token_count": 138
} | 1,154 |
// ignore_for_file: public_member_api_docs
part of 'arcade_background_cubit.dart';
class ArcadeBackgroundState extends Equatable {
const ArcadeBackgroundState({required this.characterTheme});
const ArcadeBackgroundState.initial()
: this(characterTheme: const DashTheme());
final CharacterTheme characterTheme;
@override
List<Object> get props => [characterTheme];
}
| pinball/packages/pinball_components/lib/src/components/arcade_background/cubit/arcade_background_state.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/arcade_background/cubit/arcade_background_state.dart",
"repo_id": "pinball",
"token_count": 108
} | 1,155 |
import 'dart:async';
import 'package:flame/components.dart';
import 'package:flame/effects.dart';
import 'package:flutter/material.dart';
/// {@template camera_zoom}
/// Applies zoom to the camera of the game where this is added to
/// {@endtemplate}
class CameraZoom extends Effect with HasGameRef {
/// {@macro camera_zoom}
CameraZoom({
required this.value,
}) : super(
EffectController(
duration: 0.4,
curve: Curves.easeOut,
),
);
/// The total zoom value to be applied to the camera
final double value;
late final Tween<double> _tween;
final Completer<void> _completer = Completer();
@override
Future<void> onLoad() async {
_tween = Tween(
begin: gameRef.camera.zoom,
end: value,
);
}
@override
void apply(double progress) {
gameRef.camera.zoom = _tween.transform(progress);
}
/// Returns a [Future] that completes once the zoom is finished
Future<void> get completed {
if (controller.completed) {
return Future.value();
}
return _completer.future;
}
@override
void onRemove() {
_completer.complete();
super.onRemove();
}
}
| pinball/packages/pinball_components/lib/src/components/camera_zoom.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/camera_zoom.dart",
"repo_id": "pinball",
"token_count": 451
} | 1,156 |
import 'dart:async';
import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/gen/assets.gen.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_flame/pinball_flame.dart';
/// {@template dino_walls}
/// Walls near the [ChromeDino].
/// {@endtemplate}
class DinoWalls extends Component {
/// {@macro dino_walls}
DinoWalls()
: super(
children: [
_DinoTopWall(),
_DinoBottomWall(),
],
);
}
/// {@template dino_top_wall}
/// Wall segment located above [ChromeDino].
/// {@endtemplate}
class _DinoTopWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall}
_DinoTopWall()
: super(
children: [
_DinoTopWallSpriteComponent(),
_DinoTopWallTunnelSpriteComponent(),
],
renderBody: false,
);
List<FixtureDef> _createFixtureDefs() {
final topEdgeShape = EdgeShape()
..set(
Vector2(29.05, -35.27),
Vector2(28.2, -34.77),
);
final topCurveShape = BezierCurveShape(
controlPoints: [
topEdgeShape.vertex2,
Vector2(21.15, -28.72),
Vector2(23.25, -24.62),
],
);
final tunnelTopEdgeShape = EdgeShape()
..set(
topCurveShape.vertices.last,
Vector2(30.15, -27.32),
);
final tunnelBottomEdgeShape = EdgeShape()
..set(
Vector2(30.55, -23.17),
Vector2(25.25, -21.22),
);
final middleEdgeShape = EdgeShape()
..set(
tunnelBottomEdgeShape.vertex2,
Vector2(27.25, -19.32),
);
final bottomEdgeShape = EdgeShape()
..set(
middleEdgeShape.vertex2,
Vector2(24.45, -15.02),
);
final undersideEdgeShape = EdgeShape()
..set(
bottomEdgeShape.vertex2,
Vector2(31.55, -13.77),
);
return [
FixtureDef(topEdgeShape),
FixtureDef(topCurveShape),
FixtureDef(tunnelTopEdgeShape),
FixtureDef(tunnelBottomEdgeShape),
FixtureDef(middleEdgeShape),
FixtureDef(bottomEdgeShape),
FixtureDef(undersideEdgeShape),
];
}
@override
Body createBody() {
final bodyDef = BodyDef(
position: initialPosition,
userData: this,
);
final body = world.createBody(bodyDef);
_createFixtureDefs().forEach(body.createFixture);
return body;
}
}
class _DinoTopWallSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex {
_DinoTopWallSpriteComponent()
: super(
position: Vector2(22.55, -38.07),
) {
zIndex = ZIndexes.dinoTopWall;
}
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = Sprite(
gameRef.images.fromCache(
Assets.images.dino.topWall.keyName,
),
);
this.sprite = sprite;
size = sprite.originalSize / 10;
}
}
class _DinoTopWallTunnelSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex {
_DinoTopWallTunnelSpriteComponent()
: super(position: Vector2(23.11, -26.01)) {
zIndex = ZIndexes.dinoTopWallTunnel;
}
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = Sprite(
gameRef.images.fromCache(
Assets.images.dino.topWallTunnel.keyName,
),
);
this.sprite = sprite;
size = sprite.originalSize / 10;
}
}
/// {@template dino_bottom_wall}
/// Wall segment located below [ChromeDino].
/// {@endtemplate}
class _DinoBottomWall extends BodyComponent with InitialPosition, ZIndex {
///{@macro dino_top_wall}
_DinoBottomWall()
: super(
children: [_DinoBottomWallSpriteComponent()],
renderBody: false,
) {
zIndex = ZIndexes.dinoBottomWall;
}
List<FixtureDef> _createFixtureDefs() {
final topEdgeShape = EdgeShape()
..set(
Vector2(32.2, -8.8),
Vector2(24.8, -7.7),
);
final topLeftCurveShape = BezierCurveShape(
controlPoints: [
topEdgeShape.vertex2,
Vector2(21.6, -7),
Vector2(29.6, 13.8),
],
);
final bottomLeftEdgeShape = EdgeShape()
..set(
topLeftCurveShape.vertices.last,
Vector2(31.7, 44.1),
);
final bottomEdgeShape = EdgeShape()
..set(
bottomLeftEdgeShape.vertex2,
Vector2(37.6, 44.1),
);
return [
FixtureDef(topEdgeShape),
FixtureDef(topLeftCurveShape),
FixtureDef(bottomLeftEdgeShape),
FixtureDef(bottomEdgeShape),
];
}
@override
Body createBody() {
final bodyDef = BodyDef(
position: initialPosition,
userData: this,
);
final body = world.createBody(bodyDef);
_createFixtureDefs().forEach(body.createFixture);
return body;
}
}
class _DinoBottomWallSpriteComponent extends SpriteComponent with HasGameRef {
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = Sprite(
gameRef.images.fromCache(
Assets.images.dino.bottomWall.keyName,
),
);
this.sprite = sprite;
size = sprite.originalSize / 10;
position = Vector2(23.6, -9.5);
}
}
| pinball/packages/pinball_components/lib/src/components/dino_walls.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/dino_walls.dart",
"repo_id": "pinball",
"token_count": 2320
} | 1,157 |
import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_components/src/components/google_rollover/behaviors/behaviors.dart';
/// {@template google_rollover}
/// Rollover that lights up [GoogleLetter]s.
/// {@endtemplate}
class GoogleRollover extends BodyComponent {
/// {@macro google_rollover}
GoogleRollover({
required BoardSide side,
Iterable<Component>? children,
}) : _side = side,
super(
renderBody: false,
children: [
GoogleRolloverBallContactBehavior(),
_RolloverDecalSpriteComponent(side: side),
_PinSpriteAnimationComponent(side: side),
...?children,
],
);
final BoardSide _side;
@override
Body createBody() {
final shape = PolygonShape()
..setAsBox(
0.1,
3.4,
Vector2(_side.isLeft ? -14.8 : 5.9, -11),
0.19 * _side.direction,
);
final fixtureDef = FixtureDef(shape, isSensor: true);
return world.createBody(BodyDef())..createFixture(fixtureDef);
}
}
class _RolloverDecalSpriteComponent extends SpriteComponent with HasGameRef {
_RolloverDecalSpriteComponent({required BoardSide side})
: _side = side,
super(
anchor: Anchor.center,
position: Vector2(side.isLeft ? -14.8 : 5.9, -11),
angle: 0.18 * side.direction,
);
final BoardSide _side;
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = Sprite(
gameRef.images.fromCache(
(_side.isLeft)
? Assets.images.googleRollover.left.decal.keyName
: Assets.images.googleRollover.right.decal.keyName,
),
);
this.sprite = sprite;
size = sprite.originalSize / 20;
}
}
class _PinSpriteAnimationComponent extends SpriteAnimationComponent
with HasGameRef {
_PinSpriteAnimationComponent({required BoardSide side})
: _side = side,
super(
anchor: Anchor.center,
position: Vector2(side.isLeft ? -14.9 : 5.95, -11),
angle: 0,
playing: false,
);
final BoardSide _side;
@override
Future<void> onLoad() async {
await super.onLoad();
final spriteSheet = gameRef.images.fromCache(
_side.isLeft
? Assets.images.googleRollover.left.pin.keyName
: Assets.images.googleRollover.right.pin.keyName,
);
const amountPerRow = 3;
const amountPerColumn = 1;
final textureSize = Vector2(
spriteSheet.width / amountPerRow,
spriteSheet.height / amountPerColumn,
);
size = textureSize / 10;
animation = SpriteAnimation.fromFrameData(
spriteSheet,
SpriteAnimationData.sequenced(
amount: amountPerRow * amountPerColumn,
amountPerRow: amountPerRow,
stepTime: 1 / 24,
textureSize: textureSize,
loop: false,
),
)..onComplete = () {
animation?.reset();
playing = false;
};
}
}
| pinball/packages/pinball_components/lib/src/components/google_rollover/google_rollover.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/google_rollover/google_rollover.dart",
"repo_id": "pinball",
"token_count": 1293
} | 1,158 |
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
class LayerFilteringBehavior extends ContactBehavior<LayerSensor> {
@override
void beginContact(Object other, Contact contact) {
super.beginContact(other, contact);
if (other is! Ball) return;
if (other.layer != parent.insideLayer) {
final isBallEnteringOpening =
(parent.orientation == LayerEntranceOrientation.down &&
other.body.linearVelocity.y < 0) ||
(parent.orientation == LayerEntranceOrientation.up &&
other.body.linearVelocity.y > 0);
if (isBallEnteringOpening) {
other
..layer = parent.insideLayer
..zIndex = parent.insideZIndex;
}
} else {
other
..layer = parent.outsideLayer
..zIndex = parent.outsideZIndex;
}
}
}
| pinball/packages/pinball_components/lib/src/components/layer_sensor/behaviors/layer_filtering_behavior.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/layer_sensor/behaviors/layer_filtering_behavior.dart",
"repo_id": "pinball",
"token_count": 388
} | 1,159 |
import 'package:bloc/bloc.dart';
part 'plunger_state.dart';
class PlungerCubit extends Cubit<PlungerState> {
PlungerCubit() : super(PlungerState.releasing);
void pulled() => emit(PlungerState.pulling);
void released() => emit(PlungerState.releasing);
void autoPulled() => emit(PlungerState.autoPulling);
}
| pinball/packages/pinball_components/lib/src/components/plunger/cubit/plunger_cubit.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/plunger/cubit/plunger_cubit.dart",
"repo_id": "pinball",
"token_count": 117
} | 1,160 |
import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_components/src/components/bumping_behavior.dart';
import 'package:pinball_flame/pinball_flame.dart';
/// {@template slingshots}
/// A collection of [Slingshot]s.
/// {@endtemplate}
class Slingshots extends Component with ZIndex {
/// {@macro slingshots}
Slingshots()
: super(
children: [
Slingshot(
angle: -0.017,
spritePath: Assets.images.slingshot.upper.keyName,
)..initialPosition = Vector2(22.7, -0.3),
Slingshot(
angle: -0.468,
spritePath: Assets.images.slingshot.lower.keyName,
)..initialPosition = Vector2(24.6, 6.1),
],
) {
zIndex = ZIndexes.slingshots;
}
}
/// {@template slingshot}
/// Elastic bumper that bounces the [Ball] off of its sides.
/// {@endtemplate}
class Slingshot extends BodyComponent with InitialPosition {
/// {@macro slingshot}
Slingshot({
required double angle,
required String spritePath,
}) : _angle = angle,
super(
children: [
_SlingshotSpriteComponent(spritePath, angle: angle),
BumpingBehavior(strength: 20),
],
renderBody: false,
);
final double _angle;
List<FixtureDef> _createFixtureDefs() {
const length = 3.46;
const circleRadius = 1.55;
final topCircleShape = CircleShape()..radius = circleRadius;
topCircleShape.position.setValues(0, -length / 2);
final bottomCircleShape = CircleShape()..radius = circleRadius;
bottomCircleShape.position.setValues(0, length / 2);
final leftEdgeShape = EdgeShape()
..set(
Vector2(circleRadius, length / 2),
Vector2(circleRadius, -length / 2),
);
final rightEdgeShape = EdgeShape()
..set(
Vector2(-circleRadius, length / 2),
Vector2(-circleRadius, -length / 2),
);
return [
FixtureDef(topCircleShape),
FixtureDef(bottomCircleShape),
FixtureDef(leftEdgeShape),
FixtureDef(rightEdgeShape),
];
}
@override
Body createBody() {
final bodyDef = BodyDef(
position: initialPosition,
userData: this,
angle: _angle,
);
final body = world.createBody(bodyDef);
_createFixtureDefs().forEach(body.createFixture);
return body;
}
}
class _SlingshotSpriteComponent extends SpriteComponent with HasGameRef {
_SlingshotSpriteComponent(
String path, {
required double angle,
}) : _path = path,
super(
angle: -angle,
anchor: Anchor.center,
);
final String _path;
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = Sprite(gameRef.images.fromCache(_path));
this.sprite = sprite;
size = sprite.originalSize / 10;
}
}
| pinball/packages/pinball_components/lib/src/components/slingshot.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/slingshot.dart",
"repo_id": "pinball",
"token_count": 1229
} | 1,161 |
import 'package:bloc/bloc.dart';
part 'sparky_computer_state.dart';
class SparkyComputerCubit extends Cubit<SparkyComputerState> {
SparkyComputerCubit() : super(SparkyComputerState.withoutBall);
void onBallEntered() {
emit(SparkyComputerState.withBall);
}
void onBallTurboCharged() {
emit(SparkyComputerState.withoutBall);
}
}
| pinball/packages/pinball_components/lib/src/components/sparky_computer/cubit/sparky_computer_cubit.dart/0 | {
"file_path": "pinball/packages/pinball_components/lib/src/components/sparky_computer/cubit/sparky_computer_cubit.dart",
"repo_id": "pinball",
"token_count": 126
} | 1,162 |
import 'dart:async';
import 'package:flame/components.dart';
import 'package:flame/input.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flutter/material.dart';
abstract class AssetsGame extends Forge2DGame {
AssetsGame({
List<String>? imagesFileNames,
}) : _imagesFileNames = imagesFileNames {
images.prefix = '';
}
final List<String>? _imagesFileNames;
@override
Future<void> onLoad() async {
await super.onLoad();
if (_imagesFileNames != null) {
await images.loadAll(_imagesFileNames!);
}
}
}
abstract class LineGame extends AssetsGame with PanDetector {
LineGame({
List<String>? imagesFileNames,
}) : super(
imagesFileNames: [
if (imagesFileNames != null) ...imagesFileNames,
],
);
Vector2? _lineEnd;
@override
Future<void> onLoad() async {
await super.onLoad();
camera.followVector2(Vector2.zero());
unawaited(add(_PreviewLine()));
}
@override
void onPanStart(DragStartInfo info) {
_lineEnd = info.eventPosition.game;
}
@override
void onPanUpdate(DragUpdateInfo info) {
_lineEnd = info.eventPosition.game;
}
@override
void onPanEnd(DragEndInfo info) {
if (_lineEnd != null) {
final line = _lineEnd! - Vector2.zero();
onLine(line);
_lineEnd = null;
}
}
void onLine(Vector2 line);
}
class _PreviewLine extends PositionComponent with HasGameRef<LineGame> {
static final _previewLinePaint = Paint()
..color = Colors.pink
..strokeWidth = 0.2
..style = PaintingStyle.stroke;
Vector2? lineEnd;
@override
void update(double dt) {
super.update(dt);
lineEnd = gameRef._lineEnd?.clone()?..multiply(Vector2(1, -1));
}
@override
void render(Canvas canvas) {
super.render(canvas);
if (lineEnd != null) {
canvas.drawLine(
Vector2.zero().toOffset(),
lineEnd!.toOffset(),
_previewLinePaint,
);
}
}
}
| pinball/packages/pinball_components/sandbox/lib/common/games.dart/0 | {
"file_path": "pinball/packages/pinball_components/sandbox/lib/common/games.dart",
"repo_id": "pinball",
"token_count": 775
} | 1,163 |
export 'stories.dart';
| pinball/packages/pinball_components/sandbox/lib/stories/bottom_group/bottom_group.dart/0 | {
"file_path": "pinball/packages/pinball_components/sandbox/lib/stories/bottom_group/bottom_group.dart",
"repo_id": "pinball",
"token_count": 8
} | 1,164 |
import 'dart:async';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:sandbox/stories/ball/basic_ball_game.dart';
class DashBumperMainGame extends BallGame {
DashBumperMainGame()
: super(
imagesFileNames: [
Assets.images.dash.bumper.main.active.keyName,
Assets.images.dash.bumper.main.inactive.keyName,
],
);
static const description = '''
Shows how the "main" DashBumper is rendered.
- Activate the "trace" parameter to overlay the body.
''';
@override
Future<void> onLoad() async {
await super.onLoad();
camera.followVector2(Vector2.zero());
await add(
FlameBlocProvider<DashBumpersCubit, DashBumpersState>(
create: DashBumpersCubit.new,
children: [
DashBumper.main()..priority = 1,
],
),
);
await traceAllBodies();
}
}
| pinball/packages/pinball_components/sandbox/lib/stories/flutter_forest/dash_bumper_main_game.dart/0 | {
"file_path": "pinball/packages/pinball_components/sandbox/lib/stories/flutter_forest/dash_bumper_main_game.dart",
"repo_id": "pinball",
"token_count": 412
} | 1,165 |
import 'package:dashbook/dashbook.dart';
import 'package:sandbox/common/common.dart';
import 'package:sandbox/stories/score/score_game.dart';
void addScoreStories(Dashbook dashbook) {
dashbook.storiesOf('Score').addGame(
title: 'Basic',
description: ScoreGame.description,
gameBuilder: (_) => ScoreGame(),
);
}
| pinball/packages/pinball_components/sandbox/lib/stories/score/stories.dart/0 | {
"file_path": "pinball/packages/pinball_components/sandbox/lib/stories/score/stories.dart",
"repo_id": "pinball",
"token_count": 129
} | 1,166 |
// ignore_for_file: cascade_invocations
import 'package:bloc_test/bloc_test.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_components/src/components/android_animatronic/behaviors/behaviors.dart';
import '../../../../helpers/helpers.dart';
class _MockAndroidSpaceshipCubit extends Mock implements AndroidSpaceshipCubit {
}
class _MockBall extends Mock implements Ball {}
class _MockContact extends Mock implements Contact {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final flameTester = FlameTester(TestGame.new);
group(
'AndroidAnimatronicBallContactBehavior',
() {
test('can be instantiated', () {
expect(
AndroidAnimatronicBallContactBehavior(),
isA<AndroidAnimatronicBallContactBehavior>(),
);
});
flameTester.test(
'beginContact calls onBallContacted when in contact with a ball',
(game) async {
final behavior = AndroidAnimatronicBallContactBehavior();
final bloc = _MockAndroidSpaceshipCubit();
whenListen(
bloc,
const Stream<AndroidSpaceshipState>.empty(),
initialState: AndroidSpaceshipState.withoutBonus,
);
final animatronic = AndroidAnimatronic.test();
final androidSpaceship = FlameBlocProvider<AndroidSpaceshipCubit,
AndroidSpaceshipState>.value(
value: bloc,
children: [
AndroidSpaceship.test(children: [animatronic])
],
);
await animatronic.add(behavior);
await game.ensureAdd(androidSpaceship);
behavior.beginContact(_MockBall(), _MockContact());
verify(bloc.onBallContacted).called(1);
},
);
},
);
}
| pinball/packages/pinball_components/test/src/components/android_animatronic/behaviors/android_animatronic_ball_contact_behavior_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/android_animatronic/behaviors/android_animatronic_ball_contact_behavior_test.dart",
"repo_id": "pinball",
"token_count": 829
} | 1,167 |
// ignore_for_file: cascade_invocations
import 'package:flame/components.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_theme/pinball_theme.dart' as theme;
import '../../../../helpers/helpers.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
group(
'BallTurboChargingBehavior',
() {
final assets = [
theme.Assets.images.dash.ball.keyName,
Assets.images.ball.flameEffect.keyName,
];
final flameTester = FlameTester(() => TestGame(assets));
test('can be instantiated', () {
expect(
BallTurboChargingBehavior(impulse: Vector2.zero()),
isA<BallTurboChargingBehavior>(),
);
});
flameTester.test('can be loaded', (game) async {
final ball = Ball.test();
final behavior = BallTurboChargingBehavior(impulse: Vector2.zero());
await ball.add(behavior);
await game.ensureAdd(ball);
expect(
ball.firstChild<BallTurboChargingBehavior>(),
equals(behavior),
);
});
flameTester.test(
'impulses the ball velocity when loaded',
(game) async {
final ball = Ball.test();
await game.ensureAdd(ball);
final impulse = Vector2.all(1);
final behavior = BallTurboChargingBehavior(impulse: impulse);
await ball.ensureAdd(behavior);
expect(
ball.body.linearVelocity.x,
equals(impulse.x),
);
expect(
ball.body.linearVelocity.y,
equals(impulse.y),
);
},
);
flameTester.test('adds sprite', (game) async {
final ball = Ball();
await game.ensureAdd(ball);
await ball.ensureAdd(
BallTurboChargingBehavior(impulse: Vector2.zero()),
);
expect(
ball.children.whereType<SpriteAnimationComponent>().single,
isNotNull,
);
});
flameTester.test('removes sprite after it finishes', (game) async {
final ball = Ball();
await game.ensureAdd(ball);
final behavior = BallTurboChargingBehavior(impulse: Vector2.zero());
await ball.ensureAdd(behavior);
final turboChargeSpriteAnimation =
ball.children.whereType<SpriteAnimationComponent>().single;
expect(ball.contains(turboChargeSpriteAnimation), isTrue);
game.update(behavior.timer.limit);
game.update(0.1);
expect(ball.contains(turboChargeSpriteAnimation), isFalse);
});
},
);
}
| pinball/packages/pinball_components/test/src/components/ball/behaviors/ball_turbo_charging_behavior_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/ball/behaviors/ball_turbo_charging_behavior_test.dart",
"repo_id": "pinball",
"token_count": 1188
} | 1,168 |
// ignore_for_file: prefer_const_constructors
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/pinball_components.dart';
void main() {
group('ChromeDinoState', () {
test('supports value equality', () {
expect(
ChromeDinoState(
status: ChromeDinoStatus.chomping,
isMouthOpen: true,
),
equals(
const ChromeDinoState(
status: ChromeDinoStatus.chomping,
isMouthOpen: true,
),
),
);
});
group('constructor', () {
test('can be instantiated', () {
expect(
const ChromeDinoState(
status: ChromeDinoStatus.chomping,
isMouthOpen: true,
),
isNotNull,
);
});
test('initial is idle with mouth closed', () {
const initialState = ChromeDinoState(
status: ChromeDinoStatus.idle,
isMouthOpen: false,
);
expect(ChromeDinoState.initial(), equals(initialState));
});
});
group('copyWith', () {
test(
'copies correctly '
'when no argument specified',
() {
const chromeDinoState = ChromeDinoState(
status: ChromeDinoStatus.chomping,
isMouthOpen: true,
);
expect(
chromeDinoState.copyWith(),
equals(chromeDinoState),
);
},
);
test(
'copies correctly '
'when all arguments specified',
() {
final ball = Ball();
const chromeDinoState = ChromeDinoState(
status: ChromeDinoStatus.chomping,
isMouthOpen: true,
);
final otherChromeDinoState = ChromeDinoState(
status: ChromeDinoStatus.idle,
isMouthOpen: false,
ball: ball,
);
expect(chromeDinoState, isNot(equals(otherChromeDinoState)));
expect(
chromeDinoState.copyWith(
status: ChromeDinoStatus.idle,
isMouthOpen: false,
ball: ball,
),
equals(otherChromeDinoState),
);
},
);
});
});
}
| pinball/packages/pinball_components/test/src/components/chrome_dino/cubit/chrome_dino_state_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/chrome_dino/cubit/chrome_dino_state_test.dart",
"repo_id": "pinball",
"token_count": 1132
} | 1,169 |
// ignore_for_file: avoid_dynamic_calls, cascade_invocations
import 'dart:async';
import 'package:bloc_test/bloc_test.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball_audio/pinball_audio.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
class _TestGame extends Forge2DGame {
Future<void> pump(
FlipperNoiseBehavior behavior, {
FlipperCubit? flipperBloc,
PinballAudioPlayer? audioPlayer,
}) async {
final flipper = Flipper.test(side: BoardSide.left);
await ensureAdd(
FlameProvider<PinballAudioPlayer>.value(
audioPlayer ?? _MockPinballAudioPlayer(),
children: [
flipper,
],
),
);
await flipper.ensureAdd(
FlameBlocProvider<FlipperCubit, FlipperState>.value(
value: flipperBloc ?? FlipperCubit(),
children: [behavior],
),
);
}
}
class _MockPinballAudioPlayer extends Mock implements PinballAudioPlayer {}
class _MockFlipperCubit extends Mock implements FlipperCubit {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final flameTester = FlameTester(_TestGame.new);
group('FlipperNoiseBehavior', () {
test('can be instantiated', () {
expect(
FlipperNoiseBehavior(),
isA<FlipperNoiseBehavior>(),
);
});
flameTester.test(
'plays the flipper sound when moving up',
(game) async {
final audioPlayer = _MockPinballAudioPlayer();
final bloc = _MockFlipperCubit();
whenListen(
bloc,
Stream.fromIterable([FlipperState.movingUp]),
initialState: FlipperState.movingUp,
);
final behavior = FlipperNoiseBehavior();
await game.pump(
behavior,
flipperBloc: bloc,
audioPlayer: audioPlayer,
);
behavior.onNewState(FlipperState.movingUp);
game.update(0);
verify(() => audioPlayer.play(PinballAudio.flipper)).called(1);
},
);
});
}
| pinball/packages/pinball_components/test/src/components/flipper/behaviors/flipper_noise_behavior_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/flipper/behaviors/flipper_noise_behavior_test.dart",
"repo_id": "pinball",
"token_count": 924
} | 1,170 |
// ignore_for_file: cascade_invocations
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/pinball_components.dart';
import '../../helpers/helpers.dart';
void main() {
group('LaunchRamp', () {
TestWidgetsFlutterBinding.ensureInitialized();
final assets = [
Assets.images.launchRamp.ramp.keyName,
Assets.images.launchRamp.backgroundRailing.keyName,
Assets.images.launchRamp.foregroundRailing.keyName,
];
final flameTester = FlameTester(() => TestGame(assets));
flameTester.test('loads correctly', (game) async {
final component = LaunchRamp();
await game.ensureAdd(component);
expect(game.contains(component), isTrue);
});
flameTester.testGameWidget(
'renders correctly',
setUp: (game, tester) async {
await game.images.loadAll(assets);
await game.ensureAdd(LaunchRamp());
game.camera.followVector2(Vector2.zero());
game.camera.zoom = 4.1;
await game.ready();
await tester.pump();
},
verify: (game, tester) async {
await expectLater(
find.byGame<TestGame>(),
matchesGoldenFile('golden/launch_ramp.png'),
);
},
);
});
}
| pinball/packages/pinball_components/test/src/components/launch_ramp_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/launch_ramp_test.dart",
"repo_id": "pinball",
"token_count": 549
} | 1,171 |
// ignore_for_file: cascade_invocations
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/pinball_components.dart';
import '../../../helpers/helpers.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final asset = Assets.images.plunger.plunger.keyName;
final flameTester = FlameTester(() => TestGame([asset]));
group('Plunger', () {
test('can be instantiated', () {
expect(Plunger(), isA<Plunger>());
});
flameTester.test(
'loads correctly',
(game) async {
final plunger = Plunger();
await game.ensureAdd(plunger);
expect(game.children, contains(plunger));
},
);
group('adds', () {
flameTester.test(
'a PlungerReleasingBehavior',
(game) async {
final plunger = Plunger();
await game.ensureAdd(plunger);
expect(
game.descendants().whereType<PlungerReleasingBehavior>().length,
equals(1),
);
},
);
flameTester.test(
'a PlungerJointingBehavior',
(game) async {
final plunger = Plunger();
await game.ensureAdd(plunger);
expect(
game.descendants().whereType<PlungerJointingBehavior>().length,
equals(1),
);
},
);
flameTester.test(
'a PlungerNoiseBehavior',
(game) async {
final plunger = Plunger();
await game.ensureAdd(plunger);
expect(
game.descendants().whereType<PlungerNoiseBehavior>().length,
equals(1),
);
},
);
});
group('renders correctly', () {
const goldenPath = '../golden/plunger/';
flameTester.testGameWidget(
'pulling',
setUp: (game, tester) async {
await game.images.load(asset);
await game.ensureAdd(Plunger());
game.camera.followVector2(Vector2.zero());
game.camera.zoom = 4.1;
},
verify: (game, tester) async {
final plunger = game.descendants().whereType<Plunger>().first;
final bloc = plunger
.descendants()
.whereType<FlameBlocProvider<PlungerCubit, PlungerState>>()
.single
.bloc;
bloc.pulled();
await tester.pump();
await expectLater(
find.byGame<TestGame>(),
matchesGoldenFile('${goldenPath}pull.png'),
);
},
);
flameTester.testGameWidget(
'releasing',
setUp: (game, tester) async {
await game.images.load(asset);
await game.ensureAdd(Plunger());
game.camera.followVector2(Vector2.zero());
game.camera.zoom = 4.1;
},
verify: (game, tester) async {
final plunger = game.descendants().whereType<Plunger>().first;
final bloc = plunger
.descendants()
.whereType<FlameBlocProvider<PlungerCubit, PlungerState>>()
.single
.bloc;
bloc.released();
await tester.pump();
await expectLater(
find.byGame<TestGame>(),
matchesGoldenFile('${goldenPath}release.png'),
);
},
);
});
});
}
| pinball/packages/pinball_components/test/src/components/plunger/plunger_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/plunger/plunger_test.dart",
"repo_id": "pinball",
"token_count": 1707
} | 1,172 |
// ignore_for_file: cascade_invocations, prefer_const_constructors
import 'dart:async';
import 'package:bloc_test/bloc_test.dart';
import 'package:flame/components.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_components/src/components/spaceship_ramp/behavior/behavior.dart';
import 'package:pinball_flame/pinball_flame.dart';
class _TestGame extends Forge2DGame {
@override
Future<void> onLoad() async {
images.prefix = '';
await images.loadAll([
Assets.images.android.ramp.boardOpening.keyName,
Assets.images.android.ramp.railingForeground.keyName,
Assets.images.android.ramp.railingBackground.keyName,
Assets.images.android.ramp.main.keyName,
Assets.images.android.ramp.arrow.inactive.keyName,
Assets.images.android.ramp.arrow.active1.keyName,
Assets.images.android.ramp.arrow.active2.keyName,
Assets.images.android.ramp.arrow.active3.keyName,
Assets.images.android.ramp.arrow.active4.keyName,
Assets.images.android.ramp.arrow.active5.keyName,
]);
}
Future<void> pump(
SpaceshipRamp children, {
required SpaceshipRampCubit bloc,
}) async {
await ensureAdd(
FlameBlocProvider<SpaceshipRampCubit, SpaceshipRampState>.value(
value: bloc,
children: [
ZCanvasComponent(children: [children]),
],
),
);
}
}
class _MockSpaceshipRampCubit extends Mock implements SpaceshipRampCubit {}
class _MockBall extends Mock implements Ball {}
class _MockContact extends Mock implements Contact {}
class _MockManifold extends Mock implements Manifold {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final flameTester = FlameTester(_TestGame.new);
group('SpaceshipRamp', () {
flameTester.test(
'loads correctly',
(game) async {
final bloc = _MockSpaceshipRampCubit();
final streamController = StreamController<SpaceshipRampState>();
whenListen(
bloc,
streamController.stream,
initialState: SpaceshipRampState.initial(),
);
final ramp = SpaceshipRamp.test();
await game.pump(ramp, bloc: bloc);
expect(game.descendants(), contains(ramp));
},
);
group('adds', () {
flameTester.test('a FlameBlocProvider', (game) async {
final ramp = SpaceshipRamp();
await game.ensureAdd(ramp);
expect(
ramp.children
.whereType<
FlameBlocProvider<SpaceshipRampCubit, SpaceshipRampState>>()
.single,
isNotNull,
);
});
flameTester.test(
'a SpaceshipRampBoardOpening',
(game) async {
final ramp = SpaceshipRamp();
await game.ensureAdd(ramp);
expect(
game.descendants().whereType<SpaceshipRampBoardOpening>().length,
equals(1),
);
},
);
flameTester.test(
'a SpaceshipRampArrowSpriteComponent',
(game) async {
final ramp = SpaceshipRamp();
await game.ensureAdd(ramp);
expect(
game
.descendants()
.whereType<SpaceshipRampArrowSpriteComponent>()
.length,
equals(1),
);
},
);
flameTester.test('new children', (game) async {
final component = Component();
final ramp = SpaceshipRamp(children: [component]);
await game.ensureAdd(ramp);
expect(ramp.descendants(), contains(component));
});
});
});
group('SpaceshipRampBase', () {
test('can be instantiated', () {
expect(SpaceshipRampBase(), isA<SpaceshipRampBase>());
});
flameTester.test('can be loaded', (game) async {
final component = SpaceshipRampBase();
await game.ensureAdd(component);
expect(game.children, contains(component));
});
flameTester.test(
'postSolves disables contact when ball is not on Layer.board',
(game) async {
final ball = _MockBall();
final contact = _MockContact();
when(() => ball.layer).thenReturn(Layer.spaceshipEntranceRamp);
final component = SpaceshipRampBase();
await game.ensureAdd(component);
component.preSolve(ball, contact, _MockManifold());
verify(() => contact.setEnabled(false)).called(1);
},
);
flameTester.test(
'postSolves enables contact when ball is on Layer.board',
(game) async {
final ball = _MockBall();
final contact = _MockContact();
when(() => ball.layer).thenReturn(Layer.board);
final component = SpaceshipRampBase();
await game.ensureAdd(component);
component.preSolve(ball, contact, _MockManifold());
verify(() => contact.setEnabled(true)).called(1);
},
);
});
group('SpaceshipRampBoardOpening', () {
test('can be instantiated', () {
expect(SpaceshipRampBoardOpening(), isA<SpaceshipRampBoardOpening>());
});
flameTester.test('can be loaded', (game) async {
final component = SpaceshipRampBoardOpening();
final parent = SpaceshipRamp.test();
await game.pump(parent, bloc: _MockSpaceshipRampCubit());
await parent.ensureAdd(component);
expect(parent.children, contains(component));
});
flameTester.test('adds a RampBallAscendingContactBehavior', (game) async {
final component = SpaceshipRampBoardOpening();
final parent = SpaceshipRamp.test();
await game.pump(parent, bloc: _MockSpaceshipRampCubit());
await parent.ensureAdd(component);
expect(
component.children.whereType<RampBallAscendingContactBehavior>().length,
equals(1),
);
});
});
group('SpaceshipRampArrowSpriteComponent', () {
flameTester.test(
'changes current state '
'when SpaceshipRampState changes lightState',
(game) async {
final bloc = _MockSpaceshipRampCubit();
final state = SpaceshipRampState.initial();
final streamController = StreamController<SpaceshipRampState>();
whenListen(
bloc,
streamController.stream,
initialState: state,
);
final arrow = SpaceshipRampArrowSpriteComponent();
final ramp = SpaceshipRamp.test(children: [arrow]);
await game.pump(
ramp,
bloc: bloc,
);
expect(arrow.current, ArrowLightState.inactive);
streamController
.add(state.copyWith(lightState: ArrowLightState.active1));
await game.ready();
expect(arrow.current, ArrowLightState.active1);
},
);
});
}
| pinball/packages/pinball_components/test/src/components/spaceship_ramp/spaceship_ramp_test.dart/0 | {
"file_path": "pinball/packages/pinball_components/test/src/components/spaceship_ramp/spaceship_ramp_test.dart",
"repo_id": "pinball",
"token_count": 2908
} | 1,173 |
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_flame/pinball_flame.dart';
/// {@template layer_contact_behavior}
/// Switches the [Layer] of any [Layered] body that contacts with it.
/// {@endtemplate}
class LayerContactBehavior extends ContactBehavior<BodyComponent> {
/// {@macro layer_contact_behavior}
LayerContactBehavior({
required Layer layer,
bool onBegin = true,
}) {
if (onBegin) {
onBeginContact = (other, _) => _changeLayer(other, layer);
} else {
onEndContact = (other, _) => _changeLayer(other, layer);
}
}
void _changeLayer(Object other, Layer layer) {
if (other is! Layered) return;
if (other.layer == layer) return;
other.layer = layer;
}
}
| pinball/packages/pinball_flame/lib/src/behaviors/layer_contact_behavior.dart/0 | {
"file_path": "pinball/packages/pinball_flame/lib/src/behaviors/layer_contact_behavior.dart",
"repo_id": "pinball",
"token_count": 264
} | 1,174 |
name: pinball_flame
description: Set of out-of-the-way solutions for common Pinball game problems.
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.16.0 <3.0.0"
dependencies:
bloc: ^8.0.0
flame: ^1.1.1
flame_bloc: ^1.4.0
flame_forge2d:
git:
url: https://github.com/flame-engine/flame
path: packages/flame_forge2d/
ref: a50d4a1e7d9eaf66726ed1bb9894c9d495547d8f
flutter:
sdk: flutter
geometry:
path: ../geometry
dev_dependencies:
flame_test: ^1.3.0
flutter_test:
sdk: flutter
mocktail: ^0.3.0
very_good_analysis: ^2.4.0
| pinball/packages/pinball_flame/pubspec.yaml/0 | {
"file_path": "pinball/packages/pinball_flame/pubspec.yaml",
"repo_id": "pinball",
"token_count": 279
} | 1,175 |
import 'package:flame/extensions.dart';
import 'package:flame/game.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_flame/pinball_flame.dart';
void main() {
group('BezierCurveShape', () {
test('can be instantiated', () {
expect(
BezierCurveShape(
controlPoints: [
Vector2(0, 0),
Vector2(10, 0),
Vector2(0, 10),
Vector2(10, 10),
],
),
isA<BezierCurveShape>(),
);
});
});
}
| pinball/packages/pinball_flame/test/src/shapes/bezier_curve_shape_test.dart/0 | {
"file_path": "pinball/packages/pinball_flame/test/src/shapes/bezier_curve_shape_test.dart",
"repo_id": "pinball",
"token_count": 262
} | 1,176 |
import 'package:equatable/equatable.dart';
import 'package:pinball_theme/pinball_theme.dart';
/// {@template character_theme}
/// Base class for creating character themes.
///
/// Character specific game components should have a getter specified here to
/// load their corresponding assets for the game.
/// {@endtemplate}
abstract class CharacterTheme extends Equatable {
/// {@macro character_theme}
const CharacterTheme();
/// Name of character.
String get name;
/// Asset for the ball.
AssetGenImage get ball;
/// Asset for the background.
AssetGenImage get background;
/// Icon asset.
AssetGenImage get icon;
/// Icon asset for the leaderboard.
AssetGenImage get leaderboardIcon;
/// Asset for the the idle character animation.
AssetGenImage get animation;
@override
List<Object?> get props => [
name,
ball,
background,
icon,
leaderboardIcon,
animation,
];
}
| pinball/packages/pinball_theme/lib/src/themes/character_theme.dart/0 | {
"file_path": "pinball/packages/pinball_theme/lib/src/themes/character_theme.dart",
"repo_id": "pinball",
"token_count": 296
} | 1,177 |
import 'package:flutter/material.dart';
import 'package:pinball_ui/pinball_ui.dart';
/// Pinball theme
class PinballTheme {
/// Standard [ThemeData] for Pinball UI
static ThemeData get standard {
return ThemeData(
textTheme: _textTheme,
);
}
static TextTheme get _textTheme {
return const TextTheme(
headline1: PinballTextStyle.headline1,
headline2: PinballTextStyle.headline2,
headline3: PinballTextStyle.headline3,
headline4: PinballTextStyle.headline4,
headline5: PinballTextStyle.headline5,
subtitle1: PinballTextStyle.subtitle1,
);
}
}
| pinball/packages/pinball_ui/lib/src/theme/pinball_theme.dart/0 | {
"file_path": "pinball/packages/pinball_ui/lib/src/theme/pinball_theme.dart",
"repo_id": "pinball",
"token_count": 220
} | 1,178 |
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_ui/pinball_ui.dart';
void main() {
group('CrtBackground', () {
test('is a BoxDecoration with a LinearGradient', () {
// ignore: prefer_const_constructors
final crtBg = CrtBackground();
const expectedGradient = LinearGradient(
begin: Alignment(1, 0.015),
stops: [0.0, 0.5, 0.5, 1],
colors: [
PinballColors.darkBlue,
PinballColors.darkBlue,
PinballColors.crtBackground,
PinballColors.crtBackground,
],
tileMode: TileMode.repeated,
);
expect(crtBg, isA<BoxDecoration>());
expect(crtBg.gradient, expectedGradient);
});
});
}
| pinball/packages/pinball_ui/test/src/widgets/crt_background_test.dart/0 | {
"file_path": "pinball/packages/pinball_ui/test/src/widgets/crt_background_test.dart",
"repo_id": "pinball",
"token_count": 339
} | 1,179 |
/// The platform that is being used to share a score.
enum SharePlatform {
/// Twitter platform.
twitter,
/// Facebook platform.
facebook,
}
| pinball/packages/share_repository/lib/src/models/share_platform.dart/0 | {
"file_path": "pinball/packages/share_repository/lib/src/models/share_platform.dart",
"repo_id": "pinball",
"token_count": 40
} | 1,180 |
// ignore_for_file: cascade_invocations
import 'package:bloc_test/bloc_test.dart';
import 'package:flame/components.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball/game/behaviors/behaviors.dart';
import 'package:pinball/select_character/select_character.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
import 'package:pinball_theme/pinball_theme.dart' as theme;
import 'package:platform_helper/platform_helper.dart';
class _TestGame extends Forge2DGame {
@override
Future<void> onLoad() async {
images.prefix = '';
await images.loadAll([
theme.Assets.images.dash.ball.keyName,
theme.Assets.images.dino.ball.keyName,
theme.Assets.images.dash.background.keyName,
theme.Assets.images.dino.background.keyName,
]);
}
Future<void> pump(
List<Component> children, {
CharacterThemeCubit? characterThemeBloc,
PlatformHelper? platformHelper,
}) async {
await ensureAdd(
FlameBlocProvider<CharacterThemeCubit, CharacterThemeState>.value(
value: characterThemeBloc ?? CharacterThemeCubit(),
children: [
FlameProvider.value(
platformHelper ?? _MockPlatformHelper(),
children: children,
),
],
),
);
}
}
class _MockBallCubit extends Mock implements BallCubit {}
class _MockArcadeBackgroundCubit extends Mock implements ArcadeBackgroundCubit {
}
class _MockPlatformHelper extends Mock implements PlatformHelper {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
group(
'CharacterSelectionBehavior',
() {
final flameTester = FlameTester(_TestGame.new);
test('can be instantiated', () {
expect(
CharacterSelectionBehavior(),
isA<CharacterSelectionBehavior>(),
);
});
flameTester.test(
'loads',
(game) async {
final behavior = CharacterSelectionBehavior();
await game.pump([behavior]);
expect(game.descendants(), contains(behavior));
},
);
flameTester.test(
'onNewState does not call onCharacterSelected on the arcade background '
'bloc when platform is mobile',
(game) async {
final platformHelper = _MockPlatformHelper();
when(() => platformHelper.isMobile).thenAnswer((_) => true);
final arcadeBackgroundBloc = _MockArcadeBackgroundCubit();
whenListen(
arcadeBackgroundBloc,
const Stream<ArcadeBackgroundState>.empty(),
initialState: const ArcadeBackgroundState.initial(),
);
final behavior = CharacterSelectionBehavior();
await game.pump(
[
behavior,
ZCanvasComponent(),
Plunger.test(),
Ball.test(),
],
platformHelper: platformHelper,
);
const dinoThemeState = CharacterThemeState(theme.DinoTheme());
behavior.onNewState(dinoThemeState);
await game.ready();
verifyNever(
() => arcadeBackgroundBloc
.onCharacterSelected(dinoThemeState.characterTheme),
);
},
);
flameTester.test(
'onNewState calls onCharacterSelected on the arcade background '
'bloc when platform is not mobile',
(game) async {
final platformHelper = _MockPlatformHelper();
when(() => platformHelper.isMobile).thenAnswer((_) => false);
final arcadeBackgroundBloc = _MockArcadeBackgroundCubit();
whenListen(
arcadeBackgroundBloc,
const Stream<ArcadeBackgroundState>.empty(),
initialState: const ArcadeBackgroundState.initial(),
);
final arcadeBackground =
ArcadeBackground.test(bloc: arcadeBackgroundBloc);
final behavior = CharacterSelectionBehavior();
await game.pump(
[
arcadeBackground,
behavior,
ZCanvasComponent(),
Plunger.test(),
Ball.test(),
],
platformHelper: platformHelper,
);
const dinoThemeState = CharacterThemeState(theme.DinoTheme());
behavior.onNewState(dinoThemeState);
await game.ready();
verify(
() => arcadeBackgroundBloc
.onCharacterSelected(dinoThemeState.characterTheme),
).called(1);
},
);
flameTester.test(
'onNewState calls onCharacterSelected on the ball bloc',
(game) async {
final platformHelper = _MockPlatformHelper();
when(() => platformHelper.isMobile).thenAnswer((_) => false);
final ballBloc = _MockBallCubit();
whenListen(
ballBloc,
const Stream<BallState>.empty(),
initialState: const BallState.initial(),
);
final ball = Ball.test(bloc: ballBloc);
final behavior = CharacterSelectionBehavior();
await game.pump(
[
ball,
behavior,
ZCanvasComponent(),
Plunger.test(),
ArcadeBackground.test(),
],
platformHelper: platformHelper,
);
const dinoThemeState = CharacterThemeState(theme.DinoTheme());
behavior.onNewState(dinoThemeState);
await game.ready();
verify(
() => ballBloc.onCharacterSelected(dinoThemeState.characterTheme),
).called(1);
},
);
},
);
}
| pinball/test/game/behaviors/character_selection_behavior_test.dart/0 | {
"file_path": "pinball/test/game/behaviors/character_selection_behavior_test.dart",
"repo_id": "pinball",
"token_count": 2561
} | 1,181 |
// ignore_for_file: prefer_const_constructors
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leaderboard_repository/leaderboard_repository.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball/game/components/backbox/bloc/backbox_bloc.dart';
import 'package:pinball_theme/pinball_theme.dart';
class _MockLeaderboardRepository extends Mock implements LeaderboardRepository {
}
void main() {
late LeaderboardRepository leaderboardRepository;
const emptyEntries = <LeaderboardEntryData>[];
const filledEntries = [LeaderboardEntryData.empty];
group('BackboxBloc', () {
test('inits state with LeaderboardSuccessState when has entries', () {
leaderboardRepository = _MockLeaderboardRepository();
final bloc = BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: filledEntries,
);
expect(bloc.state, isA<LeaderboardSuccessState>());
});
test('inits state with LeaderboardFailureState when has no entries', () {
leaderboardRepository = _MockLeaderboardRepository();
final bloc = BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: null,
);
expect(bloc.state, isA<LeaderboardFailureState>());
});
blocTest<BackboxBloc, BackboxState>(
'adds InitialsFormState on PlayerInitialsRequested',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(
PlayerInitialsRequested(
score: 100,
character: AndroidTheme(),
),
),
expect: () => [
InitialsFormState(score: 100, character: AndroidTheme()),
],
);
group('PlayerInitialsSubmitted', () {
blocTest<BackboxBloc, BackboxState>(
'adds [LoadingState, InitialsSuccessState] when submission succeeds',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
when(
() => leaderboardRepository.addLeaderboardEntry(
LeaderboardEntryData(
playerInitials: 'AAA',
score: 10,
character: CharacterType.dash,
),
),
).thenAnswer((_) async {});
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(
PlayerInitialsSubmitted(
score: 10,
initials: 'AAA',
character: DashTheme(),
),
),
expect: () => [
LoadingState(),
InitialsSuccessState(score: 10),
],
);
blocTest<BackboxBloc, BackboxState>(
'adds [LoadingState, InitialsFailureState] when submission fails',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
when(
() => leaderboardRepository.addLeaderboardEntry(
LeaderboardEntryData(
playerInitials: 'AAA',
score: 10,
character: CharacterType.dash,
),
),
).thenThrow(Exception('Error'));
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(
PlayerInitialsSubmitted(
score: 10,
initials: 'AAA',
character: DashTheme(),
),
),
expect: () => [
LoadingState(),
InitialsFailureState(score: 10, character: DashTheme()),
],
);
});
group('ShareScoreRequested', () {
blocTest<BackboxBloc, BackboxState>(
'emits ShareState',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(
ShareScoreRequested(score: 100),
),
expect: () => [
ShareState(score: 100),
],
);
});
group('ShareScoreRequested', () {
blocTest<BackboxBloc, BackboxState>(
'emits ShareState',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(
ShareScoreRequested(score: 100),
),
expect: () => [
ShareState(score: 100),
],
);
});
group('LeaderboardRequested', () {
blocTest<BackboxBloc, BackboxState>(
'adds [LoadingState, LeaderboardSuccessState] when request succeeds',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
when(
() => leaderboardRepository.fetchTop10Leaderboard(),
).thenAnswer(
(_) async => [LeaderboardEntryData.empty],
);
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(LeaderboardRequested()),
expect: () => [
LoadingState(),
LeaderboardSuccessState(entries: const [LeaderboardEntryData.empty]),
],
);
blocTest<BackboxBloc, BackboxState>(
'adds [LoadingState, LeaderboardFailureState] when request fails',
setUp: () {
leaderboardRepository = _MockLeaderboardRepository();
when(
() => leaderboardRepository.fetchTop10Leaderboard(),
).thenThrow(Exception('Error'));
},
build: () => BackboxBloc(
leaderboardRepository: leaderboardRepository,
initialEntries: emptyEntries,
),
act: (bloc) => bloc.add(LeaderboardRequested()),
expect: () => [
LoadingState(),
LeaderboardFailureState(),
],
);
});
});
}
| pinball/test/game/components/backbox/bloc/backbox_bloc_test.dart/0 | {
"file_path": "pinball/test/game/components/backbox/bloc/backbox_bloc_test.dart",
"repo_id": "pinball",
"token_count": 2851
} | 1,182 |
// ignore_for_file: cascade_invocations
import 'dart:async';
import 'package:bloc_test/bloc_test.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:flame_forge2d/forge2d_game.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball/game/behaviors/behaviors.dart';
import 'package:pinball/game/components/flutter_forest/behaviors/behaviors.dart';
import 'package:pinball/game/game.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
import 'package:pinball_theme/pinball_theme.dart' as theme;
class _TestGame extends Forge2DGame {
@override
Future<void> onLoad() async {
images.prefix = '';
await images.load(theme.Assets.images.dash.ball.keyName);
}
Future<void> pump(
FlutterForest child, {
required GameBloc gameBloc,
required SignpostCubit signpostBloc,
DashBumpersCubit? dashBumpersBloc,
}) async {
await ensureAdd(
FlameMultiBlocProvider(
providers: [
FlameBlocProvider<GameBloc, GameState>.value(
value: gameBloc,
),
FlameBlocProvider<SignpostCubit, SignpostState>.value(
value: signpostBloc,
),
FlameBlocProvider<DashBumpersCubit, DashBumpersState>.value(
value: dashBumpersBloc ?? DashBumpersCubit(),
),
],
children: [
ZCanvasComponent(
children: [child],
),
],
),
);
}
}
class _MockGameBloc extends Mock implements GameBloc {}
class _MockSignpostCubit extends Mock implements SignpostCubit {}
class _MockDashBumpersCubit extends Mock implements DashBumpersCubit {}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
group('FlutterForestBonusBehavior', () {
late GameBloc gameBloc;
setUp(() {
gameBloc = _MockGameBloc();
});
final flameTester = FlameTester(_TestGame.new);
test('can be instantiated', () {
expect(FlutterForestBonusBehavior(), isA<FlutterForestBonusBehavior>());
});
flameTester.testGameWidget(
'adds GameBonus.dashNest to the game '
'when signpost becomes fully activated',
setUp: (game, tester) async {
final behavior = FlutterForestBonusBehavior();
final parent = FlutterForest.test();
final signpostBloc = _MockSignpostCubit();
final streamController = StreamController<SignpostState>();
whenListen(
signpostBloc,
streamController.stream,
initialState: SignpostState.inactive,
);
await game.pump(
parent,
gameBloc: gameBloc,
signpostBloc: signpostBloc,
);
await parent.ensureAdd(behavior);
streamController.add(SignpostState.active3);
await tester.pump();
verify(
() => gameBloc.add(const BonusActivated(GameBonus.dashNest)),
).called(1);
},
);
flameTester.testGameWidget(
'calls onProgressed and onReset '
'when signpost becomes fully activated',
setUp: (game, tester) async {
final behavior = FlutterForestBonusBehavior();
final parent = FlutterForest.test();
final dashBumpersBloc = _MockDashBumpersCubit();
final signpostBloc = _MockSignpostCubit();
final streamController = StreamController<SignpostState>();
whenListen(
signpostBloc,
streamController.stream,
initialState: SignpostState.inactive,
);
await game.pump(
parent,
gameBloc: gameBloc,
signpostBloc: signpostBloc,
dashBumpersBloc: dashBumpersBloc,
);
await parent.ensureAdd(behavior);
streamController.add(SignpostState.active3);
await tester.pump();
verify(signpostBloc.onProgressed).called(1);
verify(dashBumpersBloc.onReset).called(1);
},
);
flameTester.testGameWidget(
'adds BonusBallSpawningBehavior to the game '
'when signpost becomes fully activated',
setUp: (game, tester) async {
final behavior = FlutterForestBonusBehavior();
final parent = FlutterForest.test();
final signpostBloc = _MockSignpostCubit();
final streamController = StreamController<SignpostState>();
whenListen(
signpostBloc,
streamController.stream,
initialState: SignpostState.inactive,
);
await game.pump(
parent,
gameBloc: gameBloc,
signpostBloc: signpostBloc,
);
await parent.ensureAdd(behavior);
streamController.add(SignpostState.active3);
await tester.pump();
await game.ready();
expect(
game.descendants().whereType<BonusBallSpawningBehavior>().length,
equals(1),
);
},
);
});
}
| pinball/test/game/components/flutter_forest/behaviors/flutter_forest_bonus_behavior_test.dart/0 | {
"file_path": "pinball/test/game/components/flutter_forest/behaviors/flutter_forest_bonus_behavior_test.dart",
"repo_id": "pinball",
"token_count": 2145
} | 1,183 |
// ignore_for_file: prefer_const_constructors
import 'dart:async';
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:pinball/game/game.dart';
import 'package:pinball/l10n/l10n.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_ui/pinball_ui.dart';
import '../../../helpers/helpers.dart';
class _MockGameBloc extends Mock implements GameBloc {}
void main() {
group('GameHud', () {
late GameBloc gameBloc;
const initialState = GameState(
totalScore: 0,
roundScore: 1000,
multiplier: 1,
rounds: 1,
bonusHistory: [],
status: GameStatus.playing,
);
setUp(() async {
await mockFlameImages();
gameBloc = _MockGameBloc();
whenListen(
gameBloc,
Stream.value(initialState),
initialState: initialState,
);
});
// We cannot use pumpApp when we are testing animation because
// animation tests needs to be run and check in tester.runAsync
Future<void> _pumpAppWithWidget(WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
theme: PinballTheme.standard,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
],
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: BlocProvider<GameBloc>.value(
value: gameBloc,
child: GameHud(),
),
),
),
);
}
group('renders ScoreView widget', () {
testWidgets(
'with the score',
(tester) async {
await tester.pumpApp(
GameHud(),
gameBloc: gameBloc,
);
expect(
find.text(initialState.roundScore.formatScore()),
findsOneWidget,
);
},
);
testWidgets(
'on game over',
(tester) async {
final state = initialState.copyWith(
bonusHistory: [GameBonus.dashNest],
balls: 0,
);
whenListen(
gameBloc,
Stream.value(state),
initialState: initialState,
);
await tester.pumpApp(
GameHud(),
gameBloc: gameBloc,
);
expect(find.byType(ScoreView), findsOneWidget);
expect(find.byType(BonusAnimation), findsNothing);
},
);
});
for (final gameBonus in GameBonus.values) {
testWidgets('renders BonusAnimation for $gameBonus', (tester) async {
await tester.runAsync(() async {
final state = initialState.copyWith(
bonusHistory: [gameBonus],
);
whenListen(
gameBloc,
Stream.value(state),
initialState: initialState,
);
await _pumpAppWithWidget(tester);
await tester.pump();
expect(find.byType(BonusAnimation), findsOneWidget);
});
});
}
testWidgets(
'goes back to ScoreView after the animation',
(tester) async {
await tester.runAsync(() async {
final state = initialState.copyWith(
bonusHistory: [GameBonus.dashNest],
);
whenListen(
gameBloc,
Stream.value(state),
initialState: initialState,
);
await _pumpAppWithWidget(tester);
await tester.pump();
await Future<void>.delayed(const Duration(seconds: 6));
await expectLater(find.byType(ScoreView), findsOneWidget);
});
},
);
});
}
| pinball/test/game/view/widgets/game_hud_test.dart/0 | {
"file_path": "pinball/test/game/view/widgets/game_hud_test.dart",
"repo_id": "pinball",
"token_count": 1844
} | 1,184 |
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball/start_game/bloc/start_game_bloc.dart';
void main() {
group('StartGameBloc', () {
blocTest<StartGameBloc, StartGameState>(
'on PlayTapped changes status to selectCharacter',
build: StartGameBloc.new,
act: (bloc) => bloc.add(const PlayTapped()),
expect: () => [
const StartGameState(
status: StartGameStatus.selectCharacter,
)
],
);
blocTest<StartGameBloc, StartGameState>(
'on ReplayTapped changes status to selectCharacter',
build: StartGameBloc.new,
act: (bloc) => bloc.add(const ReplayTapped()),
expect: () => [
const StartGameState(
status: StartGameStatus.selectCharacter,
)
],
);
blocTest<StartGameBloc, StartGameState>(
'on CharacterSelected changes status to howToPlay',
build: StartGameBloc.new,
act: (bloc) => bloc.add(const CharacterSelected()),
expect: () => [
const StartGameState(
status: StartGameStatus.howToPlay,
)
],
);
blocTest<StartGameBloc, StartGameState>(
'on HowToPlayFinished changes status to play',
build: StartGameBloc.new,
act: (bloc) => bloc.add(const HowToPlayFinished()),
expect: () => [
const StartGameState(
status: StartGameStatus.play,
)
],
);
});
}
| pinball/test/start_game/bloc/start_game_bloc_test.dart/0 | {
"file_path": "pinball/test/start_game/bloc/start_game_bloc_test.dart",
"repo_id": "pinball",
"token_count": 627
} | 1,185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.