diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index d3c6cba..e51a58c 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -59,7 +59,6 @@ class AppThemeData { contentTextStyle: _textTheme.titleMedium!.apply(color: _darkFillColor), ), listTileTheme: ListTileThemeData( - tileColor: colorScheme.surface, iconColor: colorScheme.primary, textColor: colorScheme.onSurface, ), diff --git a/lib/core/widgets/chat_thread.dart b/lib/core/widgets/chat_thread.dart new file mode 100644 index 0000000..8699f26 --- /dev/null +++ b/lib/core/widgets/chat_thread.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; + +class ChatThread extends StatefulWidget { + final String name; + const ChatThread({Key? key, required this.name}) : super(key: key); + + @override + State createState() => _ChatThreadState(); +} + +class _ChatThreadState extends State { + @override + Widget build(BuildContext context) { + return GestureDetector( + onLongPressStart: (details) { + final offset = details.globalPosition; + showMenu( + context: context, + position: RelativeRect.fromLTRB( + offset.dx, + offset.dy, + MediaQuery.of(context).size.width - offset.dx, + MediaQuery.of(context).size.height - offset.dy, + ), + items: [ + PopupMenuItem( + child: ListTile( + leading: Icon(Icons.edit_outlined), + title: Text('Rename'), + ), + value: 'rename', + ), + PopupMenuItem( + child: ListTile( + leading: Icon(Icons.delete_outline), + title: Text('Delete'), + ), + value: 'delete', + ), + ], + elevation: 8.0, + ).then((value) { + if (value == 'rename') { + // Handle edit option + } else if (value == 'delete') { + // Handle delete option + } + }); + }, + child: ListTile( + title: Text(widget.name), + onTap: () {}, + ), + ); + } +} diff --git a/lib/core/widgets/main_drawer.dart b/lib/core/widgets/main_drawer.dart index 4745c2d..dc5bce9 100644 --- a/lib/core/widgets/main_drawer.dart +++ b/lib/core/widgets/main_drawer.dart @@ -1,3 +1,4 @@ +import 'package:boilerplate/core/widgets/chat_thread.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -27,66 +28,24 @@ class MainDrawer extends StatelessWidget { child: ListView( padding: EdgeInsets.zero, children: [ - ListTile( - title: Text('ChatGPT Flutter App'), - onTap: () {}, - ), - ListTile( - title: Text('GraphQL in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('REST API Explanation'), - onTap: () {}, - ), - ListTile( - title: Text('Jitsi Meet in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('Websockets in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('ChatGPT Flutter App'), - onTap: () {}, - ), - ListTile( - title: Text('GraphQL in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('REST API Explanation'), - onTap: () {}, - ), - ListTile( - title: Text('Jitsi Meet in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('Websockets in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('ChatGPT Flutter App'), - onTap: () {}, - ), - ListTile( - title: Text('GraphQL in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('REST API Explanation'), - onTap: () {}, - ), - ListTile( - title: Text('Jitsi Meet in Flutter'), - onTap: () {}, - ), - ListTile( - title: Text('Websockets in Flutter'), - onTap: () {}, - ), + ChatThread(name: 'GraphQL in Flutter'), + ChatThread(name: 'REST API Explanation'), + ChatThread(name: 'Jitsi Meet in Flutter'), + ChatThread(name: 'Websockets in Flutter'), + ChatThread(name: 'ChatGPT Flutter App'), + ChatThread(name: 'GraphQL in Flutter'), + ChatThread(name: 'REST API Explanation'), + ChatThread(name: 'Jitsi Meet in Flutter'), + ChatThread(name: 'Websockets in Flutter'), + ChatThread(name: 'GraphQL in Flutter'), + ChatThread(name: 'REST API Explanation'), + ChatThread(name: 'Jitsi Meet in Flutter'), + ChatThread(name: 'Websockets in Flutter'), + ChatThread(name: 'ChatGPT Flutter App'), + ChatThread(name: 'GraphQL in Flutter'), + ChatThread(name: 'REST API Explanation'), + ChatThread(name: 'Jitsi Meet in Flutter'), + ChatThread(name: 'Websockets in Flutter'), ], ), ), diff --git a/lib/core/widgets/menu_conversation.dart b/lib/core/widgets/menu_conversation.dart new file mode 100644 index 0000000..e69de29