aves_mio/lib/widgets/common/app_bar/app_bar_title.dart
Fabio Micheluz 2c988f959b
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-02-19 13:25:23 +01:00

28 lines
741 B
Dart

import 'package:flutter/material.dart';
class InteractiveAppBarTitle extends StatelessWidget {
final GestureTapCallback? onTap;
final Widget child;
const InteractiveAppBarTitle({
super.key,
this.onTap,
required this.child,
});
@override
Widget build(BuildContext context) {
final textScaler = MediaQuery.textScalerOf(context);
return GestureDetector(
onTap: onTap,
// use a `Container` with a dummy color to make it expand
// so that we can also detect taps around the title `Text`
child: Container(
alignment: AlignmentDirectional.centerStart,
color: Colors.transparent,
height: textScaler.scale(kToolbarHeight),
child: child,
),
);
}
}