Skip to content

sibilrahman/tasky-discontinued

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tasky(Todo Master) - Flutter TODO App

A beautiful, feature-rich TODO application built with Flutter, featuring a modern UI design, local database storage, and scalable architecture ready for cloud integration.

🌟 Features

  • Modern UI Design: Beautiful, animated interface with smooth transitions
  • User Authentication: Local user creation and profile management
  • Category Management: Organize tasks by customizable categories
  • Task Management: Create, edit, complete, and delete tasks
  • Date Tracking: Due dates and calendar integration
  • Progress Tracking: Visual progress charts and statistics
  • Consistent Data: SQLite database with Drift ORM
  • Scalable Architecture: Ready for cloud integration (Firebase, Supabase, etc.)

πŸ“± Screenshots

The app features a clean, modern design with:

  • Animated side drawer navigation
  • Category-based task organization
  • Beautiful color-coded categories
  • Intuitive task completion interface
  • Progress tracking with visual charts

πŸ—οΈ Architecture

State Management

  • Provider: For reactive state management across the app
  • Repository Pattern: Clean separation of data layer

Database

  • Drift: Type-safe SQL database access
  • SQLite: Local database storage
  • Migration Ready: Prepared for cloud database integration

Project Structure

lib/
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ database.dart           # Main database configuration
β”‚   β”œβ”€β”€ tables/                 # Database table definitions
β”‚   └── database_exception.dart # Custom exception handling
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ user.dart              # User model
β”‚   β”œβ”€β”€ todo.dart              # Todo model
β”‚   └── category.dart          # Category model
β”œβ”€β”€ providers/
β”‚   β”œβ”€β”€ auth_provider.dart     # Authentication logic
β”‚   β”œβ”€β”€ todo_provider.dart     # Todo management
β”‚   └── category_provider.dart # Category management
β”œβ”€β”€ screens/
β”‚   β”œβ”€β”€ auth/                  # Authentication screens
β”‚   β”œβ”€β”€ widgets/               # Reusable UI components
β”‚   β”œβ”€β”€ home_screen.dart       # Main dashboard
β”‚   β”œβ”€β”€ add_todo_screen.dart   # Task creation
β”‚   β”œβ”€β”€ category_detail_screen.dart
β”‚   └── settings_screen.dart
└── utils/
    β”œβ”€β”€ colors.dart            # App color scheme
    β”œβ”€β”€ app_constants.dart     # Application constants
    └── date_utils.dart        # Date utilities

πŸš€ Getting Started

Prerequisites

  • Flutter SDK (>=3.0.0)
  • Dart SDK
  • Android Studio / VS Code
  • Android/iOS device or emulator

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd todo_app
  2. Install dependencies

    flutter pub get
  3. Generate database code

    flutter packages pub run build_runner build
  4. Run the app

    flutter run

Build Commands

# Clean and get dependencies
flutter clean && flutter pub get

# Generate database files
flutter packages pub run build_runner build --delete-conflicting-outputs

# Build APK
flutter build apk --release

# Build iOS
flutter build ios --release

πŸ”§ Configuration

Database Setup

The app uses Drift with SQLite for local storage. The database is automatically initialized on first run with default categories.

Adding New Categories

Default categories are defined in lib/utils/app_constants.dart. To add new categories:

static const List<Map<String, dynamic>> defaultCategories = [
  {
    'name': 'Your Category',
    'color': '0xFF2196F3',
    'icon': '59404', // MaterialIcons code point
  },
];

🌐 Cloud Integration Ready

The app is architected for easy cloud integration:

Firebase Integration

  1. Add Firebase configuration files
  2. Update providers to use Firebase Auth
  3. Replace Drift tables with Firestore collections
  4. Add real-time listeners

Supabase Integration

  1. Add Supabase configuration
  2. Update auth provider with Supabase Auth
  3. Replace local database with Supabase tables
  4. Add real-time subscriptions

API Integration

The repository pattern makes it easy to add REST API support:

  • Update providers to call API endpoints
  • Add network error handling
  • Implement offline-first architecture

🎨 Customization

Colors

Update lib/utils/colors.dart to customize the app's color scheme:

class AppColors {
  static const Color kGradientStart = Color(0xFFF92B7B);
  static const Color kGradientEnd = Color(0xFF882BF9);
  // Add your custom colors...
}

Fonts

The app uses Google Fonts (Poppins). To change fonts:

  1. Update pubspec.yaml with new Google Fonts
  2. Modify the theme in main.dart

