Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions hacktoberfest21_gdsc/lib/avenger_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AvengerDetail extends StatelessWidget {
left: 10.0,
top: MediaQuery.of(context).size.height * 0.12,
child: Container(

color: Colors.transparent.withOpacity(0),
child: Column(
children: [
Expand Down Expand Up @@ -44,7 +45,7 @@ class AvengerDetail extends StatelessWidget {
child: SizedBox(
height: 40,
width: 40,
child: Image.asset('assets/icon/GitHub.png')),
child: Image.asset('assets/icon/GitHub.png.png')),
),
SizedBox(width: MediaQuery.of(context).size.width * 0.07),
InkWell(
Expand Down Expand Up @@ -82,16 +83,16 @@ class AvengerDetail extends StatelessWidget {
alignment: Alignment.topCenter,
child: Hero(
tag: data.imgURL!,
child: Container(
height: 200.0,
width: 200.0,
decoration: BoxDecoration(
borderRadius:
const BorderRadius.all(Radius.circular(10.0)),
image: DecorationImage(
image: NetworkImage(data.imgURL!),
)),
)),
child: CircleAvatar(
backgroundColor: Colors.teal,

radius: 105,
child: CircleAvatar(
radius: 100,
backgroundImage: NetworkImage(data.imgURL!),
),
)
),
),
)
],
Expand All @@ -101,9 +102,18 @@ class AvengerDetail extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.teal.withOpacity(0.9),
appBar: AppBar(
centerTitle: true,
title: Text(data.name!),
appBar: PreferredSize(

preferredSize: const Size.fromHeight(70),
child: AppBar(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(25)
)
),
centerTitle: true,
title: Text(data.name!),
),
),
body: Container(
child: bodyWidget(context),
Expand All @@ -114,6 +124,7 @@ class AvengerDetail extends StatelessWidget {
child: SizedBox(
child: InkWell(
child: Container(

color: Colors.teal,
height: MediaQuery.of(context).size.height / 20,
// ng: EdgeInsets.all(8.0),paddi
Expand Down
123 changes: 80 additions & 43 deletions hacktoberfest21_gdsc/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hacktoberfest21_gdsc/avenger_detail.dart';
import 'package:hacktoberfest21_gdsc/models/avengers.dart';
Expand Down Expand Up @@ -45,9 +46,19 @@ class _HomePageState extends State<HomePage> {
final double itemWidth = size.width / 2;

return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text("GDSC-Hacktoberfest21"),
appBar: PreferredSize(

preferredSize: const Size.fromHeight(70),
child: AppBar(
centerTitle: true,
title: const Text("GDSC-Hacktoberfest21"),
shape: const RoundedRectangleBorder(

borderRadius: BorderRadius.vertical(
bottom: Radius.circular(25),
)
),
),
),
body: dataHub == null
? const Center(
Expand All @@ -64,52 +75,78 @@ class _HomePageState extends State<HomePage> {
},
);
},
child: GridView.count(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
children: dataHub!.data
.map((Data avenge) => Padding(
padding: const EdgeInsets.all(2.0),
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AvengerDetail(
data: avenge,
)));
},
child: Card(
elevation: 3.0,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Hero(
tag: avenge.imgURL.toString(),
child: Container(
height:
MediaQuery.of(context).size.height /
4,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
avenge.imgURL.toString())),
child: Padding(
padding: const EdgeInsets.only(top:20,left: 10.0,right: 10.0),
child: GridView.count(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
children: dataHub!.data
.map((Data avenge) => Padding(
padding: const EdgeInsets.all(2.0),
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AvengerDetail(
data: avenge,
)));
},
child: Card(

shadowColor: Colors.teal,
shape: RoundedRectangleBorder(
side: const BorderSide(color: Colors.teal,width: 1.5),
borderRadius: BorderRadius.circular(22)
),
elevation: 4.0,
child: Column(
// mainAxisAlignment:
// MainAxisAlignment.start,
children: [
Hero(
tag: avenge.imgURL.toString(),
child: Padding(
padding: const EdgeInsets.only(left: 10.0,right: 10.0),
child: SizedBox(
// width:
// MediaQuery.of(context).size.width /
// 4,
height:
MediaQuery.of(context).size.height /
4.2,
// decoration: BoxDecoration(
// image: DecorationImage(
//
// image: NetworkImage(
// avenge.imgURL.toString())),
// ),
child: CircleAvatar(
radius: 90,
backgroundImage:NetworkImage(avenge.imgURL.toString()),
),
),
),
),
),
Text(avenge.name.toString(),
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold)),
],
Padding(
padding: const EdgeInsets.only(left: 15.0,right: 15.0),
child: Text(avenge.name.toString(),
overflow: TextOverflow.ellipsis,

style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold)),
),
],
),
),
),
),
))
.toList()),
))
.toList()),
),
),
bottomNavigationBar: BottomAppBar(

child: SizedBox(
child: InkWell(
child: Container(
Expand Down