Analyze doc code snippets for all packages for which we publish docs (#132607)

Fixes TODO in the analyzer script :)
This commit is contained in:
Michael Goderbauer
2023-08-16 15:24:48 -07:00
committed by GitHub
parent e52e8da303
commit 14f9ed28d0
7 changed files with 74 additions and 33 deletions

View File

@@ -34,8 +34,10 @@ void usePathUrlStrategy() {
/// ```dart
/// import 'package:flutter_web_plugins/flutter_web_plugins.dart';
///
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(PathUrlStrategy());
/// void main() {
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(PathUrlStrategy());
/// }
/// ```
class PathUrlStrategy extends ui_web.HashUrlStrategy {
/// Creates an instance of [PathUrlStrategy].

View File

@@ -99,8 +99,10 @@ void usePathUrlStrategy() {
/// ```dart
/// import 'package:flutter_web_plugins/flutter_web_plugins.dart';
///
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(const HashUrlStrategy());
/// void main() {
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(const HashUrlStrategy());
/// }
/// ```
class HashUrlStrategy extends UrlStrategy {
/// Creates an instance of [HashUrlStrategy].
@@ -117,8 +119,10 @@ class HashUrlStrategy extends UrlStrategy {
/// ```dart
/// import 'package:flutter_web_plugins/flutter_web_plugins.dart';
///
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(PathUrlStrategy());
/// void main() {
/// // Somewhere before calling `runApp()` do:
/// setUrlStrategy(PathUrlStrategy());
/// }
/// ```
class PathUrlStrategy extends HashUrlStrategy {
/// Creates an instance of [PathUrlStrategy].

View File

@@ -9,6 +9,12 @@ import 'dart:ui_web' as ui_web;
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
// Examples can assume:
// import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// import 'package:flutter/services.dart';
// import 'dart:ui_web' as ui_web;
// void handleFrameworkMessage(String name, ByteData? data, PlatformMessageResponseCallback? callback) { }
/// A registrar for Flutter plugins implemented in Dart.
///
/// Plugins for the web platform are implemented in Dart and are
@@ -32,6 +38,11 @@ import 'package:flutter/services.dart';
/// final MyPlugin instance = MyPlugin();
/// channel.setMethodCallHandler(instance.handleMethodCall);
/// }
///
/// Future<dynamic> handleMethodCall(MethodCall call) async {
/// // ...
/// }
///
/// // ...
/// }
/// ```