Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue #20 - The superclass, 'InputDecoration', has no unnamed constructor that takes no arguments #201

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 1 addition & 52 deletions lib/src/input_decoration.dart
Original file line number Diff line number Diff line change
@@ -1,66 +1,17 @@
import 'package:flutter/material.dart';

class SearchInputDecoration extends InputDecoration {
/// text capitalization defaults to [TextCapitalization.none]
final TextCapitalization textCapitalization;

/// Specifies [TextStyle] for search input.
final TextStyle? searchStyle;

/// The color of the cursor.
/// The cursor indicates the current location of text insertion point in the field.
/// If this is null it will default to the ambient DefaultSelectionStyle.cursorColor. If that is
/// null, and the ThemeData.platform is TargetPlatform.iOS or TargetPlatform.macOS it will use
/// CupertinoThemeData.primaryColor. Otherwise it will use the value of ColorScheme.primary of
/// ThemeData.colorScheme.
///
final Color cursorColor;

///Creates a [FormField] that contains a [TextField].

/// The color of the cursor when the InputDecorator is showing an error.
///
/// If this is null it will default to TextStyle.color of InputDecoration.errorStyle. If that is
/// null, it will use ColorScheme.error of ThemeData.colorScheme.
///
final Color? cursorErrorColor;

/// How tall the cursor will be.
///
/// If this property is null, RenderEditable.preferredLineHeight will be used.
final double? cursorHeight;

/// How thick the cursor will be.
/// Defaults to 2.0.
/// The cursor will draw under the text. The cursor width will extend to the right of the
/// boundary between characters for left-to-right text and to the left for right-to-left text.
/// This corresponds to extending downstream relative to the selected position. Negative values
/// may be used to reverse this behavior.
///
final double? cursorWidth;

/// Whether the cursor will animate from fully transparent to fully opaque during each cursor
/// blink.
/// By default, the cursor opacity will animate on iOS platforms and will not animate on Android /
/// platforms.
///
final bool? cursorOpacityAnimates;

/// The radius of the cursor.How rounded the corners of the cursor should be.
/// By default, the cursor has no radius.
///
final Radius? cursorRadius;

/// The appearance of the keyboard.
/// This setting is only honored on iOS devices.
///
/// If unset, defaults to ThemeData.brightness.
///
final Brightness? keyboardAppearance;

final Key? key;
SearchInputDecoration({
this.key,
this.cursorColor = Colors.black,
this.textCapitalization = TextCapitalization.none,
this.searchStyle,
Expand All @@ -83,7 +34,6 @@ class SearchInputDecoration extends InputDecoration {
super.suffixIcon,
super.suffix,
super.label,
super.maintainHintHeight,
super.suffixIconColor,
super.prefix,
super.prefixIconColor,
Expand Down Expand Up @@ -123,7 +73,7 @@ class SearchInputDecoration extends InputDecoration {
super.errorMaxLines,
super.errorStyle,
super.suffixIconConstraints,
});
}) : super(); // Call the default constructor of InputDecoration

@override
SearchInputDecoration copyWith({
Expand Down Expand Up @@ -193,7 +143,6 @@ class SearchInputDecoration extends InputDecoration {
String? suffixText,
}) {
return SearchInputDecoration(
maintainHintHeight: maintainHintHeight ?? this.maintainHintHeight,
cursorColor: cursorColor ?? this.cursorColor,
textCapitalization: textCapitalization ?? this.textCapitalization,
searchStyle: searchStyle ?? this.searchStyle,
Expand Down
Loading