mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Automatic linting
This commit is contained in:
@@ -84,7 +84,8 @@ class _GymModeState extends State<GymMode> {
|
||||
for (final set in widget._workoutDay.sets) {
|
||||
var firstPage = true;
|
||||
for (final setting in set.settingsComputed) {
|
||||
final exercise = Provider.of<ExercisesProvider>(context, listen: false).findById(setting.exerciseId);
|
||||
final exercise =
|
||||
Provider.of<ExercisesProvider>(context, listen: false).findById(setting.exerciseId);
|
||||
|
||||
if (firstPage) {
|
||||
_exercisePages[exercise.name] = currentPage;
|
||||
@@ -153,7 +154,8 @@ class _GymModeState extends State<GymMode> {
|
||||
),
|
||||
...getContent(),
|
||||
SessionPage(
|
||||
Provider.of<WorkoutPlansProvider>(context, listen: false).findById(widget._workoutDay.workoutId),
|
||||
Provider.of<WorkoutPlansProvider>(context, listen: false)
|
||||
.findById(widget._workoutDay.workoutId),
|
||||
_controller,
|
||||
widget._start,
|
||||
_exercisePages,
|
||||
@@ -482,7 +484,8 @@ class _LogPageState extends State<LogPage> {
|
||||
|
||||
// Save the entry on the server
|
||||
try {
|
||||
await Provider.of<WorkoutPlansProvider>(context, listen: false).addLog(widget._log);
|
||||
await Provider.of<WorkoutPlansProvider>(context, listen: false)
|
||||
.addLog(widget._log);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
duration: Duration(seconds: 2), // default is 4
|
||||
@@ -522,7 +525,8 @@ class _LogPageState extends State<LogPage> {
|
||||
...widget._workoutPlan.filterLogsByExercise(widget._exercise, unique: true).map((log) {
|
||||
return ListTile(
|
||||
title: Text(log.singleLogRepTextNoNl),
|
||||
subtitle: Text(DateFormat.yMd(Localizations.localeOf(context).languageCode).format(log.date)),
|
||||
subtitle:
|
||||
Text(DateFormat.yMd(Localizations.localeOf(context).languageCode).format(log.date)),
|
||||
trailing: Icon(Icons.copy),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
@@ -630,10 +634,12 @@ class _LogPageState extends State<LogPage> {
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
Expanded(
|
||||
child:
|
||||
(widget._workoutPlan.filterLogsByExercise(widget._exercise).isNotEmpty) ? getPastLogs() : Container()),
|
||||
child: (widget._workoutPlan.filterLogsByExercise(widget._exercise).isNotEmpty)
|
||||
? getPastLogs()
|
||||
: Container()),
|
||||
// Only show calculator for barbell
|
||||
if (widget._log.exerciseObj.equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL)) getPlates(),
|
||||
if (widget._log.exerciseObj.equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL))
|
||||
getPlates(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
@@ -780,7 +786,9 @@ class _SessionPageState extends State<SessionPage> {
|
||||
renderBorder: false,
|
||||
onPressed: (int index) {
|
||||
setState(() {
|
||||
for (int buttonIndex = 0; buttonIndex < selectedImpression.length; buttonIndex++) {
|
||||
for (int buttonIndex = 0;
|
||||
buttonIndex < selectedImpression.length;
|
||||
buttonIndex++) {
|
||||
_session.impression = index + 1;
|
||||
|
||||
if (buttonIndex == index) {
|
||||
@@ -844,7 +852,8 @@ class _SessionPageState extends State<SessionPage> {
|
||||
SizedBox(width: 10),
|
||||
Flexible(
|
||||
child: TextFormField(
|
||||
decoration: InputDecoration(labelText: AppLocalizations.of(context).timeEnd),
|
||||
decoration:
|
||||
InputDecoration(labelText: AppLocalizations.of(context).timeEnd),
|
||||
controller: timeEndController,
|
||||
onFieldSubmitted: (_) {},
|
||||
onTap: () async {
|
||||
@@ -878,7 +887,8 @@ class _SessionPageState extends State<SessionPage> {
|
||||
|
||||
// Save the entry on the server
|
||||
try {
|
||||
await Provider.of<WorkoutPlansProvider>(context, listen: false).addSession(_session);
|
||||
await Provider.of<WorkoutPlansProvider>(context, listen: false)
|
||||
.addSession(_session);
|
||||
Navigator.of(context).pop();
|
||||
} on WgerHttpException catch (error) {
|
||||
showHttpExceptionErrorDialog(error, context);
|
||||
@@ -985,7 +995,8 @@ class NavigationFooter extends StatelessWidget {
|
||||
final bool showPrevious;
|
||||
final bool showNext;
|
||||
|
||||
const NavigationFooter(this._controller, this._ratioCompleted, {this.showPrevious = true, this.showNext = true});
|
||||
const NavigationFooter(this._controller, this._ratioCompleted,
|
||||
{this.showPrevious = true, this.showNext = true});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user