widget_with_codeview 1.0.3

  • Readme
  • Changelog
  • Installing
  • 88

widget_with_codeview #

pub package GitHub

A widget with side-by-side source code view. Extracted from the flutter-catalog open-source app.

Usage #

First make sure to add the source file to the app's assets by editing pubspec.yaml:

    sdk: flutter
  widget_with_codeview: '1.0.3'
    # Include a single source code file:
    - lib/my_awesome_source_code.dart
    # Include all files under a subfoler by adding trailing "/":
    - lib/my_awesome_source_code_subdir/
    - ...

Then wrap the widget from that source file by a WidgetWithCodeView:

  child: MyAwesomeWidget(),
  sourceFilePath: 'lib/my_awesome_source_code.dart',
  // 1codeLinkPrefix` is optional. When it's specified, two more buttons
  // (open-code-in-browser, copy-code-link) will be added in the code view.
  codeLinkPrefix: 'https://github.com/<my_username>/<my_project>/blob/master/',

You can also choose to only show the code:

  sourceFilePath: 'lib/my_awesome_source_code.dart',
  codeLinkPrefix: 'https://github.com/<my_username>/<my_project>/blob/master/',

Changelogs #

[1.0.3] - 2019-11-02 #

Fix zoom button behavior.

[1.0.2] - 2019-10-19 #

Use SelectableText.rich() to make code selectable.

[1.0.1] - 2019-07-27 #

Fix multiple heroes tag issue.

[1.0.0] - 2019-07-22 #

Initial version: a small tweak from the MyRoute class in https://github.com/X-Wei/flutter_catalog.

Use this package as a library

1. Depend on it

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

  widget_with_codeview: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support 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:widget_with_codeview/widget_with_codeview.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Maintenance suggestions

The package description is too short. (-16 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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and widget_with_codeview.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
animated_floatactionbuttons ^0.1.0 0.1.0
flutter 0.0.0
string_scanner ^1.0.4 1.0.5
url_launcher ^5.0.3 5.4.2
Transitive dependencies
charcode 1.1.3
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
path 1.6.4
plugin_platform_interface 1.0.2
sky_engine 0.0.99
source_span 1.6.0
term_glyph 1.1.0
typed_data 1.1.6
url_launcher_macos 0.0.1+4
url_launcher_platform_interface 1.0.6
url_launcher_web 0.1.1+1
vector_math 2.0.8
Dev dependencies