Skip to content

Commit b55bccd

Browse files
committed
File browser updated
1 parent 771ff23 commit b55bccd

File tree

7 files changed

+145
-3
lines changed

7 files changed

+145
-3
lines changed

.dart_tool/package_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
"languageVersion": "2.12"
435435
}
436436
],
437-
"generated": "2021-12-01T02:01:38.891451Z",
437+
"generated": "2021-12-01T03:08:56.692400Z",
438438
"generator": "pub",
439439
"generatorVersion": "2.14.4"
440440
}

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_ios-2.0.7\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-8.3.0\\\\","dependencies":[]},{"name":"shared_preferences_ios","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.0.8\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-6.0.15\\\\","dependencies":[]}],"android":[{"name":"path_provider_android","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_android-2.0.9\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-8.3.0\\\\","dependencies":[]},{"name":"shared_preferences_android","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.9\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-6.0.15\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.3\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_macos-2.0.2\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.0.3\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_linux-2.0.2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.4\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.0.3\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_windows-2.0.2\\\\","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.2\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-12-01 09:01:39.344134","version":"2.5.3"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_ios-2.0.7\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-8.3.0\\\\","dependencies":[]},{"name":"shared_preferences_ios","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.0.8\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-6.0.15\\\\","dependencies":[]}],"android":[{"name":"path_provider_android","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_android-2.0.9\\\\","dependencies":[]},{"name":"permission_handler","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler-8.3.0\\\\","dependencies":[]},{"name":"shared_preferences_android","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.9\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher-6.0.15\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.3\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_macos-2.0.2\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.0.3\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_linux-2.0.2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.4\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.0.3\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_windows-2.0.2\\\\","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.2\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\Programming\\\\Flutter\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\url_launcher_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-12-01 10:08:57.229735","version":"2.5.3"}

.packages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# For more info see: https://dart.dev/go/dot-packages-deprecation
55
#
6-
# Generated by pub on 2021-12-01 09:01:38.797693.
6+
# Generated by pub on 2021-12-01 10:08:56.636369.
77
archive:file:///D:/Programming/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.1.6/lib/
88
async:file:///D:/Programming/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.1/lib/
99
boolean_selector:file:///D:/Programming/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* File: document.dart
3+
* Package:
4+
* Project: tree_view
5+
* Author: Ajil Oommen ([email protected])
6+
* Description:
7+
* Date: 06 January, 2019 1:59 PM
8+
*/
9+
10+
import 'package:meta/meta.dart';
11+
12+
class Document {
13+
final String name;
14+
final String path;
15+
final bool isFile;
16+
final DateTime dateModified;
17+
final List<Document> childData;
18+
bool isOpened = false;
19+
20+
Document({
21+
required this.path,
22+
required this.name,
23+
required this.dateModified,
24+
this.isFile = false,
25+
this.childData = const <Document>[],
26+
});
27+
}

lib/filebrowser/utils/utils.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* File: utils.dart
3+
* Package:
4+
* Project: tree_view
5+
* Author: Ajil Oommen ([email protected])
6+
* Description:
7+
* Date: 06 January, 2019 2:26 PM
8+
* Copyright 2018 - Altorum Leren Private Limited
9+
*/
10+
11+
import 'package:meta/meta.dart';
12+
13+
class Utils {
14+
static String getFormattedDateTime({required DateTime dateTime}) {
15+
String day = '${dateTime.day}';
16+
String month = '${dateTime.month}';
17+
String year = '${dateTime.year}';
18+
19+
String hour = '${dateTime.hour}';
20+
String minute = '${dateTime.minute}';
21+
String second = '${dateTime.second}';
22+
return '$day/$month/$year $hour/$minute/$second';
23+
}
24+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* File: directory_widget.dart
3+
* Package:
4+
* Project: tree_view
5+
* Author: Ajil Oommen ([email protected])
6+
* Description:
7+
* Date: 06 January, 2019 2:04 PM
8+
*/
9+
10+
import 'package:flutter/material.dart';
11+
12+
import 'package:corecoder_develop/filebrowser/utils/utils.dart';
13+
14+
class DirectoryWidget extends StatelessWidget {
15+
final String path;
16+
final String directoryName;
17+
final DateTime lastModified;
18+
final VoidCallback? onPressedNext;
19+
20+
DirectoryWidget({
21+
required this.path,
22+
required this.directoryName,
23+
required this.lastModified,
24+
this.onPressedNext,
25+
});
26+
27+
@override
28+
Widget build(BuildContext context) {
29+
Widget titleWidget = Text(directoryName);
30+
Icon folderIcon = Icon(Icons.folder);
31+
32+
IconButton expandButton = IconButton(
33+
icon: Icon(Icons.navigate_next),
34+
onPressed: onPressedNext,
35+
);
36+
37+
Widget lastModifiedWidget = Text(
38+
Utils.getFormattedDateTime(dateTime: lastModified),
39+
);
40+
41+
return Card(
42+
child: ListTile(
43+
leading: folderIcon,
44+
title: titleWidget,
45+
subtitle: lastModifiedWidget,
46+
trailing: expandButton,
47+
onTap: (()=> onPressedNext!()),
48+
),
49+
);
50+
}
51+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* File: file_widget.dart
3+
* Package:
4+
* Project: tree_view
5+
* Author: Ajil Oommen ([email protected])
6+
* Description:
7+
* Date: 06 January, 2019 2:03 PM
8+
*/
9+
10+
import 'package:flutter/material.dart';
11+
12+
import 'package:corecoder_develop/filebrowser/utils/utils.dart';
13+
14+
class FileWidget extends StatelessWidget {
15+
final String fileName;
16+
final DateTime lastModified;
17+
final String path;
18+
final void Function(String filepath) onTap;
19+
20+
FileWidget({required this.path, required this.fileName, required this.lastModified, required this.onTap});
21+
22+
@override
23+
Widget build(BuildContext context) {
24+
Widget fileNameWidget = Text(this.fileName);
25+
Widget lastModifiedWidget = Text(
26+
Utils.getFormattedDateTime(dateTime: lastModified),
27+
);
28+
Icon fileIcon = Icon(Icons.insert_drive_file);
29+
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+
);
39+
}
40+
}

0 commit comments

Comments
 (0)