spotube/lib/components/Shared/LinkText.dart
Kingkor Roy Tirtho 3e498a4827 feat: implemented go_route shell/nested route
BRIEF DESCRIPTION:
- Nested Routes like React-Router/Spotify Web/desktop
- Except Login routes everything is nested and wrapped by a Shell
- PlayerOverlay is no more a overlay
A really simple Sidebar now
2022-10-10 20:00:47 +06:00

36 lines
806 B
Dart

import 'package:flutter/material.dart';
import 'package:spotube/components/Shared/AnchorButton.dart';
import 'package:spotube/utils/service_utils.dart';
class LinkText<T> extends StatelessWidget {
final String text;
final TextStyle style;
final TextAlign? textAlign;
final TextOverflow? overflow;
final String route;
final T? extra;
const LinkText(
this.text,
this.route, {
Key? key,
this.textAlign,
this.extra,
this.overflow,
this.style = const TextStyle(),
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AnchorButton(
text,
onTap: () {
ServiceUtils.navigate(context, route, extra: extra);
},
key: key,
overflow: overflow,
style: style,
textAlign: textAlign,
);
}
}