Skip to content

Commit df7f7e7

Browse files
committed
[UI] fix files style
1 parent 13791a3 commit df7f7e7

File tree

1 file changed

+42
-45
lines changed

1 file changed

+42
-45
lines changed

lib/apps/file/list.dart

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -82,39 +82,39 @@ class _FilesListState extends State<FilesList> {
8282
),
8383
body: Padding(
8484
padding: const EdgeInsets.all(10.0),
85-
child: ListView(
85+
child: Column(
8686
children: [
8787
const SizedBox(height: 10.0),
8888
Wrap(
89-
spacing: 8.0,
90-
runSpacing: 8.0,
91-
alignment: WrapAlignment.start,
92-
children: widgets
89+
spacing: 10.0,
90+
runSpacing: 10.0,
91+
children: widgets,
9392
),
9493
const SizedBox(height: 36.0),
95-
Text('Recents', style: Theme.of(context).textTheme.title),
94+
Text('Recents', style: Theme.of(context).textTheme.title, textAlign: TextAlign.left),
9695
const SizedBox(height: 16.0),
97-
Wrap(
98-
spacing: 4.0,
99-
runSpacing: 8.0,
100-
alignment: WrapAlignment.start,
101-
children: <Widget> [
102-
FileItem(name: 'myworks.dir'),
103-
FileItem(name: 'ESSE-infos-public.dir'),
104-
FileItem(name: 'personal.dir'),
105-
FileItem(name: 'others.dir'),
106-
FileItem(name: 'logo.jpg'),
107-
FileItem(name: 'cat.png'),
108-
FileItem(name: 'what-is-esse_en.doc'),
109-
FileItem(name: '20210101-customers.xls'),
110-
FileItem(name: 'product.pdf'),
111-
FileItem(name: 'deck.ppt'),
112-
FileItem(name: 'coder.md'),
113-
FileItem(name: 'how-to-live-in-happy.mp4'),
114-
FileItem(name: 'something_important'),
115-
FileItem(name: 'car.json'),
116-
],
117-
),
96+
Expanded(
97+
child: GridView.extent(
98+
maxCrossAxisExtent: 80.0,
99+
childAspectRatio: 0.8,
100+
children: <Widget> [
101+
FileItem(name: 'myworks.dir'),
102+
FileItem(name: 'ESSE-infos-public.dir'),
103+
FileItem(name: 'personal.dir'),
104+
FileItem(name: 'others.dir'),
105+
FileItem(name: 'logo.jpg'),
106+
FileItem(name: 'cat.png'),
107+
FileItem(name: 'what-is-esse_en.doc'),
108+
FileItem(name: '20210101-customers.xls'),
109+
FileItem(name: 'product.pdf'),
110+
FileItem(name: 'deck.ppt'),
111+
FileItem(name: 'coder.md'),
112+
FileItem(name: 'how-to-live-in-happy.mp4'),
113+
FileItem(name: 'something_important'),
114+
FileItem(name: 'car.json'),
115+
],
116+
),
117+
)
118118
]
119119
)
120120
),
@@ -137,24 +137,21 @@ class FileItem extends StatelessWidget {
137137
@override
138138
Widget build(BuildContext context) {
139139
final trueName = remove_dir(name);
140-
return Container(
141-
width: 80.0,
142-
child: Column(
143-
mainAxisAlignment: MainAxisAlignment.center,
144-
crossAxisAlignment: CrossAxisAlignment.center,
145-
children: [
146-
Container(
147-
height: 60.0,
148-
width: 60.0,
149-
child: fileIcon(name, 48.0),
150-
),
151-
Tooltip(
152-
message: trueName,
153-
child: Text(trueName,
154-
style: TextStyle(fontSize: 14.0), maxLines: 1, overflow: TextOverflow.ellipsis),
155-
)
156-
]
157-
)
140+
return Column(
141+
mainAxisAlignment: MainAxisAlignment.center,
142+
crossAxisAlignment: CrossAxisAlignment.center,
143+
children: [
144+
Container(
145+
height: 60.0,
146+
width: 60.0,
147+
child: fileIcon(name, 48.0),
148+
),
149+
Tooltip(
150+
message: trueName,
151+
child: Text(trueName,
152+
style: TextStyle(fontSize: 14.0), maxLines: 1, overflow: TextOverflow.ellipsis),
153+
)
154+
]
158155
);
159156
}
160157
}

0 commit comments

Comments
 (0)