Make header links work properly

This commit is contained in:
Michael Thomas 2022-09-03 14:46:39 -04:00
parent 373004f52a
commit 306defc6df
1 changed files with 12 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:furman_now/src/utils/theme.dart';
@ -28,13 +29,16 @@ class HeaderWidget extends StatelessWidget {
)),
),
if (link != null)
Text(
link!.text,
style: furmanTextStyle(const TextStyle(
color: Color(0xff755898),
fontSize: 12,
fontWeight: FontWeight.bold,
)),
GestureDetector(
onTap: () => context.router.navigate(link!.href),
child: Text(
link!.text,
style: furmanTextStyle(const TextStyle(
color: Color(0xff755898),
fontSize: 12,
fontWeight: FontWeight.bold,
)),
),
),
],
),
@ -45,7 +49,7 @@ class HeaderWidget extends StatelessWidget {
@immutable
class HeaderLink {
final String text;
final String href;
final PageRouteInfo href;
const HeaderLink({
required this.text,