friend_interaction_entry.dart
1.46 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
import 'package:doublefeel_flutter/app/routes/app_pages.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class FriendInteractionButton extends StatelessWidget {
const FriendInteractionButton({
super.key,
required this.enabled,
this.size = 24,
});
final bool enabled;
final double size;
@override
Widget build(BuildContext context) => Opacity(
opacity: enabled ? 1 : 0.4,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: enabled ? _openInteraction : null,
child: SizedBox(
width: size,
height: size,
child: DecoratedBox(
decoration: const BoxDecoration(
color: Color(0xFF845EEE),
shape: BoxShape.circle,
),
child: Padding(
padding: EdgeInsets.all(size / 8),
child: Image.asset('assets/images/interact/icon_stick.png'),
),
),
),
),
);
void _openInteraction() => Get.toNamed(Routes.INTERACT);
}
class FriendInteractionFloatingEntry extends StatelessWidget {
const FriendInteractionFloatingEntry({super.key, this.size = 72});
final double size;
@override
Widget build(BuildContext context) => GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => Get.toNamed(Routes.INTERACT),
child: Image.asset(
'assets/images/interact/interaction_float.png',
width: size,
height: size,
fit: BoxFit.contain,
),
);
}