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

inventree / inventree-app / 15837688195

23 Jun 2025 11:55PM UTC coverage: 1.586% (+0.02%) from 1.566%
15837688195

push

github

web-flow
Format Code and Add Format Checks to CI (#643)

* Remove unused lib/generated/i18n.dart

* Use `fvm dart format .`

* Add contributing guidelines

* Enforce dart format

* Add `dart format off` directive to generated files

133 of 2648 new or added lines in 82 files covered. (5.02%)

430 existing lines in 78 files now uncovered.

771 of 48628 relevant lines covered (1.59%)

0.05 hits per line

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

0.0
/lib/widget/notes_widget.dart
1
import "package:flutter/material.dart";
2
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
3
import "package:inventree/inventree/model.dart";
4
import "package:inventree/widget/refreshable_state.dart";
5
import "package:flutter_markdown/flutter_markdown.dart";
6
import "package:inventree/l10.dart";
7

8
/*
9
 * A widget for displaying the notes associated with a given model.
10
 * We need to pass in the following parameters:
11
 * 
12
 * - Model instance
13
 * - Title for the app bar
14
 */
15
class NotesWidget extends StatefulWidget {
UNCOV
16
  const NotesWidget(this.model, {Key? key}) : super(key: key);
×
17

18
  final InvenTreeModel model;
19

20
  @override
×
21
  _NotesState createState() => _NotesState();
×
22
}
23

24
/*
25
 * Class representing the state of the NotesWidget
26
 */
27
class _NotesState extends RefreshableState<NotesWidget> {
UNCOV
28
  _NotesState();
×
29

30
  @override
×
31
  Future<void> request(BuildContext context) async {
32
    await widget.model.reload();
×
33
  }
34

35
  @override
×
36
  String getAppBarTitle() => L10().editNotes;
×
37

38
  @override
×
39
  List<Widget> appBarActions(BuildContext context) {
UNCOV
40
    List<Widget> actions = [];
×
41

42
    if (widget.model.canEdit) {
×
43
      actions.add(
×
44
        IconButton(
×
45
          icon: Icon(TablerIcons.edit),
×
46
          tooltip: L10().edit,
×
47
          onPressed: () {
×
48
            widget.model.editForm(
×
49
              context,
50
              L10().editNotes,
×
51
              fields: {
×
NEW
52
                "notes": {"multiline": true},
×
53
              },
54
              onSuccess: (data) async {
×
55
                refresh(context);
×
56
              },
57
            );
58
          },
59
        ),
60
      );
61
    }
62

63
    return actions;
64
  }
65

66
  @override
×
67
  Widget getBody(BuildContext context) {
NEW
68
    return Markdown(selectable: false, data: widget.model.notes);
×
69
  }
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc