mobile_skt/lib/widgets/sk_appbar.dart

36 lines
932 B
Dart

import 'package:flutter/material.dart';
import 'package:sk_base_mobile/util/util.dart';
class SkAppbar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget>? action;
final bool hideLeading;
const SkAppbar(
{super.key, required this.title, this.action, this.hideLeading = false});
@override
Widget build(BuildContext context) {
return AppBar(
leading: hideLeading
? const SizedBox()
: IconButton(
icon: Icon(
Icons.arrow_back_ios,
size: ScreenAdaper.height(40),
),
onPressed: () {
Navigator.pop(context);
},
),
title: Text(
title,
style: TextStyle(fontSize: ScreenAdaper.height(30)),
),
actions: action,
);
}
@override
Size get preferredSize => Size.fromHeight(kToolbarHeight);
}