Skip to content

Japanese Kanji words with Flutter TTS for good pronunciation. Great for personal learning!!

Notifications You must be signed in to change notification settings

UJKC/Japanese-Assistant

Repository files navigation

🇯🇵 Japanese Flashcard App

A minimalist, offline-first flashcard app built with Flutter to help users learn Japanese vocabulary daily. Designed for simplicity, modularity, and future extensibility (e.g., voice playback, user-added words, score tracking, notifications).


📱 Features

  • ✅ Quiz mode to test vocabulary
  • ✅ Offline support with local storage
  • ✅ Preloaded vocabulary set
  • ✅ User-added custom words
  • ✅ Daily notification reminders to study
  • ✅ Future-ready voice playback (TTS)
  • ✅ Future score tracking
  • 🚫 No login, no cloud sync

🧱 Tech Stack

  • Flutter: UI and app logic
  • Hive: Local storage for flashcards and user data
  • flutter_tts: Text-to-speech for Japanese pronunciation
  • flutter_local_notifications: Daily reminders

📂 Project File Structure Summary

The structure follows typical conventions, separating code into different logical directories:

🧩 Top-Level Folders/Files

These folders are standard for a Flutter/Dart project and often relate to build systems, platform-specific code, and project configuration.

Folder/File Purpose
.dart_tool/ Files generated by the Dart tooling.
android/ Android-specific code and resources.
assets/ Resources like images, fonts, or data files.
build/ Compiled application output files.
ios/ iOS/macOS-specific code and resources.
lib/ Primary application source code (most important).
linux/, macos/, web/, windows/ Platform-specific code for desktop and web.
test/ Unit and widget tests.
pubspec.yaml Project dependencies, metadata, and assets configuration.
main.dart The application's entry point.

💻 lib/ (Application Source Code) Structure

The core logic is within the lib folder, which is well-organized into modules, models, screens, services, and widgets.

📝 lib/data/models/

This directory holds the data models for the application, defining the structure of the data used in the app (like objects received from an API or database).

  • flashcard.dart, flashcard.g.dart
  • lesson.dart, lesson.g.dart
  • quiz_result.dart, quiz_result.g.dart
  • unit.dart, unit.g.dart

The .g.dart files suggest the use of code generation (like the json_serializable package) for tasks such as JSON serialization.

🖥️ lib/screens/

This is where the main user interfaces (UIs) or pages of the app are defined. It's further organized into sub-folders based on feature/functionality:

  • Custom_Quiz/: Code for the custom quiz creation and playing screens.
    • custom_quiz_question_screen.dart
    • custom_quiz_screen.dart
    • custom_quiz_select_screen.dart
  • Flashcard/: Code related to the flashcard viewing and management screens.
    • flashcard_main_lesson_screen.dart
    • flashcard_main_screen.dart
  • Quiz/: Code for the standard quiz flow.
    • quiz_history_screen.dart
    • quiz_question.dart
    • quiz_result_screen.dart
  • Top-Level Screens:
    • all_updates_screen.dart
    • credits_screen.dart
    • future_updates_screen.dart
    • home_screen.dart

🛠️ lib/services/

Contains classes that implement application services or business logic, often dealing with background tasks or platform features.

  • notification_service.dart

🖼️ lib/widgets/

Contains reusable UI components that are smaller than a full screen.

  • flashcard_item.dart (A component to display a single flashcard within a list.)

🗂️ Data Models

Flashcard

class Flashcard {
  final String japanese;
  final String meaning;
  final String pronunciation;
  bool isLearned;
}

UserWord

class UserWord {
  final String japanese;
  final String meaning;
  final String pronunciation;
}

🔔 Daily Notification Reminder

To enable daily reminders:

dependencies:
  flutter_local_notifications: ^16.1.0

Example setup:

final FlutterLocalNotificationsPlugin notificationsPlugin = FlutterLocalNotificationsPlugin();

Future<void> schedulePeriodicNotification({
    required String title,
    required String body,
    required RepeatInterval interval,
  }) async {
    const AndroidNotificationDetails androidDetails =
        AndroidNotificationDetails(
          'periodic_channel',
          'Periodic Notifications',
          channelDescription: 'Periodic reminders for flashcard learning',
          importance: Importance.high,
          priority: Priority.high,
        );

    const NotificationDetails notificationDetails = NotificationDetails(
      android: androidDetails,
    );

    await flutterLocalNotificationsPlugin.periodicallyShow(
      0,
      title,
      body,
      interval, // e.g., RepeatInterval.daily
      notificationDetails,
      androidScheduleMode: AndroidScheduleMode.inexact,
    );
  }

🔊 Voice Playback (Future Feature)

dependencies:
  flutter_tts: ^3.6.3
final FlutterTts flutterTts = FlutterTts();
await flutterTts.setLanguage("ja-JP");
await flutterTts.speak("こんにちは");

🛠️ How to Run

  1. Clone the repo
  2. Run flutter pub get
  3. Run flutter run on your device/emulator

📌 Future Plans

  • 🔊 Flutter tts listening lesson tests
  • 🧠 Paragraph test
  • 📤 Export/import user words
  • 🌙 Dark mode