merge material 3
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
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 {
|
||||
@@ -12,6 +11,7 @@ class LocalAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final List<Widget>? actions;
|
||||
final Widget? titleWidget;
|
||||
final Function()? onBack;
|
||||
final bool centerTitle;
|
||||
|
||||
const LocalAppBar(
|
||||
{Key? key,
|
||||
@@ -21,7 +21,8 @@ class LocalAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
this.arrowColor = Colors.white,
|
||||
this.actions,
|
||||
this.titleWidget,
|
||||
this.onBack})
|
||||
this.onBack,
|
||||
this.centerTitle = true})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
@@ -31,21 +32,23 @@ class LocalAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return AppBar(
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
centerTitle: centerTitle,
|
||||
leading: IconButton(
|
||||
icon: Icon(CupertinoIcons.back, color: arrowColor, size: 25),
|
||||
onPressed: onBack),
|
||||
onPressed: () {
|
||||
if (onBack != null) {
|
||||
onBack!();
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: backgroundColor,
|
||||
surfaceTintColor: backgroundColor,
|
||||
title: titleWidget ??
|
||||
(labelKey != null
|
||||
? LocalText(
|
||||
context,
|
||||
labelKey!,
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
)
|
||||
? LocalText(context, labelKey!,
|
||||
color: labelColor ?? Colors.white, fontSize: 20)
|
||||
: const SizedBox()),
|
||||
actions: actions,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user