-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro_functions_tooltip.dart
More file actions
80 lines (75 loc) · 2.43 KB
/
Copy pathpro_functions_tooltip.dart
File metadata and controls
80 lines (75 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import 'package:flutter/material.dart';
import 'package:frontend/exports.dart';
import 'package:go_router/go_router.dart';
import 'package:super_tooltip/super_tooltip.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class ProFunctionsTooltip extends StatefulWidget {
const ProFunctionsTooltip({
super.key,
required this.modalHeader,
required this.child,
required this.isPro,
});
final String modalHeader;
final Widget child;
final bool isPro;
@override
State<ProFunctionsTooltip> createState() => _ProFunctionsTooltipState();
}
class _ProFunctionsTooltipState extends State<ProFunctionsTooltip> {
final _controller = SuperTooltipController();
@override
Widget build(BuildContext context) {
return SuperTooltip(
controller: _controller,
arrowTipRadius: 2,
arrowBaseWidth: 30,
backgroundColor: Colors.white,
borderColor: Colors.white,
hasShadow: false,
borderRadius: 16,
showBarrier: true,
barrierColor: Colors.transparent,
popupDirection: TooltipDirection.up,
content: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), color: Colors.white),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 32),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.modalHeader,
style: TextStyles.body2.copyWith(
color: ColorsConst.neutralColor300,
height: 1.3,
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: Text(
AppLocalizations.of(context).proFeatureDescription,
style: TextStyles.caption1.copyWith(
color: ColorsConst.neutralColor100,
height: 1.3,
),
),
),
!widget.isPro
? UpgradeToProButton(
onTap: () {
_controller.hideTooltip();
context.push(RouteLocations.promoScreen);
},
)
: const SizedBox.shrink()
],
),
),
),
child: widget.child,
);
}
}