- 28 Feb, 2024 1 commit
-
-
Qun Cheng authored
-
- 27 Feb, 2024 2 commits
-
-
auto-submit[bot] authored
Reverts "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2 (#144001)" (#144262) Reverts flutter/flutter#144001 Initiated by: Piinks Reason for reverting: Failing goldens at the tip of tree Original PR Author: QuncCccccc Reviewed By: {HansMuller} This change reverts the following previous change: Original Description: Reverts flutter/flutter#143973 This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958.
-
Qun Cheng authored
Reverts flutter/flutter#143973 This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958.
-
- 22 Feb, 2024 1 commit
-
-
Qun Cheng authored
Reverts flutter/flutter#138521
-
- 20 Feb, 2024 1 commit
-
-
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:) ![Screenshot 2024-01-08 at 4 56 51â¯PM](https://github.com/flutter/flutter/assets/36861262/353cdb4c-6ba9-4435-a518-fd3f67e415f0)
-
- 14 Feb, 2024 2 commits
-
-
Michael Goderbauer authored
Follow-up to https://github.com/flutter/flutter/pull/143347.
-
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.
-
- 25 Jan, 2024 1 commit
-
-
Justin McCandless authored
Attempting to help users understand how to build a confirmation dialog when exiting a route.
-
- 12 Jan, 2024 1 commit
-
-
Anis Alibegić authored
Fair amount of typos spotted and fixed. Some of them are in comments, some of them are in code and some of them are in nondart files. There is no need for issues since it's a typo fix. I have doubts about [packages/flutter_tools/lib/src/ios/core_devices.dart](https://github.com/flutter/flutter/compare/master...anisalibegic:flutter:master#diff-fdbc1496b4bbe7e2b445a567fd385677af861c0093774e3d8cc460fdd5b794fa), I have a feeling it might broke some things on the other end, even though it's a typo.
-
- 09 Jan, 2024 1 commit
-
-
Taha Tesser authored
fixes [`RouteObserver` example throws an error](https://github.com/flutter/flutter/issues/141078) ### Description This updates the `RouteObserver` example from snippet to Dartpad example and fixes the error when running the code snippet
-
- 11 Dec, 2023 2 commits
-
-
Nate authored
Thanks so much for approving the previous PR (#139048) a couple weeks ago! This one is the same, except it's covering files in `examples/` and `packages/flutter/lib/src/animation/`. (solving issue #136139)
-
Greg Spencer authored
## Description This starts the deprecation of the `RawKeyEvent`/`RawKeyboard` event system that has been replaced by the `KeyEvent`/`HardwareKeyboard` event system. Migration guide is available here: https://docs.flutter.dev/release/breaking-changes/key-event-migration ## Related Issues - https://github.com/flutter/flutter/issues/136419 ## Related PRs - https://github.com/flutter/website/pull/9889
-
- 17 Nov, 2023 1 commit
-
-
Parker Lougheed authored
Issue reference: https://github.com/flutter/flutter/issues/133877
-
- 13 Nov, 2023 1 commit
-
-
huycozy authored
### Description This PR intends to update `DraggableScrollableSheet` docs for Web and Desktop platforms. On these platforms, the vertical dragging gesture does not provide natural behavior similar to other desktop applications. By adding a note before the sample code so users are aware that the sample code will not work as expected on Desktop and Web. Also, refer to the instructions if they still want to implement it on these platforms. ### Related issue Fixes https://github.com/flutter/flutter/issues/111372
-
- 10 Nov, 2023 1 commit
-
-
Chinmoy authored
This PR deprecates `onWillAccept` and `onAccept` over `onWillAcceptWithDetails` and `onAcceptWithDetails`. Fixes: #133347
-
- 18 Oct, 2023 1 commit
-
-
Gildásio Filho authored
The documentation for using `findChildIndexCallback` recommends using `indexOf`, but that causes [this line](https://github.com/flutter/flutter/blob/05259ca938c9ea27aa551048b690d5a06371a6c0/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart#L259) to throw in debug mode, and when using `SliverList`, it breaks the render. This PR changes the usage to check if the index is not negative before using it, and changes to return `null` instead if the child wasn't able to be found. There's the related issue #107123, but this doesn't actually fix it. ----- This PR has been updated to add the snippets that were used in the `findChildIndexCallback` comment as examples with proper tests, as well as updating the comment to reference the new examples.
-
- 14 Oct, 2023 1 commit
-
-
Greg Spencer authored
## Description This converts some usages of `RawKeyEvent` to `KeyEvent` to prepare the repo for deprecation of `RawKeyEvent`, and swaps out the `raw_keyboard.dart` manual test for `hardware_keyboard.dart`. ## Related Issues - https://github.com/flutter/flutter/issues/136419 ## Tests - Just refactoring code, no semantic changes.
-
- 12 Oct, 2023 1 commit
-
-
huycozy authored
### Description This PR aims to improve/fix the PageView API doc sample for Web and Desktop platforms. On these platforms, mouse dragging gestures do not provide natural behavior similar to other desktop applications. This PR will add navigation buttons (indicators) so users can interact with the demo. ### Related issue Fixes https://github.com/flutter/flutter/issues/135188 ### Demo video https://github.com/flutter/flutter/assets/104349824/0f9c60bd-8b18-404e-b5b6-1d594604de31
-
- 20 Sep, 2023 1 commit
-
-
Michael Goderbauer authored
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
-
- 18 Sep, 2023 1 commit
-
-
Xilai Zhang authored
Reverts flutter/flutter#125927 context: b/300804374 Looks like a g3 fix might involve changing the names of widget on the customer app, and I am not sure if that would be the right approach forward. Putting up a revert to be safe for now.
-
- 14 Sep, 2023 1 commit
-
-
Justin McCandless authored
New LinkedText widget and TextLinker class for easily adding hyperlinks to text.
-
- 31 Aug, 2023 1 commit
-
-
Kate Lovett authored
Fixes https://github.com/flutter/flutter/issues/133402 On web `1 << 32` crashes, 31 is the maximum.
-
- 25 Aug, 2023 2 commits
-
-
gmilou authored
-
Tomasz Gucio authored
-
- 17 Aug, 2023 1 commit
-
-
Justin McCandless authored
Root predictive back (https://github.com/flutter/flutter/pull/120385) was reverted in https://github.com/flutter/flutter/pull/132167. This PR is an attempt to reland it. The reversion happened due to failed Google tests (b/295073110).
-
- 10 Aug, 2023 1 commit
-
-
Ian Hickson authored
-
- 08 Aug, 2023 1 commit
-
-
Jesús S Guerrero authored
Breaking google testing revert of: https://github.com/flutter/flutter/pull/120385 b/295065534
-
- 04 Aug, 2023 1 commit
-
-
Justin McCandless authored
This PR aims to support Android's predictive back gesture when popping the entire Flutter app. Predictive route transitions between routes inside of a Flutter app will come later. <img width="200" src="https://user-images.githubusercontent.com/389558/217918109-945febaa-9086-41cc-a476-1a189c7831d8.gif" /> ### Trying it out If you want to try this feature yourself, here are the necessary steps: 1. Run Android 33 or above. 1. Enable the feature flag for predictive back on the device under "Developer options". 1. Create a Flutter project, or clone [my example project](https://github.com/justinmc/flutter_predictive_back_examples). 1. Set `android:enableOnBackInvokedCallback="true"` in android/app/src/main/AndroidManifest.xml (already done in the example project). 1. Check out this branch. 1. Run the app. Perform a back gesture (swipe from the left side of the screen). You should see the predictive back animation like in the animation above and be able to commit or cancel it. ### go_router support go_router works with predictive back out of the box because it uses a Navigator internally that dispatches NavigationNotifications! ~~go_router can be supported by adding a listener to the router and updating SystemNavigator.setFrameworkHandlesBack.~~ Similar to with nested Navigators, nested go_routers is supported by using a PopScope widget. <details> <summary>Full example of nested go_routers</summary> ```dart // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:go_router/go_router.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; void main() => runApp(_MyApp()); class _MyApp extends StatelessWidget { final GoRouter router = GoRouter( routes: <RouteBase>[ GoRoute( path: '/', builder: (BuildContext context, GoRouterState state) => _HomePage(), ), GoRoute( path: '/nested_navigators', builder: (BuildContext context, GoRouterState state) => _NestedGoRoutersPage(), ), ], ); @override Widget build(BuildContext context) { return MaterialApp.router( routerConfig: router, ); } } class _HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Nested Navigators Example'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ const Text('Home Page'), const Text('A system back gesture here will exit the app.'), const SizedBox(height: 20.0), ListTile( title: const Text('Nested go_router route'), subtitle: const Text('This route has another go_router in addition to the one used with MaterialApp above.'), onTap: () { context.push('/nested_navigators'); }, ), ], ), ), ); } } class _NestedGoRoutersPage extends StatefulWidget { @override State<_NestedGoRoutersPage> createState() => _NestedGoRoutersPageState(); } class _NestedGoRoutersPageState extends State<_NestedGoRoutersPage> { late final GoRouter _router; final GlobalKey<NavigatorState> _nestedNavigatorKey = GlobalKey<NavigatorState>(); // If the nested navigator has routes that can be popped, then we want to // block the root navigator from handling the pop so that the nested navigator // can handle it instead. bool get _popEnabled { // canPop will throw an error if called before build. Is this the best way // to avoid that? return _nestedNavigatorKey.currentState == null ? true : !_router.canPop(); } void _onRouterChanged() { // Here the _router reports the location correctly, but canPop is still out // of date. Hence the post frame callback. SchedulerBinding.instance.addPostFrameCallback((Duration duration) { setState(() {}); }); } @override void initState() { super.initState(); final BuildContext rootContext = context; _router = GoRouter( navigatorKey: _nestedNavigatorKey, routes: [ GoRoute( path: '/', builder: (BuildContext context, GoRouterState state) => _LinksPage( title: 'Nested once - home route', backgroundColor: Colors.indigo, onBack: () { rootContext.pop(); }, buttons: <Widget>[ TextButton( onPressed: () { context.push('/two'); }, child: const Text('Go to another route in this nested Navigator'), ), ], ), ), GoRoute( path: '/two', builder: (BuildContext context, GoRouterState state) => _LinksPage( backgroundColor: Colors.indigo.withBlue(255), title: 'Nested once - page two', ), ), ], ); _router.addListener(_onRouterChanged); } @override void dispose() { _router.removeListener(_onRouterChanged); super.dispose(); } @override Widget build(BuildContext context) { return PopScope( popEnabled: _popEnabled, onPopped: (bool success) { if (success) { return; } _router.pop(); }, child: Router<Object>.withConfig( restorationScopeId: 'router-2', config: _router, ), ); } } class _LinksPage extends StatelessWidget { const _LinksPage ({ required this.backgroundColor, this.buttons = const <Widget>[], this.onBack, required this.title, }); final Color backgroundColor; final List<Widget> buttons; final VoidCallback? onBack; final String title; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: backgroundColor, body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text(title), //const Text('A system back here will go back to Nested Navigators Page One'), ...buttons, TextButton( onPressed: onBack ?? () { context.pop(); }, child: const Text('Go back'), ), ], ), ), ); } } ``` </details> ### Resources Fixes https://github.com/flutter/flutter/issues/109513 Depends on engine PR https://github.com/flutter/engine/pull/39208
Design doc: https://docs.google.com/document/d/1BGCWy1_LRrXEB6qeqTAKlk-U2CZlKJ5xI97g45U7azk/edit# Migration guide: https://github.com/flutter/website/pull/8952
-
- 17 Jul, 2023 1 commit
-
-
Loïc Sharma authored
Updates examples to use the new `ListenableBuilder` if there's no animation. This is slightly more idiomatic.
-
- 28 Jun, 2023 1 commit
-
-
Hans Muller authored
Updated tests in dev, examples/api, and tests/widgets to ensure that they continue to pass when the default for `ThemeData.useMaterial3` is changed to true. This is the final set of changes required for https://github.com/flutter/flutter/issues/127064.
-
- 26 Jun, 2023 1 commit
-
-
Hans Muller authored
-
- 20 Jun, 2023 1 commit
-
-
Tae Hyung Kim authored
This is a second attempt to merge #107269. Currently I've fixed two of the issues: 1. Fixed horizontal scrollview by using a switch statement to consider vertical/horizontal case. 2. Fixed issue of `paintExtent` not being the right extent for painting. Rather using a `scrollExtent` for the main axis length of the decoration box and painting it offsetted by the `scrollOffset`. 3. If the sliver child has inifinite scrollExtent, then we only draw the decoration down to the bottom of the `cacheExtent`. The developer is expected to ensure that the border does not creep up above the cache area. This PR includes a test that checks that the correct rectangle is drawn at a certain scrollOffset for both the horizontal and vertical case which should be sufficient for checking that `SliverDecoration` works properly now. Fixes https://github.com/flutter/flutter/issues/107498.
-
- 15 Jun, 2023 1 commit
-
-
Qun Cheng authored
-
- 13 Jun, 2023 1 commit
-
-
Hans Muller authored
-
- 08 Jun, 2023 2 commits
-
-
Greg Spencer authored
## Description This adds `AppLifecycleListener`, a class for listening to changes in the application lifecycle, and responding to requests to exit the application. It depends on changes in the Engine that add new lifecycle states: https://github.com/flutter/engine/pull/42418 Here's a diagram for the lifecycle states. I'll add a similar diagram to the documentation for these classes. ![Application Lifecycle Diagram](https://github.com/flutter/flutter/assets/8867023/f6937002-cb93-4ab9-a221-25de2c45cf0e) ## Related Issues - https://github.com/flutter/flutter/issues/30735 ## Tests - Added tests for new lifecycle value, as well as for the `AppLifecycleListener` itself.
-
Tae Hyung Kim authored
This widget implements the ability to place slivers one after another in a single ScrollView in a way that all child slivers are drawn within the bounds of the group itself (i.e. SliverPersistentHeaders aren't drawn outside of the scroll extent provided by all of the child slivers). The design document for SliverMainAxisGroup can be found [here](https://docs.google.com/document/d/1e2bdLSYV_Dq2h8aHpF8mda67aOmZocPiMyjCcTTZhTg/edit?resourcekey=0-Xj2X2XA3CAFae22Sv3hAiA). Fixes https://github.com/flutter/flutter/issues/33137. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat --------- Co-authored-by: Kate Lovett <katelovett@google.com>
-
- 26 May, 2023 1 commit
-
-
Phil Quitslund authored
The newly updated lint will soon flag for-each in collections. See discussion: https://github.com/dart-lang/linter/pull/4383 /cc @goderbauer
-
- 25 May, 2023 1 commit
- 16 May, 2023 1 commit
-
-
Ian Hickson authored
This is a proof of concept for renaming SlottedMultiChildRenderObjectWidgetMixin to SlottedMultiChildRenderObjectWidget and making it a concrete class. I also made SlottedContainerRenderObjectMixin generic instead of being specialized to RenderBox. I don't think this is something we can easily automigrate, but we may not need to, I don't know how common this is...
-
- 15 May, 2023 1 commit
-
-
Kate Lovett authored
Add ScrollController.onAttach & onDetach, samples/docs on listening/getting scrolling info (#124823) This PR does a couple of things! https://user-images.githubusercontent.com/16964204/231897483-416287f9-50ce-468d-a714-2a4bc0f2e011.mov ![Screenshot 2023-04-13 at 3 24 28 PM](https://user-images.githubusercontent.com/16964204/231897497-f5bee17d-43ed-46e5-acd7-e1bd64768274.png) Fixes #20819 Fixes #41910 Fixes #121419 ### Adds ScrollController.onAttach and ScrollController.onDetach This resolves a long held pain point for developers. When using a scroll controller, there is not scroll position until the scrollable widget is built, and almost all methods of notification are only triggered when scrolling happens. Adding these two methods will help developers gain access to the scroll position when it is created. A common workaround for this was using a post frame callback to access controller.position after the first frame, but this is ripe for issues such as having multiple positions attached to the controller, or the scrollable no longer existing after that post frame callback. I think this can also be helpful for folks to debug cases when the scroll controller has multiple positions attached. In particular, this also resolves this commented case: https://github.com/flutter/flutter/issues/20819#issuecomment-417784218 The isScrollingNotifier is hard for developers to access. ### Docs & samples I was surprised we did not have samples on scroll notification or scroll controller, so I overhauled it and added a lot of docs on all the different ways to access scrolling information, when it is available and how they differ.
-