7997 Commits

Author SHA1 Message Date
Taha Tesser
9a2d94ed8c
Fix DateRangePickerDialog does not use rangePickerHeaderBackgroundColor from DatePickerTheme in M2 (#147370)
fixes [DatePickerThemeData's `rangePickerHeaderBackgroundColor` not being applied to DateRangePickerDialog on M2](https://github.com/flutter/flutter/issues/147301)

### 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 MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: false,
        datePickerTheme: const DatePickerThemeData(
          rangePickerHeaderBackgroundColor: Colors.red,
        ),
      ),
      home: Scaffold(
        body: Center(
          child: Builder(builder: (BuildContext context) {
            return ElevatedButton(
              onPressed: () {
                showDateRangePicker(
                  context: context,
                  currentDate: DateTime.now(),
                  initialDateRange: DateTimeRange(
                    start: DateTime.now(),
                    end: DateTime.now().add(const Duration(days: 7)),
                  ),
                  firstDate: DateTime(2000),
                  lastDate: DateTime(2025),
                );
              },
              child: const Text('Show Date Range Picker'),
            );
          }),
        ),
      ),
    );
  }
}
```

</details>

### When using `rangePickerHeaderBackgroundColor` in `DatePickerTheme` for M2

```dart
      theme: ThemeData(
        useMaterial3: false,
        datePickerTheme: const DatePickerThemeData(
          rangePickerHeaderBackgroundColor: Colors.red,
        ),
      ),
