genericizing add card, activity ui tweaks
This commit is contained in:
@ -83,7 +83,7 @@ class _SessionViewState extends State<SessionView> {
|
||||
),
|
||||
children: [
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
icon: const Icon(Icons.military_tech_rounded),
|
||||
label: Text('Add Achievement'),
|
||||
onPressed: () {
|
||||
showEditorSheet(
|
||||
@ -93,7 +93,7 @@ class _SessionViewState extends State<SessionView> {
|
||||
},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
icon: const Icon(Icons.sports_gymnastics_rounded),
|
||||
label: Text('Add Activity'),
|
||||
onPressed: () {
|
||||
showEditorSheet(
|
||||
@ -104,7 +104,7 @@ class _SessionViewState extends State<SessionView> {
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.edit_outlined),
|
||||
label: Text('Edit'),
|
||||
label: Text('Edit Session'),
|
||||
onPressed: () {
|
||||
showEditorSheet(
|
||||
context,
|
||||
@ -114,7 +114,7 @@ class _SessionViewState extends State<SessionView> {
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: Text('Restart'),
|
||||
label: Text('Restart Session'),
|
||||
onPressed: () {
|
||||
Session newSession =
|
||||
session.copyWith(status: SessionStatus.pending);
|
||||
@ -131,7 +131,7 @@ class _SessionViewState extends State<SessionView> {
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.done_all_outlined),
|
||||
label: Text('Done'),
|
||||
label: Text('Finish Session'),
|
||||
onPressed: () {
|
||||
Session newSession =
|
||||
session.copyWith(status: SessionStatus.completed);
|
||||
|
@ -4,6 +4,7 @@ import 'package:sendtrain/daos/activities_dao.dart';
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
import 'package:sendtrain/helpers/widget_helpers.dart';
|
||||
import 'package:sendtrain/widgets/activities/activity_card.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/add_card_generic.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/generic_progress_indicator.dart';
|
||||
import 'package:sendtrain/widgets/sessions/session_activities_editor.dart';
|
||||
|
||||
@ -32,36 +33,21 @@ class _SessionViewActivitiesState extends State<SessionViewActivities> {
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
itemCount: activities.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ActivityCard(activity: activities[index], session: widget.session);
|
||||
return ActivityCard(
|
||||
activity: activities[index], session: widget.session);
|
||||
},
|
||||
));
|
||||
} else {
|
||||
return Expanded(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
children: [
|
||||
Card.outlined(
|
||||
child: InkWell(
|
||||
customBorder: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
onTap: () {
|
||||
showEditorSheet(
|
||||
context,
|
||||
SessionActivitiesEditor(
|
||||
session: widget.session,
|
||||
callback: () {}));
|
||||
},
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.only(
|
||||
top: 5, left: 15, right: 5, bottom: 5),
|
||||
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 along with during your session.'),
|
||||
)))
|
||||
]));
|
||||
return AddCardGeneric(
|
||||
title: 'Add an Activity!',
|
||||
description:
|
||||
'Here you can associate one or more activities that you can follow along with during your session.',
|
||||
action: () {
|
||||
showEditorSheet(
|
||||
context,
|
||||
SessionActivitiesEditor(
|
||||
session: widget.session, callback: () {}));
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return GenericProgressIndicator();
|
||||
|
@ -32,7 +32,7 @@ class _SessionViewMediaState extends State<SessionViewMedia> {
|
||||
List<Widget> content;
|
||||
if (mediaItems.isNotEmpty) {
|
||||
List<Widget> mediaCards = List.generate(mediaItems.length,
|
||||
(i) => MediaCard(media: mediaItems[i], callback: resetState));
|
||||
(i) => MediaCard(media: mediaItems[i], callback: resetState, canDelete: true));
|
||||
content = mediaCards;
|
||||
} else {
|
||||
content = [
|
||||
|
Reference in New Issue
Block a user