1. 24 May, 2023 5 commits
    • lsaudon's avatar
      Add missing parameters in `TextFormField` (#127020) · 7827a242
      lsaudon authored
      `TextFormField` does not have all the parameters of `TextField`.
      
      Added:
      ```dart
          UndoHistoryController? undoController,
          AppPrivateCommandCallback? onAppPrivateCommand,
          bool? cursorOpacityAnimates,
          ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
          ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
          DragStartBehavior dragStartBehavior = DragStartBehavior.start,
          ContentInsertionConfiguration? contentInsertionConfiguration,
          Clip clipBehavior = Clip.hardEdge,
          bool scribbleEnabled = true,
          bool canRequestFocus = true,
      ```
      7827a242
    • LongCatIsLooong's avatar
      Improve `TextPainter.layout` caching (#118128) · 62e78bf1
      LongCatIsLooong authored
      Improves `TextPainter.layout` caching when only the input constraints change: 
      - removes the double layout calls in `TextPainter._layoutParagraph`: now double layout is only needed when `TextAlign` is not left, and the input `maxWidth == double.infinity`.  
      - skip calls to `ui.Paragraph.layout` when it's guaranteed that there's no soft line breaks before/after the layout call.
      
      This doesn't introduce new APIs but may slightly shift text rendered on screen.
      This reduces the number of `layout` calls but since shaping results are already cached so it only skips the relatively cheap line-breaking process when possible.
      
      528 scuba failures but all of them seem reasonable.
      62e78bf1
    • Bruno Leroux's avatar
      Fix ScrollPosition overscroll precision error (#127321) · 2b105ac6
      Bruno Leroux authored
      ## Description
      
      This PR fixes a precision error in ~~`ClampingScrollPhysics`~~ `ScrollPosition` that leads to `StretchingOverscrollIndicator` stretching its content unexpectedly in some devices (see  https://github.com/flutter/flutter/issues/126561 where this is visible in `TabBarView` and the test added in this PR where it reproduces with a `PageView`).
      
      ~~This PR also contains a change to `nested_scroll_view.dart` because the first change (the one in `ClampingScrollPhysics`)  breaks the precision error test added by https://github.com/flutter/flutter/pull/87801.~~
      
      ## Related Issue
      
      Fixes https://github.com/flutter/flutter/issues/126561
      
      ## Tests
      
      Adds 1 test.
      2b105ac6
    • Devin's avatar
      `Slider.onChangeStart` & `Slider.onChangeEnd` are not called on keyboard shortcuts (#126896) · 5451ea6e
      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.
      5451ea6e
    • Sun Jiao's avatar
  2. 23 May, 2023 4 commits
  3. 22 May, 2023 2 commits
    • Daniel Iglesia's avatar
      Support keeping a bottom sheet with a DraggableScrollableSheet from closing on... · a6d62ca8
      Daniel Iglesia authored
      Support keeping a bottom sheet with a DraggableScrollableSheet from closing on drag/fling to min extent (#127339)
      
      a6d62ca8
    • Victor Ohashi's avatar
      fix: Search anchor box location when used on nested navigator (#127198) · 7e3f1df3
      Victor Ohashi authored
      This PR is to fix the position of `SearchAnchor` when used with nested navigator. This solution is based on what `DropdownButton` internally do, looking to the closest `Navigator` to proper calculate the where to render `SearchViewRoute`.
      
      Fixes: https://github.com/flutter/flutter/issues/126435
      
      <details>
      <summary>Test case</summary>
      
      ```dart
      void main() => runApp(const NestedSearchBarApp());
      
      class NestedSearchBarApp extends StatefulWidget {
        const NestedSearchBarApp({super.key});
      
        @override
        State<NestedSearchBarApp> createState() => _NestedSearchBarAppState();
      }
      
      class _NestedSearchBarAppState extends State<NestedSearchBarApp> {
        final SearchController controller = SearchController();
      
        @override
        Widget build(BuildContext context) {
          final ThemeData themeData = ThemeData(useMaterial3: true);
      
          return MaterialApp(
            theme: themeData,
            builder: (BuildContext context, Widget? child) {
              return Scaffold(
                body: Row(
                  children: <Widget>[
                    NavigationRail(
                      selectedIndex: 1,
                      destinations: const <NavigationRailDestination>[
                        NavigationRailDestination(
                          icon: Icon(Icons.favorite_border),
                          selectedIcon: Icon(Icons.favorite),
                          label: Text('First'),
                        ),
                        NavigationRailDestination(
                          icon: Icon(Icons.bookmark_border),
                          selectedIcon: Icon(Icons.book),
                          label: Text('Second'),
                        ),
                      ],
                    ),
                    const VerticalDivider(thickness: 1, width: 1),
                    Expanded(child: child!)
                  ],
                ),
              );
            },
            home: Scaffold(
              appBar: AppBar(title: const Text('Search Anchor Sample')),
              body: Column(
                children: <Widget>[
                  SearchAnchor(
                      searchController: controller,
                      builder: (BuildContext context, SearchController controller) {
                        return IconButton(
                          icon: const Icon(Icons.search),
                          onPressed: () {
                            controller.openView();
                          },
                        );
                      },
                      suggestionsBuilder:
                          (BuildContext context, SearchController controller) {
                        return List<ListTile>.generate(5, (int index) {
                          final String item = 'item $index';
                          return ListTile(
                            title: Text(item),
                            onTap: () {
                              setState(() {
                                controller.closeView(item);
                              });
                            },
                          );
                        });
                      }),
                  Center(
                    child: controller.text.isEmpty
                        ? const Text('No item selected')
                        : Text('Selected item: ${controller.value.text}'),
                  ),
                ],
              ),
            ),
          );
        }
      }
      ```
      </details>
      
      <details>
      <summary>Before fix:</summary>
      
      ![Screenshot 2023-05-19 at 11 55 53](https://github.com/flutter/flutter/assets/38299943/c86747e5-6716-4e87-b3fd-ce7f0f943b92)
      </details>
      
      <details>
      <summary>After fix:</summary>
      
      ![Screenshot 2023-05-19 at 11 53 30](https://github.com/flutter/flutter/assets/38299943/d790ee49-e047-485c-87f4-7254acbdddfa)
      </details>
      7e3f1df3
  4. 19 May, 2023 5 commits
  5. 18 May, 2023 6 commits
  6. 17 May, 2023 7 commits
  7. 16 May, 2023 11 commits