```

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/4e85a115-c702-45b2-8f1e-2f3c87c37629" /> | <img src="https://github.com/flutter/flutter/assets/48603081/d002ba0a-6328-4f97-8ba0-dcbb9662bbb3"  /> |
2024-04-26 04:18:24 +00:00
Polina Cherkasova
c77fe6bca8
Clean up leaks in a test. (#147312)
Introduced by https://github.com/flutter/flutter/pull/140962

<img width="382" alt="Screenshot 2024-04-24 at 9 18 05 AM" src="https://github.com/flutter/flutter/assets/12115586/52d69038-8537-49f3-a7f8-535e59390c5e">
2024-04-26 04:08:01 +00:00
chunhtai
8031a3e30c
add a new PopScope.onPopWithResultInvoke widget to replace PopScope.onPopInvoke (#147016)
same as https://github.com/flutter/flutter/pull/139164, but make it a soft transition
2024-04-26 04:06:11 +00:00
LongCatIsLooong
101ff6fe7d
zero-sized RenderConstraintsTransformBox respects clipBehavior (#147349)
Fixes https://github.com/flutter/flutter/issues/146840
2024-04-26 04:06:09 +00:00
chunhtai
9c33723216
Makes badge to auto size with content (#146853)
Makes badge sizes it self according to child.

Previously, the bubble fixed its height to 16pixel. It clip the content
if it is taller than 16 pixel. This causes an issue where user can
increase font size in the android setting and mess up the ui

Now, the bubble can have various height from 16 pixel to the height of
the child, it also extend the width to be the same as height if the
child's width < height.

There is minor changes to floating location in the test. I can't really
fix them unless I change some of the public API like `Badge(offset)` or
`BadgeThemeData.largeSize`. They are used differently in the new logic
since now the badge can be larger than the Badge.child. I figure they
are kind of minor so i think it should be ok

Before the fix

![image](https://github.com/flutter/flutter/assets/47866232/10430cb7-513a-4425-99ee-163c494abff8)


After the fix

![image](https://github.com/flutter/flutter/assets/47866232/34390763-2778-4c4e-b468-eda972f61bb1)

fixes https://github.com/flutter/flutter/issues/146777


## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-25 10:32:45 -07:00
Valentin Vignal
c855710af8
Fix memory leaks in Hero widget (#147303) 2024-04-25 08:55:23 -07:00
Ian Hickson
9751d4d002
Allow the SceneBuilder, PictureRecord, and Canvas constructor calls from the rendering layer to be hooked (#147271)
This also includes some minor cleanup of documentation, asserts, and tests.
2024-04-25 00:19:24 +00:00
Bruno Leroux
99411e5b24
Fix filled color is wrong for a focused and hovered TextField (#146976)
## Description

This PR fixes the filled color for a focused and hovered text field.
Before this PR, the filled color for a focused text field did not change when hovered, after this PR the filled color is blended with the hover color.

The change removes a `isFocused` check which deactivated the blending. This check was introduced in https://github.com/flutter/flutter/pull/32776, at that time it was needed because there was also a focus color animation. Sometimes later, the focus animation was removed, see https://github.com/flutter/flutter/pull/33062, but the flag was not removed.

**Before**:

https://github.com/flutter/flutter/assets/840911/9698ba82-eb67-428a-8635-8054a4b8dfaf

**After**:

https://github.com/flutter/flutter/assets/840911/4c03a137-360d-4612-8946-765d7b5c698d

## Related Issue

Fixes https://github.com/flutter/flutter/issues/146573

## Tests

Adds 1 tests.
2024-04-24 23:45:50 +00:00
Chikamatsu Kazuya
d85571b46b
Add support for overriding reverseCurve with ExpansionTile.expansionAnimationStyle (#147103)
This PR adds support for overriding `reverseCurve` with `ExpansionTile.expansionAnimationStyle`.

Closes #146760
2024-04-24 22:44:04 +00:00
Valentin Vignal
dba4f77474
Fix memory leaks in BottomNavigationBar (#147213) 2024-04-24 10:11:56 -07:00
Valentin Vignal
2676c84a90
Disable leak tracking for selection text area (#147273) 2024-04-24 09:06:17 -07:00
Taha Tesser
fa85f69e47
Add missing overlayColor property in styleFrom methods (#146685)
fixes [Add missing `overlayColor` property  in `styleFrom` methods](https://github.com/flutter/flutter/issues/146636)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

enum Sizes { extraSmall, small, medium, large, extraLarge }

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: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              Text('styleFrom(overlayColor: Colors.red)', style: Theme.of(context).textTheme.titleLarge),
              TextButton(
                style: TextButton.styleFrom(overlayColor: Colors.red),
                onPressed: () {},
                child: const Text('TextButton'),
              ),
              IconButton(
                style: IconButton.styleFrom(
                  overlayColor: Colors.red,
                ),
                onPressed: () {},
                icon: const Icon(Icons.add),
              ),
              MenuBar(
                children: [
                  MenuItemButton(
                    style: MenuItemButton.styleFrom(overlayColor: Colors.red),
                    child: const Text('MenuItemButton'),
                    onPressed: () {},
                  ),
                  SubmenuButton(
                    style: SubmenuButton.styleFrom(overlayColor: Colors.red),
                    menuChildren: [
                      MenuItemButton(
                        child: const Text('MenuItemButton'),
                        onPressed: () {},
                      ),
                    ],
                    child: const Text('SubmenuButton'),
                  ),
                ],
              ),
              SegmentedButton<Sizes>(
                style:
                    SegmentedButton.styleFrom(overlayColor: Colors.red),
                segments: const <ButtonSegment<Sizes>>[
                  ButtonSegment<Sizes>(
                      value: Sizes.extraSmall, label: Text('XS')),
                  ButtonSegment<Sizes>(value: Sizes.small, label: Text('S')),
                  ButtonSegment<Sizes>(value: Sizes.medium, label: Text('M')),
                  ButtonSegment<Sizes>(
                    value: Sizes.large,
                    label: Text('L'),
                  ),
                  ButtonSegment<Sizes>(
                      value: Sizes.extraLarge, label: Text('XL')),
                ],
                selected: const {Sizes.medium},
                onSelectionChanged: (Set<Sizes> newSelection) {},
                multiSelectionEnabled: true,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Preview

![ScreenRecording2024-04-12at15 25 58-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/89b9638d-f369-4ef1-b501-17c9c74b2541)
2024-04-24 11:56:32 +00:00
Mairramer
790ce64f0b
Adds AutovalidateMode.onFocusChange to Form and FormField (#140962)
This will add a new autovalidateMode to Form and FormField, based on issue #40675.
2024-04-23 22:09:05 +00:00
Taha Tesser
e34a9e3f39
Fix chips delete icon override the default icon size and ignores IconTheme from the chip property and ChipThemeData (#146509)
fixes [Provided delete icon overrides the default delete icon size](https://github.com/flutter/flutter/issues/146404)
fixes [Chips delete icon ignores `IconTheme` from `Chip.iconTheme` and `ChipThemeData.iconTheme`](https://github.com/flutter/flutter/issues/146501)

### 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 MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        chipTheme: const ChipThemeData(
          iconTheme: IconThemeData(
            color: Colors.red,
          ),
        ),
      ),
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              FilterChip(
                avatar: const Icon(Icons.favorite),
                onDeleted: () {},
                label: const Text('Filter Chip'),
                onSelected: (value) {},
              ),
              const SizedBox(height: 10),
              FilterChip(
                avatar: const Icon(Icons.favorite),
                // ignore: prefer_const_constructors
                deleteIcon: const Icon(Icons.delete),
                onDeleted: () {},
                label: const Text('Filter Chip'),
                onSelected: (value) {},
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before
![Screenshot 2024-04-09 at 16 48 48](https://github.com/flutter/flutter/assets/48603081/79d14a63-3c24-4f3e-bda4-5de76b319160)

### After

![Screenshot 2024-04-09 at 16 48 31](https://github.com/flutter/flutter/assets/48603081/8d54373f-53f1-4908-bd9c-2ee351227f27)
2024-04-23 19:24:00 +00:00
Gil Nobrega
dd647b0909
Fix frozen StretchingOverscrollIndicator animation (#147195)
`StretchingOverscrollIndicator`'s controller does not have a minimum value for its animation duration.
When the `OverscrollNotification`'s `velocity` is small enough (< `25`) the controller's `absorbImpact` method sets this animation duration to 0ms, making the animation appear frozen to the user.

This PR sets a minimum animation duration of 50ms.

Fixes #146277

| Before | After |
| --- | --- |
| <video src="https://github.com/flutter/flutter/assets/82336674/8761f14e-d5a5-4a39-b8e7-9e77433ce2c6" width=250px />| <video src="https://github.com/flutter/flutter/assets/82336674/57b38448-29fb-41ad-a947-d7cf1c160ca3" width=250px /> |
2024-04-23 19:14:30 +00:00
Valentin Vignal
b0198426b5
Fix memory leak in switch painter (#147228) 2024-04-23 11:14:19 -07:00
Valentin Vignal
1be28aa61a
Fix memory leaks in CupertinoTextMagnifier (#147208) 2024-04-22 22:26:09 -07:00
Valentin Vignal
4938403a7a
Fix memory leaks in PopupMenu (#147174) 2024-04-22 20:40:33 -07:00
Polina Cherkasova
1d7c680e25
Re-land fix for not disposed TabController (#146745)
Fixes https://github.com/flutter/flutter/issues/144910
2024-04-22 20:28:50 +00:00
Anis Alibegić
140edb9883
Fixed few typos (#147087)
Here's another PR with a couple of typos fixed. As you can see there was a typo in _fileReferenceI**n**dentifiers_, in class _ParsedProjectInfo._ Maybe we should do some check on that since I'm not sure if that property is used somewhere outside Flutter?
2024-04-22 16:49:19 +00:00
Dimil Kalathiya
158a9a8177
fixes some gesture not getting disposed (#147112) 2024-04-20 10:20:37 -07:00
auto-submit[bot]
bb4c9b381e
Reverts "Add generic type for result in PopScope (#139164)" (#147015)
Reverts: flutter/flutter#139164
Initiated by: chunhtai
Reason for reverting: hard breaking change
Original PR Author: chunhtai

Reviewed By: {justinmc}

This change reverts the following previous change:
Adds a generic type and pop result to popscope and its friend.

The use cases are to be able to capture the result when the pop is called.

migration guide: https://github.com/flutter/website/pull/9872
2024-04-18 22:36:26 +00:00
chunhtai
7ee05a05ff
Add generic type for result in PopScope (#139164)
Adds a generic type and pop result to popscope and its friend.

The use cases are to be able to capture the result when the pop is called.

migration guide: https://github.com/flutter/website/pull/9872
2024-04-18 19:30:10 +00:00
Valentin Vignal
cbf35b4e85
Fix memory leaks in navigation rail (#146988) 2024-04-18 08:03:19 -07:00
Valentin Vignal
fb110b98da
Fix memory leaks in MaterialBanner (#146963) 2024-04-18 07:21:18 -07:00
Valentin Vignal
c83d650de4
Fix memory leak in data table (#146892) 2024-04-18 07:16:32 -07:00
Valentin Vignal
47a4c69b82
Dispose the curved animation in transition test (#146961) 2024-04-18 07:14:15 -07:00
Polina Cherkasova
ae0a0dfc6b
Get rid of _NullElement. (#146741)
Fixes https://github.com/flutter/flutter/issues/145602
2024-04-17 19:10:42 +00:00
Valentin Vignal
51f1725261
Fix memory leak in paginated tables (#146755) 2024-04-17 11:03:48 -07:00
Taha Tesser
f2be9bcad5
Fix Tab indicator image configuration doesn't inherit device pixel ratio (#146812)
fixes [The image for the indicator of the TabBar does not auto-adapt to different resolutions](https://github.com/flutter/flutter/issues/145204)

### Description
This PR provides device pixel ratio to the tab indicator painter.
2024-04-17 07:59:07 +00:00
Dimil Kalathiya
224099872e
fix test-case for RenderView (#146825) 2024-04-16 15:20:10 -07:00
Valentin Vignal
3882afbfa9
Fix leak memory in Tooltip and account detail (#146833) 2024-04-16 12:15:37 -07:00
Valentin Vignal
c3445dc190
Fix memory leak in BottomNavigationBar (#146748) 2024-04-16 07:53:27 -07:00
Amir Panahandeh
c98d68de42
Add hitTestBehavior and rootOverlay to LongPressDraggable constructor… (#146386)
Passes through these two Draggable parameters so that they're usable in LongPressDraggable.
2024-04-15 12:20:11 -07:00
Polina Cherkasova
c4a7cf202a
Update leak related TODOs. (#146743)
https://github.com/flutter/flutter/issues/146742
2024-04-15 11:46:32 -07:00
Nate
2e748e8598
Implementing control flow collections (#146601)
This pull request aims for improved readability, based on issue #146600.

```dart
// before
Set<Color> _distinctVisibleColors() {
  final Set<Color> distinctVisibleColors = <Color>{};
  if (top.style != BorderStyle.none) {
    distinctVisibleColors.add(top.color);
  }
  if (right.style != BorderStyle.none) {
    distinctVisibleColors.add(right.color);
  }
  if (bottom.style != BorderStyle.none) {
    distinctVisibleColors.add(bottom.color);
  }
  if (left.style != BorderStyle.none) {
    distinctVisibleColors.add(left.color);
  }
  return distinctVisibleColors;
}

