content: // Copyright 2020 Sarbagya Dhaubanjar. 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/material.dart';
  import 'package:flutter_typeahead_web/flutter_typeahead.dart';
  
  ///
  class SuggestionConfiguration {
    /// A widget to display before the title.
    ///
    /// Typically an [Icon] or a [CircleAvatar] widget.
    final Widget leading;
  
    /// The primary content of the list tile.
    ///
    /// Typically a [Text] widget.
    ///
    /// This should not wrap.
    final Widget title;
  
    /// Additional content displayed below the title.
    ///
    /// Typically a [Text] widget.
    ///
    /// If [isThreeLine] is false, this should not wrap.
    ///
    /// If [isThreeLine] is true, this should be configured to take a maximum of
    /// two lines.
    final Widget subtitle;
  
    /// Whether this list tile is intended to display three lines of text.
    ///
    /// If true, then [subtitle] must be non-null (since it is expected to give
    /// the second and third lines of text).
    ///
    /// If false, the list tile is treated as having one line if the subtitle is
    /// null and treated as having two lines if the subtitle is non-null.
    final bool isThreeLine;
  
    /// Whether this list tile is part of a vertically dense list.
    ///
    /// If this property is null then its value is based on [ListTileTheme.dense].
    ///
    /// Dense list tiles default to a smaller height.
    final bool dense;
  
    /// The tile's internal padding.
    ///
    /// Insets a [ListTile]'s contents: its [leading], [title], [subtitle],
    /// and [trailing] widgets.
    ///
    /// If null, `EdgeInsets.symmetric(horizontal: 16.0)` is used.
    final EdgeInsetsGeometry contentPadding;
  
    /// A widget to display add to tags.
    final Widget additionWidget;
  
    /// The splash color of the ink response. If this property is null then the
    /// splash color of the theme, [ThemeData.splashColor], will be used.
    ///
    /// See also:
    ///
    ///  * [splashFactory], which defines the appearance of the splash.
    ///  * [radius], the (maximum) size of the ink splash.
    ///  * [highlightColor], the color of the highlight.
    final Color splashColor;
  
    /// The clipping radius of the containing rect.
    ///
    /// If this is null, it is interpreted as [BorderRadius.zero].
    final BorderRadius splashRadius;
  
    ///
    const SuggestionConfiguration({
      @required this.title,
      this.subtitle,
      this.contentPadding = const EdgeInsets.symmetric(horizontal: 16.0),
      this.dense,
      this.isThreeLine = false,
      this.leading,
      this.additionWidget,
      this.splashColor,
      this.splashRadius = BorderRadius.zero,
    });
  }
  
  ///
  class ChipConfiguration {
    /// The primary content of the chip.
    ///
    /// Typically a [Text] widget.
    final Widget label;
  
    /// A widget to display prior to the chip's label.
    ///
    /// Typically a [CircleAvatar] widget.
    final Widget avatar;
  
    /// The style to be applied to the chip's label.
    ///
    /// This only has an effect on widgets that respect the [DefaultTextStyle],
    /// such as [Text].
    ///
    /// If [labelStyle.color] is a [MaterialStateProperty<Color>], [MaterialStateProperty.resolve]
    /// is used for the following [MaterialState]s:
    ///
    ///  * [MaterialState.disabled].
    ///  * [MaterialState.selected].
    ///  * [MaterialState.hovered].
    ///  * [MaterialState.focused].
    ///  * [MaterialState.pressed].
    final TextStyle labelStyle;
  
    /// The [ShapeBorder] to draw around the chip.
    ///
    /// Defaults to the shape in the ambient [ChipThemeData].
    final ShapeBorder shape;
  
    /// {@macro flutter.widgets.Clip}
    final Clip clipBehavior;
  
    /// Color to be used for the unselected, enabled chip's background.
    ///
    /// The default is light grey.
    final Color backgroundColor;
  
    /// The padding between the contents of the chip and the outside [shape].
    ///
    /// Defaults to 4 logical pixels on all sides.
    final EdgeInsetsGeometry padding;
  
    /// The padding around the [label] widget.
    ///
    /// By default, this is 4 logical pixels at the beginning and the end of the
    /// label, and zero on top and bottom.
    final EdgeInsetsGeometry labelPadding;
  
    /// Configures the minimum size of the tap target.
    ///
    /// Defaults to [ThemeData.materialTapTargetSize].
    ///
    /// See also:
    ///
    ///  * [MaterialTapTargetSize], for a description of how this affects tap targets.
    final MaterialTapTargetSize materialTapTargetSize;
  
    /// Elevation to be applied on the chip relative to its parent.
    ///
    /// This controls the size of the shadow below the chip.
    ///
    /// Defaults to 0. The value is always non-negative.
    final double elevation;
  
    /// Color of the chip's shadow when the elevation is greater than 0.
    ///
    /// The default is [Colors.black].
    final Color shadowColor;
  
    /// The icon displayed when [onDeleted] is set.
    ///
    /// Defaults to an [Icon] widget set to use [Icons.cancel].
    final Widget deleteIcon;
  
    /// The [Color] for the delete icon. The default is based on the ambient
    /// [IconTheme.color].
    final Color deleteIconColor;
  
    /// The message to be used for the chip's delete button tooltip.
    final String deleteButtonTooltipMessage;
  
    ///
    const ChipConfiguration({
      this.avatar,
      this.label,
      this.labelStyle,
      this.labelPadding,
      this.deleteIcon,
      this.deleteIconColor,
      this.deleteButtonTooltipMessage,
      this.shape,
      this.clipBehavior = Clip.none,
      this.backgroundColor,
      this.padding,
      this.materialTapTargetSize,
      this.elevation,
      this.shadowColor,
    });
  }
  
  ///
  class WrapConfiguration {
    /// The direction to use as the main axis.
    ///
    /// For example, if [direction] is [Axis.horizontal], the default, the
    /// children are placed adjacent to one another in a horizontal run until the
    /// available horizontal space is consumed, at which point a subsequent
    /// children are placed in a new run vertically adjacent to the previous run.
    final Axis direction;
  
    /// How the children within a run should be placed in the main axis.
    ///
    /// For example, if [alignment] is [WrapAlignment.center], the children in
    /// each run are grouped together in the center of their run in the main axis.
    ///
    /// Defaults to [WrapAlignment.start].
    ///
    /// See also:
    ///
    ///  * [runAlignment], which controls how the runs are placed relative to each
    ///    other in the cross axis.
    ///  * [crossAxisAlignment], which controls how the children within each run
    ///    are placed relative to each other in the cross axis.
    final WrapAlignment alignment;
  
    /// How much space to place between children in a run in the main axis.
    ///
    /// For example, if [spacing] is 10.0, the children will be spaced at least
    /// 10.0 logical pixels apart in the main axis.
    ///
    /// If there is additional free space in a run (e.g., because the wrap has a
    /// minimum size that is not filled or because some runs are longer than
    /// others), the additional free space will be allocated according to the
    /// [alignment].
    ///
    /// Defaults to 8.0.
    final double spacing;
  
    /// How the runs themselves should be placed in the cross axis.
    ///
    /// For example, if [runAlignment] is [WrapAlignment.center], the runs are
    /// grouped together in the center of the overall [Wrap] in the cross axis.
    ///
    /// Defaults to [WrapAlignment.start].
    ///
    /// See also:
    ///
    ///  * [alignment], which controls how the children within each run are placed
    ///    relative to each other in the main axis.
    ///  * [crossAxisAlignment], which controls how the children within each run
    ///    are placed relative to each other in the cross axis.
    final WrapAlignment runAlignment;
  
    /// How much space to place between the runs themselves in the cross axis.
    ///
    /// For example, if [runSpacing] is 10.0, the runs will be spaced at least
    /// 10.0 logical pixels apart in the cross axis.
    ///
    /// If there is additional free space in the overall [Wrap] (e.g., because
    /// the wrap has a minimum size that is not filled), the additional free space
    /// will be allocated according to the [runAlignment].
    ///
    /// Defaults to 8.0.
    final double runSpacing;
  
    /// How the children within a run should be aligned relative to each other in
    /// the cross axis.
    ///
    /// For example, if this is set to [WrapCrossAlignment.end], and the
    /// [direction] is [Axis.horizontal], then the children within each
    /// run will have their bottom edges aligned to the bottom edge of the run.
    ///
    /// Defaults to [WrapCrossAlignment.start].
    ///
    /// See also:
    ///
    ///  * [alignment], which controls how the children within each run are placed
    ///    relative to each other in the main axis.
    ///  * [runAlignment], which controls how the runs are placed relative to each
    ///    other in the cross axis.
    final WrapCrossAlignment crossAxisAlignment;
  
    /// Determines the order to lay children out horizontally and how to interpret
    /// `start` and `end` in the horizontal direction.
    ///
    /// Defaults to the ambient [Directionality].
    ///
    /// If the [direction] is [Axis.horizontal], this controls order in which the
    /// children are positioned (left-to-right or right-to-left), and the meaning
    /// of the [alignment] property's [WrapAlignment.start] and
    /// [WrapAlignment.end] values.
    ///
    /// If the [direction] is [Axis.horizontal], and either the
    /// [alignment] is either [WrapAlignment.start] or [WrapAlignment.end], or
    /// there's more than one child, then the [textDirection] (or the ambient
    /// [Directionality]) must not be null.
    ///
    /// If the [direction] is [Axis.vertical], this controls the order in which
    /// runs are positioned, the meaning of the [runAlignment] property's
    /// [WrapAlignment.start] and [WrapAlignment.end] values, as well as the
    /// [crossAxisAlignment] property's [WrapCrossAlignment.start] and
    /// [WrapCrossAlignment.end] values.
    ///
    /// If the [direction] is [Axis.vertical], and either the
    /// [runAlignment] is either [WrapAlignment.start] or [WrapAlignment.end], the
    /// [crossAxisAlignment] is either [WrapCrossAlignment.start] or
    /// [WrapCrossAlignment.end], or there's more than one child, then the
    /// [textDirection] (or the ambient [Directionality]) must not be null.
    final TextDirection textDirection;
  
    /// Determines the order to lay children out vertically and how to interpret
    /// `start` and `end` in the vertical direction.
    ///
    /// If the [direction] is [Axis.vertical], this controls which order children
    /// are painted in (down or up), the meaning of the [alignment] property's
    /// [WrapAlignment.start] and [WrapAlignment.end] values.
    ///
    /// If the [direction] is [Axis.vertical], and either the [alignment]
    /// is either [WrapAlignment.start] or [WrapAlignment.end], or there's
    /// more than one child, then the [verticalDirection] must not be null.
    ///
    /// If the [direction] is [Axis.horizontal], this controls the order in which
    /// runs are positioned, the meaning of the [runAlignment] property's
    /// [WrapAlignment.start] and [WrapAlignment.end] values, as well as the
    /// [crossAxisAlignment] property's [WrapCrossAlignment.start] and
    /// [WrapCrossAlignment.end] values.
    ///
    /// If the [direction] is [Axis.horizontal], and either the
    /// [runAlignment] is either [WrapAlignment.start] or [WrapAlignment.end], the
    /// [crossAxisAlignment] is either [WrapCrossAlignment.start] or
    /// [WrapCrossAlignment.end], or there's more than one child, then the
    /// [verticalDirection] must not be null.
    final VerticalDirection verticalDirection;
  
    ///
    const WrapConfiguration({
      this.direction = Axis.horizontal,
      this.alignment = WrapAlignment.start,
      this.spacing = 8.0,
      this.runAlignment = WrapAlignment.start,
      this.runSpacing = 8.0,
      this.crossAxisAlignment = WrapCrossAlignment.start,
      this.textDirection,
      this.verticalDirection = VerticalDirection.down,
    });
  }
  
  ///
  class SuggestionsBoxConfiguration {
    /// If set to false, the suggestions box will stay opened after
    /// the keyboard is closed.
    ///
    /// Defaults to true.
    final bool hideSuggestionsOnKeyboardHide;
  
    /// If set to false, the suggestions box will show a circular
    /// progress indicator when retrieving suggestions.
    ///
    /// Defaults to true.
    final bool keepSuggestionsOnLoading;
  
    /// If set to true, the suggestions box will remain opened even after
    /// selecting a suggestion.
    ///
    /// Note that if this is enabled, the only way
    /// to close the suggestions box is either manually via the
    /// `SuggestionsBoxController` or when the user closes the software
    /// keyboard if `hideSuggestionsOnKeyboardHide` is set to true. Users
    /// with a physical keyboard will be unable to close the
    /// box without a manual way via `SuggestionsBoxController`.
    ///
    /// Defaults to false.
    final bool keepSuggestionsOnSuggestionSelected;
  
    /// If set to true, in the case where the suggestions box has less than
    /// _SuggestionsBoxController.minOverlaySpace to grow in the desired [direction], the direction axis
    /// will be temporarily flipped if there's more room available in the opposite
    /// direction.
    ///
    /// Defaults to false
    final bool autoFlipDirection;
  
    /// How far below the text field should the suggestions box be
    ///
    /// Defaults to 5.0
    final double suggestionsBoxVerticalOffset;
  
    /// The decoration of the material sheet that contains the suggestions.
    ///
    /// If null, default decoration with an elevation of 4.0 is used
    final SuggestionsBoxDecoration suggestionsBoxDecoration;
  
    /// Used to control the `_SuggestionsBox`. Allows manual control to
    /// open, close, toggle, or resize the `_SuggestionsBox`.
    final SuggestionsBoxController suggestionsBoxController;
  
    /// Determine the [SuggestionBox]'s direction.
    ///
    /// If [AxisDirection.down], the [SuggestionBox] will be below the [TextField]
    /// and the list of suggestion will grow **down**.
    ///
    /// If [AxisDirection.up], the [SuggestionBox] will be above the [TextField]
    /// and the list of suggestion will grow **up**.
    ///
    /// [AxisDirection.left] and [AxisDirection.right] are not allowed.
    final AxisDirection direction;
  
    ///
    const SuggestionsBoxConfiguration({
      this.direction = AxisDirection.down,
      this.autoFlipDirection = false,
      this.hideSuggestionsOnKeyboardHide = true,
      this.keepSuggestionsOnLoading = true,
      this.keepSuggestionsOnSuggestionSelected = false,
      this.suggestionsBoxController,
      this.suggestionsBoxDecoration = const SuggestionsBoxDecoration(),
      this.suggestionsBoxVerticalOffset = 5.0,
    });
  }
  