Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
brzhang666 committed Jul 3, 2023
2 parents 507c440 + e793dd1 commit 2e9855c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 29 deletions.
Binary file added artificial/chat.pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/components/chat.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_chatgpt/components/markdown.dart';
Expand Down Expand Up @@ -182,6 +180,7 @@ class _ChatWindowState extends State<ChatWindow> {
borderRadius: BorderRadius.circular(8),
),
child: Card(
color: Colors.blue[100],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SelectableText(
Expand Down Expand Up @@ -216,6 +215,7 @@ class _ChatWindowState extends State<ChatWindow> {
children: [
Expanded(
child: Card(
elevation: 8,
margin: const EdgeInsets.all(8),
child: Markdown(text: message.text),
),
Expand Down
57 changes: 31 additions & 26 deletions lib/components/conversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,38 @@ class ConversationWindow extends StatelessWidget {
child: ListView.builder(
itemCount: controller.conversationList.length,
itemBuilder: (context, index) {
return ListTile(
onTap: () {
_tapConversation(index);
},
selected: controller.currentConversationUuid.value ==
controller.conversationList[index].uuid,
leading: Icon(
Icons.chat,
color: Theme.of(context).colorScheme.primary,
return Card(
elevation: 1,
child: ListTile(
onTap: () {
_tapConversation(index);
},
selected:
controller.currentConversationUuid.value ==
controller.conversationList[index].uuid,
leading: Icon(
Icons.chat,
color: Theme.of(context).colorScheme.primary,
),
title: Text(
controller.conversationList[index].name,
style: TextStyle(
fontSize: 13,
color: Theme.of(context).colorScheme.primary),
),
trailing: Builder(builder: (context) {
return IconButton(
onPressed: () {
//显示一个overlay操作
_showConversationDetail(context, index);
},
icon: Icon(
Icons.more_horiz,
color:
Theme.of(context).colorScheme.primary,
));
}),
),
title: Text(
controller.conversationList[index].name,
style: TextStyle(
fontSize: 13,
color: Theme.of(context).colorScheme.primary),
),
trailing: Builder(builder: (context) {
return IconButton(
onPressed: () {
//显示一个overlay操作
_showConversationDetail(context, index);
},
icon: Icon(
Icons.more_horiz,
color: Theme.of(context).colorScheme.primary,
));
}),
);
},
),
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1

0 comments on commit 2e9855c

Please sign in to comment.