// after
Set<Color> _distinctVisibleColors() {
  return <Color>{
    if (top.style != BorderStyle.none) top.color,
    if (right.style != BorderStyle.none) right.color,
    if (bottom.style != BorderStyle.none) bottom.color,
    if (left.style != BorderStyle.none) left.color,
  };
}
```

Most of the repo should be covered in this PR (aside from `flutter_tools/`, since there was a lot going on in there).
2024-04-15 16:06:07 +00:00
Valentin Vignal
0099d1a96a
test: Fix memory leak in transitions test (#146747) 2024-04-15 08:52:18 -07:00
Bruno Leroux
63634c25ad
Fix filled text field active indicator overflows container bounds (#146637)
## Description

This PRs fixes the active indicator vertical position for a filled text field.
Before this PR, the active indicator overflowed of container bounds, After this PR the active indicator is painted inside the container bounds.

Screenshot of filled text field with active indicator width sets to 4.0dp:

| Before | After |
|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/ed2878ba-130a-4410-b170-423d00a8893d) | ![image](https://github.com/flutter/flutter/assets/840911/f78d06c0-a161-4ab6-b01f-dae297939956) | 

</details> 

## Related Issue

Fixes https://github.com/flutter/flutter/issues/146507

## Tests

Adds 1 tests, updates 3 tests.
2024-04-15 07:28:19 +00:00
Dimil Kalathiya
1002ce4b03
- Fixes _DropdownMenuState leaking text controller (#146571) 2024-04-14 07:59:43 -07:00
Valentin Vignal
266cdf0b1e
Fix memory leaks in FloatingActionButton (#146711) 2024-04-13 15:48:25 -07:00
Bruno Leroux
58ac0dc16b
Fix label text color is wrong for a focused and hovered TextField (#146572)
Before, hovering a focused TextField would incorrect change the label color. Now it does not, which is correct per the spec.
2024-04-12 14:07:03 -07:00
LongCatIsLooong
7db26b09bb
Fix getOffsetForCaret crash (#146669)
Fixes a crash in Google tests (b/333560406) related to a decomposed complex character.
2024-04-12 13:58:02 -07:00
Valentin Vignal
e2c812155c
Fix curved animation memory leak for scrollbar (#146670) 2024-04-12 09:24:13 -07:00
Polina Cherkasova
5ebc94082e
Fix leaking curved animation. (#146644) 2024-04-11 18:47:24 +00:00
Taha Tesser
831226aada
Fix IconButton theming in the InputDecorator (#146567)
fixes [DropdownMenu TrailingIcon can't be styled through providing an IconButtonTheme](https://github.com/flutter/flutter/issues/145081) (second PR)

### Description
 This PR replaces `IconButton.style`  with `ButtonStyle` when merging parent `IconButtonTheme`  as `styleFrom` returns defaults for some properties.
2024-04-11 07:15:24 +00:00
Bruno Leroux
906ce36b8d
Fix InputDecorator label position ignore visual density (#146488)
## Description

This PRs makes the label vertical position depend on visual density for filled text field.
Previously, for M2 and M3, the label vertical offset was always the same (12 on M2, 8 and M3) despite different visual density configuration.
This was noticable on desktop and can lead to weird rendering especially on M3 where line height makes the cursor taller.

Screenshots for a filled text field:

| | Before | After |
|--------|--------|--------|
|M3 macOs| ![image](https://github.com/flutter/flutter/assets/840911/bd9bdb6e-477c-4db0-ae8f-74e18d19f29e) | ![image](https://github.com/flutter/flutter/assets/840911/25e59c44-0139-4813-be28-472302d6970e) | 
|M2 macOs| ![image](https://github.com/flutter/flutter/assets/840911/1c52493b-b17b-407b-93cc-69120207b716) | ![image](https://github.com/flutter/flutter/assets/840911/1fc4a8b6-429b-476c-b5bf-ff2934bf5293) | 

</details> 

## Related Issue

Fixes https://github.com/flutter/flutter/issues/141354

## Tests

Adds 2 tests, updates 2 tests.
2024-04-09 21:11:08 +00:00
Jackson Gardner
51e70fa16b
Fix skwasm tests (#145570)
Skwasm tests are now running as `bringup: true` in postsubmit, but failing. Let's get them fixed.
2024-04-09 19:35:07 +00:00
Justin McCandless
1cd946ee31
Text editing inside of Transformed.scale (#146019)
Fixes bugs in the text selection positioning calculations so that they work even when the field is scaled. In many cases, we were simply translating things around without applying the proper localToGlobal (or vice versa) transform.

| Before | After |
| --- | --- |
| <img src="https://github.com/flutter/flutter/assets/389558/a5a45472-98c5-4cdf-b382-218971fd9404" /> | <img src="https://github.com/flutter/flutter/assets/389558/f396a1af-2546-4e38-a9d9-6c6edfa38d94" /> |

Partial fix for: https://github.com/flutter/flutter/issues/144685
It looks like there are other problems where transforms aren't applied properly. Putting a transform at the root of the application, above MaterialApp, will expose more problems.

<details>

<summary>Sample code</summary>

```dart
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(const _App());

