Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
matifjeetayraho committed Feb 3, 2024
1 parent b1494cc commit c1e8b15
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 26 deletions.
7 changes: 4 additions & 3 deletions lib/auth_screen/auth_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:qatar_billiard_football/home/home.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:responsive_sizer/responsive_sizer.dart';

class AuthMain extends StatefulWidget {
@override
Expand Down Expand Up @@ -61,15 +62,15 @@ class _AuthMainState extends State<AuthMain> {
style: AppColorScheme.heading2(),
),
SizedBox(
height: 20,
height: height * 0.02,
),
Text(
"App description will be here",
style: AppColorScheme.heading4(
fontSize: 16, color: Colors.grey),
fontSize: 16.sp, color: Colors.grey),
),
SizedBox(
height: 80,
height: height * 0.1,
),
MyCustomButton(
isWhite: false,
Expand Down
28 changes: 16 additions & 12 deletions lib/home/event_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,15 @@ class _TabSelectionWidgetState extends State<TabSelectionWidget>
),
itemCount: 4,
itemBuilder: (context, index) {
double screenWidth = MediaQuery.of(context).size.width;
double cardWidth =
(screenWidth - 24.0) / 2; // Adjust for padding and spacing

return Stack(
alignment: Alignment.topCenter,
children: [
Padding(
padding: EdgeInsets.only(top: 60),
padding: EdgeInsets.only(top: cardWidth * 0.3),
child: Card(
color: Colors.white,
child: Padding(
Expand All @@ -366,13 +370,13 @@ class _TabSelectionWidgetState extends State<TabSelectionWidget>
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 200,
height: 90,
width: cardWidth,
height: cardWidth * 0.45,
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Padding(
padding: const EdgeInsets.only(top: 30),
padding: EdgeInsets.only(top: cardWidth * 0.15),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
Expand All @@ -381,14 +385,14 @@ class _TabSelectionWidgetState extends State<TabSelectionWidget>
names[index],
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
fontSize: screenWidth * 0.04,
),
),
Text(
"Chine",
"China",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
fontSize: screenWidth * 0.03,
),
),
],
Expand All @@ -402,17 +406,17 @@ class _TabSelectionWidgetState extends State<TabSelectionWidget>
),
),
Positioned(
top: 50,
top: cardWidth * 0.25,
child: ClipRRect(
borderRadius: BorderRadius.circular(75),
borderRadius: BorderRadius.circular(cardWidth * 0.5),
child: Image.asset(
images[index],
height: 60.0,
width: 60.0,
height: cardWidth * 0.3,
width: cardWidth * 0.3,
fit: BoxFit.fill,
),
),
)
),
],
);
},
Expand Down
21 changes: 14 additions & 7 deletions lib/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,24 @@ class _HomeScreenState extends State<HomeScreen> {
})),
),
),
SizedBox(
height: 10,
),
Positioned(
top: height * 0.72,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
padding: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Videos",
style: AppColorScheme.heading3(
color: Colors.black),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Videos",
style: AppColorScheme.heading3(
color: Colors.black),
),
),
Container(
width: width,
Expand All @@ -270,12 +277,12 @@ class _HomeScreenState extends State<HomeScreen> {
itemCount: 4,
itemBuilder: (contex, index) {
return Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.symmetric(
horizontal: 10),
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(16)),
height: 100,
child: YoutubeVideo(urls[index]),
));
}),
Expand Down
11 changes: 11 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
import 'package:qatar_billiard_football/auth_screen/signup.dart';
import 'package:qatar_billiard_football/auth_screen/signup_view.dart';
import 'package:qatar_billiard_football/home/brackets.dart';
import 'package:qatar_billiard_football/home/event_detail.dart';
import 'package:qatar_billiard_football/home/home.dart';
import 'package:qatar_billiard_football/home/live_score.dart';
import 'package:qatar_billiard_football/home/matches.dart';
import 'package:qatar_billiard_football/splash.dart';
import 'package:qatar_billiard_football/utils/colors.dart';
import 'package:responsive_sizer/responsive_sizer.dart';
import 'package:responsive_framework/responsive_framework.dart';

void main() {
runApp(const MyApp());
Expand All @@ -19,6 +21,15 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return ResponsiveSizer(builder: (context, orientation, screenType) {
return MaterialApp(
builder: (context, child) => ResponsiveBreakpoints.builder(
child: child!,
breakpoints: [
const Breakpoint(start: 0, end: 450, name: MOBILE),
const Breakpoint(start: 451, end: 800, name: TABLET),
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
],
),
theme: ThemeData(),
debugShowCheckedModeBanner: false,
home: SplashScreen(),
Expand Down
7 changes: 5 additions & 2 deletions lib/widget/custom_Button.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:responsive_sizer/responsive_sizer.dart';

class MyCustomButton extends StatelessWidget {
final String name;
Expand All @@ -24,9 +25,11 @@ class MyCustomButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
final width = MediaQuery.of(context).size.width;
return SizedBox(
width: double.infinity,
height: 60,
height: height * 0.07,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
Expand Down Expand Up @@ -54,7 +57,7 @@ class MyCustomButton extends StatelessWidget {
Text(
name,
style: TextStyle(
fontSize: 18.0,
fontSize: 18.0.sp,
color: isWhite ? Colors.white : textColor,
fontWeight: FontWeight.w700,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/widget/youtube_videos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class _YoutubeVideoState extends State<YoutubeVideo> {
@override
Widget build(BuildContext context) {
return Container(
height: 200,
width: MediaQuery.of(context).size.width - 60,
height: MediaQuery.of(context).size.height * 0.1,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(16),
Expand All @@ -91,7 +92,6 @@ class _YoutubeVideoState extends State<YoutubeVideo> {
showVideoProgressIndicator: true,
progressIndicatorColor: Colors.blueAccent,
topActions: <Widget>[
const SizedBox(width: 8.0),
Expanded(
child: Text(
_controller.metadata.title,
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.0"
responsive_framework:
dependency: "direct main"
description:
name: responsive_framework
sha256: "23aa7be5d5136922df708f6ddccb5ec4e0eb8bc576c3f105f5093f31d6b68e50"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
responsive_sizer:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies:
readmore: ^2.2.0
curved_navigation_bar: ^1.0.3
bottom_navbar_with_indicator: ^0.0.8
responsive_framework: ^1.1.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit c1e8b15

Please sign in to comment.