action display, and full display, started action editor
This commit is contained in:
39
lib/widgets/activities/activity_action_editor.dart
Normal file
39
lib/widgets/activities/activity_action_editor.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart' hide Action;
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/form_text_input.dart';
|
||||
|
||||
class ActivityActionEditor extends StatelessWidget {
|
||||
ActivityActionEditor({super.key, required this.action, this.callback});
|
||||
|
||||
final Action action;
|
||||
final Function? callback;
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
final Map<String, TextEditingController> actionEditController = {
|
||||
'sets': TextEditingController(),
|
||||
'reps': TextEditingController(),
|
||||
'weight': TextEditingController(),
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String editorType = 'Create';
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 0, 15, 15),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||
child: Text('$editorType Action',
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge)),
|
||||
FormTextInput(
|
||||
controller: actionEditController['sets']!,
|
||||
title: 'Total Sets'),])));
|
||||
}
|
||||
}
|
@ -1,20 +1,26 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
import 'package:sendtrain/extensions/string_extensions.dart';
|
||||
import 'package:sendtrain/models/activity_timer_model.dart';
|
||||
import 'package:sendtrain/models/action_model.dart';
|
||||
import 'package:sendtrain/providers/action_timer.dart';
|
||||
import 'package:sendtrain/widgets/generic/elements/add_card_generic.dart';
|
||||
|
||||
class ActivityActionView extends StatefulWidget {
|
||||
const ActivityActionView({super.key, required this.actions});
|
||||
const ActivityActionView({super.key, required this.actions, this.resetOnLoad = true});
|
||||
final List actions;
|
||||
final bool resetOnLoad;
|
||||
|
||||
@override
|
||||
State<ActivityActionView> createState() => ActivityActionViewState();
|
||||
}
|
||||
|
||||
class ActivityActionViewState extends State<ActivityActionView> {
|
||||
// class ActivityActionView extends StatelessWidget {
|
||||
// ActivityActionView({super.key, required this.actions});
|
||||
|
||||
// final List actions;
|
||||
final ItemScrollController itemScrollController = ItemScrollController();
|
||||
final ScrollOffsetController scrollOffsetController =
|
||||
ScrollOffsetController();
|
||||
@ -23,88 +29,199 @@ class ActivityActionViewState extends State<ActivityActionView> {
|
||||
final ScrollOffsetListener scrollOffsetListener =
|
||||
ScrollOffsetListener.create();
|
||||
|
||||
late final ActionTimer at;
|
||||
int actionCount = 0;
|
||||
|
||||
GestureDetector gtBuild(
|
||||
ActionTimer at, Item item, int actionNum, int selectedIndex,
|
||||
{int? order}) {
|
||||
// default, for rests
|
||||
String setItemRef = '-';
|
||||
|
||||
// non rests decimal reference to item
|
||||
if (order != null) {
|
||||
setItemRef = '${order + 1}.${item.position + 1}';
|
||||
}
|
||||
|
||||
return GestureDetector(onTap: () {
|
||||
at.setAction(actionNum, true);
|
||||
}, child: Consumer<ActionTimer>(builder: (context, at, child) {
|
||||
return Row(children: [
|
||||
Ink(
|
||||
width: 70,
|
||||
padding: const EdgeInsets.all(15),
|
||||
color: item == at.currentAction
|
||||
? Theme.of(context).colorScheme.primaryContainer
|
||||
: Theme.of(context).colorScheme.onPrimary,
|
||||
child: Text(textAlign: TextAlign.center, setItemRef)),
|
||||
Expanded(
|
||||
child: Ink(
|
||||
padding: const EdgeInsets.all(15),
|
||||
color: item == at.currentAction
|
||||
? Theme.of(context).colorScheme.surfaceBright
|
||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
'${item.name}: ${item.value} ${item.humanValueType}'
|
||||
.toTitleCase())))
|
||||
]);
|
||||
}));
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
at = Provider.of<ActionTimer>(context, listen: false);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ActivityTimerModel atm =
|
||||
Provider.of<ActivityTimerModel>(context, listen: true);
|
||||
List sets = json.decode(widget.actions[0].set);
|
||||
if (widget.actions.isNotEmpty) {
|
||||
at.setup(ActionModel(
|
||||
action: widget.actions.first, db: Provider.of<AppDatabase>(context)), itemScrollController, widget.resetOnLoad);
|
||||
|
||||
// we need to set the scroll controller
|
||||
// so we can update the selected item position
|
||||
atm.setScrollController(itemScrollController);
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// if (itemScrollController.isAttached) {
|
||||
// itemScrollController.scrollTo(
|
||||
// index: at.currentAction.parentId != null
|
||||
// ? at.currentAction.parentId!
|
||||
// : at.currentAction.id,
|
||||
// duration: Duration(milliseconds: 500),
|
||||
// curve: Curves.easeInOutCubic);
|
||||
// }
|
||||
// });
|
||||
|
||||
return Expanded(
|
||||
child: ScrollablePositionedList.builder(
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 20),
|
||||
itemCount: sets.length,
|
||||
itemScrollController: itemScrollController,
|
||||
scrollOffsetController: scrollOffsetController,
|
||||
itemPositionsListener: itemPositionsListener,
|
||||
scrollOffsetListener: scrollOffsetListener,
|
||||
itemBuilder: (BuildContext context, int setNum) {
|
||||
List<GestureDetector> content = [];
|
||||
List set = sets[setNum];
|
||||
return Expanded(
|
||||
child: Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
child: Row(children: [
|
||||
Ink(
|
||||
width: 70,
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
child: Consumer<ActionTimer>(
|
||||
builder: (context, at, child) {
|
||||
return IconButton(
|
||||
alignment: AlignmentDirectional.center,
|
||||
icon: at.available
|
||||
? const Icon(Icons.play_arrow_rounded)
|
||||
: const Icon(Icons.pause_rounded),
|
||||
onPressed: () => {
|
||||
if (at.started)
|
||||
{at.pause()}
|
||||
else if (at.available)
|
||||
{at.start()}
|
||||
});
|
||||
},
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: Consumer<ActionTimer>(
|
||||
builder: (context, at, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
'${at.currentValue} ${at.currentAction.humanValueType}'
|
||||
.toTitleCase());
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerRight,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Consumer<ActionTimer>(
|
||||
builder: (context, at, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 12),
|
||||
textAlign: TextAlign.right,
|
||||
'${at.state['currentAction'] + 1} of ${at.allActions.length}');
|
||||
})),
|
||||
])),
|
||||
]))),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 14, right: 14),
|
||||
child: Consumer<ActionTimer>(builder: (context, at, child) {
|
||||
return LinearProgressIndicator(
|
||||
value: at.progress,
|
||||
semanticsLabel: 'Activity Progress',
|
||||
);
|
||||
})),
|
||||
Expanded(
|
||||
child: ScrollablePositionedList.builder(
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 20),
|
||||
itemCount: at.items.length,
|
||||
// initialScrollIndex: at.currentAction.parentId != null
|
||||
// ? at.currentAction.parentId!
|
||||
// : at.currentAction.id,
|
||||
itemScrollController: itemScrollController,
|
||||
scrollOffsetController: scrollOffsetController,
|
||||
itemPositionsListener: itemPositionsListener,
|
||||
scrollOffsetListener: scrollOffsetListener,
|
||||
itemBuilder: (BuildContext context, int itemNum) {
|
||||
if (itemNum == 0) {
|
||||
actionCount = 0;
|
||||
}
|
||||
|
||||
for (int actionNum = 0; actionNum < set.length; actionNum++) {
|
||||
Map<String, dynamic> setItem = set[actionNum];
|
||||
List<GestureDetector> content = [];
|
||||
Item item = at.items[itemNum];
|
||||
if (item.runtimeType == Rest) {
|
||||
content.add(gtBuild(at, item, actionCount++, itemNum));
|
||||
} else if (item.runtimeType == Set) {
|
||||
List<Item> setItems = item.items;
|
||||
|
||||
content.add(GestureDetector(
|
||||
onTap: () {
|
||||
atm.setAction(setNum, actionNum, 'manual');
|
||||
atm.setActionCount();
|
||||
for (int setItemNum = 0;
|
||||
setItemNum < setItems.length;
|
||||
setItemNum++) {
|
||||
Item setItem = setItems[setItemNum];
|
||||
content.add(gtBuild(at, setItem, actionCount++, itemNum,
|
||||
order: (item as Set).setOrder));
|
||||
}
|
||||
}
|
||||
|
||||
itemScrollController.scrollTo(
|
||||
index: setNum,
|
||||
duration: Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOutCubic);
|
||||
},
|
||||
child: Row(children: [
|
||||
Ink(
|
||||
width: 70,
|
||||
padding: const EdgeInsets.all(15),
|
||||
color: atm.isCurrentItem(setNum, actionNum)
|
||||
? Theme.of(context).colorScheme.primaryContainer
|
||||
: Theme.of(context).colorScheme.onPrimary,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
'${setNum + 1}.${actionNum + 1} ')),
|
||||
Expanded(
|
||||
child: Ink(
|
||||
padding: const EdgeInsets.all(15),
|
||||
color: atm.isCurrentItem(setNum, actionNum)
|
||||
? Theme.of(context).colorScheme.surfaceBright
|
||||
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||
child: Text(
|
||||
textAlign: TextAlign.center,
|
||||
'${setItem['name']}: ${setItem['amount']} ${setItem['type']}'.toTitleCase())))
|
||||
])));
|
||||
}
|
||||
|
||||
if (setNum == 0) {
|
||||
return Card(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(0),
|
||||
topRight: Radius.circular(0),
|
||||
bottomLeft: Radius.circular(10),
|
||||
bottomRight: Radius.circular(10)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(children: content));
|
||||
} else {
|
||||
return Card(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10),
|
||||
bottomLeft: Radius.circular(10),
|
||||
bottomRight: Radius.circular(10)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(children: content));
|
||||
}
|
||||
// return Column(children: contents);
|
||||
},
|
||||
));
|
||||
if (itemNum == 0) {
|
||||
return Card(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(0),
|
||||
topRight: Radius.circular(0),
|
||||
bottomLeft: Radius.circular(10),
|
||||
bottomRight: Radius.circular(10)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(children: content));
|
||||
} else {
|
||||
return Card(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10),
|
||||
bottomLeft: Radius.circular(10),
|
||||
bottomRight: Radius.circular(10)),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(children: content));
|
||||
}
|
||||
}))
|
||||
]));
|
||||
} else {
|
||||
return AddCardGeneric(
|
||||
title: 'Add an Action!',
|
||||
description:
|
||||
'Click here to create an exercise template (sets and reps, etc) for your activity!',
|
||||
action: () {
|
||||
print('teset');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' hide Action;
|
||||
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:sendtrain/daos/actions_dao.dart';
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
import 'package:sendtrain/extensions/string_extensions.dart';
|
||||
import 'package:sendtrain/helpers/widget_helpers.dart';
|
||||
import 'package:sendtrain/models/activity_timer_model.dart';
|
||||
import 'package:sendtrain/widgets/activities/activity_action_editor.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';
|
||||
import 'package:sendtrain/widgets/builders/dialogs.dart';
|
||||
|
||||
class ActivityView extends StatefulWidget {
|
||||
const ActivityView({super.key, required this.activity});
|
||||
@ -22,7 +22,7 @@ class ActivityView extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ActivityViewState extends State<ActivityView> {
|
||||
List<ActivityMuscle> activity_muscle(Activity activity) {
|
||||
List<ActivityMuscle> activityMuscle(Activity activity) {
|
||||
List<ActivityMuscle> muscles = [];
|
||||
|
||||
if (activity.primaryMuscles != null) {
|
||||
@ -36,132 +36,72 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
return muscles;
|
||||
}
|
||||
|
||||
List<Widget> action(actions) {
|
||||
if (actions.isNotEmpty) {
|
||||
return [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
topRight: Radius.circular(10)),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
child: Row(children: [
|
||||
Ink(
|
||||
width: 70,
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return IconButton(
|
||||
alignment: AlignmentDirectional.center,
|
||||
icon: atm.isActive
|
||||
? const Icon(Icons.pause_rounded)
|
||||
: const Icon(Icons.play_arrow_rounded),
|
||||
onPressed: () =>
|
||||
{atm.isActive ? atm.pause() : atm.start()});
|
||||
},
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
'${atm.actionCount} ${atm.currentAction['type']}'
|
||||
.toTitleCase());
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerRight,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 12),
|
||||
textAlign: TextAlign.right,
|
||||
'${atm.currentAction['actionID'] + 1} of ${atm.totalActions()}');
|
||||
})),
|
||||
])),
|
||||
]))),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 14, right: 14),
|
||||
child: Consumer<ActivityTimerModel>(builder: (context, atm, child) {
|
||||
return LinearProgressIndicator(
|
||||
value: atm.progress,
|
||||
semanticsLabel: 'Activity Progress',
|
||||
);
|
||||
})),
|
||||
ActivityActionView(actions: actions)
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
AddCardGeneric(
|
||||
title: 'Add an Action!',
|
||||
description:
|
||||
'Click here to create an exercise template (sets and reps, etc) for your activity!',
|
||||
action: () {
|
||||
print('teset');
|
||||
})
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Activity activity = widget.activity;
|
||||
ActivityTimerModel atm =
|
||||
Provider.of<ActivityTimerModel>(context, listen: false);
|
||||
|
||||
return FutureBuilder<List>(
|
||||
future: ActionsDao(Provider.of<AppDatabase>(context))
|
||||
.fromActivity(activity),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
List actions = snapshot.data!;
|
||||
atm.setup(activity, actions);
|
||||
List<Action> actions = snapshot.data! as List<Action>;
|
||||
|
||||
return Scaffold(
|
||||
floatingActionButtonLocation: ExpandableFab.location,
|
||||
floatingActionButton: ExpandableFab(
|
||||
distance: 70,
|
||||
type: ExpandableFabType.up,
|
||||
overlayStyle: ExpandableFabOverlayStyle(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
blur: 10,
|
||||
),
|
||||
children: [
|
||||
// FloatingActionButton.extended(
|
||||
// icon: const Icon(Icons.upload_outlined),
|
||||
// label: Text('Upload Media'),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.note_add_outlined),
|
||||
label: Text('Add Note'),
|
||||
onPressed: () {},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: Text('Restart'),
|
||||
onPressed: () {},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.done_all_outlined),
|
||||
label: Text('Done'),
|
||||
onPressed: () {},
|
||||
),
|
||||
]),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) async {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
final bool shouldPop = await showBackDialog(context) ?? false;
|
||||
if (context.mounted && shouldPop) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
floatingActionButtonLocation: ExpandableFab.location,
|
||||
floatingActionButton: ExpandableFab(
|
||||
distance: 70,
|
||||
type: ExpandableFabType.up,
|
||||
overlayStyle: ExpandableFabOverlayStyle(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
blur: 10,
|
||||
),
|
||||
children: [
|
||||
// FloatingActionButton.extended(
|
||||
// icon: const Icon(Icons.upload_outlined),
|
||||
// label: Text('Upload Media'),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.done_all_outlined),
|
||||
label: Text('Edit Action'),
|
||||
onPressed: () {
|
||||
showEditorSheet(
|
||||
context,
|
||||
ActivityActionEditor(
|
||||
action: actions.first, callback: () {}));
|
||||
},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.note_add_outlined),
|
||||
label: Text('Add Note'),
|
||||
onPressed: () {},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
label: Text('Restart'),
|
||||
onPressed: () {},
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.done_all_outlined),
|
||||
label: Text('Done'),
|
||||
onPressed: () {},
|
||||
),
|
||||
]),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: true,
|
||||
@ -215,7 +155,7 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
List<ActivityMuscle>>(
|
||||
icon: Icon(Icons.person),
|
||||
text: 'Muscles used',
|
||||
object: activity_muscle(activity))
|
||||
object: activityMuscle(activity))
|
||||
])),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
@ -272,16 +212,35 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
fontWeight: FontWeight.bold),
|
||||
'Media:')),
|
||||
ActivityViewMedia(activity: activity),
|
||||
const Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 30, 0, 10),
|
||||
child: Text(
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
'Actions')),
|
||||
] +
|
||||
action(actions)));
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(15, 20, 5, 0),
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: const Text(
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
'Actions')),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showGenericSheet(
|
||||
context,
|
||||
Column(children: [
|
||||
ActivityActionView(
|
||||
actions: actions,
|
||||
resetOnLoad: false)
|
||||
]),
|
||||
Theme.of(context).colorScheme.surface);
|
||||
},
|
||||
icon: Icon(Icons.expand),
|
||||
alignment: Alignment.bottomCenter,
|
||||
)
|
||||
])),
|
||||
ActivityActionView(actions: actions)
|
||||
])));
|
||||
// ] +
|
||||
// action(actions, context)));
|
||||
} else {
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
|
Reference in New Issue
Block a user