org_flutter 0.3.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new59

org_flutter #

Org-mode widgets for Flutter.

Usage #

For parsing Org-mode documents, see org_parser. For an example application that displays Org-mode documents with org_parser and org_flutter, see orgro.

The simplest way to display an Org-mode document in your Flutter application is to use the Org widget:

import 'package:org_flutter/org_flutter.dart';

class MyOrgViewWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return Org('''* TODO [#A] foo bar
baz buzz''');
  }
}

See the example for more.

Advanced #

For more advanced usage, such as specifying link handling, use OrgController in concert with OrgRootWidget:

import 'package:org_flutter/org_flutter.dart';

Widget build(BuildContext context) {
  final doc = OrgDocument.parse(rawOrgModeDocString);
  return OrgController(
    root: doc,
    child: OrgRootWidget(
      style: myTextStyle,
      onLinkTap: launch, // e.g. from url_launcher package
      child: OrgDocumentWidget(doc),
    ),
  );
}

Place OrgController higher up in your widget hierarchy and access via OrgController.of(context) to dynamically control various properties of the displayed document:

IconButton(
  icon: const Icon(Icons.repeat),
  onPressed: OrgController.of(context).cycleVisibility,
);

[0.3.1] - 2020-05-23 #

  • Add hideMarkup argument to OrgController constructor

[0.3.0+1] - 2020-05-21 #

  • Add example

[0.3.0] - 2020-05-15 #

  • Pad root view to safe area
  • Inherit visibility state when narrowing
  • Various refactoring

[0.2.1] - 2020-05-09 #

  • Fix color of inline footnote body

[0.2.0] - 2020-05-08 #

  • Fix table width
  • Fix block, drawer trailing space when collapsed
  • Only break link text by character when the text is (probably) a URL
  • Use a ListView as document/section root
  • Set document padding in theme: see OrgThemeData.rootPadding

[0.1.1] - 2020-05-06 #

  • Right-align table columns that are primarily numeric

[0.1.0] - 2020-05-05 #

  • Initial release

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:org_flutter/org_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'org_flutter',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('org_flutter'),
      ),
      body: const Org('''* TODO [#A] foo bar
baz buzz'''),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  org_flutter: ^0.3.1

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

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

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
org_parser ^0.1.0 0.1.1+1
Transitive dependencies
collection 1.14.12
meta 1.1.8
petitparser 2.4.0 3.0.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
pedantic ^1.9.0