jaguar_flutter_asset 1.1.5

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 68

jaguar_flutter_asset

Serve files from Flutter assets.

Example showing how to use it in a project.

Usage

Use FlutterAssetServer request handler to serve files from flutter assets.

  final server = new Jaguar();
  server.addApi(new FlutterAssetServer());
  await server.serve();

Complete example

import 'package:flutter/material.dart';
import 'package:jaguar/jaguar.dart';
import 'package:jaguar_flutter_asset/jaguar_flutter_asset.dart';

import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

final flutterWebviewPlugin = new FlutterWebviewPlugin();

main() async {
  final server = new Jaguar();
  server.addApi(new FlutterAssetServer());
  await server.serve();

  server.log.onRecord.listen((r) => print(r));

  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Jaguar Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Jaguar Demo'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(
              'Press the button to launch webview!',
            ),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: () {
          flutterWebviewPlugin.launch('http://localhost:8080/',
              fullScreen: true);
        },
        tooltip: 'Launch',
        child: new Icon(Icons.web),
      ),
    );
  }
}

Changelog

0.7.1

  • Strip prefix

1. Depend on it

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


dependencies:
  jaguar_flutter_asset: "^1.1.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:jaguar_flutter_asset/jaguar_flutter_asset.dart';
        
Version Uploaded Documentation Archive
1.1.5 Jan 12, 2018 Go to the documentation of jaguar_flutter_asset 1.1.5 Download jaguar_flutter_asset 1.1.5 archive
0.7.1 Jan 11, 2018 Go to the documentation of jaguar_flutter_asset 0.7.1 Download jaguar_flutter_asset 0.7.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1
  • Flutter: 0.0.22

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
46 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
76 / 100
Overall score:
Weighted score of the above. [more]
68

Platforms

Detected platforms: unsure

Error(s) prevent platform classification.

Suggestions

  • Fix dependencies in pubspec.yaml.

    Running flutter packages pub upgrade failed with the following output:

    ERR: Invalid argument(s): Minimum version ("2.0.0-dev.20.0") must be less than maximum ("2.0.0-dev.16.0").
    ERR: package:pub_semver/src/version_range.dart 59         new VersionRange
     package:pub/src/pubspec.dart 366                     Pubspec._ensureEnvironment
     package:pub/src/pubspec.dart 331                     Pubspec.dartSdkConstraint
     package:pub/src/solver/backtracking_solver.dart 511  BacktrackingSolver._checkPubspecMatchesSdkConstraint
     package:pub/src/solver/backtracking_solver.dart 474  BacktrackingSolver._checkVersion
     ===== asynchronous gap ===========================
     package:pub/src/solver/backtracking_solver.dart 432  BacktrackingSolver._findValidVersion.<fn>
     ===== asynchronous gap ===========================
     dart:async                                           Future.doWhile
     package:pub/src/solver/backtracking_solver.dart 430  BacktrackingSolver._findValidVersion
     package:pub/src/solver/backtracking_solver.dart 337  BacktrackingSolver._versionQueueFor
     ===== asynchronous gap ===========================
     package:pub/src/solver/backtracking_solver.dart 290  BacktrackingSolver._solve.<fn>
     ===== asynchronous gap ===========================
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/backtracking_solver.dart 315  BacktrackingSolver._solve.<fn>
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/version_selection.dart 64     VersionSelection.select
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/version_selection.dart 91     VersionSelection._addDependencies
    ERR: This is an unexpected error. Please run
     
         pub --trace upgrade --verbosity io --no-precompile
     
     and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
    
  • Fix platform conflicts.

    Make sure none of the libraries use mutually exclusive dependendencies.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use jaguar_flutter_asset.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0