Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:app_finance/_classes/herald/app_locale.dart';
5 : import 'package:app_finance/_ext/build_context_ext.dart';
6 : import 'package:app_finance/design/wrapper/text_wrapper.dart';
7 : import 'package:material_ui/material_ui.dart';
8 : import 'package:flutter/semantics.dart';
9 :
10 : class LinkWidget extends StatelessWidget {
11 : final String text;
12 : final Function()? onTap;
13 :
14 1 : const LinkWidget(this.text, {super.key, required this.onTap});
15 :
16 1 : @override
17 : Widget build(BuildContext context) {
18 1 : return Semantics(
19 3 : attributedHint: AttributedString(AppLocale.labels.typeButton),
20 1 : child: MouseRegion(
21 : cursor: SystemMouseCursors.click,
22 1 : child: GestureDetector(
23 1 : onTap: onTap,
24 1 : child: TextWrapper(
25 1 : text,
26 1 : style: TextStyle(
27 2 : color: context.colorScheme.primary,
28 : decoration: TextDecoration.underline,
29 3 : decorationColor: context.colorScheme.primary.withValues(alpha: 0.8),
30 : ),
31 : ),
32 : ),
33 : ),
34 : );
35 : }
36 : }
|