fat_markdown 0.9.1 copy "fat_markdown: ^0.9.1" to clipboard
fat_markdown: ^0.9.1 copied to clipboard

A powerful Flutter Markdown widget with LaTeX math and syntax highlighting.

example/lib/main.dart

import 'package:fat_markdown/fat_markdown.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'home_page.dart';

late SharedPreferences prefs;

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  prefs = await SharedPreferences.getInstance();
  runApp(const ExampleApp());
}

class ExampleApp extends StatefulWidget {
  const ExampleApp({super.key});

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  ThemeMode _themeMode = ThemeMode.dark;

  void _toggleTheme() {
    setState(() {
      _themeMode = _themeMode == ThemeMode.dark
          ? ThemeMode.light
          : ThemeMode.dark;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fat Markdown Example',
      debugShowCheckedModeBanner: false,
      themeMode: _themeMode,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
        useMaterial3: true,
        extensions: [
          FatMarkdownTheme(tableStretch: true),
        ],
      ),
      darkTheme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.blue,
          brightness: Brightness.dark,
        ),
        useMaterial3: true,
        extensions: const [
          FatMarkdownTheme(tableStretch: false),
        ],
      ),
      home: HomePage(
        isDark: _themeMode == ThemeMode.dark,
        onThemeToggle: _toggleTheme,
      ),
    );
  }
}
0
likes
160
points
26
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A powerful Flutter Markdown widget with LaTeX math and syntax highlighting.

Homepage
Repository (GitHub)
View/report issues

Topics

#markdown #latex #syntax-highlighting #widget #ui

License

MIT (license)

Dependencies

flutter, flutter_math_fork, markdown, syntax_highlight

More

Packages that depend on fat_markdown