// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. 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:angular/angular.dart';
import 'package:angular_components/model/ui/display_name.dart';
import 'package:angular_components/model/ui/has_renderer.dart';

/// Add this directive to any [SelectionContainer] or [SelectionItem]
/// component to render [HasUIDisplayName] objects.
@Directive(selector: '[displayNameRenderer]')
void displayNameRendererDirective(HasRenderer hasRenderer) {
  if (hasRenderer != null) hasRenderer.itemRenderer = _displayNameRenderer;
}

final _displayNameRenderer = (HasUIDisplayName item) => item.uiDisplayName;

// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. 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:angular/angular.dart';
import 'package:angular_components/model/ui/display_name.dart';
import 'package:angular_components/model/ui/has_renderer.dart';

/// Add this directive to any [SelectionContainer] or [SelectionItem]
/// component to render [HasUIDisplayName] objects.
@Directive(selector: '[displayNameRenderer]')
void displayNameRendererDirective(HasRenderer hasRenderer) {
  if (hasRenderer != null) hasRenderer.itemRenderer = _displayNameRenderer;
}

final _displayNameRenderer =
    (dynamic item) => (item as HasUIDisplayName).uiDisplayName;

Fix uses_bottom_as_dynamic ("fuzzy arrow") errors for material_select.
Fix uses_bottom_as_dynamic ("fuzzy arrow") errors for material_select.

Using dynamic as bottom will become an error in Dart 2.0. https://github.com/dart-lang/sdk/issues/29630

PiperOrigin-RevId: 182020806
