system_tasks_dart 0.2.0

Get a list of system processes, and you can kill, start, restart a process

Inspired by system-task

Install #

dependencies:
  system_tasks_dart:

Usage #

A simple usage example:

import 'package:system_tasks_dart/system_tasks_dart.dart';

void main() {
  SystemTasks.tasks().then((ps) {
    var p = ps.firstWhere((p) => p.pname.toLowerCase() == 'code.exe');
    if (p != null) {
      p.reStartLinks();
    }
  });
}

test #

pub run test ./test/system_tasks_dart_test.dart

0.2.0 2020/2/13 #

  • 修复拼写错误
    • reStartLinks->reStartLikes

0.1.0 2020/2/12 #

  • Get a list of system processes, and you can kill, start, restart a process

example/system_tasks_dart_example.dart

import 'package:system_tasks_dart/system_tasks_dart.dart';

void main() {
  SystemTasks.tasks().then((ps) {
    var p = ps.firstWhere((p) => p.pname.toLowerCase() == 'code.exe');
    if (p != null) {
      p.reStartLikes();
    }
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  system_tasks_dart: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:system_tasks_dart/system_tasks_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
95
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

We analyzed this package on Feb 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 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/src/system_tasks_dart_base.dart. (-3.93 points)

Analysis of lib/src/system_tasks_dart_base.dart reported 8 hints, including:

line 36 col 7: Use rethrow to rethrow a caught exception.

line 50 col 3: Prefer using /// for doc comments.

line 59 col 3: Prefer using /// for doc comments.

line 68 col 3: Prefer using /// for doc comments.

line 75 col 3: Prefer using /// for doc comments.

Format lib/system_tasks_dart.dart.

Run dartfmt to format lib/system_tasks_dart.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
process_run ^0.10.7 0.10.7
Transitive dependencies
args 1.5.2
charcode 1.1.3
collection 1.14.12
io 0.3.3
meta 1.1.8
path 1.6.4
pub_semver 1.4.3
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
yaml 2.2.0
Dev dependencies
test ^1.6.0