cofounderella/lib/forms/matched_screen.dart

79 lines
2.5 KiB
Dart

import 'package:flutter/material.dart';
class MatchedScreen extends StatelessWidget {
final String currentUserName;
final String otherUserName;
final String currentUserImageUrl;
final String otherUserImageUrl;
final VoidCallback onMessageButtonPressed;
final VoidCallback onContinueButtonPressed;
const MatchedScreen({
super.key,
required this.currentUserName,
required this.otherUserName,
required this.currentUserImageUrl,
required this.otherUserImageUrl,
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 $otherUserName have liked each other!',
style: const TextStyle(fontSize: 24),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// imageUrl cant be null or empty with NetworkImage
CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (currentUserImageUrl.isEmpty)
? null
: NetworkImage(currentUserImageUrl),
radius: 50,
),
const SizedBox(width: 24),
CircleAvatar(
backgroundColor: Colors.blueGrey[300],
backgroundImage: (otherUserImageUrl.isEmpty)
? null
: NetworkImage(otherUserImageUrl),
radius: 50,
),
],
),
const SizedBox(height: 24),
Text(
'$currentUserName and $otherUserName',
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'),
),
],
),
),
);
}
}