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 dbFieldUsersName = 'name';
static const String dbFieldUsersFirstName = 'firstname'; static const String dbFieldUsersFirstName = 'firstname';
static const String dbFieldUsersLastName = 'lastname'; static const String dbFieldUsersLastName = 'lastname';
static const String dbFieldUsersActive = 'active';
static const String dbFieldUsersVerified = 'verified';
static const String dbFieldUsersBio = 'bio'; static const String dbFieldUsersBio = 'bio';
static const String dbFieldUsersGender = 'gender'; static const String dbFieldUsersGender = 'gender';
static const String dbFieldUsersYearBorn = 'born'; static const String dbFieldUsersYearBorn = 'born';

View File

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

View File

@ -297,6 +297,15 @@ class _UserProfilePageState extends State<UserProfilePage> {
genderIcon = const Icon(Icons.female, color: Colors.pink); 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( return Column(
children: [ children: [
if (isOwner) if (isOwner)
@ -315,6 +324,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
verifiedIcon,
Flexible( Flexible(
child: Text( child: Text(
isOwner isOwner

View File

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