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.
46 lines
1.5 KiB
46 lines
1.5 KiB
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
|
|
|
class PageAppbar extends StatelessWidget implements PreferredSizeWidget {
|
|
|
|
final Color? backgroundColor;
|
|
final Color? color;
|
|
final Color? iconColor;
|
|
final bool? bottom;
|
|
final String title;
|
|
final Widget? right;
|
|
const PageAppbar({super.key, required this.title, this.iconColor,this.backgroundColor, this.color, this.right, this.bottom});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppBar(
|
|
backgroundColor: backgroundColor ?? const Color.fromRGBO(255, 255, 255, 1),
|
|
surfaceTintColor: backgroundColor ?? const Color.fromRGBO(255, 255, 255, 1),
|
|
centerTitle: true,
|
|
foregroundColor: color,
|
|
actions: right != null ? [right ?? Container()] : null,
|
|
leading: IconButton(
|
|
icon: Icon( TDIcons.chevron_left, size: 30, color: iconColor ?? Colors.black),
|
|
onPressed: () => Get.back(),
|
|
),
|
|
title: Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: color ?? const Color.fromRGBO(51, 51, 51, 1)
|
|
),
|
|
),
|
|
bottom: (bottom != null && bottom!) ? PreferredSize(
|
|
preferredSize: Size.fromHeight(0.5),
|
|
child: Container(
|
|
color: Colors.grey[300],
|
|
height: 0.5,
|
|
),
|
|
) : null,
|
|
);
|
|
}
|
|
@override
|
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
|
}
|