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

Separated TextBox Decorations #987

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@ build/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3

.fvm/
.fvm/
example/pubspec.lock
pubspec.lock
42 changes: 21 additions & 21 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -143,7 +143,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.8.1"
version: "4.8.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -345,10 +345,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -417,10 +417,10 @@ packages:
dependency: transitive
description:
name: petitparser
sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
url: "https://pub.dev"
source: hosted
version: "6.0.1"
version: "5.4.0"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -494,18 +494,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -542,10 +542,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -614,10 +614,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -646,10 +646,10 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.1.4-beta"
win32:
dependency: transitive
description:
Expand Down Expand Up @@ -678,10 +678,10 @@ packages:
dependency: transitive
description:
name: xml
sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
url: "https://pub.dev"
source: hosted
version: "6.4.2"
version: "6.3.0"
yaml:
dependency: transitive
description:
Expand All @@ -691,5 +691,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
38 changes: 27 additions & 11 deletions lib/src/controls/form/auto_suggest_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ class AutoSuggestBox<T> extends StatefulWidget {
this.placeholder,
this.placeholderStyle,
this.style,
this.decoration,
this.foregroundDecoration,
this.focusedDecoration,
this.unFocusedDecoration,
this.focusedForegroundDecoration,
this.unFocusedForegroundDecoration,
this.highlightColor,
this.unfocusedColor,
this.cursorColor,
Expand Down Expand Up @@ -157,8 +159,10 @@ class AutoSuggestBox<T> extends StatefulWidget {
this.placeholder,
this.placeholderStyle,
this.style,
this.decoration,
this.foregroundDecoration,
this.focusedDecoration,
this.unFocusedDecoration,
this.focusedForegroundDecoration,
this.unFocusedForegroundDecoration,
this.highlightColor,
this.unfocusedColor,
this.cursorColor,
Expand Down Expand Up @@ -243,13 +247,22 @@ class AutoSuggestBox<T> extends StatefulWidget {
/// The style to use for the text being edited.
final TextStyle? style;

/// Controls the [BoxDecoration] of the box behind the text input.
final BoxDecoration? decoration;
/// Controls the [BoxDecoration] of the box behind the text input when the FocusNode of TextBox is Focused [focusNode.hasFocus == true].
final BoxDecoration? focusedDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input.

/// Controls the [BoxDecoration] of the box behind the text input when the FocusNode of TextBox is UnFocused [focusNode.hasFocus == false].
final BoxDecoration? unFocusedDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input when the FocusNode of TextBox is Focused [focusNode.hasFocus == ture].
///
/// If [highlightColor] is provided, this must not be provided
final BoxDecoration? focusedForegroundDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input when the FocusNode of TextBox is UnFocused [focusNode.hasFocus == false].
///
/// If [highlightColor] is provided, this must not be provided
final BoxDecoration? foregroundDecoration;
final BoxDecoration? unFocusedForegroundDecoration;

/// The highlight color of the text box.
///
Expand Down Expand Up @@ -750,7 +763,8 @@ class AutoSuggestBoxState<T> extends State<AutoSuggestBox<T>> {
onChanged: _onChanged,
onFieldSubmitted: (text) => _onSubmitted(),
style: widget.style,
decoration: widget.decoration,
focusedDecoration: widget.focusedDecoration,
unFocusedDecoration: widget.unFocusedDecoration,
highlightColor: widget.highlightColor,
unfocusedColor: widget.unfocusedColor,
cursorColor: widget.cursorColor,
Expand Down Expand Up @@ -782,8 +796,10 @@ class AutoSuggestBoxState<T> extends State<AutoSuggestBox<T>> {
onChanged: _onChanged,
onSubmitted: (text) => _onSubmitted(),
style: widget.style,
decoration: widget.decoration,
foregroundDecoration: widget.foregroundDecoration,
focusedDecoration: widget.focusedDecoration,
unFocusedDecoration: widget.unFocusedDecoration,
focusedForegroundDecoration: widget.focusedForegroundDecoration,
unFocusedForegroundDecoration: widget.unFocusedForegroundDecoration,
highlightColor: widget.highlightColor,
unfocusedColor: widget.unfocusedColor,
cursorColor: widget.cursorColor,
Expand Down
32 changes: 24 additions & 8 deletions lib/src/controls/form/password_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,28 @@ class PasswordBox extends StatefulWidget {
/// {@macro flutter.widgets.editableText.obscuringCharacter}
final String obscuringCharacter;

/// Controls the [BoxDecoration] of the box behind the text input.
/// Controls the [BoxDecoration] of the box behind the text input when the FocusNode of TextBox is Focused [focusNode.hasFocus == true].
///
/// Defaults to having a rounded rectangle grey border and can be null to have
/// no box decoration.
final BoxDecoration? decoration;
final BoxDecoration? focusedDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input.

/// Controls the [BoxDecoration] of the box behind the text input when the FocusNode of TextBox is UnFocused [focusNode.hasFocus == false].
///
/// Defaults to having a rounded rectangle grey border and can be null to have
/// no box decoration.
final BoxDecoration? unFocusedDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input when the FocusNode of TextBox is Focused [focusNode.hasFocus == true].
///
/// If [highlightColor] is provided, this must not be provided
final BoxDecoration? focusedForegroundDecoration;

/// Controls the [BoxDecoration] of the box in front of the text input when the FocusNode of TextBox is UnFocused [focusNode.hasFocus == false].
///
/// If [highlightColor] is provided, this must not be provided
final BoxDecoration? foregroundDecoration;
final BoxDecoration? unFocusedForegroundDecoration;

/// The highlight color of the text box.
///
Expand Down Expand Up @@ -199,8 +211,10 @@ class PasswordBox extends StatefulWidget {
this.showCursor,
this.readOnly = false,
this.obscuringCharacter = '•',
this.decoration,
this.foregroundDecoration,
this.focusedDecoration,
this.unFocusedDecoration,
this.focusedForegroundDecoration,
this.unFocusedForegroundDecoration,
this.unfocusedColor,
this.highlightColor,
this.keyboardAppearance,
Expand Down Expand Up @@ -374,8 +388,10 @@ class _PasswordBoxState extends State<PasswordBox> {
showCursor: widget.showCursor,
readOnly: widget.readOnly,
obscuringCharacter: widget.obscuringCharacter,
decoration: widget.decoration,
foregroundDecoration: widget.foregroundDecoration,
focusedDecoration: widget.focusedDecoration,
unFocusedDecoration: widget.unFocusedDecoration,
focusedForegroundDecoration: widget.focusedForegroundDecoration,
unFocusedForegroundDecoration: widget.unFocusedForegroundDecoration,
highlightColor: widget.highlightColor,
unfocusedColor: widget.unfocusedColor,
keyboardType: _isVisible ? TextInputType.visiblePassword : null,
Expand Down
Loading