πŸ“¦ Dependencies

Core Dependencies

  • flutter: Flutter SDK
  • provider: State management
  • drift: Database ORM
  • path_provider: File system paths
  • drift_flutter: Flutter-specific Drift integration

UI Dependencies

  • flutter_zoom_drawer: Animated side drawer
  • google_fonts: Typography
  • intl: Internationalization and date formatting

Development Dependencies

  • drift_dev: Code generation for database
  • build_runner: Code generation runner
  • flutter_lints: Linting rules

πŸ§ͺ Testing

Running Tests

# Run all tests
flutter test

# Run with coverage
flutter test --coverage

Test Structure

test/
β”œβ”€β”€ unit/
β”‚   β”œβ”€β”€ providers/
β”‚   β”œβ”€β”€ models/
β”‚   └── utils/
β”œβ”€β”€ widget/
β”‚   └── screens/
└── integration/
    └── app_test.dart

πŸš€ Production Deployment

Android

  1. Configure signing

    # Generate keystore
    keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
  2. Update android/app/build.gradle

    android {
        signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
                storePassword keystoreProperties['storePassword']
            }
        }
    }
  3. Build release APK

    flutter build apk --release
    flutter build appbundle --release

iOS

  1. Configure signing in Xcode
  2. Build release
    flutter build ios --release

πŸ”„ Migration Guide (Local to Cloud)

Step 1: Backup Current Data

// Export existing data before migration
Future<Map<String, dynamic>> exportData() async {
  final todos = await database.select(database.todos).get();
  final categories = await database.select(database.categories).get();
  final users = await database.select(database.users).get();
  
  return {
    'todos': todos.map((e) => e.toJson()).toList(),
    'categories': categories.map((e) => e.toJson()).toList(),
    'users': users.map((e) => e.toJson()).toList(),
  };
}

Step 2: Update Providers

// Example: Firebase integration
class TodoProviderCloud extends ChangeNotifier {
  final FirebaseFirestore _firestore = FirebaseFirestore.instance;
  
  Future<void> addTodo(Todo todo) async {
    await _firestore.collection('todos').add(todo.toJson());
  }
  
  Stream<List<Todo>> getTodos() {
    return _firestore.collection('todos')
        .snapshots()
        .map((snapshot) => snapshot.docs
            .map((doc) => Todo.fromJson(doc.data()))
            .toList());
  }
}

Step 3: Update Models

// Add cloud-friendly methods to models
class Todo {
  // existing code...
  
  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'title': title,
      'dueDate': dueDate.toIso8601String(),
      'categoryId': categoryId,
      'isCompleted': isCompleted,
    };
  }
  
  factory Todo.fromJson(Map<String, dynamic> json) {
    return Todo(
      id: json['id'],
      title: json['title'],
      dueDate: DateTime.parse(json['dueDate']),
      categoryId: json['categoryId'],
      isCompleted: json['isCompleted'] ?? false,
    );
  }
}

πŸ› Troubleshooting

Common Issues

  1. Database generation fails

    flutter packages pub run build_runner clean
    flutter packages pub run build_runner build --delete-conflicting-outputs
  2. Import errors after generation

    • Check that all imports in database files are correct
    • Ensure models are properly exported
    • Run flutter clean and flutter pub get
  3. Provider not updating UI

    • Ensure notifyListeners() is called after state changes
    • Check that widgets are wrapped with Consumer or use context.watch()
  4. Date formatting issues

    • Add intl dependency for proper date formatting
    • Use DateFormat for consistent date display

Performance Optimization

  1. Database Queries

    // Use indexed queries
    Future<List<Todo>> getTodaysTodos() async {
      final today = DateTime.now();
      return await (select(todos)
        ..where((t) => t.dueDate.isBiggerOrEqualValue(today))
        ..orderBy([(t) => OrderingTerm.asc(t.dueDate)]))
        .get();
    }
  2. Widget Rebuilds

    // Use Selector for specific property listening
    Selector<TodoProvider, int>(
      selector: (context, provider) => provider.todayTodos.length,
      builder: (context, count, child) {
        return Text('$count tasks today');
      },
    )

πŸ“š Additional Resources

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Flutter team for the amazing framework
  • Material Design for the design system
  • Drift team for the excellent database ORM
  • All contributors and testers

Happy Coding! πŸš€

For questions or support, please open an issue in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published