• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wger-project / flutter / 30854254088

03 Aug 2026 09:21PM UTC coverage: 40.895% (-15.0%) from 55.93%
30854254088

Pull #1260

github

web-flow
Merge d93794de5 into e3affdd4f
Pull Request #1260: WIP: health sync

9980 of 24404 relevant lines covered (40.89%)

1.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.29
/lib/core/form_screen.dart
1
/*
2
 * This file is part of wger Workout Manager <https://github.com/wger-project>.
3
 * Copyright (C) 2020, 2021 wger Team
4
 *
5
 * wger Workout Manager is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Affero General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU Affero General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Affero General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18

19
import 'package:flutter/material.dart';
20
import 'package:flutter/rendering.dart';
21
import 'package:wger/core/wide_screen_wrapper.dart';
22

23
/// Arguments passed to the form screen
24
class FormScreenArguments {
25
  /// Title
26
  final String title;
27

28
  /// Widget to render, typically a form
29
  final Widget widget;
30

31
  /// Flag indicating whether to render the content has a list view (e.g. larger
32
  /// forms that use an autocompleter, etc) or not (smnall forms, content will
33
  /// get pushed down)
34
  final bool hasListView;
35

36
  /// Padding for the whole content, default 15px on all sides
37
  final EdgeInsets padding;
38

39
  const FormScreenArguments(
1✔
40
    this.title,
41
    this.widget, {
42
    this.hasListView = false,
43
    this.padding = const EdgeInsets.all(15),
44
  });
45
}
46

47
class FormScreen extends StatelessWidget {
48
  const FormScreen();
×
49
  static const routeName = '/form';
50

51
  @override
1✔
52
  Widget build(BuildContext context) {
53
    final FormScreenArguments args =
54
        ModalRoute.of(context)!.settings.arguments as FormScreenArguments;
3✔
55

56
    return Scaffold(
1✔
57
      appBar: AppBar(title: Text(args.title)),
3✔
58
      body: WidescreenWrapper(
1✔
59
        child: args.hasListView
1✔
60
            ? Scrollable(
×
61
                viewportBuilder: (BuildContext context, ViewportOffset position) => Padding(
×
62
                  padding: args.padding,
×
63
                  child: args.widget,
×
64
                ),
65
              )
66
            : Column(
1✔
67
                mainAxisSize: MainAxisSize.max,
68
                mainAxisAlignment: MainAxisAlignment.end,
69
                children: [Padding(padding: args.padding, child: args.widget)],
4✔
70
              ),
71
      ),
72
    );
73
  }
74
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc