mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
50 lines
1.2 KiB
Dart
50 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SpaceWidget extends StatelessWidget {
|
|
final String name;
|
|
final Offset position;
|
|
final VoidCallback onTap;
|
|
|
|
const SpaceWidget({
|
|
super.key,
|
|
required this.name,
|
|
required this.position,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Positioned(
|
|
left: position.dx,
|
|
top: position.dy,
|
|
child: GestureDetector(
|
|
onTap: onTap,
|
|
child:
|
|
Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(8),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.5),
|
|
spreadRadius: 5,
|
|
blurRadius: 7,
|
|
offset: const Offset(0, 3),
|
|
),
|
|
],
|
|
),
|
|
child: Row(
|
|
children: [
|
|
const Icon(Icons.location_on, color: Colors.blue),
|
|
const SizedBox(width: 8),
|
|
Text(name, style: const TextStyle(fontSize: 16)),
|
|
],
|
|
),
|
|
),
|
|
|
|
),
|
|
);
|
|
}
|
|
}
|