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. 11 Sep, 2023 1 commit
  3. 07 Sep, 2023 1 commit
    • Taha Tesser's avatar
      Fix `DataTable`'s `headingTextStyle` & `dataTextStyle` are not merged with... · 75797a8a
      Taha Tesser authored
      Fix `DataTable`'s `headingTextStyle` & `dataTextStyle` are not merged with default text style (#134138)
      
      fixes [Inconsistent text color on DataTable in different platforms](https://github.com/flutter/flutter/issues/114470)
      
      ### Code sample
      
      <details>
      <summary>expand to view the code sample</summary> 
      
      ```dart
      import 'package:flutter/material.dart';
      
      /// Flutter code sample for [DataTable].
      
      void main() => runApp(const DataTableExampleApp());
      
      class DataTableExampleApp extends StatelessWidget {
        const DataTableExampleApp({super.key});
      
        @override
        Widget build(BuildContext context) {
          return MaterialApp(
            themeMode: ThemeMode.dark,
            theme: ThemeData(),
            darkTheme: ThemeData.dark(),
            home: Scaffold(
              appBar: AppBar(title: const Text('DataTable Sample')),
              body: const DataTableExample(),
            ),
          );
        }
      }
      
      class DataTableExample extends StatelessWidget {
        const DataTableExample({super.key});
      
        @override
        Widget build(BuildContext context) {
          return DataTable(
            headingTextStyle: const TextStyle(),
            dataTextStyle: const TextStyle(),
            columns: const <DataColumn>[
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Name',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Age',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
              DataColumn(
                label: Expanded(
                  child: Text(
                    'Role',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),
                ),
              ),
            ],
            rows: const <DataRow>[
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('Sarah')),
                  DataCell(Text('19')),
                  DataCell(Text('Student')),
                ],
              ),
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('Janine')),
                  DataCell(Text('43')),
                  DataCell(Text('Professor')),
                ],
              ),
              DataRow(
                cells: <DataCell>[
                  DataCell(Text('William')),
                  DataCell(Text('27')),
                  DataCell(Text('Associate Professor')),
                ],
              ),
            ],
          );
        }
      }
      
      ```
      
      </details>
      
      ### Before
      
      | Desktop | Mobile |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/19c3908d-6b6a-4408-9c6b-da83c8efaa4a"  /> | <img src="https://github.com/flutter/flutter/assets/48603081/efda08fb-05f9-437e-be5c-6b6861babe19" width="350"  /> |
      
      ### After
      
      | Desktop | Mobile |
      | --------------- | --------------- |
      | <img src="https://github.com/flutter/flutter/assets/48603081/6bd3433f-d61f-4f35-8a2a-f7539a74f93e" /> | <img src="https://github.com/flutter/flutter/assets/48603081/5123a79b-6c2a-4bea-9fbc-64ed3e599826" width="350" /> |
      75797a8a
  4. 15 Aug, 2023 1 commit
    • Ian Hickson's avatar
      PaginatedDataTable improvements (#131374) · ccdf8264
      Ian Hickson authored
      - slightly improved assert message when row cell counts don't match column count.
      - more breadcrumbs in API documentation. more documentation in general.
      - added more documentation for the direction of the "ascending" arrow.
      - two samples for PaginatedDataTable.
      - make PaginatedDataTable support hot reloading across changes to the number of columns.
      - introduce matrix3MoreOrLessEquals. An earlier version of this PR used it in tests, but eventually it was not needed. The function seems useful to keep though.
      ccdf8264
  5. 16 Jun, 2023 1 commit
  6. 31 Mar, 2023 1 commit
  7. 24 Mar, 2023 1 commit
  8. 23 Feb, 2023 1 commit
    • David Neuy's avatar
      Fix DataCell overflows when cell height is large by adding dataRowMinHeight,... · 3681b27a
      David Neuy authored
      Fix DataCell overflows when cell height is large by adding dataRowMinHeight, dataRowMaxHeight props. (#114338)
      
      * Fix DataCell overflows when cell height is large by adding dataRowMinHeight, dataRowMaxHeight props.
      
      * Fix DataCell overflows when cell height is large by adding dataRowMinHeight, dataRowMaxHeight props - add tests.
      
      * Fix analysis errors
      
      * Review changes.
      
      * Add asserts for dataRowMinHeight and dataRowMaxHeight
      
      * Add asserts for dataRowMinHeight and dataRowMaxHeight
      
      * Make dataRowHeight a computed getter
      
      * Remove get only dataRowHeight from hashCode...
      
      * Update deprecated after
      
      * Add new line at end of AUTHORS
      
      * Apply suggestions from code review
      
      * Update packages/flutter/test/material/data_table_test.dart
      
      ---------
      Co-authored-by: 's avatarKate Lovett <katelovett@google.com>
      3681b27a
  9. 27 Jan, 2023 1 commit
  10. 24 Jan, 2023 1 commit
  11. 25 Oct, 2022 1 commit
  12. 07 Sep, 2022 1 commit
  13. 22 Aug, 2022 1 commit
  14. 19 Aug, 2022 1 commit
  15. 10 Aug, 2022 1 commit
  16. 03 Jun, 2022 2 commits
  17. 25 May, 2022 1 commit
  18. 20 May, 2022 1 commit
  19. 19 May, 2022 1 commit
  20. 27 Apr, 2022 1 commit
  21. 19 Apr, 2022 1 commit
  22. 14 Apr, 2022 1 commit
  23. 31 Mar, 2022 1 commit
  24. 21 Mar, 2022 1 commit
  25. 05 Jan, 2022 1 commit
  26. 04 Jan, 2022 1 commit
  27. 01 Nov, 2021 1 commit
  28. 04 Oct, 2021 1 commit
    • Greg Spencer's avatar
      Clean up examples, remove section markers and --template args (#91133) · fd9ce277
      Greg Spencer authored
      This does a cleanup of the examples, removing all of the "section" markers and extra comments that we don't need anymore now that the samples are no longer in the source code. It also removes the --template arguments from the {@tool dartpad} and {@tool sample} directives, since those are no longer used. It converts two examples that I discovered were still embedded into linked examples in the examples folder.
      
      I didn't delete the templates from the snippets config folder yet, because there are still embedded samples in the dart:ui package from the engine that use them. Once dart:ui no longer uses the templates, they can be removed.
      
      I bumped the version of the snippets package to pick up a change that allows removal of the --template argument.
      fd9ce277
  29. 29 Sep, 2021 1 commit
  30. 21 Sep, 2021 1 commit
    • Bonsai11's avatar
      Adding onLongPress for DataRow (#87172) · 6d2d9b2f
      Bonsai11 authored
      * Adding onLongPress for DataRow
      
      Useful to be able to e.g. start a selection mode of rows or show a drop down menu.
      
      * Test for onLongPress
      
      * Changed parameter
      6d2d9b2f
  31. 25 Aug, 2021 1 commit
    • Greg Spencer's avatar
      Extract Sample code into examples/api (#87280) · 33403bd2
      Greg Spencer authored
      This extracts the sample code out from the API doc comments, and places them in separate files on disk, allowing running of the examples locally, testing them, and building of slightly larger examples.
      33403bd2
  32. 12 Aug, 2021 1 commit
    • Greg Spencer's avatar
      Switch document generation to use the snippets package (#87231) · 10e4b040
      Greg Spencer authored
      Switch document generation to use the snippets package instead of the snippets code in the Flutter repo. In the process, some bugs in sample code analysis have been fixed, and I've fixed some more errors in the samples.
      
      This will allow the snippets package to be developed separately from the Flutter repo, and reduce the code in the Flutter repo.
      
      The snippets code is deleted in this PR.
      
      I also converted some comments in the snippet templates to be regular comments instead of doc comments, because having a doc comment block before the imports causes the Dart import sorter to lose the comment. They should have been regular comments in the first place.
      
      The snippets package resides in the assets-for-api-docs repo.
      
      The sample analysis has also been converted to be run in parallel, and I've bumped the Dartdoc version to 1.0.2.
      10e4b040
  33. 06 Aug, 2021 1 commit
  34. 10 Jun, 2021 1 commit
  35. 13 May, 2021 1 commit
  36. 20 Apr, 2021 1 commit
  37. 25 Mar, 2021 1 commit
  38. 12 Mar, 2021 1 commit
  39. 17 Feb, 2021 1 commit