session crud #5
@ -33,7 +33,7 @@ class ActivityCardState extends State<ActivityCard> {
|
|||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
List<MediaItem> mediaItems = snapshot.data!;
|
List<MediaItem> mediaItems = snapshot.data!;
|
||||||
|
|
||||||
return Card(
|
return Card.outlined(
|
||||||
color: atm.activity?.id == widget.activity.id
|
color: atm.activity?.id == widget.activity.id
|
||||||
? Theme.of(context).colorScheme.primaryContainer
|
? Theme.of(context).colorScheme.primaryContainer
|
||||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
|
@ -52,7 +52,7 @@ class _SessionCardFullState extends State<SessionCardFull> {
|
|||||||
final MediaItem? sessionImage = mediaItems
|
final MediaItem? sessionImage = mediaItems
|
||||||
.firstWhereOrNull((mediaItem) => mediaItem.type == MediaType.location);
|
.firstWhereOrNull((mediaItem) => mediaItem.type == MediaType.location);
|
||||||
|
|
||||||
return Card(
|
return Card.outlined(
|
||||||
color: (session.status == SessionStatus.started)
|
color: (session.status == SessionStatus.started)
|
||||||
? Theme.of(context).colorScheme.primaryContainer
|
? Theme.of(context).colorScheme.primaryContainer
|
||||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
|
@ -23,15 +23,32 @@ class _SessionViewActivitiesState extends State<SessionViewActivities> {
|
|||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
final activities = snapshot.data!;
|
final activities = snapshot.data!;
|
||||||
return Expanded(
|
if (activities.isNotEmpty) {
|
||||||
child: ListView.builder(
|
return Expanded(
|
||||||
// shrinkWrap: true,
|
child: ListView.builder(
|
||||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
// shrinkWrap: true,
|
||||||
itemCount: activities.length,
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemCount: activities.length,
|
||||||
return ActivityCard(activity: activities[index]);
|
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 {
|
} else {
|
||||||
return GenericProgressIndicator();
|
return GenericProgressIndicator();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user