dbilgin / swipe_image_gallery Goto Github PK
View Code? Open in Web Editor NEWA scrollable, dismissable by swiping, zoomable gallery for Flutter, on which you can add a dynamic overlay.
License: MIT License
A scrollable, dismissable by swiping, zoomable gallery for Flutter, on which you can add a dynamic overlay.
License: MIT License
I tried setting a semi-transparent color to backgroundColor
property of SwipeImageGallery widget and the color was solid instead. Transparency option seems to be ignored. Please advise
Hello! Is there any way to animate the opacity of overlay while dragging the image down?
Hi,
is it possible to have a background opacity without touching the opacity of the overlay controller? this would be really nice
Please add a direction option to swipe left or right.
Add a Directionality widget can do that.
Hello, while developing I am used to use the linux version of my app.
While the swipe image gallery works perfectly on android, I noticed that in linux it is malfunctioning.
Symptoms upon opening:
Do you experience the same issue.
Thanks for the nice library.
Hello, how can i set index to open up gallery at specific image when the specific image is clicked? thanks!
Tried this but no luck:
class FirstPage extends StatefulWidget {
var wallpaperList = <Wallpaper>[];
@override
_FirstPageState createState() => _FirstPageState();
}
class _FirstPageState extends State<FirstPage> {
StreamController<Widget> overlayController =
StreamController<Widget>.broadcast();
@override
void dispose() {
overlayController.close();
super.dispose();
}
Query<Map<String, dynamic>> firstWallieQuery = FirebaseFirestore.instance
.collection('Wallies')
.orderBy('timestamp', descending: false)
.limit(20);
@override
Widget build(BuildContext context) {
return Scaffold(
body: _buildContents(),
);
}
Widget _buildContents() {
//THIS CODE IS USED TO RETRIEVE DATA FROM DB
return FutureBuilder(
future: firstWallieQuery.get(),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasData) {
print('DATA IS THERE ROXIN');
var favWallManger =
Provider.of<FavWallpaperManger>(context, listen: false);
snapshot.data.docs.forEach((documentSnapshot) {
var wallpaper = Wallpaper.fromDocumentSnapshot(documentSnapshot);
if (favWallManger.isFavourite(wallpaper)) {
wallpaper.isFavourite = true;
}
//THIS IS WHERE IM ADDING THE IMAGES TO A LIST AFTER RETRIEVING THEM FROM A DB
widget.wallpaperList.add(wallpaper);
print('ListHome: ${wallpaper.id}');
});
}
print('GridRebuildHome');
return GridView.builder(
itemCount: widget.wallpaperList.length,
itemBuilder: (BuildContext context, int indexx) {
return InkResponse(
//WHY I PUT SWIPE IMAGE GALLERY IN A STANDALONE METHOD IS BECAUSE IT WAS GETTING LONG AND MESSY
onTap: () => swipeImageGallery(context, indexx).show(),
child: GridTile(child: imageCache(indexx)),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 0.8,
),
);
} else {
return Center(
child: CircularProgressIndicator(),
);
}
},
);
}
SwipeImageGallery swipeImageGallery(BuildContext context, int indexx) {
return SwipeImageGallery(
context: context,
initialIndex: indexx,
hideStatusBar: true,
transitionDuration: 600,
//heroProperties: heroProperties,
itemBuilder: (context, index) {
return Image(
image: CachedNetworkImageProvider(
widget.wallpaperList.elementAt(index).url));
},
itemCount: widget.wallpaperList.length,
onSwipe: (index) {
overlayController.add(FullScreenOverlayButtons(
wallpaperList: widget.wallpaperList,
initialPage: index,
currentIndex: index,
fromHome: true,
));
},
initialOverlay: FullScreenOverlayButtons(
wallpaperList: widget.wallpaperList,
initialPage: indexx,
currentIndex: indexx,
fromHome: true,
),
overlayController: overlayController,
);
}
Widget imageCache(int indexx) {
return CachedNetworkImage(
imageUrl: widget.wallpaperList.elementAt(indexx).url,
fit: BoxFit.cover,
);
}
}
Zoomed image can be in any postiion on the screen by vertical
The show() method of SwipeImageGallery should return a Future so that callers can await it and know when the gallery is closed. The show() method is already an async function so the only that the needs to change is the return signature.
I tried using the back button to dismiss the gallery but it doesn't work.
I also tried using an overlay and use PopScope
but didn't work either.
How can we handle the back button on Android in this case?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.