浏览代码

used named parameters for FileInfoCollection

ashilkn 2 年之前
父节点
当前提交
53199d5e91

+ 2 - 2
lib/ui/viewer/file/collections_list_of_file_widget.dart

@@ -30,8 +30,8 @@ class CollectionsListOfFile extends StatelessWidget {
             scrollDirection: Axis.horizontal,
             itemBuilder: (context, index) {
               return FileInfoCollection(
-                collections[index].name,
-                () {
+                name: collections[index].name,
+                onTap: () {
                   routeToPage(
                     context,
                     CollectionPage(

+ 2 - 2
lib/ui/viewer/file/device_folders_list_of_file_widget.dart

@@ -20,8 +20,8 @@ class DeviceFoldersListOfFile extends StatelessWidget {
             scrollDirection: Axis.horizontal,
             itemBuilder: (context, index) {
               return FileInfoCollection(
-                deviceFolders[index],
-                () {},
+                name: deviceFolders[index],
+                onTap: () {},
               );
             },
           );

+ 1 - 1
lib/ui/viewer/file/file_info_collection_widget.dart

@@ -4,7 +4,7 @@ import 'package:photos/ente_theme_data.dart';
 class FileInfoCollection extends StatelessWidget {
   final String name;
   final Function onTap;
-  const FileInfoCollection(this.name, this.onTap, {Key key}) : super(key: key);
+  const FileInfoCollection({this.name, this.onTap, Key key}) : super(key: key);
 
   @override
   Widget build(BuildContext context) {