You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.8 KiB

import 'package:flutter/material.dart';
class SlimAppBar extends StatelessWidget {
final String title;
final double size;
// final Function onBackTap;
2 years ago
const SlimAppBar({
required this.title,
this.size = 24,
// this.onBackTap,
super.key,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: size,
child: Container(
color:
3 years ago
Theme.of(context).appBarTheme.backgroundColor ??
Theme.of(context).primaryColor,
child: InkWell(
onTap: (ModalRoute.of(context)?.canPop ?? false)
? () => Navigator.of(context).pop()
: null,
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
2 years ago
SizedBox(
height: size,
width: size,
child: (ModalRoute.of(context)?.canPop ?? false)
2 years ago
? const BackButtonIcon()
: null,
),
Expanded(
child: Center(
child: Padding(
padding: const EdgeInsets.all(2),
child: Text(
title,
textAlign: TextAlign.center,
style:
2 years ago
Theme.of(context).appBarTheme.textTheme?.bodySmall?.copyWith(color: Theme.of(context).appBarTheme.textTheme?.bodyMedium?.color) ??
Theme.of(context).textTheme.bodySmall?.copyWith(color: Theme.of(context).textTheme.bodyMedium?.color),
),
),
),
),
2 years ago
SizedBox(
height: size,
width: size,
),
],
),
),
),
);
}
}