Skip to content

Commit f449218

Browse files
key upgrate
1 parent 65a5ce0 commit f449218

File tree

2 files changed

+104
-11
lines changed

2 files changed

+104
-11
lines changed

lib/features/text_completion/presentation/pages/text_completion_page.dart

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,42 @@ class _TextCompletionPageState extends State<TextCompletionPage> {
2929
super.dispose();
3030
}
3131

32+
Widget _buildFormattedText(String text) {
33+
return Container(
34+
padding: EdgeInsets.all(16),
35+
decoration: BoxDecoration(
36+
color: Colors.grey[900],
37+
borderRadius: BorderRadius.circular(12),
38+
),
39+
child: Column(
40+
crossAxisAlignment: CrossAxisAlignment.start,
41+
children: [
42+
Text(
43+
text,
44+
style: TextStyle(
45+
fontSize: 16,
46+
color: Colors.grey[100],
47+
height: 1.5,
48+
),
49+
),
50+
Divider(color: Colors.grey[700]),
51+
Row(
52+
mainAxisAlignment: MainAxisAlignment.end,
53+
children: [
54+
Text(
55+
DateTime.now().toString().substring(0, 16),
56+
style: TextStyle(
57+
color: Colors.grey[400],
58+
fontSize: 12,
59+
),
60+
),
61+
],
62+
),
63+
],
64+
),
65+
);
66+
}
67+
3268
@override
3369
Widget build(BuildContext context) {
3470
return Scaffold(
@@ -56,25 +92,26 @@ class _TextCompletionPageState extends State<TextCompletionPage> {
5692
itemBuilder: (BuildContext context, int index) {
5793
final text = response.candidates[index].content.parts.first.text;
5894
return Card(
95+
margin: EdgeInsets.all(8),
5996
child: Padding(
60-
padding: const EdgeInsets.all(8.0),
97+
padding: const EdgeInsets.all(16),
6198
child: Column(
6299
children: [
63-
Text(
64-
text,
65-
style: TextStyle(fontSize: 18),
66-
),
67-
SizedBox(height: 30),
100+
_buildFormattedText(text),
101+
SizedBox(height: 16),
68102
Row(
69103
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
70104
children: [
71-
InkWell(onTap: () => Share.share(text), child: Icon(Icons.share, size: 35)),
72-
InkWell(
73-
onTap: () => Clipboard.setData(ClipboardData(text: text)),
74-
child: Icon(Icons.copy, size: 35)),
105+
IconButton(
106+
icon: Icon(Icons.share),
107+
onPressed: () => Share.share(text),
108+
),
109+
IconButton(
110+
icon: Icon(Icons.copy),
111+
onPressed: () => Clipboard.setData(ClipboardData(text: text)),
112+
),
75113
],
76114
),
77-
SizedBox(height: 10),
78115
],
79116
),
80117
),

pubspec.lock

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,62 @@ packages:
504504
url: "https://pub.dev"
505505
source: hosted
506506
version: "5.0.2"
507+
shared_preferences:
508+
dependency: "direct main"
509+
description:
510+
name: shared_preferences
511+
sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a"
512+
url: "https://pub.dev"
513+
source: hosted
514+
version: "2.5.2"
515+
shared_preferences_android:
516+
dependency: transitive
517+
description:
518+
name: shared_preferences_android
519+
sha256: "9f9f3d372d4304723e6136663bb291c0b93f5e4c8a4a6314347f481a33bda2b1"
520+
url: "https://pub.dev"
521+
source: hosted
522+
version: "2.4.7"
523+
shared_preferences_foundation:
524+
dependency: transitive
525+
description:
526+
name: shared_preferences_foundation
527+
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
528+
url: "https://pub.dev"
529+
source: hosted
530+
version: "2.5.4"
531+
shared_preferences_linux:
532+
dependency: transitive
533+
description:
534+
name: shared_preferences_linux
535+
sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f"
536+
url: "https://pub.dev"
537+
source: hosted
538+
version: "2.4.1"
539+
shared_preferences_platform_interface:
540+
dependency: transitive
541+
description:
542+
name: shared_preferences_platform_interface
543+
sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"
544+
url: "https://pub.dev"
545+
source: hosted
546+
version: "2.4.1"
547+
shared_preferences_web:
548+
dependency: transitive
549+
description:
550+
name: shared_preferences_web
551+
sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019
552+
url: "https://pub.dev"
553+
source: hosted
554+
version: "2.4.3"
555+
shared_preferences_windows:
556+
dependency: transitive
557+
description:
558+
name: shared_preferences_windows
559+
sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1"
560+
url: "https://pub.dev"
561+
source: hosted
562+
version: "2.4.1"
507563
shimmer:
508564
dependency: "direct main"
509565
description:

0 commit comments

Comments
 (0)