Skip to content

Commit

Permalink
Merge pull request #3 from imhrsit/main
Browse files Browse the repository at this point in the history
challenge and meditation screen
  • Loading branch information
Yash-Khattar authored Dec 14, 2023
2 parents 33086c3 + f28d20f commit 63141a3
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 47 deletions.
Binary file added assets/images/yoga1.webp
Binary file not shown.
Binary file added assets/images/yoga2.webp
Binary file not shown.
Binary file added assets/images/yoga3.webp
Binary file not shown.
Binary file added assets/images/yoga4.webp
Binary file not shown.
Binary file added assets/images/yoga5.webp
Binary file not shown.
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
30 changes: 30 additions & 0 deletions lib/screens/challenge/challenge_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:yogzen/global/color.dart';
import 'package:yogzen/screens/challenge/components/challenge_card.dart';

class ChallengeScreen extends StatelessWidget{
const ChallengeScreen ({super.key});

@override
Widget build(BuildContext context){
return Scaffold(
backgroundColor: klightBlue,
appBar: AppBar(
backgroundColor: kdarkBlueMuted,
title: Text('30 Days Yoga Challenge',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
body: ListView.builder(
itemCount: 30,
itemBuilder: (context, index) {
return yogaChallengeCard(day: index + 1);
}
)
);
}
}
30 changes: 30 additions & 0 deletions lib/screens/challenge/components/challenge_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:yogzen/global/color.dart';

class yogaChallengeCard extends StatelessWidget{
final int day;

const yogaChallengeCard({super.key, required this.day});

@override
Widget build(BuildContext context) {
return Card(
margin: EdgeInsets.all(8.0),
color: Colors.white,
borderOnForeground: true,
child: ListTile(
title: Text('Day $day',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
subtitle: Text('Yoga Pose Description for Day $day'),
trailing: Icon(Icons.check_circle_outline),
onTap: () {
//navigation to particular yoga page and snackbar
},
),
);
}
}
100 changes: 54 additions & 46 deletions lib/screens/home/components/mediatation_card.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'dart:math' as math;

import 'package:yogzen/screens/meditation/meditation_screen.dart';

class Meditation extends StatefulWidget {
const Meditation({super.key});

Expand Down Expand Up @@ -33,57 +35,63 @@ class _MeditationState extends State<Meditation> {
itemBuilder: (context, index) {
// double offset = pageOffset - index;

return AnimatedBuilder(
animation: pageController,
builder: (context, child) {
double pageOffset = 0;
if (pageController.position.haveDimensions) {
pageOffset = pageController.page! - index;
}
double gauss =
math.exp(-(math.pow((pageOffset.abs() - 0.5), 2) / 0.08));
return Transform.translate(
offset: Offset(-32 * gauss * pageOffset.sign, 0),
child: Stack(
children: [
Container(
clipBehavior: Clip.none,
margin: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
offset: const Offset(8, 20),
blurRadius: 24,
return
GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => MeditationScreen()));
},
child: AnimatedBuilder(
animation: pageController,
builder: (context, child) {
double pageOffset = 0;
if (pageController.position.haveDimensions) {
pageOffset = pageController.page! - index;
}
double gauss =
math.exp(-(math.pow((pageOffset.abs() - 0.5), 2) / 0.08));
return Transform.translate(
offset: Offset(-32 * gauss * pageOffset.sign, 0),
child: Stack(
children: [
Container(
clipBehavior: Clip.none,
margin: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
offset: const Offset(8, 20),
blurRadius: 24,
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset(
'assets/meditation/img${index + 1}.jpeg',
height: height * 0.2,
width: width,
alignment: Alignment(-pageOffset.abs(), 0),
fit: BoxFit.none,
),
],
),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset(
'assets/meditation/img${index + 1}.jpeg',
height: height * 0.2,
width: width,
alignment: Alignment(-pageOffset.abs(), 0),
fit: BoxFit.none,
Positioned(
bottom: height * 0.052,
left: 30,
child: Text(
"Meditation ${index + 1}",
style: const TextStyle(color: Colors.white),
),
),
),
Positioned(
bottom: height * 0.052,
left: 30,
child: Text(
"Meditation ${index + 1}",
style: const TextStyle(color: Colors.white),
],
),
);
},
),
),
],
),
);
},
);
);
},
),
);
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yogzen/global/color.dart';
import 'package:yogzen/providers/user_provider.dart';
import 'package:yogzen/screens/challenge/challenge_screen.dart';
import 'package:yogzen/screens/home/components/mediatation_card.dart';
import 'dart:math' as math;

Expand Down Expand Up @@ -155,7 +156,9 @@ class _HomeScreenState extends State<HomeScreen> {
),
const SizedBox(height: 6),
GestureDetector(
onTap: () {},
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: ((context) => ChallengeScreen())));
},
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 60, vertical: 8),
Expand Down
50 changes: 50 additions & 0 deletions lib/screens/meditation/meditation_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:flutter/material.dart';

class MeditationScreen extends StatefulWidget {
const MeditationScreen({ super.key });

@override
State<MeditationScreen> createState() => _MeditationScreenState();
}

class _MeditationScreenState extends State<MeditationScreen> {

@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
Image.asset(
'assets/mountain.jpeg',
fit: BoxFit.cover,
width: double.infinity,
height: double.infinity,
),
Container(
color: Colors.black.withOpacity(0.5),
width: double.infinity,
height: double.infinity,
),
Positioned(
left: 30,
right: 30,
//top: 50,
bottom: 50,
child: Center(
child: Container(
padding: EdgeInsets.all(150),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.7),
borderRadius: BorderRadius.circular(20)
),
child: Center(
child: Text('idhar gaana bajega file submit karni hai isiliye aake bajauga!'),
),
),
),
)
],
),
);
}
}
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
43 changes: 43 additions & 0 deletions macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end

0 comments on commit 63141a3

Please sign in to comment.