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