default activity selector
This commit is contained in:
parent
9fc5fb5d22
commit
6e0b1263ba
@ -33,7 +33,7 @@ class ActivityCardState extends State<ActivityCard> {
|
||||
if (snapshot.hasData) {
|
||||
List<MediaItem> mediaItems = snapshot.data!;
|
||||
|
||||
return Card(
|
||||
return Card.outlined(
|
||||
color: atm.activity?.id == widget.activity.id
|
||||
? Theme.of(context).colorScheme.primaryContainer
|
||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
|
@ -52,7 +52,7 @@ class _SessionCardFullState extends State<SessionCardFull> {
|
||||
final MediaItem? sessionImage = mediaItems
|
||||
.firstWhereOrNull((mediaItem) => mediaItem.type == MediaType.location);
|
||||
|
||||
return Card(
|
||||
return Card.outlined(
|
||||
color: (session.status == SessionStatus.started)
|
||||
? Theme.of(context).colorScheme.primaryContainer
|
||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
|
@ -23,15 +23,32 @@ class _SessionViewActivitiesState extends State<SessionViewActivities> {
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
final activities = snapshot.data!;
|
||||
return Expanded(
|
||||
child: ListView.builder(
|
||||
// shrinkWrap: true,
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
itemCount: activities.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ActivityCard(activity: activities[index]);
|
||||
},
|
||||
));
|
||||
if (activities.isNotEmpty) {
|
||||
return Expanded(
|
||||
child: ListView.builder(
|
||||
// shrinkWrap: true,
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
itemCount: activities.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ActivityCard(activity: activities[index]);
|
||||
},
|
||||
));
|
||||
} else {
|
||||
return Expanded(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
children: [
|
||||
Card.outlined(
|
||||
child: ListTile(
|
||||
onTap: () {},
|
||||
autofocus: true,
|
||||
leading: Icon(Icons.add_box_rounded),
|
||||
title: Text('Add an Activity!'),
|
||||
subtitle: Text(
|
||||
'Here you can associate one or more activities that you can follow during your session.'),
|
||||
))
|
||||
]));
|
||||
}
|
||||
} else {
|
||||
return GenericProgressIndicator();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user