2023-07-29 02:17:26 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:freezer/settings.dart';
|
|
|
|
|
|
|
|
class LeadingIcon extends StatelessWidget {
|
|
|
|
final IconData icon;
|
|
|
|
final Color? color;
|
2023-10-12 22:09:37 +00:00
|
|
|
const LeadingIcon(this.icon, {super.key, this.color});
|
2023-07-29 02:17:26 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SizedBox.square(
|
|
|
|
dimension: 42.0,
|
|
|
|
child: DecoratedBox(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: (color ?? Theme.of(context).primaryColor).withOpacity(1.0),
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
child: Icon(
|
|
|
|
icon,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Container with set size to match LeadingIcon
|
|
|
|
class EmptyLeading extends StatelessWidget {
|
2023-10-12 22:09:37 +00:00
|
|
|
const EmptyLeading({super.key});
|
2023-07-29 02:17:26 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) => const SizedBox.square(dimension: 42.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// class FreezerAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
|
|
// final String title;
|
|
|
|
// final List<Widget>? actions;
|
|
|
|
// final PreferredSizeWidget? bottom;
|
|
|
|
// //Should be specified if bottom is specified
|
|
|
|
// final double height;
|
|
|
|
// final Color? backgroundColor;
|
|
|
|
// final Color? foregroundColor;
|
|
|
|
//
|
|
|
|
// final Brightness? brightness;
|
|
|
|
//
|
|
|
|
// const FreezerAppBar(
|
|
|
|
// this.title, {
|
|
|
|
// this.actions,
|
|
|
|
// this.bottom,
|
|
|
|
// this.height = 56.0,
|
|
|
|
// this.backgroundColor,
|
|
|
|
// this.brightness,
|
|
|
|
// this.foregroundColor,
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// Size get preferredSize => Size.fromHeight(this.height);
|
|
|
|
//
|
|
|
|
// @override
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
// return AppBar(
|
|
|
|
// automaticallyImplyLeading: true,
|
|
|
|
// title: Text(title),
|
|
|
|
// actions: actions,
|
|
|
|
// bottom: bottom,
|
|
|
|
// foregroundColor: foregroundColor,
|
|
|
|
// backgroundColor: backgroundColor,
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
class FreezerDivider extends StatelessWidget {
|
2023-10-12 22:09:37 +00:00
|
|
|
const FreezerDivider({super.key});
|
|
|
|
|
2023-07-29 02:17:26 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-10-12 22:09:37 +00:00
|
|
|
return const Divider(
|
2023-07-29 02:17:26 +00:00
|
|
|
thickness: 1.5,
|
|
|
|
indent: 16.0,
|
|
|
|
endIndent: 16.0,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TextStyle popupMenuTextStyle() {
|
|
|
|
return TextStyle(color: settings.isDark ? Colors.white : Colors.black);
|
|
|
|
}
|