WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
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
41 changes: 41 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Code of Conduct

## Our Commitment
At Cooketh Flow, we are committed to fostering an inclusive, welcoming, and respectful community for all contributors, users, and participants. We expect everyone engaging with the project to uphold these values to create a positive environment.

## Who This Applies To
This Code of Conduct applies to all community members, including but not limited to:
- Project maintainers
- Contributors
- Users
- Community members in discussions, events, and online spaces

## Expected Behavior
To ensure a respectful and inclusive environment, we expect all participants to:
- *Be Respectful*: Treat others with kindness, professionalism, and empathy.
- *Be Inclusive*: Welcome and respect people of all backgrounds and identities.
- *Collaborate Openly*: Engage in constructive discussions and offer helpful feedback.
- *Respect Differences*: Understand that people have diverse opinions and experiences.
- *Give Credit*: Properly attribute contributions and ideas.

## Unacceptable Behavior
The following behaviors are considered unacceptable within our community:
- Harassment, discrimination, or hate speech of any kind.
- Personal attacks, insults, or derogatory comments.
- Spamming, trolling, or intentionally disrupting discussions.
- Publishing private or sensitive information without consent.
- Any conduct that violates GitHub’s [Community Guidelines](https://docs.github.com/en/site-policy/github-terms/github-community-guidelines).

## Reporting Violations
If you experience or witness any violation of this Code of Conduct, please report it by contacting the project maintainers at [contact email or GitHub issues]. All reports will be handled confidentially and reviewed promptly.

## Enforcement
Violations of this Code of Conduct may result in:
- A warning from project maintainers.
- Temporary or permanent removal from the project or community spaces.
- Reporting to relevant platforms or authorities if necessary.

## Acknowledgment
This Code of Conduct is inspired by and adapted from the [Contributor Covenant](https://www.contributor-covenant.org/).

By participating in Cooketh Flow, you agree to abide by these guidelines and help create a positive and inclusive community.
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# CONTRIBUTING.md

# Contributing to Cooketh Flow

Thank you for your interest in contributing to **Cooketh Flow**! 🚀 We welcome contributions of all kinds, including code, documentation, bug reports, and feature suggestions.

## How to Contribute

1. **Fork the Repository**: Click the `Fork` button at the top of the repository page to create your own copy.
2. **Clone Your Fork**: Clone the repository to your local machine:
```sh
git clone https://github.com/your-username/Cooketh-Flow.git
cd Cooketh-Flow
```
3. **Create a Branch**: Create a new branch for your changes from the `rewrite` branch:
```sh
git checkout rewrite
git checkout -b feature-branch
```
4. **Make Changes**: Implement your changes and ensure they follow the project's coding guidelines. **Do not touch or tamper with the `v0.1.0` branch**, as it is used for deployment.
5. **Test Your Changes**: Run tests (if applicable) to verify that everything works correctly.
6. **Commit Your Changes**: Commit with a clear message describing your changes:
```sh
git commit -m "Add feature XYZ"
```
7. **Push Your Changes**: Push your branch to your forked repository:
```sh
git push origin feature-branch
```
8. **Open a Pull Request**: Go to the original repository and open a Pull Request (PR) targeting the `rewrite` branch. **Ensure your PR is directed to the `rewrite` branch, not `v0.1.0`.**

## Code Guidelines

- Follow consistent formatting and linting rules.
- Write clear and concise commit messages.
- Document your code where necessary.
- Ensure your changes do not break existing functionality.

## Reporting Issues

If you find a bug or have a feature request, please [open an issue](https://github.com/CookethOrg/Cooketh-Flow/issues) with a clear description and any relevant details.

## Community Guidelines

- Be respectful and inclusive.
- Follow the [Code of Conduct](CODE_OF_CONDUCT.md).
- Help others by reviewing and discussing pull requests.

## Governance
[Cooketh Flow](https://github.com/CookethOrg/Cooketh-Flow) is led by [Subroto Banerjee](https://github.com/TeeWrath) as BDFL, who makes final decisions on the project’s direction. Contributors are encouraged to share ideas via GitHub Issues, but the BDFL reserves the right to guide the roadmap.

## License

By contributing, you agree that your contributions will be licensed under the same license as Cooketh Flow.

---
We appreciate your contributions! ❤️ Happy coding!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Cooketh Org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 1 addition & 6 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false,
routerConfig: AppRouteConfig.returnRouter(),
localizationsDelegates: const [
// GlobalMaterialLocalizations.delegate,
// GlobalWidgetsLocalizations.delegate,
// GlobalCupertinoLocalizations.delegate,
FlutterQuillLocalizations.delegate, // REQUIRED for flutter_quill
],
// NEW: Define supported locales (at least English for now)
supportedLocales: const [
Locale('en', ''), // English
// Add other locales your app supports if needed, e.g., Locale('es', '') for Spanish
Locale('en', ''), // English for now
],
);
},
Expand Down
22 changes: 12 additions & 10 deletions lib/core/helpers/date_time_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ class DateTimeHelper {
String formatLastEdited(DateTime? lastEdited) {
if (lastEdited == null) return "Edited Just Now";
final now = DateTime.now();
final difference = now.difference(lastEdited);
final difference = now.difference(lastEdited);

if (difference.inDays > 0) {
return 'Edited ${difference.inDays} day${difference.inDays == 1 ? '' : 's'} ago';
} else if (difference.inHours > 0) {
return 'Edited ${difference.inHours} hour${difference.inHours == 1 ? '' : 's'} ago';
} else if (difference.inMinutes > 0) {
return 'Edited ${difference.inMinutes} minute${difference.inMinutes == 1 ? '' : 's'} ago';
} else {
return 'Edited just now';
}
if (difference.inDays > 0) {
return 'Edited ${difference.inDays} day${difference.inDays == 1 ? '' : 's'} ago';
} else if (difference.inHours > 0) {
return 'Edited ${difference.inHours} hour${difference.inHours == 1 ? '' : 's'} ago';
} else if (difference.inMinutes > 0) {
return 'Edited ${difference.inMinutes} minute${difference.inMinutes == 1 ? '' : 's'} ago';
} else if (difference.inSeconds > 0) {
return 'Edited ${difference.inSeconds} second${difference.inSeconds == 1 ? '' : 's'} ago';
} else {
return 'Edited just now';
}
}
}
4 changes: 2 additions & 2 deletions lib/core/helpers/input_validators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ String? validatePassword(String? value) {
return 'Password must contain at least one special character (., _, @, or #)';
}

// Optional: Check for common weak passwords
// Check for common weak passwords
if (value.contains(RegExp(r'(123456|password|qwerty|abc123)'))) {
return 'Password is too common or weak';
}
Expand All @@ -72,7 +72,7 @@ String? validateEmail(String? value) {
'Example: [email protected]';
}

// Optional: Disallow disposable emails
// Disallow disposable emails
if (value.endsWith('@tempmail.com') ||
value.endsWith('@mailinator.com')) {
return 'Disposable email addresses are not allowed';
Expand Down
3 changes: 1 addition & 2 deletions lib/core/helpers/responsive_layout.helper.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:cookethflow/core/utils/enums.dart';
import 'package:flutter/material.dart';

enum DeviceType { mobile, tab, desktop }

class ResponsiveLayoutHelper {
static const int mobileMaxWidth = 375;
static const int tabletMaxWidth = 720;
Expand Down
2 changes: 2 additions & 0 deletions lib/core/utils/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:phosphor_flutter/phosphor_flutter.dart';

enum ProviderState { inital, empty, loading, loaded, success, error }

enum DeviceType { mobile, tab, desktop }

enum NodeType {
note,
rectangle,
Expand Down
1 change: 1 addition & 0 deletions lib/features/auth/pages/login.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:cookethflow/core/helpers/responsive_layout.helper.dart';
import 'package:cookethflow/core/utils/enums.dart';
import 'package:cookethflow/features/auth/pages/desktop/login_desktop.dart';
import 'package:cookethflow/features/auth/pages/mobile/login_mobile.dart';
import 'package:cookethflow/features/auth/pages/tablet/login_tablet.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/features/auth/pages/signup.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:cookethflow/core/helpers/responsive_layout.helper.dart';
import 'package:cookethflow/core/utils/enums.dart';
import 'package:cookethflow/features/auth/pages/desktop/signup_desktop.dart';
import 'package:cookethflow/features/auth/pages/mobile/signup_mobile.dart';
import 'package:cookethflow/features/auth/pages/tablet/signup_tablet.dart';
Expand Down
5 changes: 3 additions & 2 deletions lib/features/auth/widgets/login_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:cookethflow/core/utils/enums.dart' as en;

class LoginForm extends StatelessWidget {
const LoginForm({super.key});
Expand All @@ -18,10 +19,10 @@ class LoginForm extends StatelessWidget {
Widget build(BuildContext context) {
final isMobile =
responsive_helper.ResponsiveLayoutHelper.getDeviceType(context) ==
responsive_helper.DeviceType.mobile;
en.DeviceType.mobile;
final isDesktop =
responsive_helper.ResponsiveLayoutHelper.getDeviceType(context) ==
responsive_helper.DeviceType.desktop;
en.DeviceType.desktop;

// Use a MultiProvider to listen to both AuthenticationProvider and SupabaseService
// SupabaseService's currentUser updates will trigger rebuilds related to auth state.
Expand Down
5 changes: 3 additions & 2 deletions lib/features/auth/widgets/signup_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:cookethflow/core/utils/enums.dart' as en;

class SignUpForm extends StatelessWidget {
const SignUpForm({super.key});
Expand All @@ -18,10 +19,10 @@ class SignUpForm extends StatelessWidget {
Widget build(BuildContext context) {
final isMobile =
responsive_helper.ResponsiveLayoutHelper.getDeviceType(context) ==
responsive_helper.DeviceType.mobile;
en.DeviceType.mobile;
final isDesktop =
responsive_helper.ResponsiveLayoutHelper.getDeviceType(context) ==
responsive_helper.DeviceType.desktop;
en.DeviceType.desktop;

return Consumer2<AuthenticationProvider, SupabaseService>(
// Consume both providers
Expand Down
7 changes: 4 additions & 3 deletions lib/features/dashboard/pages/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:cookethflow/features/dashboard/pages/mobile/dashboard_mobile.dar
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:cookethflow/core/utils/enums.dart' as en;

class DashboardPage extends StatelessWidget {
const DashboardPage({super.key});
Expand All @@ -14,13 +15,13 @@ class DashboardPage extends StatelessWidget {
Widget build(BuildContext context) {
Widget dashboardScreen;
switch (responsive_helper.ResponsiveLayoutHelper.getDeviceType(context)) {
case responsive_helper.DeviceType.desktop:
case en.DeviceType.desktop:
dashboardScreen = DashboardDesktop();
break;
case responsive_helper.DeviceType.tab:
case en.DeviceType.tab:
dashboardScreen = DashboardDesktop();
break;
case responsive_helper.DeviceType.mobile:
case en.DeviceType.mobile:
dashboardScreen = DashboardMobile();
break;
}
Expand Down
9 changes: 5 additions & 4 deletions lib/features/dashboard/pages/desktop/dashboard_desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh;
import 'package:cookethflow/core/utils/enums.dart' as en;

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

@override
Widget build(BuildContext context) {
rh.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
en.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
return Consumer2<DashboardProvider,SupabaseService>(
builder: (context, provider,supabaseprovider, child) {
return LayoutBuilder(
Expand All @@ -29,7 +30,7 @@ class DashboardDesktop extends StatelessWidget {
provider.isDrawerOpen
? constraints.maxHeight
: 0.185.sh,
width: deviceType == rh.DeviceType.desktop ? 0.24.sw : deviceType == rh.DeviceType.tab ? 0.257.sw : 600.w,
width: deviceType == en.DeviceType.desktop ? 0.24.sw : deviceType == en.DeviceType.tab ? 0.257.sw : 600.w,
child: const DashboardDrawer(),
),

Expand Down Expand Up @@ -108,7 +109,7 @@ class DashboardDesktop extends StatelessWidget {
),
);
}
rh.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
en.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
return GridView.builder(
shrinkWrap: true,
itemCount: displayedWorkspaces.length,
Expand All @@ -117,7 +118,7 @@ class DashboardDesktop extends StatelessWidget {
crossAxisCount: 3,
crossAxisSpacing: 20.w,
mainAxisSpacing: 20.h,
childAspectRatio: deviceType == rh.DeviceType.desktop ? 4.0/3 : 3.2/ 3,
childAspectRatio: deviceType == en.DeviceType.desktop ? 4.0/3 : 3.2/ 3,
),
itemBuilder: (context, index) {
final workspace = displayedWorkspaces[index];
Expand Down
5 changes: 3 additions & 2 deletions lib/features/dashboard/pages/mobile/dashboard_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';

import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh;
import 'package:cookethflow/core/utils/enums.dart' as en;

class DashboardMobile extends StatefulWidget {
const DashboardMobile({super.key});
Expand All @@ -21,7 +22,7 @@ class _DashboardMobileState extends State<DashboardMobile> {
bool is_Visible = false;
@override
Widget build(BuildContext context) {
rh.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
en.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context);
return Consumer2<DashboardProvider,SupabaseService>(
builder: (context, provider,suprovider,child) {
return LayoutBuilder(
Expand Down Expand Up @@ -71,7 +72,7 @@ class _DashboardMobileState extends State<DashboardMobile> {
duration: const Duration(milliseconds: 500),
height: provider.isDrawerOpen ? 0.8.sh : 0.185.sh,
width:
deviceType == rh.DeviceType.desktop ? 400.w : 0.70.sw,
deviceType == en.DeviceType.desktop ? 400.w : 0.70.sw,
child: const DashboardDrawerMob(),
),
),
Expand Down
Loading