flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.18k stars 26.64k forks source link

Fix wide `DatePicker` input mode button padding for Material 3 #147236

Closed TahaTesser closed 2 weeks ago

TahaTesser commented 3 weeks ago

fixes Wide DatePickerDialog "Switch to input" button has no margin from dialog side

Description

Currently, there is no material design token for the input mode button padding. This PR fixes the padding by taking date picker side padding values into account.

specs

Code sample

expand to view the code sample ```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( home: Scaffold( body: Center( child: Builder(builder: (BuildContext context) { return ElevatedButton( onPressed: () { showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime.utc(2010), lastDate: DateTime.utc(2030), ); }, child: const Text('Show Date Picker'), ); }), ), ), ); } } ```

Before

before

After

after

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Piinks commented 2 weeks ago

Checked the google testing failures here, there is a small expected screenshot change. 👍