Skip to content

Commit 7ec0af2

Browse files
committed
Editor: file widget is now the same as the directory widget. also the drawer close when open file
1 parent f15fecb commit 7ec0af2

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

lib/editor.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class _EditorPageState extends State<EditorPage> {
202202
return Scaffold(
203203
drawer: MyDrawer(documentList, project, (String filepath) {
204204
openFile(filepath);
205+
Navigator.pop(context);
205206
}),
206207
appBar: AppBar(
207208
title: null,

lib/filebrowser/widgets/directory_widget.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@ class DirectoryWidget extends StatelessWidget {
4343

4444
return TextButton(
4545
onPressed: (() => onPressedNext!()),
46-
child:
47-
// ListTile(
48-
// leading: folderIcon,
49-
// title: titleWidget,
50-
// subtitle: lastModifiedWidget,
51-
// trailing: expandButton,
52-
// onTap: (()=> onPressedNext!()),
53-
// ),
54-
Row(children: [
46+
child: Row(children: [
5547
folderIcon,
5648
titleWidget,
57-
Spacer(flex: 1),
49+
const Spacer(flex: 1),
5850
expandButton
5951
]));
6052
}

lib/filebrowser/widgets/file_widget.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,19 @@ class FileWidget extends StatelessWidget {
2121

2222
@override
2323
Widget build(BuildContext context) {
24-
Widget fileNameWidget = Text(this.fileName);
24+
Widget fileNameWidget = Container(
25+
padding: const EdgeInsets.fromLTRB(20, 8, 4, 8),
26+
child: Text(fileName, style: const TextStyle(fontSize: 16)));
2527
Widget lastModifiedWidget = Text(
2628
Utils.getFormattedDateTime(dateTime: lastModified),
2729
);
28-
Icon fileIcon = Icon(Icons.insert_drive_file);
30+
Icon fileIcon = const Icon(Icons.insert_drive_file);
2931

30-
return Card(
31-
elevation: 0.0,
32-
child: ListTile(
33-
leading: fileIcon,
34-
title: fileNameWidget,
35-
subtitle: lastModifiedWidget,
36-
onTap: (){onTap(path);},
37-
),
38-
);
32+
return TextButton(
33+
onPressed: (() => onTap(path)),
34+
child: Row(children: [
35+
fileIcon,
36+
fileNameWidget
37+
]));
3938
}
4039
}

0 commit comments

Comments
 (0)