load indicator on image grid
center load indicator on directory load support for trackpads
This commit is contained in:
parent
cc2f9dbb94
commit
9373df296c
@ -107,9 +107,7 @@ class _ImageGridState extends State<ImageGrid> {
|
||||
}
|
||||
}
|
||||
|
||||
return const CircularProgressIndicator(
|
||||
strokeWidth: 3,
|
||||
);
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -14,37 +14,51 @@ class ImageTile extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onClick?.call();
|
||||
},
|
||||
child: Container(
|
||||
onTap: () {
|
||||
onClick?.call();
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: imageUri == null
|
||||
? BoxDecoration(
|
||||
child: imageUri == null
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(calcTileMaxWidth() / 30)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
spreadRadius: calcTileMaxWidth() / 150,
|
||||
blurRadius: calcTileMaxWidth() / 60),
|
||||
])
|
||||
: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: dtaProvider!.getImageProvider(imageUri!),
|
||||
),
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
spreadRadius: calcTileMaxWidth() / 150,
|
||||
blurRadius: calcTileMaxWidth() / 60),
|
||||
]),
|
||||
child: child)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(calcTileMaxWidth() / 30)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
spreadRadius: calcTileMaxWidth() / 150,
|
||||
blurRadius: calcTileMaxWidth() / 60),
|
||||
]),
|
||||
child: child)),
|
||||
);
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
spreadRadius: calcTileMaxWidth() / 150,
|
||||
blurRadius: calcTileMaxWidth() / 60),
|
||||
]),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(calcTileMaxWidth() / 30),
|
||||
),
|
||||
child: Image(
|
||||
fit: BoxFit.cover,
|
||||
frameBuilder:
|
||||
(context, child, frame, wasSynchronouslyLoaded) {
|
||||
return frame == null
|
||||
? const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: child;
|
||||
},
|
||||
image: dtaProvider!.getImageProvider(imageUri!),
|
||||
)),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ class AppScrollBehavior extends MaterialScrollBehavior {
|
||||
Set<PointerDeviceKind> get dragDevices => {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
PointerDeviceKind.trackpad
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user