From c560f86db93c51370546175825aea94575eddbc5 Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Tue, 13 Aug 2024 14:12:24 +0200 Subject: [PATCH] Verified Icon --- lib/constants.dart | 2 ++ lib/models/user_profile.dart | 6 ++++++ lib/pages/user_profile_page.dart | 10 ++++++++++ lib/services/user_service.dart | 2 ++ 4 files changed, 20 insertions(+) diff --git a/lib/constants.dart b/lib/constants.dart index e2fb096..14b8b79 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -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'; diff --git a/lib/models/user_profile.dart b/lib/models/user_profile.dart index 6c485c9..01db661 100644 --- a/lib/models/user_profile.dart +++ b/lib/models/user_profile.dart @@ -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, diff --git a/lib/pages/user_profile_page.dart b/lib/pages/user_profile_page.dart index 5f026aa..b749b71 100644 --- a/lib/pages/user_profile_page.dart +++ b/lib/pages/user_profile_page.dart @@ -297,6 +297,15 @@ class _UserProfilePageState extends State { 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 { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ + verifiedIcon, Flexible( child: Text( isOwner diff --git a/lib/services/user_service.dart b/lib/services/user_service.dart index d52f856..51b4f83 100644 --- a/lib/services/user_service.dart +++ b/lib/services/user_service.dart @@ -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, );