OpenContacts/lib/widgets/messages/messages_session_header.dart
Nutcake 812148658d
Add iOS support (#18)
* add web support and remove all tabs except chat

* Update README.md

* feat: setup project for xcode builds + add other tabs back

* chore: update macos podfile

* chore: update packages + update build config + add audio playback on iOS/macOS + swap downloader library

* chore: remove ide-specific files

* chore: update readme

* chore: update build.gradle to reflect correct minSdkVersion

* chore: remove generated ic_launcher png files

* chore: update formatting to use 120 char line length

* chore: address use of then method on awaited future

* chore: update app icons for macOS & iOS

* Fix file move not waiting for download finish

---------

Co-authored-by: lumey <lumey@lumey.dev>
Co-authored-by: Garrett <toast@isota.ch>
2023-11-14 20:28:14 +01:00

47 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:recon/auxiliary.dart';
import 'package:recon/models/session.dart';
import 'package:recon/widgets/formatted_text.dart';
import 'package:recon/widgets/generic_avatar.dart';
import 'package:recon/widgets/sessions/session_view.dart';
class SessionTile extends StatelessWidget {
const SessionTile({required this.session, super.key});
final Session session;
@override
Widget build(BuildContext context) {
return TextButton(
style: TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onSurface,
),
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => SessionView(session: session)));
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GenericAvatar(imageUri: Aux.resdbToHttp(session.thumbnailUrl), placeholderIcon: Icons.no_photography),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FormattedText(session.formattedName),
Text(
"${session.sessionUsers.length.toString().padLeft(2, "0")}/${session.maxUsers.toString().padLeft(2, "0")} active users",
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(color: Theme.of(context).colorScheme.onSurface.withOpacity(.6)),
)
],
),
)
],
),
);
}
}