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

inventree / inventree-app / 10299786653

08 Aug 2024 09:44AM UTC coverage: 9.204% (+0.01%) from 9.192%
10299786653

push

github

web-flow
Change from fontawesome to tabler icons (#516)

* Change from fontawesome to tabler icons

- Consistent with the frontend

* Cleanup conflicts

* Use double quotes

* remove unused import

* Update release notes

* Migrate some google icons to tabler icons

* Icon update

* Properly support display of custom icons

* Fix lookup

1 of 254 new or added lines in 43 files covered. (0.39%)

4 existing lines in 4 files now uncovered.

754 of 8192 relevant lines covered (9.2%)

0.31 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
/*
10
 * A widget for displaying the notes associated with a given model.
11
 * We need to pass in the following parameters:
12
 * 
13
 * - Model instance
14
 * - Title for the app bar
15
 */
16
class NotesWidget extends StatefulWidget {
17

18
  const NotesWidget(this.model, {Key? key}) : super(key: key);
×
19

20
  final InvenTreeModel model;
21

22
  @override
×
23
  _NotesState createState() => _NotesState();
×
24
}
25

26

27
/*
28
 * Class representing the state of the NotesWidget
29
 */
30
class _NotesState extends RefreshableState<NotesWidget> {
31

32
  _NotesState();
×
33

34
  @override
×
35
  Future<void> request(BuildContext context) async {
36
    await widget.model.reload();
×
37
  }
38

39
  @override
×
40
  String getAppBarTitle() => L10().editNotes;
×
41

42
  @override
×
43
  List<Widget> appBarActions(BuildContext context) {
44

45
    List<Widget> actions = [];
×
46

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

70
    return actions;
71
  }
72

73
  @override
×
74
  Widget getBody(BuildContext context) {
75
    return Markdown(
×
76
      selectable: false,
77
      data: widget.model.notes,
×
78
    );
79
  }
80

81
}
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