freewig 0.0.2-dev

  • Readme
  • Changelog
  • Example
  • Installing
  • new54

The library freewig will help to use Wherigo caches in Dart or Flutter

Usage #

A simple usage example:

import 'dart:io';

import 'package:freewig/freewig.dart';

void main(List<String> arguments) async {
  var file = File(arguments[0]);
  var cartridge = await parseFile(file);

  var export = Directory("export");
  var exists = await export.exists();
  if (exists) {
    await export.delete(recursive: true);
  }
  await export.create(recursive: true);

  var contents = "";
  contents += "Name: ${cartridge.cartridgeName}\n";
  contents += "Description: ${cartridge.cartridgeDesc}\n";
  contents += "StartLocation: ${cartridge.startLocationDesc}\n";
  contents += "Longitude: ${cartridge.longitude}\n";
  contents += "Latitude: ${cartridge.latitude}\n";
  contents += "Player: ${cartridge.playerName}\n";
  contents += "Author: ${cartridge.author}\n";
  contents += "Type: ${cartridge.typeOfCartridge}\n";
  contents += "Device: ${cartridge.recommendDevice}\n";
  contents += "Version: ${cartridge.version}\n";
  contents += "Catridge-Id: ${cartridge.cartridgeGuid}\n";
  contents += "\n";
  contents += "Completion-Code: ${cartridge.completionCode}\n";
  contents += "\n";
  contents += "ItemCount: ${cartridge.objects.length}\n";
  contents += "\n";
  var infoFile = File("${export.path}/cartridge_info.txt");
  await infoFile.writeAsString(contents);

  cartridge.objects.forEach((index, data) async {
    var objectFile = File("${export.path}/object_$index.${data.objectType}");
    await objectFile.writeAsBytes(data.data);
  });
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.2-dev #

  • code cleanup
  • remove unused dependencies

0.0.1-dev #

It's a partial port of https://github.com/mars3142/wherugo, so everyone can decode Wherigo Cartridges.

example/main.dart

import 'dart:io';

import 'package:freewig/freewig.dart';

void main(List<String> arguments) async {
  var file = File(arguments[0]); // path/incl/cartridge.gwc
  var cartridge = await parseFile(file);

  var export = Directory("export");
  var exists = await export.exists();
  if (exists) {
    await export.delete(recursive: true);
  }
  await export.create(recursive: true);

  var contents = "";
  contents += "Name: ${cartridge.cartridgeName}\n";
  contents += "Description: ${cartridge.cartridgeDesc}\n";
  contents += "StartLocation: ${cartridge.startLocationDesc}\n";
  contents += "Longitude: ${cartridge.longitude}\n";
  contents += "Latitude: ${cartridge.latitude}\n";
  contents += "Player: ${cartridge.playerName}\n";
  contents += "Author: ${cartridge.author}\n";
  contents += "Type: ${cartridge.typeOfCartridge}\n";
  contents += "Device: ${cartridge.recommendDevice}\n";
  contents += "Version: ${cartridge.version}\n";
  contents += "Catridge-Id: ${cartridge.cartridgeGuid}\n";
  contents += "\n";
  contents += "Completion-Code: ${cartridge.completionCode}\n";
  contents += "\n";
  contents += "ItemCount: ${cartridge.mediaObjects.length}\n";
  contents += "\n";
  var infoFile = File("${export.path}/cartridge_info.txt");
  await infoFile.writeAsString(contents);

  cartridge.mediaObjects.forEach((index, data) async {
    var objectFile = File("${export.path}/object_$index.${data.objectType}");
    await objectFile.writeAsBytes(data.data);
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  freewig: ^0.0.2-dev

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:freewig/freewig.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
14
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
54
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance suggestions

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.

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
meta ^1.1.8 1.1.8
path ^1.6.0 1.6.4
Dev dependencies
effective_dart ^1.0.0
mockito ^4.0.0
test ^1.6.0