Added custom Appbar for each page
This commit is contained in:
@ -42,25 +42,40 @@ class _FilesState extends State<Files> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<FilesProps>(
|
||||
builder: (context, value, child) {
|
||||
if(value.primaryLoading()) return const Center(child: CircularProgressIndicator());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Dateien"),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
onPressed: () => {},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.sort),
|
||||
onPressed: () => {},
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Consumer<FilesProps>(
|
||||
builder: (context, value, child) {
|
||||
if(value.primaryLoading()) return const Center(child: CircularProgressIndicator());
|
||||
|
||||
if(value.listFilesResponse.files.isEmpty) {
|
||||
return const ErrorView(text: "Der Ordner ist leer", icon: Icons.folder_off_outlined);
|
||||
}
|
||||
if(value.listFilesResponse.files.isEmpty) {
|
||||
return const ErrorView(text: "Der Ordner ist leer", icon: Icons.folder_off_outlined);
|
||||
}
|
||||
|
||||
List<CacheableFile> files = value.listFilesResponse.files.toList();
|
||||
files.sort((a, b) => a.isDirectory ? -1 : 1);
|
||||
List<CacheableFile> files = value.listFilesResponse.files.toList();
|
||||
files.sort((a, b) => a.isDirectory ? -1 : 1);
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: files.length,
|
||||
itemBuilder: (context, index) {
|
||||
CacheableFile file = files.skip(index).first;
|
||||
return FileElement(file, updateAppBar);
|
||||
},
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
itemCount: files.length,
|
||||
itemBuilder: (context, index) {
|
||||
CacheableFile file = files.skip(index).first;
|
||||
return FileElement(file, updateAppBar);
|
||||
},
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user