chat_context_menu 2.1.0 copy "chat_context_menu: ^2.1.0" to clipboard
chat_context_menu: ^2.1.0 copied to clipboard

A Flutter package that provides chat context menu with customizable appearance and animations, perfect for chat applications.

example/lib/main.dart

import 'package:example/app_theme.dart';
import 'package:example/context_menu_example.dart';
import 'package:example/selectable_text_example.dart';
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Chat Context Menu',
      theme: AppTheme.light,
      darkTheme: AppTheme.dark,
      themeMode: ThemeMode.system,
      debugShowCheckedModeBanner: false,
      home: const HomePage(),
    );
  }
}

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  late final PageController _pageController;

  late int currentIndex = 0;

  @override
  void initState() {
    _pageController = PageController(initialPage: currentIndex);
    super.initState();
  }

  @override
  void dispose() {
    _pageController.dispose();
    super.dispose();
  }

  void onTabTapped(int index) {
    setState(() {
      currentIndex = index;
    });
    _pageController.animateToPage(
      index,
      duration: const Duration(milliseconds: 300),
      curve: Curves.easeInOut,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PageView(
        controller: _pageController,
        children: [ChatContextMenuPage(), ChatSelectableTextPage()],
      ),
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: currentIndex,
        onTap: onTabTapped,
        items: const [
          BottomNavigationBarItem(icon: Icon(Icons.chat), label: 'ContextMenu'),
          BottomNavigationBarItem(
            icon: Icon(Icons.text_fields),
            label: 'Selectable',
          ),
        ],
      ),
    );
  }
}
4
likes
0
points
214
downloads

Publisher

verified publisherjsontodart.cn

Weekly Downloads

A Flutter package that provides chat context menu with customizable appearance and animations, perfect for chat applications.

Repository (GitHub)
View/report issues

Topics

#chat #chat-context-menu #context-menu #chat-selectable-text #menu

License

unknown (license)

Dependencies

flutter, universal_platform

More

Packages that depend on chat_context_menu