@@ -178,26 +178,28 @@ class _FilePickerScreenState extends State<FilePickerScreen> {
178178
179179 @override
180180 Widget build (BuildContext context) {
181+ final theme = Theme .of (context);
182+ final colorScheme = theme.colorScheme;
183+
181184 return Scaffold (
182- appBar: AppBar (
183- title: Text (widget.title),
184- backgroundColor: Colors .blue,
185- foregroundColor: Colors .white,
186- ),
185+ appBar: AppBar (title: Text (widget.title)),
187186 body: Column (
188187 children: [
189188 // Current path bar
190189 Container (
191190 padding: const EdgeInsets .all (8.0 ),
192- color: Colors .grey.shade100 ,
191+ color: colorScheme.surfaceVariant ,
193192 child: Row (
194193 children: [
195- Icon (Icons .folder, color: Colors .blue ),
194+ Icon (Icons .folder, color: colorScheme.primary ),
196195 const SizedBox (width: 8 ),
197196 Expanded (
198197 child: Text (
199198 _currentDirectory? .path ?? 'Loading...' ,
200- style: const TextStyle (fontWeight: FontWeight .bold),
199+ style: theme.textTheme.bodyMedium? .copyWith (
200+ fontWeight: FontWeight .bold,
201+ color: colorScheme.onSurfaceVariant,
202+ ),
201203 overflow: TextOverflow .ellipsis,
202204 ),
203205 ),
@@ -290,12 +292,15 @@ class _FilePickerScreenState extends State<FilePickerScreen> {
290292 // Parent directory entry
291293 if (_currentDirectory? .parent != null && index == 0 ) {
292294 return ListTile (
293- leading: const Icon (
295+ leading: Icon (
294296 Icons .arrow_upward,
295- color: Colors .orange,
297+ color: colorScheme.secondary,
298+ ),
299+ title: Text ('..' , style: theme.textTheme.bodyLarge),
300+ subtitle: Text (
301+ 'Parent directory' ,
302+ style: theme.textTheme.bodySmall,
296303 ),
297- title: const Text ('..' ),
298- subtitle: const Text ('Parent directory' ),
299304 onTap: () =>
300305 _navigateToDirectory (_currentDirectory! .parent! ),
301306 );
@@ -315,25 +320,31 @@ class _FilePickerScreenState extends State<FilePickerScreen> {
315320 leading: Icon (
316321 isDirectory ? Icons .folder : Icons .description,
317322 color: isDirectory
318- ? Colors .blue
323+ ? colorScheme.primary
319324 : isAllowed
320- ? Colors .green
321- : Colors .grey ,
325+ ? colorScheme.secondary
326+ : colorScheme.outline ,
322327 ),
323328 title: Text (
324329 fileName,
325- style: TextStyle (
326- color: isAllowed ? Colors .black : Colors .grey,
330+ style: theme.textTheme.bodyLarge? .copyWith (
331+ color: isAllowed
332+ ? colorScheme.onSurface
333+ : colorScheme.outline,
327334 fontWeight: isSelected
328335 ? FontWeight .bold
329336 : FontWeight .normal,
330337 ),
331338 ),
332- subtitle: isDirectory
333- ? const Text ('Directory' )
334- : Text (_getFileSize (entity as File )),
339+ subtitle: Text (
340+ isDirectory
341+ ? 'Directory'
342+ : _getFileSize (entity as File ),
343+ style: theme.textTheme.bodySmall,
344+ ),
335345 selected: isSelected,
336- selectedTileColor: Colors .blue.withOpacity (0.1 ),
346+ selectedTileColor: colorScheme.primaryContainer
347+ .withOpacity (0.3 ),
337348 onTap: isDirectory
338349 ? () => _navigateToDirectory (entity as Directory )
339350 : isAllowed
@@ -349,18 +360,24 @@ class _FilePickerScreenState extends State<FilePickerScreen> {
349360 Container (
350361 padding: const EdgeInsets .all (16.0 ),
351362 decoration: BoxDecoration (
352- color: Colors .grey.shade50,
353- border: Border (top: BorderSide (color: Colors .grey.shade300)),
363+ color: colorScheme.surface,
364+ border: Border (
365+ top: BorderSide (color: colorScheme.outline.withOpacity (0.2 )),
366+ ),
354367 ),
355368 child: Row (
356369 children: [
357- const Text ('File name: ' ),
370+ Text ('File name: ' , style : theme.textTheme.bodyMedium ),
358371 Expanded (
359372 child: TextField (
360373 controller: _fileNameController,
361- decoration: const InputDecoration (
362- border: OutlineInputBorder (),
374+ style: theme.textTheme.bodyMedium,
375+ decoration: InputDecoration (
376+ border: const OutlineInputBorder (),
363377 isDense: true ,
378+ focusedBorder: OutlineInputBorder (
379+ borderSide: BorderSide (color: colorScheme.primary),
380+ ),
364381 ),
365382 onSubmitted: (_) => _confirmSelection (),
366383 ),
@@ -386,10 +403,6 @@ class _FilePickerScreenState extends State<FilePickerScreen> {
386403 : (_fileNameController.text.trim ().isNotEmpty
387404 ? _confirmSelection
388405 : null ),
389- style: ElevatedButton .styleFrom (
390- backgroundColor: Colors .blue,
391- foregroundColor: Colors .white,
392- ),
393406 child: Text (
394407 widget.mode == FilePickerMode .open ? 'Open' : 'Save' ,
395408 ),
0 commit comments