Skip to content

Commit

Permalink
Merge branch 'main' into kudos-for-meditation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanat-Jha authored Jan 9, 2025
2 parents 8a3fe92 + 47220a4 commit f13ef5c
Show file tree
Hide file tree
Showing 20 changed files with 496 additions and 219 deletions.
14 changes: 12 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:resource="@style/NormalTheme"/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="taskly" />
<data android:host="taskly.com" />
</intent-filter>

</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
19 changes: 18 additions & 1 deletion android/app/src/main/kotlin/com/example/taskly/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
package com.example.taskly

import android.content.Intent
import io.flutter.embedding.android.FlutterActivity
import io.flutter.plugin.common.MethodChannel

class MainActivity: FlutterActivity()
class MainActivity: FlutterActivity() {
private val CHANNEL = "com.example.taskly/deeplink"

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleDeepLink(intent)
}

private fun handleDeepLink(intent: Intent) {
val data: String? = intent.dataString
flutterEngine?.dartExecutor?.binaryMessenger?.let {
MethodChannel(it, CHANNEL)
.invokeMethod("onDeepLink", data)
}
}
}
6 changes: 5 additions & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2123B31439D2BCC6D361E8DD /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
2A4BDFD88F11D19FFF7D5371 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
285419062D10925E00F56D85 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
393850DC3621A36CF4AD6477 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -138,7 +139,6 @@
2123B31439D2BCC6D361E8DD /* Pods-RunnerTests.release.xcconfig */,
EF51637AE1B35676F68DF4C3 /* Pods-RunnerTests.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -188,6 +188,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
285419062D10925E00F56D85 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -505,6 +506,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = AT4J799SCP;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -688,6 +690,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = AT4J799SCP;
ENABLE_BITCODE = NO;
Expand All @@ -711,6 +714,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = AT4J799SCP;
ENABLE_BITCODE = NO;
Expand Down
13 changes: 13 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@ import Flutter
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

override func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
let data = url.absoluteString
let controller = window?.rootViewController as! FlutterViewController
let channel = FlutterMethodChannel(name: "com.example.taskly/deeplink", binaryMessenger: controller.binaryMessenger)

channel.invokeMethod("onDeepLink", arguments: data)
return true
}
}
11 changes: 11 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>taskly</string>
</array>
<key>CFBundleURLName</key>
<string>com.example.taskly</string>
</dict>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
10 changes: 10 additions & 0 deletions ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:taskly.com</string>
</array>
</dict>
</plist>
6 changes: 3 additions & 3 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ String completedAfterDeadline(int daysDiff) =>
String completeTaskWithNoDeadline(String task) => "completed $task";
scoreReducedForTask(String task) => "Score reduced for $task";


//suggestions
final List<String> suggestions = [
'Grocery shopping',
Expand Down Expand Up @@ -120,13 +119,14 @@ String stayFocused(int min) => "Stay focused for $min minutes";
String relax(int min) => "Relax for $min minutes";

//Meditation Completion
String ExtraMeditation(int selectedMinutes, int extraSeconds) =>
String extraMeditation(int selectedMinutes, int extraSeconds) =>
"Great job! You meditated for $selectedMinutes minutes and $extraSeconds extra seconds";
String MeditationComplete(int minutesMeditated, int secondsMeditated) =>
String meditationComplete(int minutesMeditated, int secondsMeditated) =>
"Session ended. You meditated for $minutesMeditated minutes and $secondsMeditated seconds";

String MeditationCompleteKudos (int minute) =>"Complete a $minute minute meditation session";
String MeditationCompleteKudosExtra (int minute) =>"$minute minutes of extra meditation.";
String MeditationCompleteKudosLess (int minute) =>"$minute minutes of meditation missed.";

String AskDependencyCompletion = "Complete the dependency first!";
String meditationEndedTooSoon() => "Oh no! You stopped meditating too quickly!";
9 changes: 8 additions & 1 deletion lib/enums/taskoptions.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
// Enum to represent options in the menu
enum TaskOption { deleteAll,showKudos,launchMeditationScreen,toggleTipVisibility,exportToCSV }
enum TaskOption {
deleteSelected,
deleteAll,
showKudos,
launchMeditationScreen,
toggleTipVisibility,
exportToCSV,
}
18 changes: 14 additions & 4 deletions lib/models/task.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

class Task {
String id;
String title;
String description;
bool isCompleted;
Expand All @@ -20,9 +21,10 @@ class Task {
this.hasDeadline = false,
this.color = Colors.blue,
this.recurringDays,
this.dependency})

: deadline = deadline ?? DateTime.now();
this.dependency,
String? id})
: deadline = deadline ?? DateTime.now(),
id = id ?? DateTime.now().microsecondsSinceEpoch.toString();

// Convert a Task object to JSON
Map<String, dynamic> toJson() {
Expand All @@ -35,6 +37,7 @@ class Task {
'dependency': dependency?.toJson(),
'recurringDays': recurringDays,
'color': color.value,
'id': id,
};
}

Expand All @@ -46,9 +49,11 @@ class Task {
isCompleted: json['isCompleted'],
deadline: DateTime.parse(json['deadline']),
hasDeadline: json['hasDeadline'],
dependency: json['dependency'] != null ? Task.fromJson(json['dependency']) : null,
dependency:
json['dependency'] != null ? Task.fromJson(json['dependency']) : null,
recurringDays: json['recurringDays'],
color: Color(json['color']),
id: json['id'],
);
}

Expand All @@ -63,4 +68,9 @@ class Task {
return;
}
}

@override
String toString() {
return 'Task(id: $id, title: $title, description: $description, isCompleted: $isCompleted, deadline: $deadline, hasDeadline: $hasDeadline)';
}
}
Loading

0 comments on commit f13ef5c

Please sign in to comment.