Kate Lovett
9d96df2364
Modernize framework lints ( #179089 )
...
WIP
Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues
- Run `dart format .` in the right places.
Local analysis and testing passes. Checking CI now.
Part of https://github.com/flutter/flutter/issues/178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)
## 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].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-11-26 01:10:39 +00:00
Taha Tesser
9574d585e3
Fix shape and collapsedShape isn't applied to ExpansionTile's splash ink ( #141777 )
...
This updates the previous attempt https://github.com/flutter/flutter/pull/135855 and removes the complications when testing M3 ink sparkle effect.
Thanks to this [PR](https://github.com/flutter/flutter/pull/138757 ) by @Piinks
fixes [ExpansionTile InkSplash doesn't respect Shape's borderRadius](https://github.com/flutter/flutter/issues/125779 )
fixes [`ExpansionTile.backgroundColor` & `ExpansionTile.collapsedBackgroundColor` removes splash effect](https://github.com/flutter/flutter/issues/107113 )
### 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 const MaterialApp(
debugShowCheckedModeBanner: false,
home: Example(),
);
}
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.0),
child: ExpansionTile(
collapsedBackgroundColor: Color(0x25ff0000),
backgroundColor: Color(0x250000ff),
collapsedShape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30.0)),
side: BorderSide(color: Colors.black, width: 2.0),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30.0)),
side: BorderSide(color: Colors.black, width: 2.0),
),
clipBehavior: Clip.hardEdge,
title: Text('Expansion Tile'),
children: <Widget>[
FlutterLogo(size: 50),
FlutterLogo(size: 50),
FlutterLogo(size: 50),
FlutterLogo(size: 50),
],
),
)),
);
}
}
```
</details>
### Before
<img width="789" alt="Screenshot 2024-01-18 at 18 16 15" src="https://github.com/flutter/flutter/assets/48603081/8c6a6f1e-6986-4acf-8dec-e223a682c0d7 ">
<img width="789" alt="Screenshot 2024-01-18 at 18 16 44" src="https://github.com/flutter/flutter/assets/48603081/f55f6a26-2128-48a1-b24d-3c14e4f6ecdc ">
### After
<img width="789" alt="Screenshot 2024-01-18 at 18 20 27" src="https://github.com/flutter/flutter/assets/48603081/7ec8b888-7319-460d-8488-9cd44c9246a6 ">
<img width="789" alt="Screenshot 2024-01-18 at 18 20 53" src="https://github.com/flutter/flutter/assets/48603081/80d66d5b-7eb2-4f47-ab4d-d7f469a731fa ">
2024-01-22 11:13:31 +00:00
Taha Tesser
f794cf9d97
Add AnimationStyle to ExpansionTile ( #139664 )
...
fixes [Expose animation parameters for the [ExpansionTile] widget](https://github.com/flutter/flutter/issues/138047 )
### Description
Add `AnimationStyle` to the `ExpansionTile` widget to override the default expand and close animation.
Syntax:
```dart
child: ExpansionTile(
title: const Text('Tap to expand'),
expansionAnimationStyle: AnimationStyle(
duration: Durations.extralong1,
curve: Easing.emphasizedAccelerate,
),
children: const <Widget>[FlutterLogo(size: 200)],
),
```
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
/// Flutter code sample for [ExpansionTile] and [AnimationStyle].
void main() {
runApp(const ExpansionTileAnimationStyleApp());
}
enum AnimationStyles { defaultStyle, custom, none }
const List<(AnimationStyles, String)> animationStyleSegments = <(AnimationStyles, String)>[
(AnimationStyles.defaultStyle, 'Default'),
(AnimationStyles.custom, 'Custom'),
(AnimationStyles.none, 'None'),
];
class ExpansionTileAnimationStyleApp extends StatefulWidget {
const ExpansionTileAnimationStyleApp({super.key});
@override
State<ExpansionTileAnimationStyleApp> createState() => _ExpansionTileAnimationStyleAppState();
}
class _ExpansionTileAnimationStyleAppState extends State<ExpansionTileAnimationStyleApp> {
Set<AnimationStyles> _animationStyleSelection = <AnimationStyles>{AnimationStyles.defaultStyle};
AnimationStyle? _animationStyle;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SegmentedButton<AnimationStyles>(
selected: _animationStyleSelection,
onSelectionChanged: (Set<AnimationStyles> styles) {
setState(() {
_animationStyleSelection = styles;
switch (styles.first) {
case AnimationStyles.defaultStyle:
_animationStyle = null;
case AnimationStyles.custom:
_animationStyle = AnimationStyle(
curve: Easing.emphasizedAccelerate,
duration: Durations.extralong1,
);
case AnimationStyles.none:
_animationStyle = AnimationStyle.noAnimation;
}
});
},
segments: animationStyleSegments
.map<ButtonSegment<AnimationStyles>>(((AnimationStyles, String) shirt) {
return ButtonSegment<AnimationStyles>(value: shirt.$1, label: Text(shirt.$2));
})
.toList(),
),
const SizedBox(height: 20),
ExpansionTile(
expansionAnimationStyle: _animationStyle,
title: const Text('ExpansionTile'),
children: const <Widget>[
ListTile(title: Text('Expanded Item 1')),
ListTile(title: Text('Expanded Item 2')),
],
)
],
),
),
),
);
}
}
```
</details>
Related to https://github.com/flutter/flutter/pull/138721 .
2023-12-06 16:40:24 +00:00