Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into enhancement/283-add-r…
Browse files Browse the repository at this point in the history
…oom-search-to-quick-actions
  • Loading branch information
jakobkoerber committed Oct 31, 2024
2 parents 6a4510f + e68f01a commit 5d17d71
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 71 deletions.
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.7.0' apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "2.0.20" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "2.0.21" apply false
id "com.google.gms.google-services" version "4.4.2" apply false
id "com.google.firebase.crashlytics" version "3.0.2" apply false
}
Expand Down
26 changes: 13 additions & 13 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PODS:
- GoogleUtilities/Logger (~> 8.0)
- FirebaseCoreExtension (11.4.1):
- FirebaseCore (~> 11.0)
- FirebaseCoreInternal (11.4.0):
- FirebaseCoreInternal (11.4.2):
- "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseCrashlytics (11.2.0):
- FirebaseCore (~> 11.0)
Expand Down Expand Up @@ -122,20 +122,20 @@ PODS:
- sqflite_darwin (0.0.4):
- Flutter
- FlutterMacOS
- "sqlite3 (3.46.1+1)":
- "sqlite3/common (= 3.46.1+1)"
- "sqlite3/common (3.46.1+1)"
- "sqlite3/dbstatvtab (3.46.1+1)":
- sqlite3 (3.47.0):
- sqlite3/common (= 3.47.0)
- sqlite3/common (3.47.0)
- sqlite3/dbstatvtab (3.47.0):
- sqlite3/common
- "sqlite3/fts5 (3.46.1+1)":
- sqlite3/fts5 (3.47.0):
- sqlite3/common
- "sqlite3/perf-threadsafe (3.46.1+1)":
- sqlite3/perf-threadsafe (3.47.0):
- sqlite3/common
- "sqlite3/rtree (3.46.1+1)":
- sqlite3/rtree (3.47.0):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- "sqlite3 (~> 3.46.0+1)"
- sqlite3 (~> 3.47.0)
- sqlite3/dbstatvtab
- sqlite3/fts5
- sqlite3/perf-threadsafe
Expand Down Expand Up @@ -241,7 +241,7 @@ SPEC CHECKSUMS:
FirebaseABTesting: aef1719704fade00b200827e7973f352efc4caee
FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da
FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e
FirebaseCoreInternal: 5c2b016f06a96fbf20d9b443459f80427a827d7b
FirebaseCoreInternal: 35731192cab10797b88411be84940d2beb33a238
FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac
FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
FirebaseRemoteConfig: fca0b2d017fc1de52b28a4e5bcf2007c1a840457
Expand All @@ -268,11 +268,11 @@ SPEC CHECKSUMS:
quick_actions_ios: 56f3cbaa71e94f212838d1f9fe354bd0734779bf
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
sqlite3_flutter_libs: c00457ebd31e59fa6bb830380ddba24d44fbcd3b
sqlite3: 0aa20658a9b238a3b1ff7175eb7bdd863b0ab4fd
sqlite3_flutter_libs: b55ef23cfafea5318ae5081e0bf3fbbce8417c94
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3

PODFILE CHECKSUM: f5f6fa56ec332013222699049ea868939deda084

