tex_markdown 0.0.3 copy "tex_markdown: ^0.0.3" to clipboard
tex_markdown: ^0.0.3 copied to clipboard

discontinuedreplaced by: gpt_markdown
outdated

This package is used to create flutter widget that can render markdown and latex formulas. It is very simple to use and uses native flutter components.

example/example.md

example #

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        useMaterial3: true,
        colorSchemeSeed: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _controller = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: [
          Expanded(
            child: ListView(
              children: [
                AnimatedBuilder(
                    animation: _controller,
                    builder: (context, _) {
                      return TexMarkdown(
                        _controller.text,
                        style: const TextStyle(
                          color: Colors.red,
                        ),
                      );
                    }),
              ],
            ),
          ),
          ConstrainedBox(
            constraints: const BoxConstraints(maxHeight: 300),
            child: TextField(
              decoration: const InputDecoration(border: OutlineInputBorder()),
              maxLines: null,
              controller: _controller,
            ),
          ),
        ],
      ),
    );
  }
}

18
likes
0
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

This package is used to create flutter widget that can render markdown and latex formulas. It is very simple to use and uses native flutter components.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, tex_text

More

Packages that depend on tex_markdown