Skip to content
Permalink
Browse files

Small improvements

  • Loading branch information...
mayank99 committed Feb 3, 2019
1 parent dacedfc commit 4e93e4426d420e35f348779274cedd09e76b28d0
Showing with 25 additions and 11 deletions.
  1. +5 −3 instarip/lib/gallery.dart
  2. +18 −7 instarip/lib/homepage.dart
  3. +1 −1 instarip/lib/imageservice.dart
  4. +1 −0 instarip/pubspec.yaml
@@ -30,7 +30,7 @@ class _GalleryPageState extends State<GalleryPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
backgroundColor: Color.fromRGBO(0, 0, 0, 50),
),
body: FutureBuilder(
future: _photos,
@@ -74,7 +74,9 @@ class _ImageTile extends StatelessWidget {
Navigator.push(context,
MaterialPageRoute<void>(builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(actions: <Widget>[
appBar: AppBar(
backgroundColor: Color.fromRGBO(0, 0, 0, 50),
actions: <Widget>[
IconButton(
icon: Icon(Icons.share),
onPressed: () async {
@@ -83,7 +85,7 @@ class _ImageTile extends StatelessWidget {
await Share.share(imagePath);
})
]),
body: Container(child: networkImage),
body: Center(child: Container(child: networkImage)),
);
}));
}
@@ -3,6 +3,7 @@ import 'package:instarip/gallery.dart';
import 'package:instarip/authentication.dart';
import 'package:instarip/imageservice.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart';

class GridList extends StatefulWidget {
final String uid;
@@ -31,12 +32,20 @@ class GridListState extends State<GridList> {
// requestStoragePermission();
}

Future<void> updateFolders() async {
await imageService.getFolders();
setState(() {
_folders = imageService.getFolders();;
});
}

@override
Widget build(BuildContext context) {
final Orientation orientation = MediaQuery.of(context).orientation;
return Scaffold(
appBar: AppBar(
title: const Text('InstaRip'),
title: Center(child: const Text('InstaRip')),
backgroundColor: Color.fromRGBO(0, 0, 0, 50),
actions: <Widget>[
IconButton(
icon: Icon(Icons.exit_to_app), onPressed: authService.signOut)
@@ -54,12 +63,14 @@ class GridListState extends State<GridList> {
// print(snapshot.data);
List<GridPhotoItem> grid = List.from(snapshot.data
.map((folder) => GridPhotoItem(folder: folder)));
return GridView.count(
crossAxisCount: 2,
mainAxisSpacing: 4.0,
crossAxisSpacing: 4.0,
padding: const EdgeInsets.all(12.0),
children: grid);
return LiquidPullToRefresh(onRefresh: updateFolders,
child: GridView.count(
crossAxisCount: 2,
mainAxisSpacing: 4.0,
crossAxisSpacing: 4.0,
padding: const EdgeInsets.all(12.0),
children: grid),
);
} else {
return Center(child: CircularProgressIndicator());
}
@@ -33,7 +33,7 @@ class ImageService {

List<String> filenames = [];
photos.documents.forEach((photo) {
var filename = photo.documentID;
var filename = "cropped_${photo.documentID}";
filenames.add(filename);
});

@@ -31,6 +31,7 @@ dependencies:
path_provider: ^0.4.0
watcher: ^0.9.7+10
image: ^2.0.6
liquid_pull_to_refresh: ^1.1.0

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.

0 comments on commit 4e93e44

Please sign in to comment.
You can’t perform that action at this time.