Files
adventofcode2025/lib/day_page.dart

61 lines
1.5 KiB
Dart
Raw Normal View History

2026-02-21 21:32:56 -06:00
import 'package:file_picker/file_picker.dart';
2026-02-21 15:56:39 -06:00
import 'package:flutter/material.dart';
2026-02-21 21:32:56 -06:00
Future<void> selectFile() async {
2026-02-21 15:56:39 -06:00
print("Button Pushed");
2026-02-21 21:32:56 -06:00
FilePickerResult? result = await FilePicker.platform.pickFiles();
if (result != null) {
//File file = File(result.files.single.path!);
print(result.files.single.path!);
} else {
// User canceled the picker
}
2026-02-21 15:56:39 -06:00
}
class DayPage extends StatelessWidget {
const DayPage({super.key});
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: [
Row(
children: [
2026-02-21 21:32:56 -06:00
TextButton(onPressed: selectFile, child: Text("Select Input")),
2026-02-21 15:56:39 -06:00
SizedBox(
width: 300,
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Input File Path',
),
),
),
],
),
Row(
2026-02-21 21:32:56 -06:00
children: [TextButton(onPressed: selectFile, child: Text("Run"))],
2026-02-21 15:56:39 -06:00
),
Expanded(
child: Row(
children: [
Expanded(
child: TextField(
decoration: InputDecoration(border: OutlineInputBorder()),
readOnly: true,
expands: true,
minLines: null,
maxLines: null,
),
),
],
),
),
],
),
);
}
}