widget_with_codeview 2.0.0-nullsafe copy "widget_with_codeview: ^2.0.0-nullsafe" to clipboard
widget_with_codeview: ^2.0.0-nullsafe copied to clipboard

outdated

A widget with side-by-side source code view.

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:

dependencies:
  flutter:
    sdk: flutter
  widget_with_codeview: '1.0.3'
flutter:
  assets:
    # 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:

WidgetWithCodeView(
  child: MyAwesomeWidget(),
  sourceFilePath: 'lib/my_awesome_source_code.dart',
  /// [codeLinkPrefix] 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:

SourceCodeView(
  sourceFilePath: 'lib/my_awesome_source_code.dart',
  codeLinkPrefix: 'https://github.com/<my_username>/<my_project>/blob/master/',
),
67
likes
0
points
343
downloads

Publisher

unverified uploader

Weekly Downloads

A widget with side-by-side source code view.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_speed_dial, google_fonts, string_scanner, url_launcher

More

Packages that depend on widget_with_codeview