COCOAPODS: 1.15.2
COCOAPODS: 1.16.1
2 changes: 2 additions & 0 deletions lib/base/networking/apis/google/protobuf/empty.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import 'package:protobuf/protobuf.dart' as $pb;
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
///
/// The JSON representation for `Empty` is empty JSON object `{}`.
class Empty extends $pb.GeneratedMessage {
factory Empty() => create();
Empty._() : super();
Expand Down
4 changes: 3 additions & 1 deletion lib/base/networking/apis/google/protobuf/timestamp.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
/// .setNanos((int) ((millis % 1000) * 1000000)).build();
///
///
/// Example 5: Compute Timestamp from Java `Instant.now()`.
///
/// Instant now = Instant.now();
Expand All @@ -73,6 +74,7 @@ import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
/// .setNanos(now.getNano()).build();
///
///
/// Example 6: Compute Timestamp from current time in Python.
///
/// timestamp = Timestamp()
Expand Down Expand Up @@ -102,7 +104,7 @@ import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
/// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
/// the Joda Time's [`ISODateTimeFormat.dateTime()`](
/// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
/// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
/// ) to obtain a formatter capable of generating timestamps in this format.
class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin {
factory Timestamp({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:campus_flutter/base/util/placeholder_text.dart';
import 'package:campus_flutter/base/util/shimmer_view.dart';
import 'package:campus_flutter/homeComponent/view/contactCard/contact_card_view.dart';
import 'package:flutter/material.dart';

class ContactCardLoadingView extends StatelessWidget {
Expand All @@ -11,11 +12,9 @@ class ContactCardLoadingView extends StatelessWidget {
padding: const EdgeInsets.all(10.0),
child: Row(
children: [
const CircleAvatar(
backgroundImage: AssetImage(
'assets/images/placeholders/portrait_placeholder.png',
),
radius: 50,
const SizedBox(
width: contactImageSize,
height: contactImageSize,
),
const Padding(padding: EdgeInsets.only(left: 15)),
Column(
Expand Down
43 changes: 33 additions & 10 deletions lib/homeComponent/view/contactCard/contact_card_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import 'package:campus_flutter/navigation_service.dart';
import 'package:campus_flutter/personComponent/model/personDetails/person_details.dart';
import 'package:campus_flutter/personComponent/model/profile/profile.dart';
import 'package:campus_flutter/personComponent/viewModel/person_details_viewmodel.dart';
import 'package:campus_flutter/studentCardComponent/model/student_card.dart';
import 'package:campus_flutter/studentCardComponent/viewModel/student_card_viewmodel.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

const double contactImageSize = 100;

class ContactCardView extends ConsumerStatefulWidget {
const ContactCardView({super.key, required this.profile});

Expand All @@ -25,7 +28,6 @@ class _ContactCardViewState extends ConsumerState<ContactCardView> {
@override
void initState() {
ref.read(profileDetailsViewModel).fetch(false);
ref.read(studentCardViewModel);
super.initState();
}

Expand Down Expand Up @@ -58,15 +60,7 @@ class _ContactCardViewState extends ConsumerState<ContactCardView> {
padding: const EdgeInsets.all(10.0),
child: Row(
children: [
CircleAvatar(
backgroundImage: data?.imageData != null
? Image.memory(base64DecodeImageData(data!.imageData!)).image
: const AssetImage(
'assets/images/placeholders/portrait_placeholder.png',
),
backgroundColor: Theme.of(context).cardTheme.color,
radius: 50,
),
profilePicture(),
const Padding(padding: EdgeInsets.only(left: 15)),
Expanded(
child: Column(
Expand Down Expand Up @@ -100,4 +94,33 @@ class _ContactCardViewState extends ConsumerState<ContactCardView> {
),
);
}

Widget profilePicture() {
return StreamBuilder(
stream: ref.watch(studentCardViewModel).studentCard,
builder: (context, snapshot) {
if (snapshot.hasData || snapshot.hasError) {
return CircleAvatar(
backgroundImage: imageData(snapshot),
backgroundColor: Theme.of(context).cardTheme.color,
radius: contactImageSize / 2,
);
} else {
return SizedBox(height: contactImageSize, width: contactImageSize);
}
},
);
}

ImageProvider<Object> imageData(AsyncSnapshot<List<StudentCard>?> snapshot) {
if (snapshot.hasData) {
return Image.memory(
base64DecodeImageData(snapshot.data!.first.image),
).image;
} else {
return const AssetImage(
'assets/images/placeholders/portrait_placeholder.png',
);
}
}
}
4 changes: 2 additions & 2 deletions protos/tumdev/campus_backend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ service Campus {
option (google.api.http) = {delete: "/device/{device_id}"};
}

// Delete a device from push notifications
// List all avaliable student clubs
rpc ListStudentClub(ListStudentClubRequest) returns (ListStudentClubReply) {
option (google.api.http) = {delete: "/student_clubs"};
option (google.api.http) = {get: "/student_clubs"};
}
}

Expand Down
Loading

0 comments on commit 5d17d71

Please sign in to comment.