79 lines
2.4 KiB
Dart
79 lines
2.4 KiB
Dart
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;
|
|
|
|
const MatchedScreen({
|
|
super.key,
|
|
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: [
|
|
// TODO imageUrl cant be null or empty with NetworkImage
|
|
CircleAvatar(
|
|
backgroundColor: Colors.blueGrey[300],
|
|
backgroundImage: (user1ImageUrl.isEmpty)
|
|
? null
|
|
: NetworkImage(user1ImageUrl),
|
|
radius: 50,
|
|
),
|
|
const SizedBox(width: 24),
|
|
CircleAvatar(
|
|
backgroundColor: Colors.blueGrey[300],
|
|
backgroundImage: (user2ImageUrl.isEmpty)
|
|
? null
|
|
: NetworkImage(user2ImageUrl),
|
|
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'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|