class _App extends StatelessWidget {
  const _App();

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: _Home());
  }
}

class _Home extends StatefulWidget {
  const _Home();

  @override
  State<_Home> createState() => _HomeState();
}

class _HomeState extends State<_Home> {
  final _controller = WebViewController();
  final TextEditingController textEditingController = TextEditingController(
    text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
  );
  final OverlayPortalController overlayPortalController = OverlayPortalController();

  @override
  void initState() {
    super.initState();
    _controller
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..loadRequest(Uri.https('api.flutter.dev'));
  }

  @override
  Widget build(BuildContext context) {
    overlayPortalController.show();
    return Scaffold(
      appBar: AppBar(
        title: const Text('Scaled WebView Tester'),
      ),
      body: Stack(
        children: <Widget>[
          Transform.scale(
            alignment: Alignment.topLeft,
            scale: 0.5,
            child: TextField(
              controller: textEditingController,
              maxLines: null,
            ),
          ),
          OverlayPortal(
            controller: overlayPortalController,
            overlayChildBuilder: (BuildContext context) {
              return Positioned(
                top: 0.0,
                left: 0.0,
                child: SizedBox(
                  height: 1000,
                  width: 1000,
                  child: Stack(
                    children: <Widget>[
                      Positioned(
                        top: 90.0,
                        left: 0.0,
                        child: Container(
                          height: 1.0,
                          width: 1000,
                          color: Colors.blue,
                        ),
                      ),
                      Positioned(
                        top: 102.0,
                        left: 0.0,
                        child: Container(
                          height: 1.0,
                          width: 1000,
                          color: Colors.blue,
                        ),
                      ),
                    ],
                  ),
                ),
              );
            },
          ),
        ],
      ),
    );
  }
}
```

</details>
2024-04-08 22:01:05 +00:00
Bruno Leroux
f45741bc51
Fix DropdownButtonFormField throws when onChange is null (#146342)
## Description

This PRs fixes a null pointer exception thrown when reset is called on a `DropdownButtonFormField` whose `onChange` callback is null.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/146335

## Tests

Adds 1 tests.
2024-04-08 20:47:13 +00:00
LongCatIsLooong
98d23f709f
Prepare for RenderDecorator.computeBaseline changes. (#146363)
Minor changes to make the `RenderDecorator.computeBaseline` change a bit easier to make. No semantic changes.
2024-04-06 21:51:23 +00:00