genericizing add card, activity ui tweaks
This commit is contained in:
@ -11,6 +11,7 @@ import 'package:sendtrain/models/activity_timer_model.dart';
|
||||
import 'package:sendtrain/widgets/activities/activity_action_view.dart';
|
||||
import 'package:sendtrain/widgets/activities/activity_view_categories.dart';
|
||||
import 'package:sendtrain/widgets/activities/activity_view_media.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/add_card_generic.dart';
|
||||
|
||||
class ActivityView extends StatefulWidget {
|
||||
const ActivityView({super.key, required this.activity});
|
||||
@ -87,7 +88,15 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
ActivityActionView(actions: actions)
|
||||
];
|
||||
} else {
|
||||
return [Text('add an action')];
|
||||
return [
|
||||
AddCardGeneric(
|
||||
title: 'Add an Action!',
|
||||
description:
|
||||
'Click here to create an exercise template (sets and reps, etc) for your activity!',
|
||||
action: () {
|
||||
print('teset');
|
||||
})
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,8 +187,8 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
: []),
|
||||
ActivityViewCategories<List<ActivityType>>(
|
||||
icon: Icon(Icons.type_specimen_rounded),
|
||||
text: 'Activity Equipments',
|
||||
object: activity.equipment != null
|
||||
text: 'Activity Type',
|
||||
object: activity.type != null
|
||||
? [activity.type!]
|
||||
: []),
|
||||
])),
|
||||
@ -188,11 +197,12 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
top: 0, bottom: 0, left: 15, right: 15),
|
||||
child: Text(
|
||||
maxLines: 4,
|
||||
overflow: TextOverflow. ellipsis,
|
||||
softWrap: true,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
// softWrap: true,
|
||||
textAlign: TextAlign.left,
|
||||
style: const TextStyle(fontSize: 15),
|
||||
jsonToDescription(json.decode(activity.description ?? "")))),
|
||||
jsonToDescription([json
|
||||
.decode(activity.description ?? "")[0]]))),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Align(
|
||||
@ -215,12 +225,18 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
context,
|
||||
Padding(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Text(jsonToDescription(
|
||||
json.decode(activity.description ??
|
||||
"")))));
|
||||
child: Text(
|
||||
style:
|
||||
TextStyle(fontSize: 18),
|
||||
jsonToDescription(json.decode(
|
||||
activity.description ??
|
||||
"")))));
|
||||
},
|
||||
child: Text("read more",
|
||||
textAlign: TextAlign.right, style: TextStyle(fontSize: 12),),
|
||||
child: Text(
|
||||
"read more",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
))),
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 10, 0, 10),
|
||||
|
Reference in New Issue
Block a user