1. 22 Aug, 2023 1 commit
    • Taha Tesser's avatar
      Fix `FlexibleSpaceBar.title` doesn't respect the leading widget (#132573) · db89df51
      Taha Tesser authored
      fixes [Long `FlexibleSpaceBar.title` doesn't respect the leading widget 
      ](https://github.com/flutter/flutter/issues/132030)
      
      ### Description
      
      - This adds `FlexibleSpaceBarSettings.hasLeading` for the `FlexibleSpaceBar`'s title to respect the leading widget.
      - Use the new `FlexibleSpaceBarSettings.hasLeading` property in the  `SliverAppBar` for its `FlexibleSpaceBar`.
      
      ### 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(
            debugShowCheckedModeBanner: false,
            theme: ThemeData(
              useMaterial3: true,
              brightness: Brightness.dark,
            ),
            home: const Example(),
          );
        }
      }
      
      class Example extends StatelessWidget {
        const Example({super.key});
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            body: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                const Text('TargetPlatform.Android'),
                Theme(
                  data: Theme.of(context).copyWith(
                    platform: TargetPlatform.android,
                  ),
                  child: Container(
                    height: 250,
                    padding: const EdgeInsets.all(8),
                    decoration: BoxDecoration(
                      border: Border.all(
                        color: Colors.amber,
                        width: 4,
                      ),
                    ),
                    child: const AppBarLeading(
                      showLeading: true,
                      showTitle: false,
                    ),
                  ),
                ),
                const Text('TargetPlatform.iOS'),
                Theme(
                  data: Theme.of(context).copyWith(
                    platform: TargetPlatform.iOS,
                  ),
                  child: Container(
                    height: 250,
                    padding: const EdgeInsets.all(8),
                    decoration: BoxDecoration(
                      border: Border.all(
                        color: Colors.amber,
                        width: 2,
                      ),
                    ),
                    child: const AppBarLeading(
                      showLeading: true,
                      showTitle: false,
                    ),
                  ),
                ),
              ],
            ),
          );
        }
      }
      
      class AppBarLeading extends StatelessWidget {
        const AppBarLeading({
          super.key,
          required this.showLeading,
          required this.showTitle,
        });
      
        final bool showLeading;
        final bool showTitle;
      
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            drawer: const Drawer(),
            body: CustomScrollView(
              slivers: [
                SliverAppBar(
                  automaticallyImplyLeading: showLeading,
                  iconTheme: const IconThemeData(
                    color: Colors.amber,
                  ),
                  title: showTitle ? const Text('AppBar') : null,
                  flexibleSpace: FlexibleSpaceBar(
                    title: Text('Title ' * 15),
                    // centerTitle: true,
                  ),
                  toolbarHeight: showTitle ? 170 : 100,
                ),
              ],
            ),
          );
        }
      }
      ``` 
      	
      </details>
      
      ### Before 
      
      ![Screenshot 2023-08-15 at 18 11 34](https://github.com/flutter/flutter/assets/48603081/4b798998-8549-43aa-b564-933ea14f494c)
      
      ### After
      
      ![Screenshot 2023-08-15 at 18 11 45](https://github.com/flutter/flutter/assets/48603081/b085a33a-db7d-40d4-8a12-ee37197b5bd4)
      db89df51
  2. 14 Aug, 2023 1 commit
  3. 10 Aug, 2023 1 commit
  4. 09 Aug, 2023 1 commit
  5. 22 Jul, 2023 1 commit
  6. 14 Jul, 2023 1 commit
  7. 28 Jun, 2023 1 commit
  8. 13 Jun, 2023 1 commit
    • Qun Cheng's avatar
      Update unit tests in material library for Material 3 (#128725) · a5f8b64e
      Qun Cheng authored
      Updates most of the unit tests in the packages/flutter/test/material folder so that they'll pass if ThemeData.useMaterial3 defaults to true.
      
      All of the tests have wired useMaterial3 to false and will need to be updated with a M3 version.
      
      related to #127064
      a5f8b64e
  9. 05 Jun, 2023 2 commits
  10. 26 May, 2023 1 commit
  11. 21 Dec, 2022 1 commit
  12. 09 Dec, 2022 1 commit
  13. 04 May, 2022 1 commit
  14. 02 May, 2022 2 commits
  15. 26 Mar, 2022 1 commit
  16. 25 Mar, 2022 2 commits
  17. 05 Nov, 2021 1 commit
  18. 03 Nov, 2021 1 commit
  19. 19 Aug, 2021 1 commit
  20. 18 Aug, 2021 2 commits
  21. 17 Aug, 2021 1 commit
  22. 28 Apr, 2021 1 commit
  23. 23 Apr, 2021 1 commit
  24. 16 Apr, 2021 1 commit
  25. 14 Apr, 2021 1 commit
  26. 04 Mar, 2021 1 commit
  27. 04 Feb, 2021 1 commit
  28. 28 Oct, 2020 1 commit
    • Greg Spencer's avatar
      Remove `nullOk` in `MediaQuery.of` (#68736) · 55289324
      Greg Spencer authored
      Adds MediaQuery.maybeOf to replace calling MediaQuery.of(context, nullOk: true), and removes the nullOk parameter. Also changes MediaQuery.of to return a non-nullable value, and removes many instances of the ! operator, reducing the possible places where a null dereference could occur.
      55289324
  29. 08 Oct, 2020 1 commit
  30. 08 Sep, 2020 1 commit
  31. 06 Aug, 2020 1 commit
  32. 11 Jun, 2020 1 commit
  33. 22 Apr, 2020 1 commit
  34. 09 Mar, 2020 1 commit
  35. 03 Mar, 2020 1 commit
  36. 27 Jan, 2020 1 commit