progress indicator
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:sendtrain/classes/activity_action.dart';
|
||||
import 'package:sendtrain/classes/media.dart';
|
||||
@ -53,7 +52,7 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
child: Text(
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
'Actions:')),
|
||||
'Actions')),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: Card(
|
||||
@ -65,54 +64,55 @@ class _ActivityViewState extends State<ActivityView> {
|
||||
),
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
child: Row(children: [
|
||||
// LinearProgressIndicator(
|
||||
// value: 0.5,
|
||||
// minHeight: 100,
|
||||
// color: Theme.of(context).colorScheme.error,
|
||||
// semanticsLabel: 'Linear progress indicator',
|
||||
// ),
|
||||
Ink(
|
||||
width: 70,
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
Ink(
|
||||
width: 70,
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return IconButton(
|
||||
alignment: AlignmentDirectional.center,
|
||||
iconSize: 30,
|
||||
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 IconButton(
|
||||
alignment: AlignmentDirectional.center,
|
||||
iconSize: 30,
|
||||
icon: atm.isActive
|
||||
? const Icon(Icons.pause_rounded)
|
||||
: const Icon(Icons.play_arrow_rounded),
|
||||
onPressed: () =>
|
||||
{atm.isActive ? atm.pause : atm.start()});
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
'${atm.actionCount} ${atm.currentAction['type']}');
|
||||
},
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerRight,
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 20),
|
||||
textAlign: TextAlign.center,
|
||||
'${atm.actionCount} ${atm.currentAction['type']}');
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerRight,
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 15),
|
||||
textAlign: TextAlign.right,
|
||||
'${atm.currentAction['actionID'] + 1} | ${atm.totalActions()}');
|
||||
// 'Set: ${atm.currentSet + 1}/${atm.totalSets}\nRep: ${atm.currentRep + 1}/${atm.totalReps}');
|
||||
})),
|
||||
])),
|
||||
]))),
|
||||
return Text(
|
||||
style: const TextStyle(fontSize: 15),
|
||||
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(action: activity.actions[0]),
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user