Skip to content

Commit

Permalink
Fix unnamed function parameters (#1309)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassony105 authored Aug 22, 2024
1 parent db8d05f commit 71d644a
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/core/lib/src/core_html_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class HtmlWidget extends StatefulWidget {
final OnLoadingBuilder? onLoadingBuilder;

/// The callback when user taps an image.
final void Function(ImageMetadata)? onTapImage;
final void Function(ImageMetadata imageMetadata)? onTapImage;

/// The callback when user taps a link.
///
/// Returns `true` if the url has been handled,
/// the default handler will be skipped.
final FutureOr<bool> Function(String)? onTapUrl;
final FutureOr<bool> Function(String url)? onTapUrl;

/// The values that should trigger rebuild.
///
Expand Down
3 changes: 2 additions & 1 deletion packages/core/lib/src/internal/flattener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class Flattener implements Flattened {
final WidgetFactory wf;
final _widgets = <WidgetPlaceholder>[];

List<InlineSpan? Function(BuildContext, {bool? isLast})>? _childrenBuilder;
List<InlineSpan? Function(BuildContext context, {bool? isLast})>?
_childrenBuilder;
late InheritanceResolvers _firstInheritanceResolvers;
late List<_String> _firstStrings;

Expand Down
4 changes: 3 additions & 1 deletion packages/core/lib/src/internal/margin_vertical.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class HeightPlaceholder extends WidgetPlaceholder {
}

@override
HeightPlaceholder wrapWith(Widget? Function(BuildContext, Widget) builder) =>
HeightPlaceholder wrapWith(
Widget? Function(BuildContext context, Widget child) builder,
) =>
this;

static Widget _build(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/src/internal/ops/tag_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class _TagTableData {
final footer = _TagTableRowGroup(kCssDisplayTableFooterGroup);
final header = _TagTableRowGroup(kCssDisplayTableHeaderGroup);

final builders = <HtmlTableCell? Function(BuildContext)>[];
final builders = <HtmlTableCell? Function(BuildContext context)>[];
final cells = <int, Map<int, int>>{};
int columns = 0;
int rows = 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/src/widgets/html_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ extension on BuildContext {

class _HtmlDetailsInherited extends InheritedWidget {
final bool isOpen;
final void Function(bool) setIsOpen;
final void Function(bool value) setIsOpen;

const _HtmlDetailsInherited({
required super.child,
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/_.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Widget? buildCurrentState({GlobalKey? key}) {
Future<String> explain(
WidgetTester tester,
String? html, {
String? Function(Explainer, Widget)? explainer,
String? Function(Explainer explainer, Widget child)? explainer,
double? height,
Widget? hw,
GlobalKey? key,
Expand Down Expand Up @@ -82,7 +82,7 @@ Future<String> explain(
}

Future<String> explainWithoutPumping({
String? Function(Explainer, Widget)? explainer,
String? Function(Explainer explainer, Widget child)? explainer,
GlobalKey? key,
bool useExplainer = true,
}) async {
Expand Down Expand Up @@ -216,7 +216,7 @@ Future<int> tapText(WidgetTester tester, String data) async {

class Explainer {
final BuildContext context;
final String? Function(Explainer, Widget)? explainer;
final String? Function(Explainer explainer, Widget child)? explainer;
final TextStyle _defaultStyle;

Explainer(this.context, {this.explainer})
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/core_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class _OnErrorBuilderFactory extends WidgetFactory {

class _OnTapUrlApp extends StatelessWidget {
final String href;
final FutureOr<bool> Function(String)? onTapUrl;
final FutureOr<bool> Function(String url)? onTapUrl;
final List? onTapCallbackResults;

const _OnTapUrlApp({
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/src/internal/core_build_tree_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ dom.NodeList _parseHtml(String html) =>
parser.HtmlParser(html, parseMeta: false).parseFragment().nodes;

class _WidgetFactory extends WidgetFactory {
final void Function(BuildTree)? onParse;
final void Function(BuildTree)? onParseStyle;
final void Function(BuildTree value)? onParse;
final void Function(BuildTree value)? onParseStyle;

_WidgetFactory({
this.onParse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class _PositionText extends StatelessWidget {
class _PositionSlider extends StatelessWidget {
final Stream<Duration?> durationStream;
final Stream<Duration> positionStream;
final void Function(Duration) seek;
final void Function(Duration duration) seek;
final double size;

const _PositionSlider({
Expand Down Expand Up @@ -257,7 +257,7 @@ class _PositionSlider extends StatelessWidget {
}

class _MuteButton extends StatelessWidget {
final Future<void> Function(double) setVolume;
final Future<void> Function(double value) setVolume;
final double size;
final Stream<double> stream;

Expand Down
2 changes: 1 addition & 1 deletion packages/fwfh_svg/test/svg_factory_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ HttpClient _createMockSvgImageHttpClient() {
),
).thenAnswer((invocation) {
final onData =
invocation.positionalArguments[0] as void Function(List<int>);
invocation.positionalArguments[0] as void Function(List<int> data);
final onDone =
invocation.namedArguments[const Symbol('onDone')] as Function?;
return Stream.fromIterable(<List<int>>[redTriangleBytes])
Expand Down
2 changes: 1 addition & 1 deletion packages/fwfh_webview/lib/src/web_view/web_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class WebView extends StatefulWidget {
/// Returning `true` will stop web view from navigating.
///
/// Flutter Web is not supported.
final bool Function(String)? interceptNavigationRequest;
final bool Function(String value)? interceptNavigationRequest;

/// {@template web_view.js}
/// Controls whether to enable JavaScript.
Expand Down

1 comment on commit 71d644a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.