Verified Icon

master
Rafael 2024-08-13 14:12:24 +02:00
parent a848041823
commit c560f86db9
4 changed files with 20 additions and 0 deletions

View File

@ -45,6 +45,8 @@ class Constants {
static const String dbFieldUsersName = 'name';
static const String dbFieldUsersFirstName = 'firstname';
static const String dbFieldUsersLastName = 'lastname';
static const String dbFieldUsersActive = 'active';
static const String dbFieldUsersVerified = 'verified';
static const String dbFieldUsersBio = 'bio';
static const String dbFieldUsersGender = 'gender';
static const String dbFieldUsersYearBorn = 'born';

View File

@ -1,3 +1,5 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import '../enumerations.dart';
import 'language.dart';
import 'location.dart';
@ -16,6 +18,8 @@ class UserProfile {
String? bio;
Gender? gender;
int? born;
bool? active;
Timestamp? verified;
RiskTolerance risk;
AvailabilityOption availability;
CultureOption culture;
@ -42,6 +46,8 @@ class UserProfile {
this.bio,
this.gender,
this.born,
this.active,
this.verified,
required this.risk,
required this.availability,
required this.culture,

View File

@ -297,6 +297,15 @@ class _UserProfilePageState extends State<UserProfilePage> {
genderIcon = const Icon(Icons.female, color: Colors.pink);
}
Widget verifiedIcon = const Icon(null);
if (myData.verified != null &&
myData.verified!.toDate().isAfter(DateTime(2024, 8, 1))) {
verifiedIcon = const Padding(
padding: EdgeInsets.only(right: 4.0),
child: Icon(Icons.verified, color: Colors.blueGrey),
);
}
return Column(
children: [
if (isOwner)
@ -315,6 +324,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
verifiedIcon,
Flexible(
child: Text(
isOwner

View File

@ -212,6 +212,8 @@ class UserService {
bio: data[Constants.dbFieldUsersBio],
gender: Gender.values[data[Constants.dbFieldUsersGender] ?? 0],
born: data[Constants.dbFieldUsersYearBorn],
active: data[Constants.dbFieldUsersActive],
verified: data[Constants.dbFieldUsersVerified],
languages: languages,
locations: locations,
);