- 05 Sep, 2023 1 commit
-
-
Polina Cherkasova authored
-
- 07 Aug, 2023 2 commits
-
-
Kate Lovett authored
Fixes https://github.com/flutter/flutter/issues/59413 This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`. The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :) mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
-
Mingyu authored
This is a follow up to the following pull requests: - https://github.com/flutter/flutter/pull/124514 I was finally able to reproduce this bug and found out why it was happening. Consider this code: ```dart GestureDetector( behavior: HitTestBehavior.translucent, // Note: Make sure onTap is not null to ensure events // are captured by `GestureDetector` onTap: () {}, child: _shouldShowSlider ? Slider(value: _value, onChanged: _handleSlide) : const SizedBox.shrink(). ) ``` Runtime exception happens when: 1. User taps and holds the Slider (drag callback captured by `GestureDetector`) 2. `_shouldShowSlider` changes to false, Slider disappears and unmounts, and unregisters `_handleSlide`. But the callback is still registered by `GestureDetector` 3. Users moves finger as if Slider were still there 4. Drag callback is invoked, `_SliderState.showValueIndicator` is called 5. Exception - Slider is already disposed This pull request fixes it by adding a mounted check inside `_SliderState.showValueIndicator` to ensure the Slider is actually mounted at the time of invoking drag event callback. I've added a unit test that will fail without this change. The error stack trace is: ``` The following assertion was thrown while handling a gesture: This widget has been unmounted, so the State no longer has a context (and should be considered defunct). Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active. When the exception was thrown, this was the stack: #0 State.context.<anonymous closure> (package:flutter/src/widgets/framework.dart:950:9) #1 State.context (package:flutter/src/widgets/framework.dart:956:6) #2 _SliderState.showValueIndicator (package:flutter/src/material/slider.dart:968:18) #3 _RenderSlider._startInteraction (package:flutter/src/material/slider.dart:1487:12) #4 _RenderSlider._handleDragStart (package:flutter/src/material/slider.dart:1541:5) #5 DragGestureRecognizer._checkStart.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:531:53) #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24) #7 DragGestureRecognizer._checkStart (package:flutter/src/gestures/monodrag.dart:531:7) #8 DragGestureRecognizer._checkDrag (package:flutter/src/gestures/monodrag.dart:498:5) #9 DragGestureRecognizer.acceptGesture (package:flutter/src/gestures/monodrag.dart:431:7) #10 _CombiningGestureArenaMember.acceptGesture (package:flutter/src/gestures/team.dart:45:14) #11 GestureArenaManager._resolveInFavorOf (package:flutter/src/gestures/arena.dart:281:12) #12 GestureArenaManager._resolve (package:flutter/src/gestures/arena.dart:239:9) #13 GestureArenaEntry.resolve (package:flutter/src/gestures/arena.dart:53:12) #14 _CombiningGestureArenaMember._resolve (package:flutter/src/gestures/team.dart:85:15) #15 _CombiningGestureArenaEntry.resolve (package:flutter/src/gestures/team.dart:19:15) #16 OneSequenceGestureRecognizer.resolve (package:flutter/src/gestures/recognizer.dart:375:13) #17 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:414:13) #18 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12) #19 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9) #20 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13) #21 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18) #22 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7) #23 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19) #24 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22) #25 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:439:11) #26 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7) #27 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5) #28 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7) #29 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9) #30 _invoke1 (dart:ui/hooks.dart:186:13) #31 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:433:7) #32 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31) Handler: "onStart" Recognizer: HorizontalDragGestureRecognizer#a5df2 ``` *List which issues are fixed by this PR. You must list at least one issue.* Internal bug: b/273666179, b/192329942 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
-
- 22 Jun, 2023 1 commit
-
-
Taha Tesser authored
fixes https://github.com/flutter/flutter/issues/129016
-
- 14 Jun, 2023 1 commit
-
-
cruiser-baxter authored
Fixed slider value indicator not disappearing after a bit on desktop platform when slider is clicked not dragged (#128137) In slider.dart within the _startInteraction method and within the below conditional. "if (!_active && !hasFocus && _state.valueIndicatorController.status == AnimationStatus.completed)" **Changed to:** "f (!_active && _state.valueIndicatorController.status == AnimationStatus.completed)" This allows the value indicator to disappear after a bit when clicked instead of dragged on Desktop platform. I also added a test in slider_test.dart to detect the bug if it ever returns. Fixes https://github.com/flutter/flutter/issues/123313
-
- 13 Jun, 2023 1 commit
-
-
Qun Cheng authored
Updates most of the unit tests in the packages/flutter/test/material folder so that they'll pass if ThemeData.useMaterial3 defaults to true. All of the tests have wired useMaterial3 to false and will need to be updated with a M3 version. related to #127064
-
- 30 May, 2023 1 commit
-
-
Taha Tesser authored
fixes https://github.com/flutter/flutter/issues/127795
-
- 24 May, 2023 1 commit
-
-
Devin authored
fixes https://github.com/flutter/flutter/issues/123315 -------- This PR makes changes to the _actionHandler function used on the Slider.Dart Widget for Key Events. It ensures onChangeStart is called at the beginning of a Key Event and onChangeEnd at the end of one. This PR includes a test for the changes made. I ran all existing tests after my changes were made and they passed.
-
- 11 May, 2023 1 commit
-
-
Qun Cheng authored
Fixes #122250. This PR is to make sure all the MaterialStateProperty defaults are able to correctly resolve different states. * When a widget is pressed, it is also hovered, so we need to put the `MaterialState.pressed` check before `MaterialState.hovered`. * When a widget is focused, the widget should still be able to be hovered, so we should check `MaterialState.hovered` before `MaterialState.focused`. * There are also cases like in _InputDecoratorDefaultsM3, the `MaterialState.disabled` should be checked before `MaterialState.error`. the order should be disabled, (error), pressed, hovered, focused.
-
- 01 May, 2023 1 commit
-
-
Viren Khatri authored
design doc: https://docs.flutter.dev/go/permissible-slider-interaction closes #113370 open questions: - No, as `SliderInteraction.none` doesn't exist anymore. - Yes (done) - Yes. - SliderInteraction - SliderAction - Slider.allowedInteraction - Slider.permissibleInteraction - Slider.interaction - Slider.allowedAction - Slider.permittedAction
-
- 23 Feb, 2023 1 commit
-
-
Lioness100 authored
* Fix typos * lowercase animated & opacity * Undo typo fix --------- Co-authored-by:
Michael Goderbauer <goderbauer@google.com>
-
- 13 Feb, 2023 1 commit
-
-
xubaolin authored
* fix a Slider theme update bug * Code review feedback
-
- 19 Jan, 2023 1 commit
-
-
Mingyu authored
* Check whether slider is unmounted before interaction * Update slider.dart * Update Slider * Add test * Update slider_test.dart * Update packages/flutter/test/material/slider_test.dart Co-authored-by:
Taha Tesser <tessertaha@gmail.com> Co-authored-by:
Taha Tesser <tessertaha@gmail.com>
-
- 30 Nov, 2022 2 commits
-
-
Casey Hillers authored
This reverts commit 8473da22.
-
Taha Tesser authored
-
- 02 Nov, 2022 1 commit
-
-
Taha Tesser authored
-
- 31 Oct, 2022 1 commit
-
-
Greg Spencer authored
-
- 25 Oct, 2022 1 commit
-
-
Taha Tesser authored
-
- 06 Oct, 2022 1 commit
-
-
Taha Tesser authored
-
- 28 Aug, 2022 1 commit
-
-
Akshdeep Singh authored
-
- 06 Jun, 2022 1 commit
-
-
Jonah Williams authored
-
- 25 May, 2022 2 commits
-
-
xubaolin authored
Fixes #103965
-
Pierre-Louis authored
* Use `curly_braces_in_flow_control_structures` for `material` * include test/material * add back removed comments
-
- 20 May, 2022 1 commit
-
-
Tong Mu authored
-
- 12 May, 2022 1 commit
-
-
Jonah Williams authored
-
- 07 May, 2022 1 commit
-
-
Eric egramond authored
Updating the Slider Widget to allow up and down arrow keys to navigate out of the slider when in directional NavigationMode. (#103149)
-
- 26 Apr, 2022 2 commits
-
-
Jonah Williams authored
-
xubaolin authored
-
- 03 Feb, 2022 1 commit
-
-
Ian Hickson authored
-
- 14 Jan, 2022 1 commit
-
-
Hans Muller authored
-
- 15 Dec, 2021 1 commit
-
-
Chris Bracken authored
Microsoft Active Accessibility (MSAA) does not include increment/decrement keyboard shortcuts for manipulating sliders and other similar controls. To make up for this, we give the slider keyboard focus when it gains accessibility focus so that the user can use the arrow keys to manipulate the slider. Issue: https://github.com/flutter/flutter/issues/77838
-
- 04 Dec, 2021 1 commit
-
-
Ian Hickson authored
-
- 08 Oct, 2021 3 commits
-
-
Ian Hickson authored
-
Zachary Anderson authored
This reverts commit 5fd259be.
-
Ian Hickson authored
-
- 20 Jul, 2021 1 commit
-
-
nt4f04uNd authored
-
- 15 Jul, 2021 1 commit
-
- 14 Jul, 2021 3 commits
-
-
Ian Hickson authored
-
Zachary Anderson authored
This reverts commit 31de052e.
-
Ian Hickson authored
-