55// that can be found in the LICENSE file.
66
77import 'package:flutter/material.dart' ;
8+ import 'package:flutter/services.dart' ;
89
910import '../common/strings.dart' as strings;
1011import '../data/counter_ideas.dart' ;
1112import '../models/counter.dart' ;
12- import '../utils/utils.dart' ;
13+ import '../utils/utils.dart' as utils ;
1314
1415/// Screen that displays inspiration ideas for counting with a specific counter color.
1516class InspirationScreen extends StatefulWidget {
@@ -74,13 +75,16 @@ class _EmptyStateWidget extends StatelessWidget {
7475 Text (
7576 strings.noInspirationTitle (colorName),
7677 textAlign: TextAlign .center,
77- style: TextStyle (fontSize: 18 , color: Colors .grey[600 ]),
78+ style: Theme .of (context).textTheme.titleLarge? .copyWith (
79+ fontSize: 18.0 ,
80+ color: Colors .grey[600 ],
81+ ),
7882 ),
7983 const SizedBox (height: 8 ),
8084 Text (
8185 strings.noInspirationSubtitle,
8286 textAlign: TextAlign .center,
83- style: TextStyle (fontSize : 16 , color: Colors .grey[500 ]),
87+ style: Theme . of (context).textTheme.bodyLarge ? . copyWith ( color: Colors .grey[500 ]),
8488 ),
8589 ],
8690 ),
@@ -112,7 +116,10 @@ class _IdeasListWidget extends StatelessWidget {
112116 padding: const EdgeInsets .fromLTRB (16 , 8 , 16 , 16 ),
113117 child: Text (
114118 strings.inspirationHeader,
115- style: TextStyle (fontSize: 14 , color: Colors .grey[600 ], fontStyle: FontStyle .italic),
119+ style: Theme .of (context).textTheme.bodyMedium? .copyWith (
120+ color: Colors .grey[600 ],
121+ fontStyle: FontStyle .italic,
122+ ),
116123 ),
117124 ),
118125 // Ideas list
@@ -135,17 +142,23 @@ class _IdeaListItem extends StatelessWidget {
135142 /// The color of the leading dot.
136143 final Color dotColor;
137144
145+ /// Handles long press to copy the idea to clipboard.
146+ void _onLongPress (BuildContext context) {
147+ Clipboard .setData (ClipboardData (text: idea));
148+ utils.showSnackBar (context, strings.ideaCopied);
149+ }
150+
138151 @override
139152 Widget build (BuildContext context) {
140153 return ListTile (
141154 visualDensity: .comfortable,
142- // visualDensity: .compact,
143155 minLeadingWidth: 20.0 ,
144156 leading: Icon (Icons .circle, size: 12.0 , color: dotColor),
145157 title: Text (
146158 idea,
147159 style: Theme .of (context).textTheme.bodyMedium? .copyWith (fontSize: 15.0 ),
148160 ),
161+ onLongPress: () => _onLongPress (context),
149162 );
150163 }
151164}
0 commit comments