63 lines
1.6 KiB
Dart
63 lines
1.6 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:furman_now/src/utils/theme.dart';
|
|
|
|
class HeaderWidget extends StatelessWidget {
|
|
const HeaderWidget({
|
|
required this.title,
|
|
this.link,
|
|
Key? key
|
|
}) : super(key: key);
|
|
|
|
final String title;
|
|
final HeaderLink? link;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.only(left: 40, right: 36, top: 20, bottom: 15),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
title.toUpperCase(),
|
|
style: furmanTextStyle(TextStyle(
|
|
color: Colors.grey[800],
|
|
fontWeight: FontWeight.w900,
|
|
fontSize: 18,
|
|
)),
|
|
),
|
|
if (link != null)
|
|
GestureDetector(
|
|
onTap: () => context.router.navigate(link!.href),
|
|
behavior: HitTestBehavior.translucent,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(6),
|
|
child: Text(
|
|
link!.text,
|
|
style: furmanTextStyle(const TextStyle(
|
|
color: Color(0xff755898),
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
@immutable
|
|
class HeaderLink {
|
|
final String text;
|
|
final PageRouteInfo href;
|
|
|
|
const HeaderLink({
|
|
required this.text,
|
|
required this.href,
|
|
});
|
|
}
|