-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Implement CupertinoCollapsible/CupertinoExpansionTile #165606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CupertinoCollapsible/CupertinoExpansionTile #165606
Conversation
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
### Flutter fade https://github.com/user-attachments/assets/0cfd3759-3e8d-4e5e-af55-20dfa1494bb5 ### Native iOS fade https://github.com/user-attachments/assets/ce8799d8-78bd-49e7-9d64-bb818fc6667e ### Flutter scroll https://github.com/user-attachments/assets/04291449-147c-4b8c-900e-c6e3989ef0e8 ### Native iOS scroll https://github.com/user-attachments/assets/a5917e64-6e67-45f0-a580-2fda80d16c32 <details> <summary>Sample code</summary> ```dart import 'package:flutter/cupertino.dart'; void main() => runApp(const CollapsibleApp()); class CollapsibleApp extends StatelessWidget { const CollapsibleApp({super.key}); @OverRide Widget build(BuildContext context) { return CupertinoApp( home: CupertinoPageScaffold( backgroundColor: CupertinoColors.systemGroupedBackground, child: CustomScrollView( slivers: [ CupertinoSliverNavigationBar( stretch: true, largeTitle: Text('Lists'), leading: CupertinoButton( alignment: Alignment.centerLeft, padding: EdgeInsets.zero, child: const Text('Edit'), onPressed: () {}, ), trailing: CupertinoButton( alignment: Alignment.centerRight, padding: EdgeInsets.zero, child: const Text('Add List'), onPressed: () {}, ), ), SliverToBoxAdapter( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: const CollapsibleExample(), ), ), ], ), ), ); } } class CollapsibleExample extends StatefulWidget { const CollapsibleExample({super.key}); @OverRide State<CollapsibleExample> createState() => _CollapsibleExampleState(); } class _CollapsibleExampleState extends State<CollapsibleExample> { @OverRide Widget build(BuildContext context) { return CupertinoCollapsible( title: Text( ' iPhone', style: CupertinoTheme.of(context) .textTheme .navLargeTitleTextStyle .copyWith(fontSize: 21, fontWeight: FontWeight.w600), ), child: CupertinoListSection.insetGrouped( margin: EdgeInsets.symmetric(horizontal: 0.0), children: <CupertinoListTile>[ CupertinoListTile( title: const Text('All iPhone'), leading: Icon( CupertinoIcons.person_3, size: 30.0, ), trailing: const CupertinoListTileChevron(), additionalInfo: const Text('6'), onTap: () {}), CupertinoListTile( title: const Text('Friends'), leading: Icon(CupertinoIcons.person_2), trailing: const CupertinoListTileChevron(), additionalInfo: const Text('1'), onTap: () {}), CupertinoListTile( title: const Text('Work'), leading: Icon(CupertinoIcons.person_2), trailing: const CupertinoListTileChevron(), additionalInfo: const Text('0'), onTap: () {}), ], ), ); } } ``` </details> Fixes flutter#153937
Flutter fade
flutter.fade.take.3.mov
Native iOS fade
native.fade.mov
Flutter scroll
flutter.scroll.take.3.mov
Native iOS scroll
native.iOS.collapsible.mov
Sample code
Fixes #153937