update flutter widgets

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-19 13:39:01 +08:00
parent 1fb798db4e
commit 725d7055bf
80 changed files with 493 additions and 455 deletions

View File

@@ -47,7 +47,11 @@ import 'package:flutter/rendering.dart' hide RenderParagraph;
/// Container(
/// width: 100,
/// decoration: BoxDecoration(border: Border.all()),
/// child: Text(overflow: TextOverflow.ellipsis, 'Hello $_name, how are you?'))
/// child: const Text(
/// 'Hello, how are you?',
/// overflow: TextOverflow.ellipsis,
/// ),
/// )
/// ```
/// {@end-tool}
///
@@ -60,10 +64,11 @@ import 'package:flutter/rendering.dart' hide RenderParagraph;
/// ![If a second line overflows the Text widget displays a horizontal fade](https://flutter.github.io/assets-for-api-docs/assets/widgets/text_fade_max_lines.png)
///
/// ```dart
/// Text(
/// const Text(
/// 'Hello, how are you?',
/// overflow: TextOverflow.fade,
/// maxLines: 1,
/// 'Hello $_name, how are you?')
/// )
/// ```
///
/// Here soft wrapping is enabled and the [Text] widget tries to wrap the words
@@ -74,10 +79,11 @@ import 'package:flutter/rendering.dart' hide RenderParagraph;
/// ![If a single line overflows the Text widget displays a horizontal fade](https://flutter.github.io/assets-for-api-docs/assets/widgets/text_fade_soft_wrap.png)
///
/// ```dart
/// Text(
/// const Text(
/// 'Hello, how are you?',
/// overflow: TextOverflow.fade,
/// softWrap: false,
/// 'Hello $_name, how are you?')
/// )
/// ```
///
/// Here soft wrapping is disabled with `softWrap: false` and the [Text] widget
@@ -410,6 +416,7 @@ class Text extends StatelessWidget {
text: TextSpan(
style: effectiveTextStyle,
text: data,
locale: locale,
children: textSpan != null ? <InlineSpan>[textSpan!] : null,
),
primary: primary,
@@ -442,6 +449,7 @@ class Text extends StatelessWidget {
text: TextSpan(
style: effectiveTextStyle,
text: data,
locale: locale,
children: textSpan != null ? <InlineSpan>[textSpan!] : null,
),
onShowMore: onShowMore,
@@ -1105,7 +1113,7 @@ class _SelectableTextContainerDelegate
bool forwardSelection =
currentSelectionEndIndex >= currentSelectionStartIndex;
if (currentSelectionEndIndex == currentSelectionStartIndex) {
// Determining selection direction is innacurate if currentSelectionStartIndex == currentSelectionEndIndex.
// Determining selection direction is inaccurate if currentSelectionStartIndex == currentSelectionEndIndex.
// Use the range from the selectable within the selection as the source of truth for selection direction.
final SelectedContentRange rangeAtSelectableInSelection =
selectables[currentSelectionStartIndex].getSelection()!;