Skip to content

Commit

Permalink
home complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Imatifdev committed Jan 27, 2024
1 parent b302eb9 commit 00b7812
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 215 deletions.
Binary file added assets/images.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
347 changes: 264 additions & 83 deletions lib/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:qatar_billiard_football/utils/colors.dart';
import 'package:qatar_billiard_football/utils/images.dart';
import 'package:qatar_billiard_football/widget/custom_Button.dart';
import 'package:qatar_billiard_football/widget/youtube_videos.dart';
import 'package:responsive_sizer/responsive_sizer.dart';

class HomeScreen extends StatefulWidget {
Expand All @@ -16,96 +17,276 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
final width = MediaQuery.of(context).size.width;
return Scaffold(
body: Column(
children: [
Expanded(
child: Stack(children: [
Container(
height: height * 0.4,
width: width,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(MyImages.mainScreen),
fit: BoxFit.cover),
),
),
Positioned(
top: height * 0.39,
child: Container(
height: height * 0.1,
return SafeArea(
child: Scaffold(
body: Column(
children: [
Expanded(
child: Stack(children: [
Container(
height: height * 0.3,
width: width,
color: AppColorScheme.secondaryColor.withOpacity(0.5),
),
),
Positioned(
top: height * 0.46,
child: Container(
width: width,
height: height * 0.30,
child: ListView.builder(
itemCount: 9,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return SizedBox(
height: height * 0.25,
width: width * 0.55,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image(
height: height * 0.15,
width: width * 0.5,
image:
AssetImage(MyImages.sampleListImage),
fit: BoxFit.cover,
),
SizedBox(
height: height * 0.01,
),
Text(
"Qatar 9 Ball Open -\nStage 1 1st Chance ",
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(MyImages.mainScreen),
fit: BoxFit.cover),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
child: Column(
children: [
SizedBox(
height: height * 0.04,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
CircleAvatar(
radius: 25,
backgroundImage:
AssetImage(MyImages.profileImafe),
),
const SizedBox(height: 20.0),
Positioned(
right: 0,
bottom: 0,
child: LiveActiveIcon()),
],
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Hi, Welcome",
style: AppColorScheme.heading4(
color: Colors.black,
fontWeight: FontWeight.normal),
),
SizedBox(
height: height * 0.01,
fontWeight: FontWeight.normal,
color: Colors.white,
fontSize: 15.sp)),
Text(
"Noman Zafar",
style: AppColorScheme.heading2(
color: Colors.white,
fontWeight: FontWeight.normal,
),
Container(
height: height * 0.04,
width: width * 0.5,
decoration: BoxDecoration(
color: AppColorScheme.secondaryColor,
borderRadius: BorderRadius.circular(10),
),
Row(
children: [
const Text(
"Current location",
style: TextStyle(color: Colors.white),
),
child: GestureDetector(
child: Center(
child: Text(
"Join Now",
style: AppColorScheme.heading4(
fontSize: 16.sp,
color: Colors.white),
),
),
const SizedBox(
width: 5,
),
)
],
),
Icon(
Icons.location_on,
color: Colors.pink[100],
size: 15,
),
const SizedBox(
width: 5,
),
const Text(
"Doha, 2303",
style: TextStyle(color: Colors.white),
),
],
)
],
),
),
);
})),
),
]),
),
],
)
],
),
],
),
),
),
Positioned(
top: height * 0.29,
child: Container(
height: height * 0.12,
width: width,
color: AppColorScheme.secondaryColor.withOpacity(0.7),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Upcoming Events",
style: AppColorScheme.heading3(color: Colors.white),
),
Text(
"View All",
style: AppColorScheme.heading4(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.normal),
)
],
),
),
),
),
Positioned(
top: height * 0.39,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Container(
width: width,
height: height * 0.30,
child: ListView.builder(
itemCount: 9,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return SizedBox(
height: height * 0.25,
width: width * 0.55,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Image(
height: height * 0.15,
width: width * 0.5,
image: AssetImage(
MyImages.sampleListImage),
fit: BoxFit.cover,
),
SizedBox(
height: height * 0.01,
),
Text(
"Qatar 9 Ball Open -\nStage 1 1st Chance ",
style: AppColorScheme.heading4(
color: Colors.black,
fontWeight: FontWeight.normal),
),
SizedBox(
height: height * 0.01,
),
Container(
height: height * 0.04,
width: width * 0.5,
decoration: BoxDecoration(
color:
AppColorScheme.secondaryColor,
borderRadius:
BorderRadius.circular(10),
),
child: GestureDetector(
child: Center(
child: Text(
"Join Now",
style: AppColorScheme.heading4(
fontSize: 16.sp,
color: Colors.white),
),
),
),
)
],
),
),
),
);
})),
),
),
Positioned(
top: height * 0.70,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
Text(
"Videos",
style: AppColorScheme.heading3(color: Colors.black),
)
// Container(
// width: width,
// height: height * 0.3,
// child: ListView.builder(
// scrollDirection: Axis.horizontal,
// itemCount: 7,
// itemBuilder: (contex, index) {
// return Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// height: 100,
// child: YoutubeVideo(
// "https://www.youtube.com/watch?v=GV5CuB4zPTY&pp=ygUOYmlsbGlhcmQgdmlkZW8%3D"),
// ),
// );
// }),
// ),
],
),
))
]),
),
],
),
),
);
}
}

class LiveActiveIcon extends StatefulWidget {
@override
_LiveActiveIconState createState() => _LiveActiveIconState();
}

class _LiveActiveIconState extends State<LiveActiveIcon>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<Color?> _colorAnimation;

@override
void initState() {
super.initState();

_controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 1),
);

_colorAnimation = ColorTween(
begin: Colors.grey,
end: Colors.green,
).animate(_controller);

_controller.repeat(reverse: true);
}

@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _colorAnimation,
builder: (context, child) {
return Icon(
Icons.circle,
color: _colorAnimation.value,
size: 15.0,
);
},
);
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
2 changes: 2 additions & 0 deletions lib/utils/images.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ class MyImages {
static String mainScreen = 'assets/main_screen.png';

static String sampleListImage = 'assets/list_img.png';

static String profileImafe = 'assets/images.jpg';
}
Loading

0 comments on commit 00b7812

Please sign in to comment.