forked from lohanidamodar/flutter_ui_challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
846a9ff
commit 88397f4
Showing
5 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; | ||
import 'package:flutter_ui_challenges/src/pages/animations/animation1/animation1.dart'; | ||
|
||
class GalleryPageOne extends StatelessWidget { | ||
static final String path = "lib/src/pages/misc/gallery1.dart"; | ||
final List<StaggeredTile> _staggeredTiles = const <StaggeredTile>[ | ||
const StaggeredTile.count(2, 2), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(2, 2), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(1, 1), | ||
const StaggeredTile.count(2, 1), | ||
const StaggeredTile.count(1, 2), | ||
const StaggeredTile.count(1, 1), | ||
]; | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Colors.white, | ||
appBar: AppBar( | ||
centerTitle: true, | ||
elevation: 0, | ||
title: Text( | ||
'Photos', | ||
style: TextStyle(color: Colors.black), | ||
), | ||
backgroundColor: Colors.transparent, | ||
iconTheme: IconThemeData(color: Colors.black), | ||
actions: <Widget>[ | ||
FlatButton( | ||
textColor: Colors.blue, | ||
child: Text("Add New"), | ||
onPressed: () {}, | ||
) | ||
], | ||
), | ||
body: StaggeredGridView.countBuilder( | ||
padding: const EdgeInsets.all(8.0), | ||
crossAxisCount: 3, | ||
itemCount: 16, | ||
itemBuilder: (context, index) => Container( | ||
decoration: BoxDecoration( | ||
image: DecorationImage( | ||
image: | ||
CachedNetworkImageProvider(images[index % images.length]), | ||
fit: BoxFit.cover, | ||
), | ||
borderRadius: BorderRadius.circular(10.0)), | ||
), | ||
staggeredTileBuilder: (index) => _staggeredTiles[index], | ||
mainAxisSpacing: 8.0, | ||
crossAxisSpacing: 8.0, | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.