GitXplorerGitXplorer
a

org_flutter

public
18 stars
4 forks
1 issues

Commits

List of commits on branch master.
Unverified
dc13409348f0ec649dd9e9f5e9ff3b78f83437d6

v8.7.1

aamake committed 16 hours ago
Unverified
6e0a08bbc412ab762f81c08f3c991eeaa4b8f026

Render OrgCitation as TextSpan, not Widget

aamake committed 18 hours ago
Unverified
5abf7f73f0b1bc13691492f752da66449c36dc86

v8.7.0

aamake committed 20 hours ago
Unverified
87bc76bfee70713f5e79bb6be824a986b8b681c2

Bump CI checkout action

aamake committed 20 hours ago
Unverified
9d3f5caf68ade4fecc8ba4340f85a429c7db4099

Ensure all span args are passed along

aamake committed 20 hours ago
Unverified
292c92e60a2eb87b3c6dd090c29195521b689a84

Add Makefile, manual screenshot facility

aamake committed 20 hours ago

README

The README file for this repository.

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.

Rich text

Use Org markup to create rich Text-equivalent widgets with OrgText.

OrgText('*This* is a /rich/ text label ([[https://example.com][details]])')

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,
    // Interpret e.g. #+TODO: settings at the cost of a second parsing pass
    interpretEmbeddedSettings: true,
  );
  return OrgController(
    root: doc,
    child: OrgLocator( // Include OrgLocator to enable tap-to-jump on footnotes, etc.
      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,
);

Text selection

The Org Mode text is not selectable by default, but you can make it so by wrapping the widget in SelectionArea.