- 22 Feb, 2024 7 commits
-
-
Qun Cheng authored
Reverts flutter/flutter#138521
-
dsanagustin authored
Adds a localized Close Button tooltip to the 'X' Button on a SnackBar, making it readable by screen readers. Github Issue #143793 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
-
Martin Kustermann authored
-
LongCatIsLooong authored
Fixes an issue where if the `TextSpan` doesn't have a text style, the specified strutStyle is not applied. Additionally, adds a migration flag for https://github.com/flutter/engine/pull/50385, for internal golden changes. It's only going to exist for a week.
-
Kostia Sokolovskyi authored
Contributes to https://github.com/flutter/flutter/issues/141198 ### Description - Adds `CurvedAnimation` disposals to `material/chip.dart`, `material/input_decorator.dart`, `material/toggleable.dart`, `widgets/animated_switcher.dart`, `widgets/overscroll_indicator.dart`.
-
Andrew authored
Fixes a small documentation typo.
-
Kate Lovett authored
My RenderSliverMultiBoxAdaptor/RenderSliverFixedExtentList/RenderSliverVariedExtentList yak shave continues. I've been subclassing RenderSliverVariedExtentList for SliverTree and have found some opportunities for clean up. There is a larger clean up I'd like to do, but this week SliverTree comes first. I noticed these methods were getting repeated ð, and I was about to repeat them again ð for the tree, so I figured bumping them up to the base class was better than continuing to copy-paste the same methods.
-
- 21 Feb, 2024 6 commits
-
-
Kate Lovett authored
Multiple methods in `RenderSliverFixedExtentBoxAdaptor` pass a `double itemExtent` for computing things like what children will be laid out, what the max scroll offset will be, and how the children will be laid out. Since `RenderSliverFixedExtentBoxAdaptor` was further subclassed to support a `itemExtentBuider` in `RenderSliverVariedExtentList`, these itemExtent parameters became useless when using that RenderObject. Reading through `RenderSliverFixedExtentBoxAdaptor.performLayout`, the remaining artifacts of passing around itemExtent make it hard to follow when it is irrelevant. `RenderSliverFixedExtentBoxAdaptor.itemExtent` is available from these methods, so it does not need to pass it. It is redundant API. Plus, if a bogus itemExtent is passed for some reason, errors will ensue and the layout will be incorrect. ð£ ð¥ Deprecating so we can remove these for a cleaner API. Unfortunately this is not supported by dart fix, but the fact that these methods are protected means usage outside of the framework is likely minimal.
-
Taha Tesser authored
fixes [`hourMinuteTextStyle` Material 3 default doesn't match the specs](https://github.com/flutter/flutter/issues/143748) This updates `hourMinuteTextStyle` defaults to match Material 3 specs. `hourMinuteTextStyle` should use different font style for different entry modes based on the specs. ### Specs   ### Before ```dart return _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states)); ``` ### After ```dart return entryMode == TimePickerEntryMode.dial ? _textTheme.displayLarge!.copyWith(color: _hourMinuteTextColor.resolve(states)) : _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states)); ```
-
Taha Tesser authored
fixes [Screen reader is not announcing the selected date as selected on DatePicker](https://github.com/flutter/flutter/issues/143439) ### Descriptions - This fixes an issue where `CalendarDatePicker` doesn't announce selected date on desktop. - Add semantic label to describe the selected date is indeed "Selected". ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override MyHomePageState createState() => MyHomePageState(); } class MyHomePageState extends State<MyHomePage> { void _showDatePicker() async { await showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime(1900), lastDate: DateTime(2200), ); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title, style: const TextStyle(fontFamily: 'ProductSans')), ), body: const Center( child: Text('Click the button to show date picker.'), ), floatingActionButton: FloatingActionButton( onPressed: _showDatePicker, tooltip: 'Show date picker', child: const Icon(Icons.edit_calendar), ), ); } } // import 'package:flutter/material.dart'; // void main() => runApp(const MyApp()); // class MyApp extends StatelessWidget { // const MyApp({super.key}); // @override // Widget build(BuildContext context) { // return MaterialApp( // debugShowCheckedModeBanner: false, // home: Scaffold( // body: Center( // child: CalendarDatePicker( // initialDate: DateTime.now(), // firstDate: DateTime(2020), // lastDate: DateTime(2050), // onDateChanged: (date) { // print(date); // }, // ), // ), // ), // ); // } // } ``` </details> ### Before https://github.com/flutter/flutter/assets/48603081/c82e1f15-f067-4865-8a5a-1f3c0c8d91da ### After https://github.com/flutter/flutter/assets/48603081/193d9e26-df9e-4d89-97ce-265c3d564607
-
Taha Tesser authored
Add `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle` for Material 3 Time Picker (#143739) fixes [`Time selector separator` in TimePicker is not centered vertically](https://github.com/flutter/flutter/issues/143691) Separator currently `hourMinuteTextStyle` to style itself. This introduces `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle` from Material 3 specs to correctly style the separator. This also adds ability to change separator color without changing `hourMinuteTextColor`. ### Specs for the time selector separator https://m3.material.io/components/time-pickers/specs  ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() { runApp(const App()); } class App extends StatelessWidget { const App({super.key}); @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( // timePickerTheme: TimePickerThemeData( // hourMinuteTextColor: Colors.amber, // ) ), home: Scaffold( body: Center( child: Builder(builder: (context) { return ElevatedButton( onPressed: () async { await showTimePicker( context: context, initialTime: TimeOfDay.now(), ); }, child: const Text('Pick Time'), ); }), ), ), ); } } ``` </details> | Before | After | | --------------- | --------------- | | <img src="https://github.com/flutter/flutter/assets/48603081/20beeba4-5cc2-49ee-bba8-1c552c0d1e44" /> | <img src="https://github.com/flutter/flutter/assets/48603081/24927187-aff7-4191-930c-bceab6a4b4c2" /> |
-
Simon Friis Vindum authored
This PR fixes #142885. The issue is that in `_RepeatingSimulation` the initial time is calculated as follows: ``` (initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond) ``` This calculation does not work in general. For instance, if `max` is 300, `min` is 100, and `initialValue` is 100 then `initialValue / (max - min)` is 1/2 when it should be 0 The current tests work by happenstance because the numbers used happen to work. To reveal the bug I've added some more tests similar to the existing ones but with different numbers. A "side-effect" of the incorrect calculation is that if `initialValue` is 0, then the animation will always start from `min` no matter what. For instance, in one of the tests, an `AnimationController` with the value 0 is told to `repeat` between 0.5 and 1.0, and this starts the animation from 0.5. To preserve this behavior, and to more generally handle the case where the initial value is out of bounds, this PR clamps the initial value to be within the lower and upper bounds of the repetition. Just for reference, this calculation was introduced at https://github.com/flutter/flutter/pull/25125.
-
auto-submit[bot] authored
Reverts "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (#143801) Reverts flutter/flutter#143281 Initiated by: LongCatIsLooong Reason for reverting: https://github.com/flutter/flutter/issues/143797 Original PR Author: LongCatIsLooong Reviewed By: {justinmc, jason-simmons} This change reverts the following previous change: Original Description: The behavior largely remains the same, except: 1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. And it makes the navigation order consistent for `aA\naA`: ``` |aA => aA| => aA| => aA => aA => aA aA aA aA |aA aA| aA| (1) (2) (3) (4) (5) (6) ``` This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). But logical order navigation will always be confusing in bidi text, in one way or another. Interestingly there are 3 different behaviors I've observed in chrome: - the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and - its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). - On the other hand, its (new) omnibar seems to use visual order arrow navigation Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424. ## Internal Tests This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
-
- 20 Feb, 2024 9 commits
-
-
LongCatIsLooong authored
Unblocks https://github.com/flutter/tests/pull/345 Add `bulkApply: false` to partial fixes so they don't automatically get applied on registered tests.
-
Nate authored
Previously we merged #142930, to solve issue #87061. Since then, I discovered that the keyboard input wasn't being captured after the app had been paused and resumed. After some digging, I realized that the problem was due to [a line in editable_text.dart](https://github.com/flutter/flutter/blob/d4b1b6e744ba6196e14fb49904f07a4aea4d5869/packages/flutter/lib/src/widgets/editable_text.dart#L3589) that called the `focusNode.consumeKeyboardToken()` method. Luckily, it's a very easy fix: we just use `requestFocus()` instead of `applyFocusChangesIfNeeded()`. @gspencergoog could you take a look when you have a chance?
-
xubaolin authored
Fixes https://github.com/flutter/flutter/issues/138912 Change `ItemExtentBuilder`'s return value nullable, it should return null if asked to build an item extent with a greater index than exists.
-
Nate authored
This PR is the 9áµÊ° step in the journey to solve issue #136139 and make the entire Flutter repo more readable. (previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793, #143293, #143496) I did a pass through all of `packages/flutter/lib/src/` and found an abundance of `switch` statements to improve. Whereas #143496 focused on in-depth refactoring, this PR is full of simple, straightforward changes. (I ended up making some more complicated changes in `rendering/` and will file those separately after this PR is done.)
-
LongCatIsLooong authored
The behavior largely remains the same, except: 1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. And it makes the navigation order consistent for `aA\naA`: ``` |aA => aA| => aA| => aA => aA => aA aA aA aA |aA aA| aA| (1) (2) (3) (4) (5) (6) ``` This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). But logical order navigation will always be confusing in bidi text, in one way or another. Interestingly there are 3 different behaviors I've observed in chrome: - the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and - its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). - On the other hand, its (new) omnibar seems to use visual order arrow navigation Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424. ## Internal Tests This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
-
Polina Cherkasova authored
-
Qun Cheng authored
This PR is to introduce 19 new color roles and deprecate 3 color roles in `ColorScheme`. **Tone-based surface colors** (7 colors): * surfaceBright * surfaceDim * surfaceContainer * surfaceContainerLowest * surfaceContainerLow * surfaceContainerHigh * surfaceContainerHighest **Accent color add-ons** (12 colors): * primary/secondary/tertiary-Fixed * primary/secondary/tertiary-FixedDim * onPrimary/onSecondary/onTertiary-Fixed * onPrimary/onSecondary/onTertiary-FixedVariant **Deprecated colors**: * background -> replaced with surface * onBackground -> replaced with onSurface * surfaceVariant -> replaced with surfaceContainerHighest Please checkout this [design doc](https://docs.google.com/document/d/1ODqivpM_6c490T4j5XIiWCDKo5YqHy78YEFqDm4S8h4/edit?usp=sharing) for more information:) 
-
Greg Price authored
Improves the docs around horizontal alignment of text, due to several issues expressing confusion about this topic.
-
Greg Price authored
This follows up on #143452, to slightly further address #95978. The double- rather than triple-slash on the blank line caused it to be ignored by dartdoc, so that the two paragraphs it's intended to separate were getting joined as one paragraph instead. Also expand this constructor's summary line slightly to mention its distinctive feature compared with the other constructor, and make other small fixes that I noticed in other docs on this class.
-
- 18 Feb, 2024 2 commits
- 17 Feb, 2024 1 commit
-
-
Bruno Leroux authored
## Description This PR updates the `InputDecoration.contentPadding` documentation to detail both Material 3 and Material 2 default values. ## Related Issue Follow-up to https://github.com/flutter/flutter/pull/142981. ## Tests Documentation only.
-
- 16 Feb, 2024 5 commits
-
-
LongCatIsLooong authored
Fixes https://github.com/flutter/flutter/issues/79495 This is basically a reland of https://github.com/flutter/flutter/pull/79607. Currently when the cursor is invalid, arrow key navigation / typing / backspacing doesn't work since the cursor position is unknown. Showing the cursor when the selection is invalid gives the user the wrong information about the current insert point in the text. This is going to break internal golden tests.
-
Tirth authored
Added Missing Field Name in Doc Comment in SnackBarThemeData.
-
Nate authored
This PR is the 8áµÊ° step in the journey to solve issue #136139 and make the entire Flutter repo more readable. (previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793, #143293) I did a pass through all of `packages/flutter/lib/src/` and found a whole bunch of `switch` statements to improve: most of them were really simple, but many involved some thorough refactoring. This pull request is just the complicated stuff. ð I'll make comments to describe the changes, and then in the future there will be another PR (and it'll be much easier to review than this one).
-
Taha Tesser authored
fixes [Calling `setState` in a `MaterialStatesController` listener and `MaterialStateController.update` causes Exception](https://github.com/flutter/flutter/issues/138986) ### Description `MaterialStatesController` listener calls `setState` during build when `MaterialStatesController.update` listener calls `notifyListeners`. I tried fixing this issue by putting `notifyListeners` in a post-frame callback. However, this breaks existing customer tests (particularly super editor tests). A safer approach would be to document that the listener's `setState` call should be in a post-frame callback to delay it and not call this during the build phase triggered by the `MaterialStatesController.update` in the widgets such as InkWell or buttons.
-
Taha Tesser authored
fixes [[`DataTable`] Data row does not respond to `MaterialState.hovered`](https://github.com/flutter/flutter/issues/138968)
-
- 15 Feb, 2024 1 commit
-
-
Jake authored
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
-
- 14 Feb, 2024 6 commits
-
-
auto-submit[bot] authored
Reverts flutter/flutter#143334 Initiated by: hangyujin Reason for reverting: broke g3 tests Original PR Author: hangyujin Reviewed By: {LongCatIsLooong} This change reverts the following previous change: Original Description: Add a semantics flag to text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`) internal: b/322345393
-
auto-submit[bot] authored
Reverts flutter/flutter#143117 Initiated by: dnfield Reason for reverting: made the tree red. Original PR Author: hangyujin Reviewed By: {QuncCccccc} This change reverts the following previous change: Original Description: fixes: https://github.com/flutter/flutter/issues/143116 fixes: https://github.com/flutter/flutter/issues/141992 https://b.corp.google.com/issues/322173632
-
hangyu authored
fixes: [DatePicker edit field](https://github.com/flutter/flutter/issues/143116) https://b.corp.google.com/issues/322173632
-
Michael Goderbauer authored
Follow-up to https://github.com/flutter/flutter/pull/143347.
-
Qun Cheng authored
Fixes #142895 With the change of #143121, this PR is to add auto scroll to `PopupMenuButton` so when we open the menu, it will automatically scroll to the selected item. https://github.com/flutter/flutter/assets/36861262/c2bc0395-0641-4e7a-a54d-57a8e62ee26f
-
Bruno Leroux authored
## Description This PR adds more documentation for `TextEditingController(String text)` constructor and it adds one example. https://github.com/flutter/flutter/pull/96245 was a first improvement to the documentation. https://github.com/flutter/flutter/issues/79495 tried to hide the cursor when an invalid selection is set but it was reverted. https://github.com/flutter/flutter/pull/123777 mitigated the issue of having a default invalid selection: it takes care of setting a proper selection when a text field is focused and its controller selection is not initialized. I will try changing the initial selection in another PR, but It will probably break several existing tests. ## Related Issue Fixes https://github.com/flutter/flutter/issues/95978 ## Tests Adds 1 test for the new example.
-
- 13 Feb, 2024 3 commits
-
-
Nate authored
fixes #87061 It doesn't matter whether I'm using Google Chrome, VS Code, Discord, or a Terminal window: any time a text cursor is blinking, it means that the characters I type will show up there. And this isn't limited to text fields: if I repeatedly press `Tab` to navigate through a website, there's a visual indicator that goes away if I click away from the window, and it comes back if I click or `Alt+Tab` back into it. <details open> <summary>Example (Chrome):</summary>  </details> <details open> <summary>This PR adds the same functionality to Flutter apps:</summary>  </details>
-
Loïc Sharma authored
Adds some missing spaces, rewords some errors, and splits some errors into more lines.
-
hangyu authored
Add a semantics flag to text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`) internal: b/322345393
-