Insparkspokalen-ui/lib/teams/showTeams.dart
Beata Ericsson a3c2a08e4a test commit
2025-05-06 12:21:07 +02:00

51 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:insparkspokalen_ui/models/teamModel.dart';
class TeamCard extends StatelessWidget {
final TeamModel group;
final VoidCallback onJoin;
const TeamCard({super.key, required this.group, required this.onJoin});
@override
Widget build(BuildContext context) {
return Card(
color: Colors.white,
margin: const EdgeInsets.symmetric(vertical: 6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: const BorderSide(color: Colors.black12),
),
child: ListTile(
title: Text(group.name),
subtitle: Row(
children: [
const Text('', style: TextStyle(color: Colors.amber)),
Text(
'${'2'}/${'20'}', //hårdkodat antal personer och max antal personer i ett team
style: const TextStyle(
color: Colors.amber,
fontWeight: FontWeight.w600,
),
),
],
),
trailing: ElevatedButton(
onPressed: onJoin,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[300],
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
shadowColor: Colors.black45,
elevation: 4,
),
child: const Text('Join'),
),
),
);
}
}