@@ -23,6 +23,8 @@ import 'text_button.dart';
2323import 'text_theme.dart' ;
2424import 'theme.dart' ;
2525
26+ part 'generated/date_picker_defaults_m3.g.dart' ;
27+
2628// Examples can assume:
2729// late BuildContext context;
2830
@@ -1261,230 +1263,3 @@ class _DatePickerDefaultsM2 extends DatePickerThemeData {
12611263 return null ;
12621264 });
12631265}
1264-
1265- // BEGIN GENERATED TOKEN PROPERTIES - DatePicker
1266-
1267- // Do not edit by hand. The code between the "BEGIN GENERATED" and
1268- // "END GENERATED" comments are generated from data in the Material
1269- // Design token database by the script:
1270- // dev/tools/gen_defaults/bin/gen_defaults.dart.
1271-
1272- // dart format off
1273- class _DatePickerDefaultsM3 extends DatePickerThemeData {
1274- _DatePickerDefaultsM3 (this .context)
1275- : super (
1276- elevation: 6.0 ,
1277- shape: const RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (28.0 ))),
1278- // TODO(tahatesser): Update this to use token when gen_defaults
1279- // supports `CircleBorder` for fully rounded corners.
1280- dayShape: const WidgetStatePropertyAll <OutlinedBorder >(CircleBorder ()),
1281- yearShape: const WidgetStatePropertyAll <OutlinedBorder >(StadiumBorder ()),
1282- rangePickerElevation: 0.0 ,
1283- rangePickerShape: const RoundedRectangleBorder (),
1284- );
1285-
1286- final BuildContext context;
1287- late final ThemeData _theme = Theme .of (context);
1288- late final ColorScheme _colors = _theme.colorScheme;
1289- late final TextTheme _textTheme = _theme.textTheme;
1290-
1291- @override
1292- Color ? get backgroundColor => _colors.surfaceContainerHigh;
1293-
1294- @override
1295- Color ? get subHeaderForegroundColor => _colors.onSurface.withOpacity (0.60 );
1296-
1297- @override
1298- TextStyle ? get toggleButtonTextStyle => _textTheme.titleSmall? .apply (
1299- color: subHeaderForegroundColor,
1300- );
1301-
1302- @override
1303- ButtonStyle get cancelButtonStyle {
1304- return TextButton .styleFrom ();
1305- }
1306-
1307- @override
1308- ButtonStyle get confirmButtonStyle {
1309- return TextButton .styleFrom ();
1310- }
1311-
1312- @override
1313- Color ? get shadowColor => Colors .transparent;
1314-
1315- @override
1316- Color ? get surfaceTintColor => Colors .transparent;
1317-
1318- @override
1319- Color ? get headerBackgroundColor => Colors .transparent;
1320-
1321- @override
1322- Color ? get headerForegroundColor => _colors.onSurfaceVariant;
1323-
1324- @override
1325- TextStyle ? get headerHeadlineStyle => _textTheme.headlineLarge;
1326-
1327- @override
1328- TextStyle ? get headerHelpStyle => _textTheme.labelLarge;
1329-
1330- @override
1331- TextStyle ? get weekdayStyle => _textTheme.bodyLarge? .apply (
1332- color: _colors.onSurface,
1333- );
1334-
1335- @override
1336- TextStyle ? get dayStyle => _textTheme.bodyLarge;
1337-
1338- @override
1339- WidgetStateProperty <Color ?>? get dayForegroundColor =>
1340- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1341- if (states.contains (WidgetState .selected)) {
1342- return _colors.onPrimary;
1343- } else if (states.contains (WidgetState .disabled)) {
1344- return _colors.onSurface.withOpacity (0.38 );
1345- }
1346- return _colors.onSurface;
1347- });
1348-
1349- @override
1350- WidgetStateProperty <Color ?>? get dayBackgroundColor =>
1351- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1352- if (states.contains (WidgetState .selected)) {
1353- return _colors.primary;
1354- }
1355- return null ;
1356- });
1357-
1358- @override
1359- WidgetStateProperty <Color ?>? get dayOverlayColor =>
1360- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1361- if (states.contains (WidgetState .selected)) {
1362- if (states.contains (WidgetState .pressed)) {
1363- return _colors.onPrimary.withOpacity (0.1 );
1364- }
1365- if (states.contains (WidgetState .hovered)) {
1366- return _colors.onPrimary.withOpacity (0.08 );
1367- }
1368- if (states.contains (WidgetState .focused)) {
1369- return _colors.onPrimary.withOpacity (0.1 );
1370- }
1371- } else {
1372- if (states.contains (WidgetState .pressed)) {
1373- return _colors.onSurfaceVariant.withOpacity (0.1 );
1374- }
1375- if (states.contains (WidgetState .hovered)) {
1376- return _colors.onSurfaceVariant.withOpacity (0.08 );
1377- }
1378- if (states.contains (WidgetState .focused)) {
1379- return _colors.onSurfaceVariant.withOpacity (0.1 );
1380- }
1381- }
1382- return null ;
1383- });
1384-
1385- @override
1386- WidgetStateProperty <Color ?>? get todayForegroundColor =>
1387- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1388- if (states.contains (WidgetState .selected)) {
1389- return _colors.onPrimary;
1390- } else if (states.contains (WidgetState .disabled)) {
1391- return _colors.primary.withOpacity (0.38 );
1392- }
1393- return _colors.primary;
1394- });
1395-
1396- @override
1397- WidgetStateProperty <Color ?>? get todayBackgroundColor => dayBackgroundColor;
1398-
1399- @override
1400- BorderSide ? get todayBorder => BorderSide (color: _colors.primary);
1401-
1402- @override
1403- TextStyle ? get yearStyle => _textTheme.bodyLarge;
1404-
1405- @override
1406- WidgetStateProperty <Color ?>? get yearForegroundColor =>
1407- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1408- if (states.contains (WidgetState .selected)) {
1409- return _colors.onPrimary;
1410- } else if (states.contains (WidgetState .disabled)) {
1411- return _colors.onSurfaceVariant.withOpacity (0.38 );
1412- }
1413- return _colors.onSurfaceVariant;
1414- });
1415-
1416- @override
1417- WidgetStateProperty <Color ?>? get yearBackgroundColor =>
1418- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1419- if (states.contains (WidgetState .selected)) {
1420- return _colors.primary;
1421- }
1422- return null ;
1423- });
1424-
1425- @override
1426- WidgetStateProperty <Color ?>? get yearOverlayColor =>
1427- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1428- if (states.contains (WidgetState .selected)) {
1429- if (states.contains (WidgetState .pressed)) {
1430- return _colors.onPrimary.withOpacity (0.1 );
1431- }
1432- if (states.contains (WidgetState .hovered)) {
1433- return _colors.onPrimary.withOpacity (0.08 );
1434- }
1435- if (states.contains (WidgetState .focused)) {
1436- return _colors.onPrimary.withOpacity (0.1 );
1437- }
1438- } else {
1439- if (states.contains (WidgetState .pressed)) {
1440- return _colors.onSurfaceVariant.withOpacity (0.1 );
1441- }
1442- if (states.contains (WidgetState .hovered)) {
1443- return _colors.onSurfaceVariant.withOpacity (0.08 );
1444- }
1445- if (states.contains (WidgetState .focused)) {
1446- return _colors.onSurfaceVariant.withOpacity (0.1 );
1447- }
1448- }
1449- return null ;
1450- });
1451-
1452- @override
1453- Color ? get rangePickerShadowColor => Colors .transparent;
1454-
1455- @override
1456- Color ? get rangePickerSurfaceTintColor => Colors .transparent;
1457-
1458- @override
1459- Color ? get rangeSelectionBackgroundColor => _colors.secondaryContainer;
1460-
1461- @override
1462- WidgetStateProperty <Color ?>? get rangeSelectionOverlayColor =>
1463- WidgetStateProperty .resolveWith ((Set <WidgetState > states) {
1464- if (states.contains (WidgetState .pressed)) {
1465- return _colors.onPrimaryContainer.withOpacity (0.1 );
1466- }
1467- if (states.contains (WidgetState .hovered)) {
1468- return _colors.onPrimaryContainer.withOpacity (0.08 );
1469- }
1470- if (states.contains (WidgetState .focused)) {
1471- return _colors.onPrimaryContainer.withOpacity (0.1 );
1472- }
1473- return null ;
1474- });
1475-
1476- @override
1477- Color ? get rangePickerHeaderBackgroundColor => Colors .transparent;
1478-
1479- @override
1480- Color ? get rangePickerHeaderForegroundColor => _colors.onSurfaceVariant;
1481-
1482- @override
1483- TextStyle ? get rangePickerHeaderHeadlineStyle => _textTheme.titleLarge;
1484-
1485- @override
1486- TextStyle ? get rangePickerHeaderHelpStyle => _textTheme.titleSmall;
1487- }
1488- // dart format on
1489-
1490- // END GENERATED TOKEN PROPERTIES - DatePicker
0 commit comments