2024-05-25 13:56:45 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class MatchedScreen extends StatelessWidget {
|
2024-05-30 16:37:34 +02:00
|
|
|
final String currentUserName;
|
|
|
|
final String otherUserName;
|
|
|
|
final String currentUserImageUrl;
|
|
|
|
final String otherUserImageUrl;
|
2024-05-25 13:56:45 +02:00
|
|
|
final VoidCallback onMessageButtonPressed;
|
|
|
|
final VoidCallback onContinueButtonPressed;
|
|
|
|
|
2024-05-26 01:44:49 +02:00
|
|
|
const MatchedScreen({
|
|
|
|
super.key,
|
2024-05-30 16:37:34 +02:00
|
|
|
required this.currentUserName,
|
|
|
|
required this.otherUserName,
|
|
|
|
required this.currentUserImageUrl,
|
|
|
|
required this.otherUserImageUrl,
|
2024-05-25 13:56:45 +02:00
|
|
|
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(
|
2024-05-30 16:37:34 +02:00
|
|
|
'You and $otherUserName have liked each other!',
|
2024-05-25 13:56:45 +02:00
|
|
|
style: const TextStyle(fontSize: 24),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2024-05-30 16:37:34 +02:00
|
|
|
// 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],
|
2024-05-30 16:37:34 +02:00
|
|
|
backgroundImage: (currentUserImageUrl.isEmpty)
|
2024-05-26 01:44:49 +02:00
|
|
|
? null
|
2024-05-30 16:37:34 +02:00
|
|
|
: NetworkImage(currentUserImageUrl),
|
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],
|
2024-05-30 16:37:34 +02:00
|
|
|
backgroundImage: (otherUserImageUrl.isEmpty)
|
2024-05-26 01:44:49 +02:00
|
|
|
? null
|
2024-05-30 16:37:34 +02:00
|
|
|
: NetworkImage(otherUserImageUrl),
|
2024-05-25 13:56:45 +02:00
|
|
|
radius: 50,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
Text(
|
2024-05-30 16:37:34 +02:00
|
|
|
'$currentUserName and $otherUserName',
|
2024-05-25 13:56:45 +02:00
|
|
|
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'),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|