inventiv_critic_flutter 0.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 67

critic_flutter #

This plugin allows Flutter apps to interact with the Inventiv Critic system for bug tracking and reporting. You will need to have a Critic account to properly utilize this. Please visit the Critic website for more information.

How to use #

Step 1: Initialize the Critic library using your api key:

String key = 'your api key';
Critic().initialize(key);

Step 2: Create a new Bug Report using the .create const:

BugReport report = BugReport.create(
    description: 'description text',
    stepsToReproduce: 'steps to reproduce text',
);

Step 3: Attach a file, if necessary

File file = File('path to file');
report.attachments = <Attachment>[];
report.attachments.add(Attachment(name: 'test file', path: file.path));

Step 4: Use the Critic() singleton to submit your BugReport (example using Futures):

Critic().submitReport(report).then(
    (BugReport successfulReport) {
      //success!
    }).catchError((Object error) {
      //failure
    });

Step 5: Review bugs submitted for your organization using Critic's web portal

0.0.5 #

Multiple attachments can be uploaded properly. Add battery and network connection to device status.

0.0.4 #

Added attachment support.

0.0.2 #

Cleaned up readme files for better published documents.

0.0.1 #

Initial version of the Critic integration. Supports bug reporting with custom description and steps to reproduce. All device platform information is gathered as well.

example/README.md

example/main.dart #

import 'package:flutter/material.dart';

import 'package:inventiv_critic_flutter/critic.dart';
import 'package:inventiv_critic_flutter/modal/bug_report.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  TextEditingController _descriptionController = new TextEditingController(),
      _reproduceController = new TextEditingController();

  @override
  void initState() {
    super.initState();
    Critic().initialize('gJ44GxttrahyVBFs4k3jb8T1');
  }

  void _submitReport(BuildContext context) {
    BugReport report = BugReport.create(
        description: _descriptionController.text,
        stepsToReproduce: _reproduceController.text);
    Critic().submitReport(report).then((BugReport successfulReport) {
      Scaffold.of(context).showSnackBar(new SnackBar(
        content: new Text('Bug Report has been filed, check console'),
      ));
      print(
          'Successfully logged!\ndescription: ${successfulReport.description}\nsteps to reproduce: ${successfulReport.stepsToReproduce}');
    }).catchError((Object error) {
      print(error.toString());
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Padding(
          padding: const EdgeInsets.all(25.0),
          child: Builder(
            builder: (context) => Column(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: <Widget>[
                    Text('Enter a description'),
                    TextField(
                      controller: _descriptionController,
                    ),
                    Text('Enter steps to reproduce'),
                    TextField(
                      controller: _reproduceController,
                    ),
                    MaterialButton(
                      color: Colors.grey,
                      onPressed: () {
                        _submitReport(context);
                      },
                      child: Text('Test Submit'),
                    ),
                  ],
                ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  inventiv_critic_flutter: ^0.0.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:inventiv_critic_flutter/api.dart';
import 'package:inventiv_critic_flutter/critic.dart';
import 'package:inventiv_critic_flutter/modal/app.dart';
import 'package:inventiv_critic_flutter/modal/bug_report.dart';
import 'package:inventiv_critic_flutter/modal/device.dart';
import 'package:inventiv_critic_flutter/modal/ping_request_modal.dart';
import 'package:inventiv_critic_flutter/modal/ping_response.dart';
import 'package:inventiv_critic_flutter/modal/report_request_modal.dart';
  
Version Uploaded Documentation Archive
0.0.5 Apr 5, 2019 Go to the documentation of inventiv_critic_flutter 0.0.5 Download inventiv_critic_flutter 0.0.5 archive
0.0.4 Mar 5, 2019 Go to the documentation of inventiv_critic_flutter 0.0.4 Download inventiv_critic_flutter 0.0.4 archive
0.0.3 Mar 5, 2019 Go to the documentation of inventiv_critic_flutter 0.0.3 Download inventiv_critic_flutter 0.0.3 archive
0.0.2 Dec 11, 2018 Go to the documentation of inventiv_critic_flutter 0.0.2 Download inventiv_critic_flutter 0.0.2 archive
0.0.1 Dec 11, 2018 Go to the documentation of inventiv_critic_flutter 0.0.1 Download inventiv_critic_flutter 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
51
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
65
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Apr 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

103 out of 103 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/api.dart. (-1.99 points)

Analysis of lib/api.dart reported 4 hints:

line 5 col 8: Unused import: 'package:device_info/device_info.dart'.

line 17 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 28 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 50 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Format lib/critic.dart.

Run flutter format to format lib/critic.dart.

Format lib/modal/app.dart.

Run flutter format to format lib/modal/app.dart.

Fix additional 5 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/modal/bug_report.dart (Run flutter format to format lib/modal/bug_report.dart.)
  • lib/modal/device.dart (Run flutter format to format lib/modal/device.dart.)
  • lib/modal/ping_request_modal.dart (Run flutter format to format lib/modal/ping_request_modal.dart.)
  • lib/modal/ping_response.dart (Run flutter format to format lib/modal/ping_response.dart.)
  • lib/modal/report_request_modal.dart (Run flutter format to format lib/modal/report_request_modal.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
battery ^0.2.3 0.2.3 0.3.0+3
connectivity ^0.3.2 0.3.2 0.4.3+1
device_info ^0.3.0 0.3.0 0.4.0+1
dio ^2.0.18 2.1.2
flutter 0.0.0
http ^0.12.0 0.12.0+2
mime ^0.9.6+2 0.9.6+2
package_info ^0.3.2 0.3.2+1 0.4.0+3
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
cookie_jar 1.0.0
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.2
pedantic 1.5.0
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8