1. 20 Sep, 2023 1 commit
    • Greg Spencer's avatar
      Remove 'must be non-null' and 'must not be null' comments from material. (#134991) · a1e49be2
      Greg Spencer authored
      ## Description
      
      This removes all of the comments that are of the form "so-and-so (must not be null|can ?not be null|must be non-null)" from the cases where those values are defines as non-nullable values.
      
      This PR removes them from the material library.
      
      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/134992
      - https://github.com/flutter/flutter/pull/134993
      - https://github.com/flutter/flutter/pull/134994
      
      ## Tests
       - Documentation only change.
      a1e49be2
  2. 14 Sep, 2023 1 commit
  3. 13 Sep, 2023 1 commit
  4. 09 Sep, 2023 1 commit
  5. 23 Aug, 2023 1 commit
  6. 17 Aug, 2023 1 commit
    • Ian Hickson's avatar
      Allow date pickers to not have selected date (#132343) · d19fb632
      Ian Hickson authored
      This enables our various date picker classes to have a null `initialDate`.
      
      It also fixes the logic of some of the widgets which used to do something when you _changed_ the `initial*` parameters, which is wrong for `initial*` properties (they by definition should only impact the initial state) and wrong for properties in general (behaviour should not change based on whether the widget was built with a new value or not, that violates the reactive design principles).
      
      Fixes https://github.com/flutter/flutter/issues/638.
      d19fb632
  7. 24 Jul, 2023 1 commit
  8. 17 Jul, 2023 1 commit
    • Taha Tesser's avatar
      Fix `DatePicker` uses incorrect overlay color from `DatePickerTheme` and add... · a6187d9a
      Taha Tesser authored
      Fix `DatePicker` uses incorrect overlay color from `DatePickerTheme` and add missing tests (#130584)
      
      fixes [YearPickerState in calendar_date_picker is using dayOverlayColor instead of yearOverlayColor](https://github.com/flutter/flutter/issues/130051)
      
      ### Description
      
      - Fix year selection uses incorrect overlay color from `DatePickerTheme`
      - Update defaults tests to check for overlay color for different modes
      - Add tests to check overlay color is resolved.
      
      ### 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(
              datePickerTheme: const DatePickerThemeData(
                yearOverlayColor: MaterialStatePropertyAll<Color>(Colors.green),
                dayOverlayColor: MaterialStatePropertyAll<Color>(Colors.amber),
              ),
              useMaterial3: true,
            ),
            home: Directionality(
              textDirection: TextDirection.ltr,
              child: Material(
                child: Center(
                  child: DatePickerDialog(
                    initialDate: DateTime(2023, DateTime.january, 25),
                    firstDate: DateTime(2022),
                    lastDate: DateTime(2024, DateTime.december, 31),
                    currentDate: DateTime(2023, DateTime.january, 24),
                  ),
                ),
              ),
            ),
          );
        }
      }
      
      ``` 
      	
      </details>
      
      ```dart
                yearOverlayColor: MaterialStatePropertyAll<Color>(Colors.green),
                dayOverlayColor: MaterialStatePropertyAll<Color>(Colors.red),
      ```
      
      ### Before
      ![Screenshot 2023-07-14 at 18 39 51](https://github.com/flutter/flutter/assets/48603081/52ec5096-bad6-4753-9e9a-15b6d5ce767e)
      
      ### After
      ![Screenshot 2023-07-14 at 18 38 32](https://github.com/flutter/flutter/assets/48603081/a51aeca8-a5c2-42b4-8c05-b55f9955e860)
      a6187d9a
  9. 15 Jun, 2023 1 commit
  10. 22 Mar, 2023 1 commit
  11. 31 Jan, 2023 1 commit
  12. 24 Jan, 2023 1 commit
  13. 07 Dec, 2022 1 commit
  14. 28 Nov, 2022 1 commit
  15. 31 Oct, 2022 1 commit
  16. 22 Aug, 2022 1 commit
  17. 10 Aug, 2022 1 commit
  18. 25 May, 2022 1 commit
  19. 27 Apr, 2022 1 commit
  20. 14 Apr, 2022 1 commit
  21. 03 Feb, 2022 1 commit
  22. 20 Jan, 2022 1 commit
  23. 13 Jan, 2022 1 commit
  24. 08 Oct, 2021 3 commits
  25. 15 Jul, 2021 1 commit
  26. 14 Jul, 2021 3 commits
  27. 13 Jul, 2021 2 commits
  28. 10 May, 2021 1 commit
  29. 26 Apr, 2021 1 commit
  30. 03 Apr, 2021 1 commit
  31. 31 Mar, 2021 2 commits
  32. 11 Mar, 2021 1 commit
  33. 04 Mar, 2021 1 commit
  34. 27 Jan, 2021 1 commit