Polina Cherkasova
1f3103e50d
Upgrade leak_tracker. ( #141153 )
2024-01-09 12:02:35 -08:00
Christopher Fujino
6edbce9e07
Manual pub roll pinning web socket channel ( #141040 )
...
Work around https://github.com/flutter/flutter/issues/141032
Otherwise a re-land of https://github.com/flutter/flutter/pull/140979
Fixes https://github.com/flutter/flutter/issues/137163 & https://github.com/flutter/flutter/issues/139181
2024-01-05 22:29:58 +00:00
auto-submit[bot]
c2286a7642
Reverts "manual pub roll to pick up dds fixes" ( #141033 )
...
Reverts flutter/flutter#140979
Initiated by: loic-sharma
This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-05 19:10:19 +00:00
Christopher Fujino
e256d49117
manual pub roll to pick up dds fixes ( #140979 )
...
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-04 19:43:06 +00:00
Furkan Acar
83ac76050d
Add SegmentedButton.styleFrom
( #137542 )
...
fixes https://github.com/flutter/flutter/issues/138289
---
SegmentedButtom.styleFrom has been added to the segment button, so there is no longer any need to the button style from the beginning. It works like ElevatedButton.styleFrom only I added selectedForegroundColor, selectedBackgroundColor. In this way, the user will be able to change the color first without checking the MaterialState states. I added tests of the same controls.
#129215 I opened this problem myself, but I was rejected because I handled too many items in a PR. For now, I wrote a structure that only handles MaterialStates instead of users.
old (still avaliable)
<img width="626" alt="image" src="https://github.com/flutter/flutter/assets/65075121/9446b13b-c355-4d20-bda2-c47a23d42d4f ">
new (just an option for developer)
<img width="483" alt="image" src="https://github.com/flutter/flutter/assets/65075121/0a645257-4c83-4029-9484-bd746c02265f ">
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [SegmentedButton].
void main() {
runApp(const SegmentedButtonApp());
}
enum Calendar { day, week, month, year }
class SegmentedButtonApp extends StatefulWidget {
const SegmentedButtonApp({super.key});
@override
State<SegmentedButtonApp> createState() => _SegmentedButtonAppState();
}
class _SegmentedButtonAppState extends State<SegmentedButtonApp> {
Calendar calendarView = Calendar.day;
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
body: Center(
child: SegmentedButton<Calendar>(
style: SegmentedButton.styleFrom(
foregroundColor: Colors.amber,
visualDensity: VisualDensity.comfortable,
),
// style: const ButtonStyle(
// foregroundColor: MaterialStatePropertyAll<Color>(Colors.deepPurple),
// visualDensity: VisualDensity.comfortable,
// ),
segments: const <ButtonSegment<Calendar>>[
ButtonSegment<Calendar>(
value: Calendar.day,
label: Text('Day'),
icon: Icon(Icons.calendar_view_day)),
ButtonSegment<Calendar>(
value: Calendar.week,
label: Text('Week'),
icon: Icon(Icons.calendar_view_week)),
ButtonSegment<Calendar>(
value: Calendar.month,
label: Text('Month'),
icon: Icon(Icons.calendar_view_month)),
ButtonSegment<Calendar>(
value: Calendar.year,
label: Text('Year'),
icon: Icon(Icons.calendar_today)),
],
selected: <Calendar>{calendarView},
onSelectionChanged: (Set<Calendar> newSelection) {
setState(() {
calendarView = newSelection.first;
});
},
),
),
),
);
}
}
```
</details>
2024-01-03 21:26:02 +00:00
Polina Cherkasova
45c611f040
Upgrade leak_tracker. ( #140758 )
2024-01-02 20:58:16 +00:00
flutter-pub-roller-bot
2d75f76b44
Roll pub packages ( #140472 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-20 22:57:21 +00:00
Polina Cherkasova
6368d65622
Upgrade to version of leak tracker that does not depend on test_widgets. ( #140247 )
...
Contributes to: https://github.com/flutter/flutter/issues/135856
2023-12-19 04:28:09 +00:00
Polina Cherkasova
bda158adf0
Reorganize dependencies on leak_tracker. ( #140233 )
...
1. Move leak_tracker and leak_tracker_testing out of direct dependencies.
2. Move leak_tracker_flutter_testing from dev to prod dependencies for flutter_test
It is prerequisite for https://github.com/flutter/flutter/issues/135856
2023-12-15 19:33:23 +00:00
Srujan Gaddam
2407f699e9
Move package:web dependency to dev dependency ( #139696 )
...
Pinning the package:web dependency constrains downstream packages from
using newer versions and making sure they support the version pinned in
Flutter. Since the usage of package:web in Flutter is light, we should
instead have a small shim like the engine and keep package:web as a dev
dependency only.
2023-12-15 08:53:27 -08:00
Polina Cherkasova
6a85684877
Increase versions of leak tracker libraries. ( #140018 )
...
Contributes to https://github.com/flutter/flutter/issues/135856
2023-12-15 05:18:23 +00:00
Loïc Sharma
51e607082f
[Windows] Remove header guard from generated key map ( #140082 )
...
The generated file is a `.cc` file that does not need header guards. This change updates the template that's used to generate that `.cc` file.
No tests as this is a refactoring with no semantic changes.
The generated `.cc` file in the engine will be updated by https://github.com/flutter/engine/pull/48993
2023-12-13 23:54:48 +00:00
Ian Hickson
fca7bc9e28
Roll dependencies ( #139606 )
...
test-exempt: rolling dependencies
2023-12-06 19:22:06 +00:00
flutter-pub-roller-bot
935c8e8efe
Roll pub packages ( #139510 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-05 20:23:54 +00:00
Gray Mackall
4ce5421ca9
Update generate_gradle_lockfiles script to represent newer templates, and run it on dev/ ( #135175 )
...
Upgrades agp versions and lockfiles for `dev/`. Also changes the lockfile generation script to represent the newer form of the `settings.gradle` template, and therefore also propagates these changes.
~~Potentially related to https://github.com/flutter/flutter/issues/134419~~ , but worth doing anyways. (not actually related)
2023-12-05 18:04:08 +00:00
Nate
3267fbc07a
Implement switch
expressions in dev/
( #139048 )
...
I previously made a PR (#136140 ) that used `switch` expressions to make some parts of the Flutter codebase easier to understand. It was assigned to the framework team, and @christopherfujino let me know that it was too large to effectively review and recommended breaking it up into smaller pull requests.
Here's a PR that only targets files in the `dev/` directory. Hopefully this will be easier to work with!
(solves issue https://github.com/flutter/flutter/issues/136139 )
2023-11-28 23:40:28 +00:00
godofredoc
fe7299d318
Migrate customer_testing to sharded tests. ( #138659 )
...
This will allow Dart Team to run customer tests as part of monorepo and will be a step forward to remove ad_hoc tests.
Bug: https://github.com/dart-lang/sdk/issues/51042
Bug: https://github.com/flutter/flutter/issues/115476
2023-11-28 00:41:53 +00:00
Qun Cheng
c7d4b32fdd
Update the default outline color for OutlinedButton
( #138768 )
...
Fix b/311343182
This is to update the default outline for `OutlinedButton`. When the button is focused, the outline color should be primary color.
2023-11-22 20:16:37 +00:00
Parker Lougheed
096cdc39a9
Update links and surrounding text for new main-api
docs ( #138602 )
...
Issue reference: https://github.com/flutter/flutter/issues/133877
2023-11-17 22:27:53 +00:00
Srujan Gaddam
d8ffc7390c
Pin package:web 0.4.0 ( #138428 )
...
This version is needed so that dart:js_interop can move to extension
types. Also adds some code to handle some breaking changes:
- Body -> Response. Body was an IDL interface mixin type we exposed in
dart:html. Going forward, users should either use Request or Response.
- Casts to JSAny. These are temporary until we move package:web types to
extension types. Currently, package:web types can't implement JSObject
as JSObject will move to be an extension type itself.
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
2023-11-15 15:03:21 -08:00
Greg Spencer
1b9cab7138
Clean up synonyms, key code generation. ( #138192 )
...
## Description
This cleans up how synonyms are calculated, and adds a reverse mapping from pseudo keys to the real keys they are synonyms of.
Updates the `layout_goals.json` to include the "Space" key, since that was added in the engine without updating the generation configuration.
2023-11-13 20:13:00 +00:00
Polina Cherkasova
793827d98a
Upgrade leak tracker. ( #138283 )
2023-11-13 09:47:55 -08:00
Nate Bosch
fa3a37c76d
Use merge-base in find_commit.dart ( #138033 )
...
Closes #97595
The prior approach of manually diffing the entire log chain is less
efficient, and only found the original branch point ignoring subsequent
merges. The limitation forced PR workflows into rebasing and force
pushing new history to get the branch point far enough for CI to pass.
Use `git merge-base` to find the latest common commit with the main
branch.
Add an `allowFailure` argument to the `git` utility to use a more
specific failure in the case of no shared history when this command will
fail with a generic error.
Use `^branch` with the `git log` commands to exclude shared history and
more easily count the unique commits on each branch.
Drop the `Commit` abstraction. Parse directly to timestamp or line counts.
2023-11-10 02:15:27 +00:00
Qun Cheng
ed70f4e248
Adaptive Switch
( #130425 )
...
Currently, `Switch.factory` delegates to `CupertinoSwitch` when platform
is iOS or macOS. This PR is to:
* have the factory configure the Material `Switch` for the expected look
and feel.
* introduce `Adaptation` class to customize themes for the adaptive
components.
2023-11-07 10:26:23 -08:00
Polina Cherkasova
e1b420cd5b
Upgrade leak_tracker and remove some deps in allow list. ( #137806 )
2023-11-03 06:20:47 -07:00
Qun Cheng
dee88d19c1
Update Carousel tokens to v0.202 ( #137728 )
...
This PR is to export the carousel tokens from database. Only carousel tokens are updated.
Related to #125980
2023-11-02 00:45:23 +00:00
Qun Cheng
4a0f261b4e
Add Card.filled
and Card.outlined
factory methods ( #136229 )
...
Fixes #119401
This PR is to:
* add `Card.filled` and `Card.outlined` factory methods so that we can use tokens for these two types of cards to generate default theme instead of providing hard-corded values in example.
* update card.2.dart example.
* add test file for card.2.dart example.
* fix some mismatch caused by editing the auto-generated defaults by hand in navigation_bar.dart and navigation_drawer.dart.
2023-11-01 23:29:49 +00:00
Polina Cherkasova
d50f1fa9c9
Add dependency on leak_tracker and leak_tracker_testing to flutter_test. ( #137646 )
2023-10-31 19:19:12 -07:00
Polina Cherkasova
bcf267359c
Move dependency on leak_tracker from dependencies to dev_dependencies in flutter_test. ( #137633 )
...
Analyzer's dependency on autosnapshotting causes issues.
Because every version of integration_test from sdk depends on leak_tracker from hosted and autosnapshotting depends on leak_tracker from path, integration_test from sdk is forbidden.
So, because autosnapshotting depends on integration_test from sdk, version solving failed.
2023-10-31 21:12:52 +00:00
Polina Cherkasova
dcbb2de0ad
Add dependency on leak_tracker to flutter_test. ( #137069 )
...
Contributes to: https://github.com/flutter/flutter/issues/135856
This PR also adds transitive dependency on web_socket_channel, crypto, typed_data. `web_socket_channel` is needed to request retaining path for not GCed objects from VM Service. Two others are needed to serve web_socket_channel.
The dependency on leak_tracker is pinned:
aea562114c/packages/flutter_tools/lib/src/commands/update_packages.dart (L40)
2023-10-25 02:45:26 +00:00
Qun Cheng
ebc67643bd
Revert "Fix Gradle lockfiles." ( #137198 )
...
Reverts flutter/flutter#137190
2023-10-24 17:47:45 -07:00
Polina Cherkasova
ccbe221b3d
Fix Gradle lockfiles. ( #137190 )
2023-10-24 23:19:52 +00:00
flutter-pub-roller-bot
d7c82888c3
Roll pub packages ( #136924 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-10-20 20:36:29 +00:00
Elliott Brooks
01eef7ca13
Upgrade Flutter deps to pull in latest vm_service and dwds ( #136734 )
...
Generated by running `flutter update-packages --force-upgrade`
Updates vm_service to [12.0.0](https://pub.dev/packages/vm_service/versions/12.0.0 ) and dwds to [22.0.0](https://pub.dev/packages/dwds/versions/22.0.0 )
The changes to `packages/flutter_tools/lib/src/isolated/devfs_web.dart` are for the new interface of DWDS introduced in https://github.com/dart-lang/webdev/pull/2243
FYI @bkonyi
2023-10-19 18:29:02 +00:00
Christopher Fujino
4dcd1598b7
update analytics in generate api docs site to use new UA4 ( #136497 )
...
Change the analytics instance that the generated api.flutter.dev and master-api.flutter.dev use.
2023-10-16 19:47:48 +00:00
Christopher Fujino
c353e641ad
run tests under dev/tools as part of framework-misc and get them passing ( #136501 )
...
part of https://github.com/flutter/flutter/issues/136500
this should not affect any production code, it merely runs the tests on CI and makes the changes needed to get them passing.
2023-10-13 18:48:43 +00:00
Michael Goderbauer
437361321a
Bump file,process,process_runner ( #136418 )
2023-10-12 13:05:24 -07:00
Kevin Moore
3e60999b11
Allow latest pkg:material_color_utilities ( #132445 )
...
* Allow latest pkg:material_color_utilities
* Bump other dependencies to their latest - including pkg:web
2023-10-11 23:57:16 +00:00
Polina Cherkasova
9d9f213eed
Upgrade leak_tracker to fix flackiness. ( #135760 )
...
Fixes: https://github.com/flutter/flutter/issues/135716
leak_tracker is left pinned because future updates are going to be breaking.
2023-09-29 18:55:21 +00:00
David Iglesias
a4bc894616
[deps] Update package:web dependency. ( #135174 )
...
This PR is the result of running:
```console
$ flutter upgrade-packages --force-upgrade
```
### Issues
* Fixes https://github.com/flutter/flutter/issues/135075
* Supersedes #135081
2023-09-20 22:55:52 +00:00
Gray Mackall
f4b5fc1803
Unpin url launcher (remake) ( #134958 )
...
More up to date version of https://github.com/flutter/flutter/pull/133786 .
Fixes https://github.com/flutter/flutter/issues/111304
2023-09-20 02:43:57 +00:00
Greg Spencer
4ce7fdd92b
Remove 'must be non-null' and 'must not be null' comments from non-framework libraries ( #134994 )
...
## Description
This removes all of the comments that are of the form "so-and-so must not be null" or "so-and-so must be non-null" from the cases where those values are defines as non-nullable values.
This PR removes them from the library in the repo that don't have anything to do with the framework.
This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some.
In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow.
This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases. I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these).
## Related PRs
- https://github.com/flutter/flutter/pull/134984
- https://github.com/flutter/flutter/pull/134991
- https://github.com/flutter/flutter/pull/134992
- https://github.com/flutter/flutter/pull/134993
## Tests
- Documentation only change.
2023-09-19 17:26:07 +00:00
Michael Goderbauer
b966b2beee
Enable private field promotion for dev ( #134480 )
...
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020 . Feature is enabled by bumping the min SDK version to 3.2.
Part of https://github.com/flutter/flutter/issues/134476 .
2023-09-12 18:29:00 +00:00
Taha Tesser
1e770c3808
Add cancelButtonStyle
& confirmButtonStyle
to the DatePickerThemeData
( #132847 )
...
fixes [Unable to adjust the color for "Cancel" and "Ok" button in datePicker dialog](https://github.com/flutter/flutter/issues/127739 )
### 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: true,
datePickerTheme: DatePickerThemeData(
cancelButtonStyle: TextButton.styleFrom(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
side: BorderSide(color: Colors.red),
),
backgroundColor: Colors.white,
foregroundColor: Colors.red,
elevation: 3,
shadowColor: Colors.red,
),
confirmButtonStyle: TextButton.styleFrom(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
),
backgroundColor: Colors.green[700],
foregroundColor: Colors.white,
elevation: 3,
shadowColor: Colors.green[700],
),
),
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: DatePickerDialog(
initialDate: DateTime.now(),
firstDate: DateTime(2020),
lastDate: DateTime(2030),
),
),
);
}
}
```
</details>
### Before
Not possible to customize action buttons from the `DatePickerThemeData`.
### After

2023-08-30 21:16:13 +00:00
Xilai Zhang
6fd42536b7
[flutter roll] Revert "Fix Chip.shape
's side is not used when provided in Material 3" ( #133615 )
...
Reverts flutter/flutter#132941
context: b/298110031
The rounded rectangle borders don't appear in some of the internal
golden image tests.
2023-08-29 19:59:02 -07:00
Greg Spencer
ff829fd8b2
Add doxygen doc generation. ( #131356 )
2023-08-29 11:12:02 -07:00
Greg Spencer
5bd8579bc8
Use flutter pub get instead of dart pub get in create_api_docs.dart ( #133493 )
2023-08-28 16:12:16 -07:00
Kenzie Davisson
61d9f55665
Update flutter packages to pick up latest vm_service ( #133335 )
...
Generated by running `flutter update-packages --force-upgrade`
2023-08-25 11:03:35 -07:00
Taha Tesser
612117a690
Fix Chip.shape
's side is not used when provided in Material 3 ( #132941 )
...
fixes [Chip border side color not working in Material3](https://github.com/flutter/flutter/issues/132922 )
### 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(
theme: ThemeData(
useMaterial3: true,
chipTheme: const ChipThemeData(
// shape: RoundedRectangleBorder(
// side: BorderSide(color: Colors.amber),
// borderRadius: BorderRadius.all(Radius.circular(12)),
// ),
// side: BorderSide(color: Colors.red),
),
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: RawChip(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.amber),
borderRadius: BorderRadius.all(Radius.circular(12)),
),
// side: BorderSide(color: Colors.red),
label: Text('Chip'),
),
),
);
}
}
```
</details>
---
### Before
When `RawChip.shape` is provided with a `BorderSide`.
```dart
body: Center(
child: RawChip(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.amber),
borderRadius: BorderRadius.all(Radius.circular(12)),
),
label: Text('Chip'),
),
),
```

When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The `RawChip.side` overrides the shape's side.
```dart
body: Center(
child: RawChip(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.amber),
borderRadius: BorderRadius.all(Radius.circular(12)),
),
side: BorderSide(color: Colors.red),
label: Text('Chip'),
),
),
```

---
### After
When `RawChip.shape` is provided with a `BorderSide`.
```dart
body: Center(
child: RawChip(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.amber),
borderRadius: BorderRadius.all(Radius.circular(12)),
),
label: Text('Chip'),
),
),
```

When `RawChip.shape` is provided with a `BorderSide` and also `RawChip.side` is provided. The `RawChip.side` overrides the shape's side.
```dart
body: Center(
child: RawChip(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.amber),
borderRadius: BorderRadius.all(Radius.circular(12)),
),
side: BorderSide(color: Colors.red),
label: Text('Chip'),
),
),
```

---
2023-08-25 14:47:08 +00:00
Ian Hickson
5fa8de05ee
l10n-related documentation improvements ( #133114 )
2023-08-24 21:54:56 +00:00
Taha Tesser
1bc791697c
Update default menu text styles for Material 3 ( #131930 )
...
Related https://github.com/flutter/flutter/issues/131676
## Description
#### Fix default input text style for `DropdownMenu`

### Fix default text style for `MenuAnchor`'s menu items (which `DropdownMenu` uses for menu items)

### Default `DropdownMenu` Input text style

### Default `DropdownMenu` menu item text style

### Default `MenuAnchor` menu item text style

### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [DropdownMenu]s. The first dropdown menu has an outlined border.
void main() => runApp(const DropdownMenuExample());
class DropdownMenuExample extends StatefulWidget {
const DropdownMenuExample({super.key});
@override
State<DropdownMenuExample> createState() => _DropdownMenuExampleState();
}
class _DropdownMenuExampleState extends State<DropdownMenuExample> {
final TextEditingController colorController = TextEditingController();
final TextEditingController iconController = TextEditingController();
ColorLabel? selectedColor;
IconLabel? selectedIcon;
@override
Widget build(BuildContext context) {
final List<DropdownMenuEntry<ColorLabel>> colorEntries =
<DropdownMenuEntry<ColorLabel>>[];
for (final ColorLabel color in ColorLabel.values) {
colorEntries.add(
DropdownMenuEntry<ColorLabel>(
value: color, label: color.label, enabled: color.label != 'Grey'),
);
}
final List<DropdownMenuEntry<IconLabel>> iconEntries =
<DropdownMenuEntry<IconLabel>>[];
for (final IconLabel icon in IconLabel.values) {
iconEntries
.add(DropdownMenuEntry<IconLabel>(value: icon, label: icon.label));
}
return MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.green,
// textTheme: const TextTheme(
// bodyLarge: TextStyle(
// fontWeight: FontWeight.bold,
// fontStyle: FontStyle.italic,
// decoration: TextDecoration.underline,
// ),
// ),
),
home: Scaffold(
body: SafeArea(
child: Column(
children: <Widget>[
const Text('DropdownMenus'),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
DropdownMenu<ColorLabel>(
controller: colorController,
label: const Text('Color'),
dropdownMenuEntries: colorEntries,
onSelected: (ColorLabel? color) {
setState(() {
selectedColor = color;
});
},
),
const SizedBox(width: 20),
DropdownMenu<IconLabel>(
controller: iconController,
enableFilter: true,
leadingIcon: const Icon(Icons.search),
label: const Text('Icon'),
dropdownMenuEntries: iconEntries,
inputDecorationTheme: const InputDecorationTheme(
filled: true,
contentPadding: EdgeInsets.symmetric(vertical: 5.0),
),
onSelected: (IconLabel? icon) {
setState(() {
selectedIcon = icon;
});
},
),
],
),
),
const Text('Plain TextFields'),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
width: 150,
child: TextField(
controller: TextEditingController(text: 'Blue'),
decoration: const InputDecoration(
suffixIcon: Icon(Icons.arrow_drop_down),
labelText: 'Color',
border: OutlineInputBorder(),
)),
),
const SizedBox(width: 20),
SizedBox(
width: 150,
child: TextField(
controller: TextEditingController(text: 'Smile'),
decoration: const InputDecoration(
prefixIcon: Icon(Icons.search),
suffixIcon: Icon(Icons.arrow_drop_down),
filled: true,
labelText: 'Icon',
)),
),
],
),
),
if (selectedColor != null && selectedIcon != null)
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You selected a ${selectedColor?.label} ${selectedIcon?.label}'),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: Icon(
selectedIcon?.icon,
color: selectedColor?.color,
),
)
],
)
else
const Text('Please select a color and an icon.')
],
),
),
),
);
}
}
enum ColorLabel {
blue('Blue', Colors.blue),
pink('Pink', Colors.pink),
green('Green', Colors.green),
yellow('Yellow', Colors.yellow),
grey('Grey', Colors.grey);
const ColorLabel(this.label, this.color);
final String label;
final Color color;
}
enum IconLabel {
smile('Smile', Icons.sentiment_satisfied_outlined),
cloud(
'Cloud',
Icons.cloud_outlined,
),
brush('Brush', Icons.brush_outlined),
heart('Heart', Icons.favorite);
const IconLabel(this.label, this.icon);
final String label;
final IconData icon;
}
```
</details>
2023-08-22 22:21:00 +00:00
Gray Mackall
505f9d8954
Change gradle lockfile generation script to use --config-only flag ( #132967 )
...
The `generate_gradle_lockfiles.dart` script was generating the gradle wrapper by building a flavor that didn't exist. In the time since the script was written, the `--config-only` flag was created and should be used instead.
Context https://github.com/flutter/flutter/pull/132406#discussion_r1300352602
2023-08-21 19:51:55 +00:00
Zachary Anderson
d5a162b788
Forward port API docs creation realm handling from prior script ( #132867 )
...
It looks like the logic added here:
https://github.com/flutter/flutter/pull/131951/files#diff-297ee4cfe6d9bffc2fa1376918a50b8e4165ada4569575880c40811b6f749265R18
got dropped in the refactor here:
https://github.com/flutter/flutter/pull/132710
2023-08-18 15:33:27 -07:00
Greg Spencer
ced3e76626
Reland: "Reorganize and clarify API doc generator" ( #132353 ) ( #132710 )
...
## Description
This re-lands #132353 with some additional options for keeping around the staging directory, so that the recipe for publishing docs can give those options and have the staging directory left around for deploying to the website.
Reverted in #132613
## Related Issues
- https://flutter-review.googlesource.com/c/recipes/+/49580
2023-08-17 23:53:06 +00:00
Polina Cherkasova
1a0077dc81
Upgrade flutter packages. ( #132697 )
2023-08-16 16:26:58 -07:00
Jonah Williams
909400dc4d
Revert "Reorganize and clarify API doc generator" ( #132613 )
...
Reverts flutter/flutter#132353
Educated guess that this is causing the docs failures: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8772644466113801713/+/u/Docs/Deploy_docs/Firebase_deploy/stdout
2023-08-16 02:47:26 +00:00
Taha Tesser
23315f1b57
[Reland] #131609 ( #132555 )
...
This relands https://github.com/flutter/flutter/pull/131609
---
fixes [`PopupMenuItem` adds redundant padding when using `ListItem`](https://github.com/flutter/flutter/issues/128553 )
2023-08-16 00:44:06 +00:00
Greg Spencer
899a29f830
Reorganize and clarify API doc generator ( #132353 )
...
## Description
This cleans up a lot of issues with the API doc generation.
Here are the main changes:
- Rename `dartdoc.dart` to `create_api_docs.dart`
- Move the bulk of the operations out of `dev/bots/docs.sh` into `create_api_docs.dart`.
- Delete `dashing_postprocess.dart` and `java_and_objc.dart` and incorporate those operations into `create_api_docs.dart`.
- Refactor the doc generation into more understandable classes
- Bump the snippets tool version to 0.4.0 (the latest one)
- Centralize the information gathering about the Flutter repo into the new `FlutterInformation` class.
- Clean up the directory handling, and convert to using the `file` package for all file and directory paths.
- Add an `--output` option to docs.sh that specifies the location of the output ZIP file containing the docs.
- Defaults to placing the output in `dev/docs/api_docs.zip` (i.e. where the previous code generates the file).
- Moved all document generation into a temporary folder that is removed once the documents are generated, to avoid VSCode and other IDEs trying to index the thousands of HTML and JS files in the docs output.
- Updated pubspec dependencies.
## Tests
- Added tests for doc generation.
2023-08-15 22:12:16 +00:00
Polina Cherkasova
f0e7c51816
Upgrade flutter packages. ( #132585 )
2023-08-15 13:50:17 -07:00
Casey Hillers
7ce2d83b84
Revert "Fix PopupMenuItem
& CheckedPopupMenuItem
has redundant ListTile
padding and update default horizontal padding for Material 3" ( #132457 )
...
Reverts flutter/flutter#131609
b/295497265 - This broke Google Testing. We'll need the internal patch
before landing as there's a large number of customer codebases impacted.
2023-08-13 14:27:01 -07:00
Polina Cherkasova
60634c65b2
Upgrade flutter packages. ( #132326 )
2023-08-10 13:44:05 -07:00
Taha Tesser
96e02c61dc
Fix PopupMenuItem
& CheckedPopupMenuItem
has redundant ListTile
padding and update default horizontal padding for Material 3 ( #131609 )
...
fixes [`PopupMenuItem` adds redundant padding when using `ListItem`](https://github.com/flutter/flutter/issues/128553 )
### Description
- Fixed redundant `ListTile` padding when using `CheckedPopupMenuItem` or `PopupMenuItem` with the `ListTile` child for complex popup menu items as suggested in the docs.
- Updated default horizontal padding for popup menu items.
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [PopupMenuButton].
// This is the type used by the popup menu below.
enum SampleItem { itemOne, itemTwo, itemThree }
void main() => runApp(const PopupMenuApp());
class PopupMenuApp extends StatelessWidget {
const PopupMenuApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const PopupMenuExample(),
);
}
}
class PopupMenuExample extends StatefulWidget {
const PopupMenuExample({super.key});
@override
State<PopupMenuExample> createState() => _PopupMenuExampleState();
}
class _PopupMenuExampleState extends State<PopupMenuExample> {
SampleItem? selectedMenu;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('PopupMenuButton')),
body: Center(
child: SizedBox(
width: 150,
height: 100,
child: Align(
alignment: Alignment.topLeft,
child: PopupMenuButton<SampleItem>(
initialValue: selectedMenu,
// Callback that sets the selected popup menu item.
onSelected: (SampleItem item) {
setState(() {
selectedMenu = item;
});
},
itemBuilder: (BuildContext context) =>
<PopupMenuEntry<SampleItem>>[
const PopupMenuItem<SampleItem>(
value: SampleItem.itemOne,
child: Text('PopupMenuItem'),
),
const CheckedPopupMenuItem<SampleItem>(
checked: true,
value: SampleItem.itemTwo,
child: Text('CheckedPopupMenuItem'),
),
const PopupMenuItem<SampleItem>(
value: SampleItem.itemOne,
child: ListTile(
leading: Icon(Icons.cloud),
title: Text('ListTile'),
contentPadding: EdgeInsets.zero,
trailing: Icon(Icons.arrow_right_rounded),
),
),
],
),
),
),
),
);
}
}
```
</details>
### Before

- Default horizontal padding is the same as M2 (16.0), while the specs use a smaller value (12.0)
- `ListTile` nested by default in `CheckedPopupMenuItem` has redundant padding
- `PopupMenuItem` using `ListTile` as a child for complex menu items contains redundant padding.

### After
- Default horizontal padding is updated for Material 3.
- `PopupMenuItem` & `CheckedPopupMenuItem` override `ListTile` padding (similar to how `ExpansionTile` overrides `ListTile` text and icon color.

2023-08-10 16:05:03 +00:00
Zachary Anderson
118c2df776
Allows adding a storage 'realm' to the storage base URL ( #131951 )
...
Context: https://github.com/flutter/flutter/issues/131862
This PR injects a "realm" component to the storage base URL when the contents of the file `bin/internal/engine.realm` is non-empty.
As documented in the PR, when the realm is `flutter_archives_v2`, and `bin/internal/engine.version` contains the commit hash for a commit in a `flutter/engine` PR, then the artifacts pulled by the tool will be the artifacts built by the presubmit checks for the PR.
This works for everything but the following two cases:
1. Fuchsia artifacts are not uploaded to CIPD by the Fuchsia presubmit builds.
2. Web artifacts are not uploaded to gstatic by the web engine presubmit builds.
For (1), the flutter/flutter presubmit `fuchsia_precache` is driven by a shell script outside of the repo. It will fail when the `engine.version` and `engine.realm` don't point to a post-submit engine commit.
For (2), the flutter/flutter web presubmit tests that refer to artifacts in gstatic hang when the artifacts aren't found, so this PR skips them.
2023-08-09 23:26:05 +00:00
Zachary Anderson
f4c25bbb35
Revert "Handle breaking changes in leak_tracker." ( #132223 )
...
Reverts flutter/flutter#131998
Reverting for https://github.com/flutter/flutter/issues/132222
2023-08-09 08:14:39 -07:00
Qun Cheng
0bc5a2bca4
Add textCapitalization
property for SearchBar
and SearchAnchor
( #131459 )
...
This is to add `textCapitalization` property for `SearchBar` and `SearchAnchor`.
Fixes : #131260
2023-08-08 23:24:19 +00:00
Ian Hickson
e60dc3012e
Update dartdoc driver to match current behaviour ( #132078 )
2023-08-08 17:12:52 +00:00
Polina Cherkasova
acd636f7ba
Handle breaking changes in leak_tracker. ( #131998 )
2023-08-08 09:39:19 -07:00
Polina Cherkasova
2c10295904
Upgrade packages. ( #131927 )
2023-08-04 08:09:00 -07:00
Taha Tesser
0192f88328
Fix TimePicker token issue link ( #131863 )
...
Fix issue reference for https://github.com/flutter/flutter/issues/131247 (it was added in the bug fix PR https://github.com/flutter/flutter/pull/131253 )
2023-08-03 22:32:57 +00:00
Taha Tesser
2c71881f50
Fix Scrollable TabBar
for Material 3 ( #131409 )
...
fixes [Material 3 `TabBar` does not take full width when `isScrollable: true`](https://github.com/flutter/flutter/issues/117722 )
### Description
1. Fixed the divider doesn't stretch to take all the available width in the scrollable tab bar in M3
2. Added `dividerHeight` property.
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [TabBar].
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
const TabBarApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: TabBarExample(),
);
}
}
class TabBarExample extends StatefulWidget {
const TabBarExample({super.key});
@override
State<TabBarExample> createState() => _TabBarExampleState();
}
class _TabBarExampleState extends State<TabBarExample> {
bool rtl = false;
bool customColors = false;
bool removeDivider = false;
Color dividerColor = Colors.amber;
Color indicatorColor = Colors.red;
@override
Widget build(BuildContext context) {
return DefaultTabController(
initialIndex: 1,
length: 3,
child: Directionality(
textDirection: rtl ? TextDirection.rtl : TextDirection.ltr,
child: Scaffold(
appBar: AppBar(
title: const Text('TabBar Sample'),
actions: <Widget>[
IconButton.filledTonal(
tooltip: 'Switch direction',
icon: const Icon(Icons.swap_horiz),
onPressed: () {
setState(() {
rtl = !rtl;
});
},
),
IconButton.filledTonal(
tooltip: 'Use custom colors',
icon: const Icon(Icons.color_lens),
onPressed: () {
setState(() {
customColors = !customColors;
});
},
),
IconButton.filledTonal(
tooltip: 'Show/hide divider',
icon: const Icon(Icons.remove_rounded),
onPressed: () {
setState(() {
removeDivider = !removeDivider;
});
},
),
],
),
body: Column(
children: <Widget>[
const Spacer(),
const Text('Scrollable - TabAlignment.start'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.start,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Text('Scrollable - TabAlignment.startOffset'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.startOffset,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Text('Scrollable - TabAlignment.center'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.center,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Spacer(),
const Text('Non-scrollable - TabAlignment.fill'),
TabBar(
tabAlignment: TabAlignment.fill,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Text('Non-scrollable - TabAlignment.center'),
TabBar(
tabAlignment: TabAlignment.center,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Spacer(),
const Text('Secondary - TabAlignment.fill'),
TabBar.secondary(
tabAlignment: TabAlignment.fill,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Text('Secondary - TabAlignment.center'),
TabBar.secondary(
tabAlignment: TabAlignment.center,
dividerColor: customColors ? dividerColor : null,
indicatorColor: customColors ? indicatorColor : null,
dividerHeight: removeDivider ? 0 : null,
tabs: const <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
const Spacer(),
],
),
),
),
);
}
}
```
</details>
### Before

### After

This also contains regression test for https://github.com/flutter/flutter/pull/125974#discussion_r1239089151
```dart
// This is a regression test for https://github.com/flutter/flutter/pull/125974#discussion_r1239089151 .
testWidgets('Divider can be constrained', (WidgetTester tester) async {
```

2023-08-02 00:48:06 +00:00
Polina Cherkasova
35213ceabd
Upgrade Flutter libraries. ( #131700 )
2023-08-01 12:59:47 -07:00
Taha Tesser
7d89617a92
Fix TimePicker
defaults for hourMinuteTextStyle
and dayPeriodTextColor
for Material 3 ( #131253 )
...
fixes [`TimePicker` color and visual issues](https://github.com/flutter/flutter/issues/127035 )
## Description
- fixes default text style for `TimePicker`s `hourMinuteTextStyle` and added a todo for https://github.com/flutter/flutter/issues/131247
- fixes correct default color not being accessed for `dayPeriodTextColor`
- Updates tests
### 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: true),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Sample'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
showTimePicker(
context: context,
orientation: Orientation.portrait,
initialEntryMode: TimePickerEntryMode.input,
initialTime: TimeOfDay.now(),
builder: (BuildContext context, Widget? child) {
return MediaQuery(
data: MediaQuery.of(context)
.copyWith(alwaysUse24HourFormat: true),
child: child!,
);
},
);
},
child: const Text('Open Time Picker'),
),
),
);
}
}
```
</details>
### Before

### After

2023-07-28 14:11:23 +00:00
Jason Simmons
8a84437989
Manual roll to engine commit 9b14c382 using Dart SDK version 3.2.x ( #131371 )
...
Dart SDK 3.2.x requires a new version of the dart_internal package.
2023-07-27 17:33:07 +00:00
Taha Tesser
5554b0eeb3
Fix M3 TimePicker dial background uses incorrect color ( #131045 )
...
fixes [Material3: TimePicker clock dial use wrong spec color and its web spec has a mistake](https://github.com/flutter/flutter/issues/118657 )
### Description
This PR fixes the default color used for the Material 3 dial background.
### 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) {
final ThemeData theme = ThemeData(useMaterial3: true);
return MaterialApp(
debugShowCheckedModeBanner: false,
// theme: theme,
theme: theme.copyWith(
colorScheme: theme.colorScheme.copyWith(
surfaceVariant: const Color(0xffffbf00),
),
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Sample'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
showTimePicker(
context: context,
initialTime: TimeOfDay.now(),
);
},
child: const Text('Open Time Picker'),
),
),
);
}
}
```
</details>
### Default dial background color
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/59514586-60c6-489f-b024-f659a26fa1e7 " /> | <img src="https://github.com/flutter/flutter/assets/48603081/75c3c360-df2b-47c8-8187-136ff6d963b6 " /> |
### Custom color scheme
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/666dd2fc-7ee2-4268-9af0-923019adfccd " /> | <img src="https://github.com/flutter/flutter/assets/48603081/f32dc39e-a43f-4a63-a6e4-9df479b723ed " /> |
2023-07-24 18:30:23 +00:00
Pierre-Louis
0919fb86f1
Improve handling of certain icons in RTL ( #130979 )
...
Fixes https://github.com/flutter/flutter/issues/130978
## 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
2023-07-21 19:07:39 +02:00
Pierre-Louis
0830a362d5
Add support for M3 motion ( #129942 )
...
## Description
This adds support for M3 easing and duration tokens.
This PR includes these changes:
* Generation of duration and easing constants, in `Durations` and
`Easing`, respectively (`Curves` is already taken in the `animation`
library)
* Add 3 Dart fixes
Once this is merged, I'll migrate packages/plugins/customers and then
uncomment the deprecation notices for the 3 M2 curves, all of which have
1:1 replacements.
## Related Issues
- Fixes https://github.com/flutter/flutter/issues/116525
## Tests
- Added Dart fix tests
## 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
2023-07-19 22:07:59 +02:00
flutter-pub-roller-bot
edcaa335d1
Roll pub packages ( #130821 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-07-18 21:55:17 +00:00
LongCatIsLooong
b2e22d3558
Replaces textScaleFactor
with TextScaler
( #128522 )
...
Deprecate `textScaleFactor` in favor of `textScaler`, in preparation for Android 14 [Non-linear font scaling to 200%](https://developer.android.com/about/versions/14/features#non-linear-font-scaling ). The `TextScaler` class can be moved to `dart:ui` in the future, if we decide to use the Android platform API or AndroidX to get the scaling curve instead of hard coding the curve in the framework.
I haven't put the Flutter version in the deprecation message so the analyzer checks are failing. Will do so after I finish the migration guide.
**Why `TextScaler.textScaleFactor`**
The author of a `TextScaler` subclass should provide a fallback `textScaleFactor`. By making `TextScaler` also contain the `textScaleFactor` information it also makes it easier to migrate: if a widget overrides `MediaQueryData.textScaler` in the tree, for unmigrated widgets in the subtree it would also have to override `MediaQueryData.textScaleFactor`, and that makes it difficult to remove `MediaQueryData.textScaleFactor` in the future.
## A full list of affected APIs in this PR
Deprecated: The method/getter/setter/argument is annotated with a `@Deprecated()` annotation in this PR, and the caller should replace it with `textScaler` instead. Unless otherwise specified there will be a Flutter fix available to help with migration but it's still recommended to migrate case-by-case.
**Replaced**: The method this `textScaleFactor` argument belongs to is rarely called directly by user code and is not overridden by any of the registered custom tests, so the argument is directly replaced by `TextScaler`.
**To Be Deprecated**: The method/getter/setter/argument can't be deprecated in this PR because a registered customer test depends on it and a Flutter fix isn't available (or the test was run without applying flutter fixes first). This method/getter/setter/argument will be deprecated in a followup PR once the registered test is migrated.
### `Painting` Library
| Affected API | State of `textScaleFactor` | Comment |
| --- | --- | --- |
| `InlineSpan.build({ double textScaleFactor = 1.0 })` argument | **Replaced** | |
| `TextStyle.getParagraphStyle({ double TextScaleFactor = 1.0 })` argument | **Replaced** | |
| `TextStyle.getTextStyle({ double TextScaleFactor = 1.0 })` argument| Deprecated | Can't replace: c47fd38dca/super_editor/lib/src/infrastructure/super_textfield/desktop/desktop_textfield.dart (L1903-L1905)
|
| `TextPainter({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `TextPainter.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |
| `TextPainter.computeWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | |
| `TextPainter.computeMaxIntrinsicWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | |
### `Rendering` Library
| Affected API | State of `textScaleFactor` | Comment |
| --- | --- | --- |
| `RenderEditable({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `RenderEditable.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |
| `RenderParagraph({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | |
| `RenderParagraph.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet |
### `Widgets` Library
| Affected API | State of `textScaleFactor` | Comment |
| --- | --- | --- |
| `MediaQueryData({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/test/text_scale_factor_test.dart (LL39C21-L39C35)
|
| `MediaQueryData.textScaleFactor` getter | Deprecated | |
| `MediaQueryData.copyWith({ double? TextScaleFactor })` argument | Deprecated | |
| `MediaQuery.maybeTextScaleFactorOf(BuildContext context)` static method | Deprecated | No Flutter Fix, not expressible yet |
| `MediaQuery.textScaleFactorOf(BuildContext context)` static method | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/_functions_io.dart (L68-L70)
, No Flutter Fix, not expressible yet |
| `RichText({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/builder.dart (L829-L843)
|
| `RichText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away|
| `Text({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | 914d120da1/packages/rfw/lib/src/flutter/core_widgets.dart (L647)
, No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `Text.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `Text.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away |
| `EditableText({ double? TextScaleFactor = 1.0 })` constructor argument | Deprecated | No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `EditableText.textScaleFactor` getter | Deprecated | |
### `Material` Library
| Affected API | State of `textScaleFactor` | Comment |
| --- | --- | --- |
| `SelectableText({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | cd7b93532e/packages/flutter_markdown/lib/src/builder.dart (L829-L843)
, No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `SelectableText.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 |
| `SelectableText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away |
A lot of material widgets (`Slider`, `RangeSlider`, `TimePicker`, and different types of buttons) also change their layout based on `textScaleFactor`. These need to be handled in a case-by-case fashion and will be migrated in follow-up PRs.
2023-07-17 17:56:07 +00:00
Alexander Aprelev
3b8f6c4020
Upgrade framework pub dependencies, roll engine with rolled dart sdk ( #130163 )
...
Manual roll is needed because incoming dart sdk requires updated version
vm_snapshot_analysis (>=0.7.4).
5ae09b8b4f...7c83ea3e85
```
7c83ea3e85 Reland "Manual roll Dart SDK from 2d98d9e27dae to 0b07debd5862 (21 revisions) (#43457 )" (#43472 )
9ef3e8d533 Roll Skia from 5eba922297bb to 93c92f97f5ab (2 revisions) (#43471 )
```
Remove implementation of SuitePlatform from the test as well. Remove use
of fake cwd from SuitePlatform as it can't be properly faked.
2023-07-07 13:55:35 -07:00
Michael Goderbauer
55b6f049a6
Enable unreachable_from_main lint - it is stable now!!1 ( #129854 )
...
PLUS: clean-up of all the unreachable stuff.
2023-07-06 00:09:01 +00:00
Taha Tesser
7cef966147
Fix NavigationDrawer
selected item has wrong icon color ( #129625 )
...
fixes [NavigationDrawer selected item has wrong icon color [Material3 spec]](https://github.com/flutter/flutter/issues/129572 )
### Description
This PR fixes a mistake in the `NavigationDrawer` defaults, where generated token value returns a `null`.
This issue can be detected when you want to customize the selected icon color for `NavigationDrawerDestination` using a custom color scheme.
### Code sample
<details>
<summary>expanded 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,
themeMode: ThemeMode.light,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue).copyWith(
onSecondaryContainer: Colors.red,
),
useMaterial3: true,
),
home: const Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('NavigationDrawer Sample'),
),
drawer: const NavigationDrawer(
children: <Widget>[
NavigationDrawerDestination(
icon: Icon(Icons.favorite_outline_rounded),
label: Text('Favorite'),
selectedIcon: Icon(Icons.favorite_rounded),
),
NavigationDrawerDestination(
icon: Icon(Icons.favorite_outline_rounded),
label: Text('Favorite'),
),
],
),
);
}
}
```
</details>
### Before
<img width="1053" alt="Screenshot 2023-06-27 at 13 24 38" src="https://github.com/flutter/flutter/assets/48603081/18c13a73-688f-4586-bb60-bddef45d173f ">
### After
<img width="1053" alt="Screenshot 2023-06-27 at 13 24 25" src="https://github.com/flutter/flutter/assets/48603081/8a1427c6-517f-424a-b0bd-24bad7c5fbb0 ">
2023-06-30 08:58:14 +00:00
Kate Lovett
087377ea2f
Revert "Fix Material 3 Scrollable TabBar
" ( #129383 )
...
Reverts flutter/flutter#125974
2023-06-22 22:34:06 +00:00
Taha Tesser
32fde139bc
Fix Material 3 Scrollable TabBar
( #125974 )
...
fix https://github.com/flutter/flutter/issues/117722
### Description
1. Fix the divider doesn't stretch to take all the available width in the scrollable tab bar in M3
2. Add `dividerHeight` property.
3. Update the default tab alignment for the scrollable tab bar to match the specs (this is backward compatible for M2 with the new `tabAlignment` property).
### Bug (default tab alignment)

### Fix (default tab alignment)

### Code sample
<details>
<summary>code sample</summary>
```dart
import 'package:flutter/material.dart';
/// Flutter code sample for [TabBar].
void main() => runApp(const TabBarApp());
class TabBarApp extends StatelessWidget {
const TabBarApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
// tabBarTheme: const TabBarTheme(tabAlignment: TabAlignment.start),
useMaterial3: true,
),
home: const TabBarExample(),
);
}
}
class TabBarExample extends StatefulWidget {
const TabBarExample({super.key});
@override
State<TabBarExample> createState() => _TabBarExampleState();
}
class _TabBarExampleState extends State<TabBarExample> {
bool rtl = false;
@override
Widget build(BuildContext context) {
return DefaultTabController(
initialIndex: 1,
length: 3,
child: Directionality(
textDirection: rtl ? TextDirection.rtl : TextDirection.ltr,
child: Scaffold(
appBar: AppBar(
title: const Text('TabBar Sample'),
),
body: const Column(
children: <Widget>[
Text('Scrollable-TabAlignment.start'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.start,
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
Text('Scrollable-TabAlignment.startOffset'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.startOffset,
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
Text('Scrollable-TabAlignment.center'),
TabBar(
isScrollable: true,
tabAlignment: TabAlignment.center,
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
Spacer(),
Text('Non-scrollable-TabAlignment.fill'),
TabBar(
tabAlignment: TabAlignment.fill,
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
Text('Non-scrollable-TabAlignment.center'),
TabBar(
tabAlignment: TabAlignment.center,
tabs: <Widget>[
Tab(
icon: Icon(Icons.cloud_outlined),
),
Tab(
icon: Icon(Icons.beach_access_sharp),
),
Tab(
icon: Icon(Icons.brightness_5_sharp),
),
],
),
Spacer(),
],
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
setState(() {
rtl = !rtl;
});
},
label: const Text('Switch Direction'),
icon: const Icon(Icons.swap_horiz),
),
),
),
);
}
}
```
</details>

2023-06-22 17:30:46 +00:00
Taha Tesser
467c970bfb
Introduce MaterialState color
property for chips ( #128584 )
...
fixes https://github.com/flutter/flutter/issues/115827
fixes https://github.com/flutter/flutter/issues/101325
### Description
1. This PR adds a new MaterialState `color` property to all the chips (this makes it possible to customize chips in all states from the M3 specs).
2. Updated defaults to use the new MaterialState `color` property.
3. Updated and added new tests to all the chip test classes.
<details>
<summary>code sample</summary>
```dart
import 'package:flutter/material.dart';
const Color disabledColor = Colors.black26;
const Color backgroundColor = Colors.cyan;
final Color disabledSelectedColor = Colors.red.shade100;
const Color selectedColor = Colors.amber;
final MaterialStateProperty<Color> color =
MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled) &&
states.contains(MaterialState.selected)) {
return disabledSelectedColor;
}
if (states.contains(MaterialState.disabled)) {
return disabledColor;
}
if (states.contains(MaterialState.selected)) {
return selectedColor;
}
return backgroundColor;
});
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: true,
// chipTheme: ChipThemeData(color: color),
),
home: const Example(),
);
}
}
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
bool enabled = false;
bool selected = true;
@override
Widget build(BuildContext context) {
const Widget verticalSpace = SizedBox(height: 20);
return Scaffold(
body: Center(
child: Column(
children: <Widget>[
const SizedBox(height: 25),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const Card(
elevation: 0.0,
color: disabledColor,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text('disabledColor'),
),
),
const Card(
elevation: 0.0,
color: backgroundColor,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text('backgroundColor'),
),
),
Card(
elevation: 0.0,
color: disabledSelectedColor,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text('disabledSelectedColor'),
),
),
const Card(
elevation: 0.0,
color: selectedColor,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text('selectedColor'),
),
),
],
),
const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RawChip(
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('RawChip'),
isEnabled: enabled,
onSelected: enabled ? (bool value) {} : null,
),
verticalSpace,
InputChip(
isEnabled: enabled,
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('InputChip'),
onSelected: enabled ? (bool value) {} : null,
),
],
),
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FilterChip(
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('FilterChip'),
onSelected: enabled ? (bool value) {} : null,
),
verticalSpace,
FilterChip.elevated(
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('FilterChip.elevated'),
onSelected: enabled ? (bool value) {} : null,
),
],
),
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ChoiceChip(
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('ChoiceChip'),
onSelected: enabled ? (bool value) {} : null,
),
verticalSpace,
ChoiceChip.elevated(
selected: selected,
selectedColor: selectedColor,
color: color,
label: const Text('ChoiceChip.elevated'),
onSelected: enabled ? (bool value) {} : null,
),
],
),
],
),
const Spacer(),
Row(
children: <Widget>[
Flexible(
child: SwitchListTile(
title: const Text('Enabled'),
value: enabled,
onChanged: (bool value) {
setState(() => enabled = value);
},
),
),
Flexible(
child: SwitchListTile(
title: const Text('Selected'),
value: selected,
onChanged: (bool value) {
setState(() => selected = value);
},
),
),
],
)
],
),
),
);
}
}
```
</details>
### Before (not possible to customize disabled and selected chips)

### After (using disabled and selected chips using the new MaterialState `color` property)

2023-06-19 22:03:26 +00:00
Mouad Debbar
a162d7546a
flutter update-packages --force-upgrade ( #128908 )
...
- Bumps `vm_service` from `11.6.0` to `11.7.1`
- Bumps `web` from `0.1.3-beta` to `0.1.4-beta` and adds it everywhere.
- Moves `js` from `dependencies` to `dev_dependencies`
2023-06-15 18:17:09 +00:00
Taha Tesser
ca5aa2329a
Update ListTile
text defaults to use ColorScheme
( #128581 )
...
fixes https://github.com/flutter/flutter/issues/128569
<details>
<summary>code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const ListTileApp());
}
class ListTileApp extends StatelessWidget {
const ListTileApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red).copyWith(
onSurface: Colors.yellow,
onSurfaceVariant: Colors.green,
),
),
home: const Scaffold(
body: Center(
child: ListTile(
title: Text('title'),
subtitle: Text('subtitle'),
),
),
),
);
}
}
```
</details>
# Description
M3 ListTile couldn't be customized using `ColorScheme` colors.
- This PR updates the list tile text defaults to `ColorScheme` text color tokens.
- Improved the `ListTile` template to use the token group.
- Update docs and tests.
```dart
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red).copyWith(
onSurface: Colors.yellow,
onSurfaceVariant: Colors.green,
),
```
### Before

### After

2023-06-12 14:52:06 +00:00
Pierre-Louis
66cda5917d
Improve defaults generation with logging, stats, and token validation ( #128244 )
...
## Description
This improves defaults generation with logging, stats, and token validation.
This PR includes these changes:
* introduce `TokenLogger`, with a verbose mode
* prints versions and tokens usage to the console
* outputs `generated/used_tokens.csv`, a list of all used tokens, for use by Google
* find token files in `data` automatically
* hide tokens `Map`
* tokens can be obtained using existing resolvers (e.g. `color`, `shape`), or directly through `getToken`.
* tokens can be checked for existence with `tokenAvailable`
* remove version from template, since the tokens are aggregated and multiple versions are possible (as is the case currently), it does not make sense to attribute a single version
* improve documentation
## Related Issues
- Fixes https://github.com/flutter/flutter/issues/122602
## Tests
- Added tests for `TokenLogger`
- Regenerated tokens, no-op except version removal
## Future work
A future PR should replace or remove the following invalid tokens usages
<img width="578" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b6f9e5a7-523f-4f72-94f9-1b0bf4cc9f00 ">
2023-06-09 11:28:18 +00:00
Jackson Gardner
7c15a26eab
Reland "Migrate benchmarks to package:web" ( #128266 )
...
This attempts to reland https://github.com/flutter/flutter/pull/126848
This was reverted because it made some unexpected changes to our perf measurements. After landing https://github.com/flutter/flutter/pull/127900 , we have much less noise in our benchmarks, so I'd like to reland this and see if there is still a significant measurement difference.
2023-06-08 22:25:40 +00:00
LongCatIsLooong
73e1f23426
Remove textScaleFactor
dependent logic from AppBar
( #128112 )
...
I am trying to remove `textScaleFactor`-dependent logic from the framework since it's likely going to be deprecated, hopefully the original logic isn't from the material spec.
I stole the sample code from https://github.com/flutter/flutter/pull/125038 and here are the screenshots (`textScaleFactor = 3.0`).
Internal Tests: **no relevant test failures**
| Medium | Large |
| --------------- | --------------- |
|  |  |
2023-06-06 20:47:40 +00:00
Taha Tesser
513ff44bce
Add FilterChip.elevated
, ChoiceChip.elevated
, & ActionChip.elevated
variants ( #128049 )
2023-06-01 16:29:28 -07:00
Christopher Fujino
0763d61f56
[flutter_tools] manually roll pub deps ( #127447 )
...
Fixes https://github.com/flutter/flutter/issues/127226
2023-05-30 23:34:52 +00:00
Parker Lougheed
c313083a88
Remove null-safety argument from DartPad doc samples ( #127345 )
...
Removes the `null_safety=true` query parameter from DartPad samples in the API docs, since all DartPad channels only support null safety now and the parameter does nothing.
## Test
Removing code, but updates the check in the dartdoc tool for the removal.
2023-05-23 00:10:11 +00:00
Polina Cherkasova
ea5eddb5a9
Upgrade leak_tracker to 5.0.0 ( #126367 )
...
Fixes https://github.com/flutter/flutter/issues/126259
Updated pubspec:
345f0bffbf/packages/flutter/pubspec.yaml
2023-05-16 04:39:26 +00:00
Tomasz Gucio
99c7e9f088
Add spaces after flow control statements ( #126320 )
2023-05-15 11:07:30 +02:00
Michael Goderbauer
42d9a2b3fa
Sync lints ( #126316 )
...
Sync lints with https://github.com/dart-lang/linter/blob/master/example/all.yaml and enable `implicit_reopen` and `type_literal_in_constant_pattern` (which have no violations). Also contains some clean-up work towards enabling `matching_super_parameters`, which is not quite ready yet due to its handling of "private" arguments.
2023-05-11 13:27:51 +00:00
Qun Cheng
4e7e4512b6
Reorder materialStateProperty
defaults ( #125905 )
...
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.
2023-05-11 00:03:09 +00:00
Pierre-Louis
65dfb555c0
Update packages ( #126140 )
...
In particular, update pin for `material_color_utilities` to `0.5.0`.
2023-05-08 09:51:28 +02:00
Qun Cheng
c1c2513ac9
Add Switch.trackOutlineWidth
property ( #125848 )
2023-05-05 13:34:08 -07:00
Taha Tesser
ad009fb7ac
Fix Material 3 tab indicator weight and position ( #125883 )
...
fixes https://github.com/flutter/flutter/issues/123112
### Description
1. Add proper M3 indicator height aka`IndictorWeight` from the M3 specs for the primary tab bar with label indicator size.
db6074ade4/dev/tools/gen_defaults/data/navigation_tab_primary.json (L9)
(this was held due to `indicatorWeight` having a hard-coded value)
and added a secondary tab bar indicator height.
2. Set a minimum value for the rounded indicator to maintain the indicator shape.
3. With proper indicator height, the rounded indicator position is also fixed.
4. Fix round indicator is shown for the primary tab bar with tab indicator size.
5. Above changes fix https://github.com/flutter/flutter/issues/123112 .
6. Fix the `startOffset` const value from https://github.com/flutter/flutter/pull/125036 to match docs and move it to a variable.
2023-05-05 14:09:18 +00:00
Taha Tesser
a732a74888
Introduce TabBar.tabAlignment
( #125036 )
...
fixes https://github.com/flutter/flutter/issues/124195
This introduces `TabBar.tabAlignment` while keeping the default alignment for both M2 and M3.
2023-05-01 16:59:55 +00:00
Flutter GitHub Bot
73a343f191
Roll pub packages ( #125698 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-04-28 19:30:06 +00:00
Qun Cheng
a433f88d16
Checkbox.fillColor
should be applied to checkbox's background color when it is unchecked. (#125643 )
2023-04-28 12:05:31 -07:00
Flutter GitHub Bot
888b208d62
Roll pub packages ( #125447 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-04-28 17:31:45 +00:00
Pierre-Louis
1f602cb6ca
Provide default constraints for M3 bottom sheets ( #120065 )
...
This PR constrains M3 bottom sheets to 640dp max width by default.
`constraints` can be used to provide different `minWidth` and
`maxWidth`.
This is not a breaking change per the breaking change policy.
Part of https://github.com/flutter/flutter/issues/118619
Part of https://github.com/flutter/flutter/issues/111448
## 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
2023-04-27 09:28:11 +02:00
Flutter GitHub Bot
d85e2fb810
Roll pub packages ( #125225 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-04-20 18:28:10 +00:00
Flutter GitHub Bot
a573d1aeee
Roll pub packages ( #125050 )
...
This PR was generated by `flutter update-packages --force-upgrade`.
2023-04-20 17:36:10 +00:00
Flutter GitHub Bot
d300b86e80
Roll pub packages ( #124709 )
...
Roll pub packages
2023-04-13 20:54:52 +00:00
Tae Hyung Kim
c0c5901c0b
Fix gen_date_localizations script and regenerate ( #124547 )
...
Internal bug: b/256596915
Turns out we need to regenerate date localizations in order for the
`intl` package to be setup properly within Flutter. This PR fixes the
script (since it assumes the use of the old `.packages` way of handling
packages), and regenerates the `generated_date_localizations.dart` file.
2023-04-11 16:54:54 -07:00
Eilidh Southren
0f5e513ba8
Update MCU version ( #124512 )
...
Update MCU version
2023-04-10 16:44:26 +00:00
Flutter GitHub Bot
cc4b455521
Roll pub packages ( #124364 )
...
Roll pub packages
2023-04-07 17:19:24 +00:00
chunhtai
9e4b5fb7d9
Adds i18n to widget layer ( #123620 )
...
Adds i18n to widget layer
2023-04-04 22:57:35 +00:00
Flutter GitHub Bot
0046a25e39
Roll pub packages ( #123899 )
...
Roll pub packages
2023-04-03 16:56:56 +00:00
Danny Tuppeny
a5fc8b2bd4
Roll pub packages ( #123854 )
...
Roll pub packages
2023-03-31 16:41:18 +00:00
Kate Lovett
3dfc60c0d1
Revert "Fix divider width in scrollable TabBar
for Material 3 and add dividerHeight
parameter ( #123127 )" ( #123616 )
...
Revert "Fix divider width in scrollable `TabBar` for Material 3 and add `dividerHeight` parameter"
2023-03-28 16:45:15 +00:00
Qun Cheng
0300cfa603
Create SearchAnchor
and SearchViewTheme
Widget ( #123256 )
2023-03-27 23:31:11 -07:00
Taha Tesser
3512c2cd76
Fix divider width in scrollable TabBar
for Material 3 and add dividerHeight
parameter ( #123127 )
...
Fix divider width in scrollable `TabBar` for Material 3 and add `dividerHeight` parameter
2023-03-27 22:52:59 +00:00
Pierre-Louis
02d5c7595b
Add support for secondary tab bar ( #122756 )
...
Add support for secondary tab bar
2023-03-23 22:49:59 +00:00
Flutter GitHub Bot
7b7af9f34c
roll packages ( #123339 )
...
Roll pub packages
2023-03-23 19:03:57 +00:00
Michael Goderbauer
fda9ecfef7
Remove 1745 decorative breaks ( #123259 )
...
Remove 1745 decorative breaks
2023-03-22 21:12:22 +00:00
Bartek Pacia
c40dd27681
Fix Gradle warning in a freshly flutter create
ed Android project ( #122290 )
...
Fix Gradle warning in a freshly `flutter create`ed Android project
2023-03-21 23:41:49 +00:00
Michael Goderbauer
25e38a2a87
Bump lower Dart SDK constraints to 3.0 & add class modifiers ( #122546 )
...
Bump lower Dart SDK constraints to 3.0 & add class modifiers
2023-03-21 20:21:58 +00:00
Christopher Fujino
6b7c60d69a
manual pub roll ( #123071 )
...
manual pub roll
2023-03-21 01:08:51 +00:00
hangyu
9fc1fd15f6
Update Material 3 bottom sheet ( #122445 )
...
* M3 bottomsheet
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update bottom_sheet.dart
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update packages/flutter/lib/src/material/bottom_sheet.dart
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
* Update bottom_sheet.dart
Update bottom_sheet_test.dart
Update bottom_sheet.dart
* showDragHandle defaults to false
* fix test
---------
Co-authored-by: Pierre-Louis <6655696+guidezpl@users.noreply.github.com>
2023-03-18 20:13:08 -07:00
Renzo Olivares
358d79cb0d
TextField should support disabled input text style ( #119216 )
...
Co-authored-by: Renzo Olivares <roliv@google.com>
2023-03-17 10:09:49 -07:00
Qun Cheng
5180e45080
Create SearchBar
and SearchBarTheme
( #122309 )
2023-03-16 15:04:19 -07:00
Qun Cheng
e08d250eeb
Run dart command to update widget defaults ( #122557 )
...
* Run dart command to update widget defaults
* Revert the tokens and the template
---------
Co-authored-by: Qun Cheng <quncheng@google.com>
2023-03-15 18:53:29 +01:00
Taha Tesser
d24a28b806
Cleanup M3 token templates for theme lookups ( #122601 )
...
Cleanup M3 token templates for theme lookups
2023-03-14 17:01:13 +00:00
Pierre-Louis
d8f7c3d362
Refactor icon update script ( #122392 )
...
* x
* docs
2023-03-13 22:17:35 +01:00
Pierre-Louis
598ebfbd66
Update Material tokens to 0.162 ( #122388 )
...
Update Material tokens to 0.162
2023-03-13 16:16:07 +00:00
André Sousa
d7e851749a
Fix Gradle 7 warnings that are now errors in Gradle 8 ( #121958 )
...
Fix Gradle 7 warnings that are now errors in Gradle 8
2023-03-10 18:24:49 +00:00
Christopher Fujino
b1641749fc
pin flutter_plugin_android_lifecycle and roll other pub deps ( #122043 )
...
pin flutter_plugin_android_lifecycle and roll other pub deps
2023-03-06 21:51:07 +00:00
Eilidh Southren
d696b05165
Bottom appbar/sheet shadow property ( #121406 )
...
* add shadowColor property
* add to bottom app bar
* add test
* update m2/m3 diffs
* reorder debug test
* finalize
* remove crswap
* update doc comments
* add m2 shadow back
* add const
* update docs
* update docs
* comment replies
* make param non-null
* indentation fix
* doc fix
2023-03-06 11:41:59 +00:00
Qun Cheng
b114654947
Add IconButton.filled
, IconButton.filledTonal
, IconButton.outlined
( #121884 )
2023-03-03 19:59:39 -08:00
Qun Cheng
d33125687b
Reland: Add visual density for menu default style ( #114878 )
2023-03-03 18:08:27 -08:00
Flutter GitHub Bot
0d9a0207ad
roll packages ( #121746 )
...
Roll pub packages
2023-03-03 01:38:03 +00:00
Qun Cheng
c7fa8e5f7d
Revert "Add visual density for menu default style ( #114878 )" ( #121810 )
...
This reverts commit 37be384205
.
2023-03-02 10:34:15 -08:00
Qun Cheng
37be384205
Add visual density for menu default style ( #114878 )
...
Add visual density for menu default style
2023-03-01 23:01:49 +00:00
Flutter GitHub Bot
d48aef0e27
roll packages ( #121675 )
...
Roll pub packages
2023-03-01 19:02:30 +00:00
Michael Goderbauer
cb123947df
Update a TODO in dartdoc.dart ( #121620 )
...
Update a TODO in dartdoc.dart
2023-03-01 18:39:12 +00:00
Flutter GitHub Bot
2c3fa08253
roll packages ( #121556 )
...
Roll pub packages
2023-02-28 00:11:26 +00:00
Taha Tesser
219ff64574
Reland "Update ExpansionTile to support Material 3 & add an example" ( #121212 )
2023-02-24 06:30:33 -08:00
Flutter GitHub Bot
5d36cb77fb
roll packages ( #121358 )
2023-02-23 20:20:25 +00:00
Lioness100
26b6c1bedd
Fix typos ( #121171 )
...
* Fix typos
* lowercase animated & opacity
* Undo typo fix
---------
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-23 19:43:21 +00:00
Flutter GitHub Bot
8080becadf
roll packages ( #120951 )
2023-02-23 19:21:53 +00:00
Taha Tesser
56e1bddc59
Fix SliverAppBar.medium
& SliverAppBar.large
title overlap with leading/actions widgets, leading width, and title spacing ( #120780 )
...
* Fix `SliverAppBar.medium` & `SliverAppBar.large` title overlap with leading/actions widgets, leading width, and title spacing
* Add `titleSpacing` theme tests and consolidate multiple tests for the same widgets
2023-02-23 17:12:11 +00:00
Eilidh Southren
0c1ed75915
Remove newline ( #121090 )
...
* remove newline
* update crswap
* add const constructor
* update const
2023-02-23 10:39:41 +00:00
Eilidh Southren
ae8d05184e
[M3] Update checkbox shape value ( #120976 )
...
* update m3 values
* update test formatting
* update crswap
* update test
* update token value
* update tests
2023-02-20 11:38:26 +00:00
Ian Hickson
6205c110d6
Remove "note that" in our documentation (as per style guide) ( #120842 )
...
* lerp documentation
* Remove Note, Note That from repo
* Improve BorderSide documentation.
* apply review comments
2023-02-17 22:27:33 +00:00
Renzo Olivares
9367641ce2
clean up ( #120934 )
...
Co-authored-by: Renzo Olivares <roliv@google.com>
2023-02-17 18:42:09 +00:00
Flutter GitHub Bot
206c6ae992
roll packages ( #120922 )
2023-02-16 23:53:16 +00:00