cofounderella/lib/forms/matched_screen.dart

79 lines
2.4 KiB
Dart
Raw Normal View History

2024-05-25 13:56:45 +02:00
import 'package:flutter/material.dart';
class MatchedScreen extends StatelessWidget {
final String user1Name;
final String user2Name;
final String user1ImageUrl;
final String user2ImageUrl;
final VoidCallback onMessageButtonPressed;
final VoidCallback onContinueButtonPressed;
2024-05-26 01:44:49 +02:00
const MatchedScreen({
super.key,
2024-05-25 13:56:45 +02:00
required this.user1Name,
required this.user2Name,
required this.user1ImageUrl,
required this.user2ImageUrl,
required this.onMessageButtonPressed,
required this.onContinueButtonPressed,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('It\'s a Match!')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'You and $user2Name have liked each other!',
style: const TextStyle(fontSize: 24),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2024-05-26 01:44:49 +02:00
// TODO imageUrl cant be null or empty with NetworkImage
2024-05-25 13:56:45 +02:00
CircleAvatar(
2024-05-26 01:44:49 +02:00
backgroundColor: Colors.blueGrey[300],
backgroundImage: (user1ImageUrl.isEmpty)
? null
: NetworkImage(user1ImageUrl),
2024-05-25 13:56:45 +02:00
radius: 50,
),
const SizedBox(width: 24),
CircleAvatar(
2024-05-26 01:44:49 +02:00
backgroundColor: Colors.blueGrey[300],
backgroundImage: (user2ImageUrl.isEmpty)
? null
: NetworkImage(user2ImageUrl),
2024-05-25 13:56:45 +02:00
radius: 50,
),
],
),
const SizedBox(height: 24),
Text(
'$user1Name and $user2Name',
style: const TextStyle(fontSize: 20),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: onMessageButtonPressed,
child: const Text('Send a Message'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: onContinueButtonPressed,
child: const Text('Continue Swiping'),
),
],
),
),
);
}
}