Implement actionsPadding for AppBar (#155632)

This pull requests adds a new `actionsPadding` property to AppBar, which controls the padding of the actions row's end. By default, no padding is added.

As it was already discussed in the linked issue below (https://github.com/flutter/flutter/issues/115349#issuecomment-1315582192), it is not feasible to change defaults. This PR is an interim solution to allow developers to change layout across the app, until that change/transition can be made (see: the new TODO line). 

Different to the original code from 2018, this PR only adds padding to the actual actions row, instead of the entire `NavigationToolbar`.

Fixes #155747
This commit is contained in:
Crafti
2024-10-17 13:03:22 +00:00
committed by GitHub
parent fcb4e25acd
commit 0ce5285051
4 changed files with 91 additions and 6 deletions

View File

@@ -56,6 +56,12 @@ class _${blockName}DefaultsM3 extends AppBarTheme {
@override
TextStyle? get titleTextStyle => ${textStyle('md.comp.top-app-bar.small.headline')};
// TODO(Craftplacer): Consider using EdgeInsets.only(right: 8.0) instead of
// EdgeInsets.zero for Material 3 in the future,
// https://github.com/flutter/flutter/issues/155747
@override
EdgeInsets? get actionsPadding => EdgeInsets.zero;
}
// Variant configuration