org_flutter

Last updated:

0 purchases

org_flutter Image
org_flutter Images
Add to Cart

Description:

org flutter

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''');
}
}
copied to clipboard
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]])')
copied to clipboard
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),
),
);
}
copied to clipboard
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,
);
copied to clipboard
Text selection #
The Org Mode text is not selectable by default, but you can make it so by
wrapping the widget in
SelectionArea.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.