)]}'
{
  "commit": "6b39a62b21d3bc63e1f0991fd8dc2f183bfce7c7",
  "tree": "dbccf980324876c2d34a296cccedc28f4e98022c",
  "parents": [
    "15c304ac7ecc4c7ae50e7b0ff76fca25546230c5"
  ],
  "author": {
    "name": "Bruno Leroux",
    "email": "bruno.leroux@gmail.com",
    "time": "Fri Dec 06 11:11:26 2024 +0100"
  },
  "committer": {
    "name": "dart-internal-monorepo",
    "email": "dart-internal-monorepo@dart-ci-internal.iam.gserviceaccount.com",
    "time": "Fri Dec 06 02:18:31 2024 -0800"
  },
  "message": "Fix DropdownButtonFormField overlay colors management (#159472)\n\n## Description\n\nThis PR fixes some `DropdownButtonFormField` issues where the overlay\ncolor overflows.\n\nBefore this PR, `DropdownButtonFormField` was relying on an `InkWell` to\ndisplay overlay colors. This resulted in several issues related to the\n`InkWell` overflowing because it is not aware of the inner container\ninside `InputDecorator`, for instance see\nhttps://github.com/flutter/flutter/issues/106659.\n\nWith this PR, `DropdownButtonFormField` does not use an `InkWell` but\nrely on `InputDecorator` to paint overlay colors. `InputDecorator`\npaints overlay colors only on its internal container, this fixes the\ncolor overflowing when using `InkWell`. With this change users can\nopt-in for overlay colors to be painted by setting InputDecorator.filled\nto true (similarly to TextField and accordingly to [the Material\nspecification](https://m2.material.io/components/menus#dropdown-menu)).\n\nCode sample from https://github.com/flutter/flutter/issues/106659 with\nInputDecoration.filled set to true:\n\n\u003cdetails\u003e\u003csummary\u003eCode sample with InputDecoration.filled set to\ntrue\u003c/summary\u003e\n\n```dart\nimport \u0027package:flutter/material.dart\u0027;\n\nvoid main() \u003d\u003e runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  MyApp({Key? key}) : super(key: key);\n\n  static const String _title \u003d \u0027Flutter Code Sample\u0027;\n  final _formKey \u003d GlobalKey\u003cFormState\u003e();\n\n  @override\n  Widget build(BuildContext context) {\n    var items \u003d [\n      \u0027Ayo\u0027,\n      \u0027This\u0027,\n      \u0027Don\u0027,\n      \u0027Look\u0027,\n      \u0027Right\u0027,\n    ].map((String val) {\n      return DropdownMenuItem(\n        value: val,\n        child: Text(\n          val,\n        ),\n      );\n    }).toList();\n\n    return MaterialApp(\n      title: _title,\n      theme: ThemeData(\n        inputDecorationTheme: const InputDecorationTheme(\n          border: OutlineInputBorder(\n            borderRadius: BorderRadius.all(Radius.circular(32)),\n            borderSide: BorderSide(color: Colors.blue, width: 2),\n          ),\n        ),\n      ),\n      home: Scaffold(\n        body: Center(\n          child: SizedBox(\n            width: 500,\n            child: Column(\n              mainAxisAlignment: MainAxisAlignment.center,\n              children: [\n                Form(\n                  key: _formKey,\n                  child: DropdownButtonFormField(\n                    onTap: () {\n                      _formKey.currentState!.validate();\n                    },\n                    validator: (String? v) \u003d\u003e \u0027Required\u0027,\n                    onChanged: (String? value) {},\n                    items: items,\n                    // Set InputDecoration.filled to true if overlays should be visible.\n                    // See Material specification for filled vs outlined dropdown button:\n                    // https://m2.material.io/components/menus#dropdown-menu.\n                    decoration: const InputDecoration(filled: true),\n                  ),\n                ),\n              ],\n            ),\n          ),\n        ),\n      ),\n    );\n  }\n}\n\n```\n\u003c/details\u003e\n\nBefore:\n\n![image](https://github.com/user-attachments/assets/3c22975f-9b8c-4184-8ffe-67f2191bf563)\n\nAfter:\n\n![image](https://github.com/user-attachments/assets/47ac35c3-b516-454f-bd47-2d35d85f172f)\n\nAfter (when filled is not set to true):\n\n![image](https://github.com/user-attachments/assets/faf46e40-5817-4d64-9158-7a57d94a9776)\n\n## Related Issue\n\nFixes [DropdownButtonFormField InkWell spreads to error\nmessage](https://github.com/flutter/flutter/issues/106659).\nFixes [DropdownButtonFormField input decorator focus/hover is not\nclipped and appears behind fill\ncolor.](https://github.com/flutter/flutter/issues/147069)\nFirst step for [DropDownButtonFormField hoverColor has no effect in web\nand desktop platforms](https://github.com/flutter/flutter/issues/151460)\n\n## Tests\n\nAdds 4 tests.\nUpdates 2 tests (remove checks specific to InkWell usage and use filled:\ntrue when checking for hover/focus colors).\nRemoves 1 test (test specific to InkWell usage, because this PR removes\nthe InkWell the test is obsolete).\nhttps://dart.googlesource.com/external/github.com/flutter/flutter/+/5881b13b9707b510bfa9d0ef0881ac98d24a8774\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f1fcf0460edde333a5295d508ff4a4f74981d32e",
      "old_mode": 33188,
      "old_path": "DEPS",
      "new_id": "1b45faaee41f45b55b30b011f45c5ec459824e5d",
      "new_mode": 33188,
      "new_path": "DEPS"
    },
    {
      "type": "modify",
      "old_id": "4a2925b5368c3d8525380ff626296a7678d10306",
      "old_mode": 33188,
      "old_path": "commits.json",
      "new_id": "ad8794cef43d8d91e7105eb0b406828a9b3f4fab",
      "new_mode": 33188,
      "new_path": "commits.json"
    }
  ]
}
