1. 13 Mar, 2024 4 commits
    • Victoria Ashworth's avatar
      Set cacheExtent for SliverFillRemaining widget (#143612) · 825e901e
      Victoria Ashworth authored
      When a Sliver with items is outside of the Viewport, but within the Viewport's `cacheExtent`, the framework should create SemanticNodes for the items even though they are out of view. However, for this to work, the Sliver's geometry must have a `cacheExtent` (how much space the sliver took up of the Viewport's `cacheExtent`) greater than 0, otherwise it is [excluded](https://github.com/flutter/flutter/blob/f01ce9f4cb41beff7b85122b5fcf1228bb655a87/packages/flutter/lib/src/rendering/viewport.dart#L311-L315).
      
      `SliverFillRemaining` widgets that fall outside the viewport did not have this set and therefore were being excluded when SemanticNodes were created, even if they were within the Viewport's `cacheExtent`. This PR sets the `cacheExtent` for `SliverFillRemaining` widgets.
      
      In addition, `RenderSliverFillRemainingWithScrollable` would get dropped from the semantic tree because it's child had a size of 0 when outside the remaining paint extent. To fix, we give the child a `maxExtent` of the sliver's `cacheExtent` if it's outside the remaining paint extent but within the viewport's cacheExtent.
      
      Fixes https://github.com/flutter/flutter/issues/142065.
      
      Definitions:
      * `RenderViewport.cacheExtent`:
        ```dart
        /// The viewport has an area before and after the visible area to cache items
        /// that are about to become visible when the user scrolls.
        ///
        /// Items that fall in this cache area are laid out even though they are not
        /// (yet) visible on screen. The [cacheExtent] describes how many pixels
        /// the cache area extends before the leading edge and after the trailing edge
        /// of the viewport.
        ///
        /// The total extent, which the viewport will try to cover with children, is
        /// [cacheExtent] before the leading edge + extent of the main axis +
        /// [cacheExtent] after the trailing edge.
        ///
        /// The cache area is also used to implement implicit accessibility scrolling
        /// on iOS: When the accessibility focus moves from an item in the visible
        /// viewport to an invisible item in the cache area, the framework will bring
        /// that item into view with an (implicit) scroll action.
        ```
      * `SliverGeometry.cacheExtent`:
        ```dart
        /// How many pixels the sliver has consumed in the
        /// [SliverConstraints.remainingCacheExtent].
        ```
      * `SliverContraints.remainingCacheExtent`:
        ```dart
        /// Describes how much content the sliver should provide starting from the
        /// [cacheOrigin].
        ///
        /// Not all content in the [remainingCacheExtent] will be visible as some
        /// of it might fall into the cache area of the viewport.
        ///
        /// Each sliver should start laying out content at the [cacheOrigin] and
        /// try to provide as much content as the [remainingCacheExtent] allows.
        ```
      825e901e
    • Qun Cheng's avatar
      Remove `showTrackOnHover` from `Scrollbar` and `ScrollbarTheme` (#144180) · 1ccad1a2
      Qun Cheng authored
      This PR is to remove deprecated `Scrollbar.showTrackOnHover` and `ScrollbarThemeData.showTrackOnHover`.
      
      These parameters are made obsolete in https://github.com/flutter/flutter/pull/111706.
      Part of https://github.com/flutter/flutter/issues/143956
      1ccad1a2
    • Bruno Leroux's avatar
      InputDecorator M3 tests migration - Step5 - Helper/Counter/Error (#144932) · 34b454f4
      Bruno Leroux authored
      ## Description
      
      This PR migrates `InputDecorator` helper/counter/error related tests to M3 and adds some missing tests.
      
      It is the fifth step for the M3 test migration for `InputDecorator`.
      Step 1: https://github.com/flutter/flutter/pull/142981
      Step 2: https://github.com/flutter/flutter/pull/143369
      Step 3: https://github.com/flutter/flutter/pull/143520
      Step 4: https://github.com/flutter/flutter/pull/144169
      
      ## Related Issue
      
      Related to https://github.com/flutter/flutter/issues/139076
      fixes https://github.com/flutter/flutter/issues/138213
      34b454f4
    • xubaolin's avatar
      [New feature]Introduce iOS multi-touch drag behavior (#141355) · c83237f3
      xubaolin authored
      Fixes #38926
      
      This patch implements the iOS behavior pointed out by @dkwingsmt at #38926 , which is also consistent with the performance of my settings application on the iPhone.
      
      ### iOS behavior (horizontal or vertical drag)
      
      ## Algorithm
      When dragging: delta(combined) = max(i of n that are positive) delta(i) - max(i of n that are negative) delta(i)
      It means that, if two fingers are moving +50 and +10 respectively, it will move +50; if they're moving at +50 and -10 respectively, it will move +40.
      
      ~~TODO~~
      ~~Write some test cases~~
      c83237f3
  2. 12 Mar, 2024 3 commits
  3. 11 Mar, 2024 2 commits
  4. 09 Mar, 2024 2 commits
  5. 08 Mar, 2024 1 commit
    • Mitchell Goodwin's avatar
      Fixes the transition builder changing the Cupertino transition on Android. (#134790) · 2be5084b
      Mitchell Goodwin authored
      Fixes #124850.
      
      Changes the fallback for the builder on Android. Before the error was from the platform being changed mid Cupertino transition to iOS. If a default builder wasn't set for iOS (which a developer developing only for Android might not), then it defaulted to the Zoom transition. Which changing the transition while on the fly caused issues.
      2be5084b
  6. 07 Mar, 2024 3 commits
    • Faisal Ansari's avatar
      Fixed -> DropdownMenu throws exception when it is in any scrollable l… (#140566) · 874804e5
      Faisal Ansari authored
      Fixed -> DropdownMenu throws exception when it is in any scrollable list view and scrolls quickly #139871
      874804e5
    • Bruno Leroux's avatar
      [flutter_test] Change KeyEventSimulator default transit mode (#143847) · 8ade81fb
      Bruno Leroux authored
      ## Description
      
      This PRs changes the default value transit mode for key event simulation.
      
      The default transit mode for key event simulation is currently `KeyDataTransitMode.rawKeyData` while on the framework side `KeyDataTransitMode.keyDataThenRawKeyData` is the preferred transit mode.
      
      `KeyDataTransitMode.keyDataThenRawKeyData` is more accurate and can help detect issues.
      
      For instance the following test will fail with `KeyDataTransitMode.rawKeyData` because raw keyboard logic for modifier keys is less accurate:
      
      ```dart
        testWidgets('Press control left once', (WidgetTester tester) async {
          debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.keyDataThenRawKeyData;
      
          final List<KeyEvent> events = <KeyEvent>[];
          final FocusNode focusNode = FocusNode();
          addTearDown(focusNode.dispose);
      
          await tester.pumpWidget(
            Focus(
              focusNode: focusNode,
              autofocus: true,
              onKeyEvent: (_, KeyEvent event) {
                events.add(event);
                return KeyEventResult.handled;
              },
              child: Container(),
            ),
          );
      
          await simulateKeyDownEvent(LogicalKeyboardKey.controlLeft);
      
          // This will fail when transit mode is KeyDataTransitMode.rawKeyData
          // because a down event for controlRight is synthesized.
          expect(events.length, 1);
      
          debugKeyEventSimulatorTransitModeOverride = null;
        });
      ```
      
      And the following this test is ok with `KeyDataTransitMode.rawKeyData` but rightly fails with `KeyDataTransitMode.keyDataThenRawKeyData`:
      
      ```dart
        testWidgets('Simulates consecutive key down events', (WidgetTester tester) async {
          debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.rawKeyData;
      
          // Simulating several key down events without key up in between is tolerated
          // when transit mode is KeyDataTransitMode.rawKeyData, it will trigger an
          // assert on KeyDataTransitMode.keyDataThenRawKeyData.
          await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
          await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
      
          debugKeyEventSimulatorTransitModeOverride = null;
        });
      ```
      
      ## Related Issue
      
      Related to https://github.com/flutter/flutter/issues/143845
      
      ## Tests
      
      Adds two tests.
      8ade81fb
    • Valentin Vignal's avatar
  7. 06 Mar, 2024 2 commits
  8. 05 Mar, 2024 4 commits
  9. 04 Mar, 2024 2 commits
  10. 01 Mar, 2024 4 commits
  11. 29 Feb, 2024 7 commits
  12. 28 Feb, 2024 5 commits
  13. 27 Feb, 2024 1 commit