-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'faeture/refactor-library' of https://github.com/forus-l…
…abs/forui into faeture/refactor-library
- Loading branch information
Showing
12 changed files
with
135 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
/// Creates a default text style that overrides the text styles in scope at | ||
/// this point in the widget tree. | ||
/// | ||
/// The given [style] is merged with the [style] from the default text style | ||
/// for the [BuildContext] where the widget is inserted, and any of the other | ||
/// arguments that are not null replace the corresponding properties on that | ||
/// same default text style. | ||
/// | ||
/// This constructor cannot be used to override the [maxLines] property of the | ||
/// ancestor with the value null, since null here is used to mean "defer to | ||
/// ancestor". To replace a non-null [maxLines] from an ancestor with the null | ||
/// value (to remove the restriction on number of lines), manually obtain the | ||
/// ambient [DefaultTextStyle] using [DefaultTextStyle.of], then create a new | ||
/// [DefaultTextStyle] using the [DefaultTextStyle.new] constructor directly. | ||
/// See the source below for an example of how to do this (since that's | ||
/// essentially what this constructor does). | ||
Widget merge({ | ||
required Widget child, | ||
Key? key, | ||
TextStyle? style, | ||
TextAlign? textAlign, | ||
bool? softWrap, | ||
TextOverflow? overflow, | ||
int? maxLines, | ||
TextWidthBasis? textWidthBasis, | ||
TextHeightBehavior? textHeightBehavior, | ||
}) => | ||
Builder( | ||
builder: (context) { | ||
final DefaultTextStyle parent = DefaultTextStyle.of(context); | ||
return DefaultTextStyle( | ||
key: key, | ||
style: parent.style.merge(style), | ||
textAlign: textAlign ?? parent.textAlign, | ||
softWrap: softWrap ?? parent.softWrap, | ||
overflow: overflow ?? parent.overflow, | ||
maxLines: maxLines ?? parent.maxLines, | ||
textWidthBasis: textWidthBasis ?? parent.textWidthBasis, | ||
textHeightBehavior: textHeightBehavior ?? parent.textHeightBehavior, | ||
child: child, | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/// {@category Widgets} | ||
/// | ||
/// A Scaffold. | ||
/// A scaffold. | ||
library forui.widgets.scaffold; | ||
|
||
export '../src/widgets/scaffold.dart'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters