lotrofans / latex-flutter

Show a LaTeX-Widget in Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latex

Simply perfom following steps

Import it

import 'package:latex/latex.dart';

Load the Widget async

  Widget latexWidget;

  void loadWidget() async{
    if(latexWidget == null){
      latexWidget = await Latex.getLaTeXWidget("x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}");
      setState(() {
        
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    loadWidget();
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: latexWidget == null? CupertinoActivityIndicator() : latexWidget

        ),
      ),
    );
  }

important hint

This plugin uses the following libraries. Special thanks to the developers:

iOS: https://github.com/kostub/iosMath Android: https://github.com/noties/jlatexmath-android

About

Show a LaTeX-Widget in Flutter

License:Other


Languages

Language:Java 35.7%Language:Dart 25.2%Language:Ruby 22.3%Language:Swift 14.2%Language:Objective-C 2.6%