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(
|
return const Center(child: CircularProgressIndicator());
|
||||||
strokeWidth: 3,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -14,37 +14,51 @@ class ImageTile extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
onClick?.call();
|
onClick?.call();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(3),
|
padding: const EdgeInsets.all(3),
|
||||||
child: Container(
|
child: imageUri == null
|
||||||
decoration: imageUri == null
|
? Container(
|
||||||
? BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(calcTileMaxWidth() / 30)),
|
Radius.circular(calcTileMaxWidth() / 30)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black12,
|
color: Colors.black12,
|
||||||
spreadRadius: calcTileMaxWidth() / 150,
|
spreadRadius: calcTileMaxWidth() / 150,
|
||||||
blurRadius: calcTileMaxWidth() / 60),
|
blurRadius: calcTileMaxWidth() / 60),
|
||||||
])
|
]),
|
||||||
: BoxDecoration(
|
child: child)
|
||||||
image: DecorationImage(
|
: Container(
|
||||||
fit: BoxFit.cover,
|
decoration: BoxDecoration(
|
||||||
image: dtaProvider!.getImageProvider(imageUri!),
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(calcTileMaxWidth() / 30)),
|
Radius.circular(calcTileMaxWidth() / 30)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black12,
|
color: Colors.black12,
|
||||||
spreadRadius: calcTileMaxWidth() / 150,
|
spreadRadius: calcTileMaxWidth() / 150,
|
||||||
blurRadius: calcTileMaxWidth() / 60),
|
blurRadius: calcTileMaxWidth() / 60),
|
||||||
]),
|
]),
|
||||||
child: child)),
|
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 => {
|
Set<PointerDeviceKind> get dragDevices => {
|
||||||
PointerDeviceKind.touch,
|
PointerDeviceKind.touch,
|
||||||
PointerDeviceKind.mouse,
|
PointerDeviceKind.mouse,
|
||||||
|
PointerDeviceKind.trackpad
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user