1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

[Gallery] Add padding to demo appBar (#289)

* Add padding to demo appBar

* Update demo.dart

* Add padding to leading icon as well

* Update demo.dart
This commit is contained in:
Pierre-Louis
2020-01-28 17:24:33 +01:00
committed by GitHub
parent 9eebbce1fb
commit bf3979220e

View File

@@ -178,15 +178,19 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
final colorScheme = Theme.of(context).colorScheme; final colorScheme = Theme.of(context).colorScheme;
final iconColor = colorScheme.onSurface; final iconColor = colorScheme.onSurface;
final selectedIconColor = colorScheme.primary; final selectedIconColor = colorScheme.primary;
final appBarPadding = isDesktop ? 20.0 : 0.0;
final appBar = AppBar( final appBar = AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
leading: IconButton( leading: Padding(
icon: const BackButtonIcon(), padding: EdgeInsetsDirectional.only(start: appBarPadding),
tooltip: MaterialLocalizations.of(context).backButtonTooltip, child: IconButton(
onPressed: () { icon: const BackButtonIcon(),
Navigator.maybePop(context); tooltip: MaterialLocalizations.of(context).backButtonTooltip,
}, onPressed: () {
Navigator.maybePop(context);
},
),
), ),
actions: [ actions: [
if (_hasOptions) if (_hasOptions)
@@ -244,6 +248,7 @@ class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin {
_state == _DemoState.fullscreen ? selectedIconColor : iconColor, _state == _DemoState.fullscreen ? selectedIconColor : iconColor,
onPressed: () => _handleTap(_DemoState.fullscreen), onPressed: () => _handleTap(_DemoState.fullscreen),
), ),
SizedBox(width: appBarPadding),
], ],
); );