Files
fcs/lib/pages/widgets/local_app_bar.dart
2024-01-24 16:54:08 +06:30

54 lines
1.4 KiB
Dart

import 'package:fcs/helpers/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'local_text.dart';
class LocalAppBar extends StatelessWidget implements PreferredSizeWidget {
final String? labelKey;
final Color? backgroundColor;
final Color? labelColor;
final Color? arrowColor;
final List<Widget>? actions;
final Widget? titleWidget;
final Function()? onBack;
const LocalAppBar(
{Key? key,
this.labelKey,
this.backgroundColor = primaryColor,
this.labelColor,
this.arrowColor = Colors.white,
this.actions,
this.titleWidget,
this.onBack})
: super(key: key);
@override
Size get preferredSize => const Size.fromHeight(56);
@override
Widget build(BuildContext context) {
return AppBar(
elevation: 0,
centerTitle: true,
leading: IconButton(
icon: Icon(CupertinoIcons.back, color: arrowColor, size: 25),
onPressed: onBack),
shadowColor: Colors.transparent,
backgroundColor: backgroundColor,
surfaceTintColor: backgroundColor,
title: titleWidget ??
(labelKey != null
? LocalText(
context,
labelKey!,
color: Colors.white,
fontSize: 20,
)
: const SizedBox()),
actions: actions,
);
}
}