merge material 3

This commit is contained in:
tzw
2024-01-25 17:40:35 +06:30
parent 18053cbe3c
commit 991ecd7ae6
70 changed files with 572 additions and 1377 deletions

View File

@@ -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,
);