commit 27338de5f62b33a4f34546b1ec8c3b3e6ad356d2 Author: mplorentz Date: Mon Apr 20 14:39:49 2026 -0400 One-shot opus diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3820a95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..2d88468 --- /dev/null +++ b/.metadata @@ -0,0 +1,36 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "ac4e799d237041cf905519190471f657b657155a" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: ac4e799d237041cf905519190471f657b657155a + base_revision: ac4e799d237041cf905519190471f657b657155a + - platform: android + create_revision: ac4e799d237041cf905519190471f657b657155a + base_revision: ac4e799d237041cf905519190471f657b657155a + - platform: ios + create_revision: ac4e799d237041cf905519190471f657b657155a + base_revision: ac4e799d237041cf905519190471f657b657155a + - platform: macos + create_revision: ac4e799d237041cf905519190471f657b657155a + base_revision: ac4e799d237041cf905519190471f657b657155a + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..5e1073a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,122 @@ +# Agent Guide + +Preferences for AI agents working on this repository. Follow these strictly. + +## Architecture + +### State management: Riverpod only + +- Use Riverpod for all state management and dependency injection. +- The app is wrapped in `ProviderScope` at the root (`lib/main.dart`). +- Use the right provider type: + - `Provider` for services. + - `FutureProvider` for async loads. + - `StreamProvider` for reactive streams. + - `StreamProvider.family` for parameterized streams. + - `StateNotifierProvider` for mutable, persisted state (see `trackerServiceProvider`). + +### Services (business logic) + +- All services are instance classes — never static. +- Accept dependencies via the constructor. +- Always expose via a `Provider`. + +```dart +final myServiceProvider = Provider((ref) { + return MyService(ref.read(repositoryProvider)); +}); + +class MyService { + final MyRepository _repository; + MyService(this._repository); +} +``` + +### Repositories (data access) + +Create a repository only when data access meets one of: + +- Complex caching (in-memory + persistence). +- Stream management for reactive updates. +- Multiple specialized queries. +- Multiple consumers. +- Would otherwise be 100+ lines. + +Otherwise, keep simple CRUD inline in the service. Never create thin repository +wrappers that just delegate to a service. + +### Breaking circular dependencies + +When two providers reference each other, add explicit types to break inference +cycles: + +```dart +final Provider serviceAProvider = Provider((ref) { + final ServiceB b = ref.read(serviceBProvider); + return ServiceA(b); +}); +``` + +## Code Quality (mandatory) + +After every change, run in this order: + +1. Codegen (if `@freezed` or `@GenerateMocks` changed): + `dart run build_runner build --delete-conflicting-outputs` +2. Format (always, especially after codegen): `dart format .` +3. Lints: use the ReadLints tool on modified files — must be clean. +4. Analyzer: `flutter analyze` — must show "No issues found!". +5. Tests: `flutter test` — 0 failures. +6. Goldens (if UI changed and golden test exists): + `flutter test --update-goldens` and commit PNGs alongside the UI change. + +Never commit unformatted code, lints, analyzer warnings, or UI changes without +corresponding golden updates. Never tell the user "it's clean" without running +the checks. + +## Code Style + +- Prefer `const` constructors everywhere possible. +- Use `final` for locals by default. +- Avoid `dynamic` — prefer explicit types. +- Use Freezed for immutable data models; avoid hand-rolled `==`/`hashCode`. +- No narrative comments. Don't write `// increment the counter`. Only comment + non-obvious intent, trade-offs, or constraints. +- Keep files focused; mirror `lib/` structure in `test/`. + +## Testing + +- Mock with `mockito` + `@GenerateMocks` + `build_runner`. +- Unit tests for services and models; golden tests for screens and widgets. +- Golden tests must run on macOS for consistent font rendering. +- Load bundled fonts in `test/flutter_test_config.dart`. +- Never skip failing tests to make CI pass — fix the root cause. + +## UI + +- Define a single theme in `lib/widgets/theme.dart` and reference design tokens + (`AppTokens`) — no inline magic colors. +- Keep `DESIGN_GUIDE.md` documenting color palette, typography, spacing, and + component patterns. Reference it before any UI work. +- Build reusable widgets (`TrackerTile`, `BookTile`, `ProgressBar`, etc.) + instead of repeating styling. +- Support both light and dark modes. +- Use `ListView.separated` for lists with dividers. + +## Commits & PRs + +- Commit messages focus on _why_, not _what_. +- Every commit on an open PR must be production-ready (format + analyze + test + + lints + goldens). +- Commit generated files (freezed, mocks, goldens) alongside the source + changes that produced them. +- Don't open/push a PR until the full checklist passes. + +## General Agent Behavior + +- Read `README.md` and this file before starting work. +- Use todos for multi-step tasks; mark them complete promptly. +- Don't hide verification failures — report honestly and fix. +- Prefer editing existing files over creating new ones. +- Never create docs (`*.md`) proactively unless asked. +- Use specialized file tools (Read/Edit/Write) instead of `cat`/`sed`/`echo`. diff --git a/DESIGN_GUIDE.md b/DESIGN_GUIDE.md new file mode 100644 index 0000000..bce4230 --- /dev/null +++ b/DESIGN_GUIDE.md @@ -0,0 +1,113 @@ +# Design Guide + +All UI code must reference tokens from `lib/widgets/theme.dart` (`AppTokens`) +rather than hard-coding values. Any new token belongs here first. + +## Color + +### Seed + +- `AppTokens.seed` = `#3F51B5` (indigo). + Both the light and dark schemes are derived from this seed via + `ColorScheme.fromSeed`. + +### Tracker palette + +Each tracker chooses an accent color from `AppTokens.trackerPalette`. The +accent is applied to progress bars, the checked-chapter fill, and the header +stats. The palette (10 colors) is tuned to remain legible on both light and +dark surfaces: + +| Color | Hex | +| ----- | --------- | +| Indigo | `#3F51B5` | +| Blue | `#1E88E5` | +| Teal | `#00897B` | +| Green | `#43A047` | +| Amber | `#FDD835` | +| Orange | `#FB8C00` | +| Red | `#E53935` | +| Pink | `#D81B60` | +| Purple | `#8E24AA` | +| Brown | `#6D4C41` | + +### Usage rules + +- **Never** use raw `Color(0x…)` or `Colors.red` outside of `theme.dart` or + the palette constant. Pull from `Theme.of(context).colorScheme` or pass the + tracker accent through. +- Inactive surfaces (unread chapters, progress bar track) use + `colorScheme.surfaceContainerHigh` / `surfaceContainerHighest`. +- Destructive actions use `colorScheme.error`. + +## Typography + +Use the Material 3 text theme. Reach for: + +- `displaySmall` — hero progress percentages on the Stats screen. +- `headlineMedium` — progress percentage on the Tracker header. +- `titleLarge` / `titleMedium` — screen-level and card titles. +- `titleSmall` — list-item titles (e.g. book names). +- `bodyMedium` — body copy, stat values. +- `labelMedium` / `labelSmall` — compact counters, section metadata. + +Weight overrides are allowed (`FontWeight.w500` / `w600` / `w700`) but font +family and sizes must come from the theme. + +## Spacing + +8pt grid, defined in `AppTokens`: + +| Token | Value | +| ------------ | ----- | +| `spaceXS` | 4 | +| `spaceS` | 8 | +| `spaceM` | 12 | +| `spaceL` | 16 | +| `spaceXL` | 24 | +| `spaceXXL` | 32 | + +Screen padding defaults to `spaceL`. Inner card padding defaults to `spaceL`. +Gaps between related widgets use `spaceS`–`spaceM`; gaps between distinct +sections use `spaceXL`. + +## Radius + +| Token | Value | +| ---------- | ----- | +| `radiusS` | 8 | +| `radiusM` | 12 | +| `radiusL` | 16 | + +Cards: `radiusM`. Chapter cells: `radiusM`. Pill chips: `radiusL`. Buttons: +`radiusS`. + +## Components + +- **`TrackerTile`** — card on the home list. Shows dot + name + percent pill + + progress bar. +- **`BookTile`** — list row on the Tracker screen. Shows leading status badge, + book name, inline progress bar, and `read / total` counter. +- **`ProgressBar`** — thin rounded linear indicator with a tracker accent + color on top of the `surfaceContainerHighest` track. +- **`ProgressPill`** — percent chip tinted with the accent color at 15% alpha. +- **Chapter cell** (`book_screen.dart`) — square tile, accent-filled when + read; tap toggles. + +## Layout conventions + +- Home, Tracker, and Stats screens each own a single `Scaffold` with a + contextual `AppBar`. +- Long scrollable lists always use `ListView.separated` with a thin + `outlineVariant` divider. Books within a testament are grouped under a + `_SectionHeader`. +- Destructive confirmations (delete, reset) use a standard `AlertDialog` with + an error-tinted confirm button. + +## Theming + +`AppTheme.light()` / `AppTheme.dark()` build from a Material 3 +`ColorScheme.fromSeed`. Component themes (`AppBarTheme`, `CardThemeData`, +`ListTileThemeData`, `DividerThemeData`, `FilledButtonThemeData`, +`ProgressIndicatorThemeData`) are centralized so individual widgets stay +declarative. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5f92f4 --- /dev/null +++ b/README.md @@ -0,0 +1,64 @@ +# Bible Tracker + +A Flutter app for tracking your Bible reading progress at your own pace. +Inspired by the "My Bible Tracker" Android app. + +## Features + +- Multiple trackers with custom names and colors (e.g. one per reading plan). +- Check off chapters as you read them — no schedules, no deadlines. +- Overall progress percentage, per-testament breakdowns, per-book progress. +- Start date is recorded automatically; see days reading in Stats. +- Long-press a tracker on the home screen to rename, recolor, reset, or delete. +- Mark an entire book as read (or clear) from the book's screen. +- Light and dark modes that follow system settings. +- Local-only data (SharedPreferences); no accounts, no network calls. + +## Project layout + +``` +lib/ + data/bible.dart # 66-book Bible structure (names, chapter counts) + models/tracker.dart # Freezed Tracker model (+ generated files) + services/ + progress.dart # Pure progress calculations + tracker_service.dart # StateNotifier managing trackers + tracker_storage.dart # SharedPreferences-backed repository + widgets/ + theme.dart # AppTokens + AppTheme (light/dark) + progress_bar.dart + tracker_tile.dart + book_tile.dart + screens/ + home_screen.dart + create_tracker_screen.dart + tracker_screen.dart + book_screen.dart + stats_screen.dart + main.dart +test/ # Mirrors lib/ layout +DESIGN_GUIDE.md # Colors, typography, spacing, components +AGENTS.md # Contributor / AI-agent guide +``` + +## Getting started + +```bash +flutter pub get +dart run build_runner build --delete-conflicting-outputs +flutter run +``` + +## Verification checklist + +Run after every change: + +```bash +dart run build_runner build --delete-conflicting-outputs # if codegen changed +dart format . +flutter analyze +flutter test +``` + +Never commit unformatted code, analyzer warnings, or a broken test suite. +See `AGENTS.md` for full contribution rules. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..5b50271 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,14 @@ +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + - "**/*.mocks.dart" + +linter: + rules: + - prefer_const_constructors + - prefer_const_declarations + - prefer_final_locals + - unawaited_futures diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..88a9831 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.matt.bible_tracker" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.matt.bible_tracker" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ada5211 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/matt/bible_tracker/MainActivity.kt b/android/app/src/main/kotlin/com/matt/bible_tracker/MainActivity.kt new file mode 100644 index 0000000..ff32aa0 --- /dev/null +++ b/android/app/src/main/kotlin/com/matt/bible_tracker/MainActivity.kt @@ -0,0 +1,5 @@ +package com.matt.bible_tracker + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..f018a61 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ac3b479 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..fb605bc --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.9.1" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..1dc6cf7 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 13.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..620e46e --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.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! + + 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 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d728586 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,619 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S2FZ788KSW; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S2FZ788KSW; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S2FZ788KSW; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..e3773d4 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..6266644 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..de20cdc --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Bible Tracker + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + bible_tracker + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/data/bible.dart b/lib/data/bible.dart new file mode 100644 index 0000000..d9913e2 --- /dev/null +++ b/lib/data/bible.dart @@ -0,0 +1,283 @@ +enum Testament { old, newT } + +class Book { + const Book({ + required this.index, + required this.name, + required this.chapterCount, + required this.testament, + }); + + final int index; + final String name; + final int chapterCount; + final Testament testament; +} + +class Bible { + const Bible._(); + + static const List books = [ + Book(index: 0, name: 'Genesis', chapterCount: 50, testament: Testament.old), + Book(index: 1, name: 'Exodus', chapterCount: 40, testament: Testament.old), + Book( + index: 2, + name: 'Leviticus', + chapterCount: 27, + testament: Testament.old, + ), + Book(index: 3, name: 'Numbers', chapterCount: 36, testament: Testament.old), + Book( + index: 4, + name: 'Deuteronomy', + chapterCount: 34, + testament: Testament.old, + ), + Book(index: 5, name: 'Joshua', chapterCount: 24, testament: Testament.old), + Book(index: 6, name: 'Judges', chapterCount: 21, testament: Testament.old), + Book(index: 7, name: 'Ruth', chapterCount: 4, testament: Testament.old), + Book( + index: 8, + name: '1 Samuel', + chapterCount: 31, + testament: Testament.old, + ), + Book( + index: 9, + name: '2 Samuel', + chapterCount: 24, + testament: Testament.old, + ), + Book( + index: 10, + name: '1 Kings', + chapterCount: 22, + testament: Testament.old, + ), + Book( + index: 11, + name: '2 Kings', + chapterCount: 25, + testament: Testament.old, + ), + Book( + index: 12, + name: '1 Chronicles', + chapterCount: 29, + testament: Testament.old, + ), + Book( + index: 13, + name: '2 Chronicles', + chapterCount: 36, + testament: Testament.old, + ), + Book(index: 14, name: 'Ezra', chapterCount: 10, testament: Testament.old), + Book( + index: 15, + name: 'Nehemiah', + chapterCount: 13, + testament: Testament.old, + ), + Book(index: 16, name: 'Esther', chapterCount: 10, testament: Testament.old), + Book(index: 17, name: 'Job', chapterCount: 42, testament: Testament.old), + Book( + index: 18, + name: 'Psalms', + chapterCount: 150, + testament: Testament.old, + ), + Book( + index: 19, + name: 'Proverbs', + chapterCount: 31, + testament: Testament.old, + ), + Book( + index: 20, + name: 'Ecclesiastes', + chapterCount: 12, + testament: Testament.old, + ), + Book( + index: 21, + name: 'Song of Solomon', + chapterCount: 8, + testament: Testament.old, + ), + Book(index: 22, name: 'Isaiah', chapterCount: 66, testament: Testament.old), + Book( + index: 23, + name: 'Jeremiah', + chapterCount: 52, + testament: Testament.old, + ), + Book( + index: 24, + name: 'Lamentations', + chapterCount: 5, + testament: Testament.old, + ), + Book( + index: 25, + name: 'Ezekiel', + chapterCount: 48, + testament: Testament.old, + ), + Book(index: 26, name: 'Daniel', chapterCount: 12, testament: Testament.old), + Book(index: 27, name: 'Hosea', chapterCount: 14, testament: Testament.old), + Book(index: 28, name: 'Joel', chapterCount: 3, testament: Testament.old), + Book(index: 29, name: 'Amos', chapterCount: 9, testament: Testament.old), + Book(index: 30, name: 'Obadiah', chapterCount: 1, testament: Testament.old), + Book(index: 31, name: 'Jonah', chapterCount: 4, testament: Testament.old), + Book(index: 32, name: 'Micah', chapterCount: 7, testament: Testament.old), + Book(index: 33, name: 'Nahum', chapterCount: 3, testament: Testament.old), + Book( + index: 34, + name: 'Habakkuk', + chapterCount: 3, + testament: Testament.old, + ), + Book( + index: 35, + name: 'Zephaniah', + chapterCount: 3, + testament: Testament.old, + ), + Book(index: 36, name: 'Haggai', chapterCount: 2, testament: Testament.old), + Book( + index: 37, + name: 'Zechariah', + chapterCount: 14, + testament: Testament.old, + ), + Book(index: 38, name: 'Malachi', chapterCount: 4, testament: Testament.old), + Book( + index: 39, + name: 'Matthew', + chapterCount: 28, + testament: Testament.newT, + ), + Book(index: 40, name: 'Mark', chapterCount: 16, testament: Testament.newT), + Book(index: 41, name: 'Luke', chapterCount: 24, testament: Testament.newT), + Book(index: 42, name: 'John', chapterCount: 21, testament: Testament.newT), + Book(index: 43, name: 'Acts', chapterCount: 28, testament: Testament.newT), + Book( + index: 44, + name: 'Romans', + chapterCount: 16, + testament: Testament.newT, + ), + Book( + index: 45, + name: '1 Corinthians', + chapterCount: 16, + testament: Testament.newT, + ), + Book( + index: 46, + name: '2 Corinthians', + chapterCount: 13, + testament: Testament.newT, + ), + Book( + index: 47, + name: 'Galatians', + chapterCount: 6, + testament: Testament.newT, + ), + Book( + index: 48, + name: 'Ephesians', + chapterCount: 6, + testament: Testament.newT, + ), + Book( + index: 49, + name: 'Philippians', + chapterCount: 4, + testament: Testament.newT, + ), + Book( + index: 50, + name: 'Colossians', + chapterCount: 4, + testament: Testament.newT, + ), + Book( + index: 51, + name: '1 Thessalonians', + chapterCount: 5, + testament: Testament.newT, + ), + Book( + index: 52, + name: '2 Thessalonians', + chapterCount: 3, + testament: Testament.newT, + ), + Book( + index: 53, + name: '1 Timothy', + chapterCount: 6, + testament: Testament.newT, + ), + Book( + index: 54, + name: '2 Timothy', + chapterCount: 4, + testament: Testament.newT, + ), + Book(index: 55, name: 'Titus', chapterCount: 3, testament: Testament.newT), + Book( + index: 56, + name: 'Philemon', + chapterCount: 1, + testament: Testament.newT, + ), + Book( + index: 57, + name: 'Hebrews', + chapterCount: 13, + testament: Testament.newT, + ), + Book(index: 58, name: 'James', chapterCount: 5, testament: Testament.newT), + Book( + index: 59, + name: '1 Peter', + chapterCount: 5, + testament: Testament.newT, + ), + Book( + index: 60, + name: '2 Peter', + chapterCount: 3, + testament: Testament.newT, + ), + Book(index: 61, name: '1 John', chapterCount: 5, testament: Testament.newT), + Book(index: 62, name: '2 John', chapterCount: 1, testament: Testament.newT), + Book(index: 63, name: '3 John', chapterCount: 1, testament: Testament.newT), + Book(index: 64, name: 'Jude', chapterCount: 1, testament: Testament.newT), + Book( + index: 65, + name: 'Revelation', + chapterCount: 22, + testament: Testament.newT, + ), + ]; + + static int get totalChapters => + books.fold(0, (int sum, Book book) => sum + book.chapterCount); + + static int get totalBooks => books.length; + + static int totalChaptersIn(Testament testament) => books + .where((Book book) => book.testament == testament) + .fold(0, (int sum, Book book) => sum + book.chapterCount); + + static int totalBooksIn(Testament testament) => + books.where((Book book) => book.testament == testament).length; + + /// Chapter key used to identify a chapter in persisted state. + static String chapterKey(int bookIndex, int chapter) => '$bookIndex:$chapter'; +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..9849aed --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import 'screens/home_screen.dart'; +import 'services/tracker_storage.dart'; +import 'widgets/theme.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + final SharedPreferences prefs = await SharedPreferences.getInstance(); + runApp( + ProviderScope( + overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], + child: const BibleTrackerApp(), + ), + ); +} + +class BibleTrackerApp extends StatelessWidget { + const BibleTrackerApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'My Bible Tracker', + debugShowCheckedModeBanner: false, + theme: AppTheme.light(), + darkTheme: AppTheme.dark(), + themeMode: ThemeMode.system, + home: const HomeScreen(), + ); + } +} diff --git a/lib/models/tracker.dart b/lib/models/tracker.dart new file mode 100644 index 0000000..d5b6190 --- /dev/null +++ b/lib/models/tracker.dart @@ -0,0 +1,18 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'tracker.freezed.dart'; +part 'tracker.g.dart'; + +@freezed +class Tracker with _$Tracker { + const factory Tracker({ + required String id, + required String name, + required int colorValue, + required DateTime startDate, + @Default({}) Set readChapters, + }) = _Tracker; + + factory Tracker.fromJson(Map json) => + _$TrackerFromJson(json); +} diff --git a/lib/models/tracker.freezed.dart b/lib/models/tracker.freezed.dart new file mode 100644 index 0000000..1da609b --- /dev/null +++ b/lib/models/tracker.freezed.dart @@ -0,0 +1,272 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'tracker.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +Tracker _$TrackerFromJson(Map json) { + return _Tracker.fromJson(json); +} + +/// @nodoc +mixin _$Tracker { + String get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + int get colorValue => throw _privateConstructorUsedError; + DateTime get startDate => throw _privateConstructorUsedError; + Set get readChapters => throw _privateConstructorUsedError; + + /// Serializes this Tracker to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of Tracker + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $TrackerCopyWith get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $TrackerCopyWith<$Res> { + factory $TrackerCopyWith(Tracker value, $Res Function(Tracker) then) = + _$TrackerCopyWithImpl<$Res, Tracker>; + @useResult + $Res call({ + String id, + String name, + int colorValue, + DateTime startDate, + Set readChapters, + }); +} + +/// @nodoc +class _$TrackerCopyWithImpl<$Res, $Val extends Tracker> + implements $TrackerCopyWith<$Res> { + _$TrackerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of Tracker + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? colorValue = null, + Object? startDate = null, + Object? readChapters = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + colorValue: null == colorValue + ? _value.colorValue + : colorValue // ignore: cast_nullable_to_non_nullable + as int, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + readChapters: null == readChapters + ? _value.readChapters + : readChapters // ignore: cast_nullable_to_non_nullable + as Set, + ) + as $Val, + ); + } +} + +/// @nodoc +abstract class _$$TrackerImplCopyWith<$Res> implements $TrackerCopyWith<$Res> { + factory _$$TrackerImplCopyWith( + _$TrackerImpl value, + $Res Function(_$TrackerImpl) then, + ) = __$$TrackerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + String name, + int colorValue, + DateTime startDate, + Set readChapters, + }); +} + +/// @nodoc +class __$$TrackerImplCopyWithImpl<$Res> + extends _$TrackerCopyWithImpl<$Res, _$TrackerImpl> + implements _$$TrackerImplCopyWith<$Res> { + __$$TrackerImplCopyWithImpl( + _$TrackerImpl _value, + $Res Function(_$TrackerImpl) _then, + ) : super(_value, _then); + + /// Create a copy of Tracker + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? colorValue = null, + Object? startDate = null, + Object? readChapters = null, + }) { + return _then( + _$TrackerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + colorValue: null == colorValue + ? _value.colorValue + : colorValue // ignore: cast_nullable_to_non_nullable + as int, + startDate: null == startDate + ? _value.startDate + : startDate // ignore: cast_nullable_to_non_nullable + as DateTime, + readChapters: null == readChapters + ? _value._readChapters + : readChapters // ignore: cast_nullable_to_non_nullable + as Set, + ), + ); + } +} + +/// @nodoc +@JsonSerializable() +class _$TrackerImpl implements _Tracker { + const _$TrackerImpl({ + required this.id, + required this.name, + required this.colorValue, + required this.startDate, + final Set readChapters = const {}, + }) : _readChapters = readChapters; + + factory _$TrackerImpl.fromJson(Map json) => + _$$TrackerImplFromJson(json); + + @override + final String id; + @override + final String name; + @override + final int colorValue; + @override + final DateTime startDate; + final Set _readChapters; + @override + @JsonKey() + Set get readChapters { + if (_readChapters is EqualUnmodifiableSetView) return _readChapters; + // ignore: implicit_dynamic_type + return EqualUnmodifiableSetView(_readChapters); + } + + @override + String toString() { + return 'Tracker(id: $id, name: $name, colorValue: $colorValue, startDate: $startDate, readChapters: $readChapters)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$TrackerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.colorValue, colorValue) || + other.colorValue == colorValue) && + (identical(other.startDate, startDate) || + other.startDate == startDate) && + const DeepCollectionEquality().equals( + other._readChapters, + _readChapters, + )); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + colorValue, + startDate, + const DeepCollectionEquality().hash(_readChapters), + ); + + /// Create a copy of Tracker + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$TrackerImplCopyWith<_$TrackerImpl> get copyWith => + __$$TrackerImplCopyWithImpl<_$TrackerImpl>(this, _$identity); + + @override + Map toJson() { + return _$$TrackerImplToJson(this); + } +} + +abstract class _Tracker implements Tracker { + const factory _Tracker({ + required final String id, + required final String name, + required final int colorValue, + required final DateTime startDate, + final Set readChapters, + }) = _$TrackerImpl; + + factory _Tracker.fromJson(Map json) = _$TrackerImpl.fromJson; + + @override + String get id; + @override + String get name; + @override + int get colorValue; + @override + DateTime get startDate; + @override + Set get readChapters; + + /// Create a copy of Tracker + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$TrackerImplCopyWith<_$TrackerImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/models/tracker.g.dart b/lib/models/tracker.g.dart new file mode 100644 index 0000000..1fe4231 --- /dev/null +++ b/lib/models/tracker.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tracker.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$TrackerImpl _$$TrackerImplFromJson(Map json) => + _$TrackerImpl( + id: json['id'] as String, + name: json['name'] as String, + colorValue: (json['colorValue'] as num).toInt(), + startDate: DateTime.parse(json['startDate'] as String), + readChapters: + (json['readChapters'] as List?) + ?.map((e) => e as String) + .toSet() ?? + const {}, + ); + +Map _$$TrackerImplToJson(_$TrackerImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'colorValue': instance.colorValue, + 'startDate': instance.startDate.toIso8601String(), + 'readChapters': instance.readChapters.toList(), + }; diff --git a/lib/screens/book_screen.dart b/lib/screens/book_screen.dart new file mode 100644 index 0000000..3038fe2 --- /dev/null +++ b/lib/screens/book_screen.dart @@ -0,0 +1,139 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../data/bible.dart'; +import '../models/tracker.dart'; +import '../services/progress.dart'; +import '../services/tracker_service.dart'; +import '../widgets/progress_bar.dart'; +import '../widgets/theme.dart'; + +class BookScreen extends ConsumerWidget { + const BookScreen({ + super.key, + required this.trackerId, + required this.bookIndex, + }); + + final String trackerId; + final int bookIndex; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final Tracker? tracker = ref.watch(trackerByIdProvider(trackerId)); + if (tracker == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Tracker not found')), + ); + } + final Book book = Bible.books[bookIndex]; + final Color accent = Color(tracker.colorValue); + final TrackerProgress progress = TrackerProgress(tracker); + final int chaptersRead = progress.chaptersReadIn(book); + final bool allRead = chaptersRead == book.chapterCount; + + return Scaffold( + appBar: AppBar( + title: Text(book.name), + actions: [ + TextButton( + onPressed: () => ref + .read(trackerServiceProvider.notifier) + .setBookRead(trackerId, bookIndex, read: !allRead), + child: Text(allRead ? 'Clear book' : 'Mark all'), + ), + ], + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '$chaptersRead of ${book.chapterCount} chapters', + style: Theme.of(context).textTheme.titleMedium, + ), + const SizedBox(height: AppTokens.spaceM), + ProgressBar( + value: progress.fractionOf(book), + color: accent, + height: 8, + ), + ], + ), + ), + const Divider(), + Expanded( + child: GridView.builder( + padding: const EdgeInsets.all(AppTokens.spaceL), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 5, + mainAxisSpacing: AppTokens.spaceM, + crossAxisSpacing: AppTokens.spaceM, + childAspectRatio: 1, + ), + itemCount: book.chapterCount, + itemBuilder: (BuildContext context, int index) { + final int chapter = index + 1; + final bool read = tracker.readChapters.contains( + Bible.chapterKey(bookIndex, chapter), + ); + return _ChapterCell( + chapter: chapter, + read: read, + accent: accent, + onTap: () => ref + .read(trackerServiceProvider.notifier) + .toggleChapter(trackerId, bookIndex, chapter), + ); + }, + ), + ), + ], + ), + ); + } +} + +class _ChapterCell extends StatelessWidget { + const _ChapterCell({ + required this.chapter, + required this.read, + required this.accent, + required this.onTap, + }); + + final int chapter; + final bool read; + final Color accent; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return Material( + color: read ? accent : Theme.of(context).colorScheme.surfaceContainerHigh, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(AppTokens.radiusM), + ), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(AppTokens.radiusM), + child: Center( + child: Text( + '$chapter', + style: Theme.of(context).textTheme.titleMedium?.copyWith( + color: read + ? Colors.white + : Theme.of(context).colorScheme.onSurface, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/create_tracker_screen.dart b/lib/screens/create_tracker_screen.dart new file mode 100644 index 0000000..ff27374 --- /dev/null +++ b/lib/screens/create_tracker_screen.dart @@ -0,0 +1,135 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../models/tracker.dart'; +import '../services/tracker_service.dart'; +import '../widgets/theme.dart'; + +class CreateTrackerScreen extends ConsumerStatefulWidget { + const CreateTrackerScreen({super.key, this.existing}); + + final Tracker? existing; + + @override + ConsumerState createState() => + _CreateTrackerScreenState(); +} + +class _CreateTrackerScreenState extends ConsumerState { + late final TextEditingController _nameController; + late Color _color; + bool _saving = false; + + @override + void initState() { + super.initState(); + _nameController = TextEditingController(text: widget.existing?.name ?? ''); + _color = widget.existing != null + ? Color(widget.existing!.colorValue) + : AppTokens.trackerPalette.first; + } + + @override + void dispose() { + _nameController.dispose(); + super.dispose(); + } + + Future _save() async { + final String name = _nameController.text.trim(); + if (name.isEmpty) return; + setState(() => _saving = true); + final TrackerService service = ref.read(trackerServiceProvider.notifier); + if (widget.existing == null) { + await service.create(name: name, color: _color); + } else { + await service.updateMeta(widget.existing!.id, name: name, color: _color); + } + if (!mounted) return; + Navigator.of(context).pop(); + } + + @override + Widget build(BuildContext context) { + final bool isEditing = widget.existing != null; + return Scaffold( + appBar: AppBar(title: Text(isEditing ? 'Edit Tracker' : 'New Tracker')), + body: SingleChildScrollView( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + controller: _nameController, + decoration: const InputDecoration( + labelText: 'Name', + hintText: 'e.g. My First Read-Through', + border: OutlineInputBorder(), + ), + textInputAction: TextInputAction.done, + autofocus: !isEditing, + ), + const SizedBox(height: AppTokens.spaceXL), + Text('Color', style: Theme.of(context).textTheme.titleMedium), + const SizedBox(height: AppTokens.spaceM), + Wrap( + spacing: AppTokens.spaceM, + runSpacing: AppTokens.spaceM, + children: [ + for (final Color option in AppTokens.trackerPalette) + _ColorSwatch( + color: option, + selected: option.toARGB32() == _color.toARGB32(), + onTap: () => setState(() => _color = option), + ), + ], + ), + const SizedBox(height: AppTokens.spaceXXL), + FilledButton( + onPressed: _saving ? null : _save, + style: FilledButton.styleFrom(backgroundColor: _color), + child: Text(isEditing ? 'Save Changes' : 'Create Tracker'), + ), + ], + ), + ), + ); + } +} + +class _ColorSwatch extends StatelessWidget { + const _ColorSwatch({ + required this.color, + required this.selected, + required this.onTap, + }); + + final Color color; + final bool selected; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return InkResponse( + onTap: onTap, + radius: 32, + child: Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: color, + shape: BoxShape.circle, + border: Border.all( + color: selected + ? Theme.of(context).colorScheme.onSurface + : Colors.transparent, + width: 3, + ), + ), + child: selected + ? const Icon(Icons.check, color: Colors.white, size: 20) + : null, + ), + ); + } +} diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart new file mode 100644 index 0000000..c6defde --- /dev/null +++ b/lib/screens/home_screen.dart @@ -0,0 +1,200 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../models/tracker.dart'; +import '../services/tracker_service.dart'; +import '../widgets/theme.dart'; +import '../widgets/tracker_tile.dart'; +import 'create_tracker_screen.dart'; +import 'tracker_screen.dart'; + +class HomeScreen extends ConsumerWidget { + const HomeScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final AsyncValue> state = ref.watch(trackerServiceProvider); + return Scaffold( + appBar: AppBar(title: const Text('My Bible Tracker')), + body: state.when( + loading: () => const Center(child: CircularProgressIndicator()), + error: (Object error, StackTrace stack) => + Center(child: Text('Something went wrong:\n$error')), + data: (List trackers) { + if (trackers.isEmpty) { + return const _EmptyState(); + } + return ListView.separated( + padding: const EdgeInsets.all(AppTokens.spaceL), + itemCount: trackers.length, + separatorBuilder: (_, __) => + const SizedBox(height: AppTokens.spaceM), + itemBuilder: (BuildContext context, int index) { + final Tracker tracker = trackers[index]; + return TrackerTile( + tracker: tracker, + onTap: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => TrackerScreen(trackerId: tracker.id), + ), + ), + onLongPress: () => _showTrackerMenu(context, ref, tracker), + ); + }, + ); + }, + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: () => Navigator.of(context).push( + MaterialPageRoute(builder: (_) => const CreateTrackerScreen()), + ), + icon: const Icon(Icons.add), + label: const Text('New Tracker'), + ), + ); + } + + Future _showTrackerMenu( + BuildContext context, + WidgetRef ref, + Tracker tracker, + ) async { + final _TrackerMenuAction? action = + await showModalBottomSheet<_TrackerMenuAction>( + context: context, + showDragHandle: true, + builder: (BuildContext context) { + return SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + leading: const Icon(Icons.edit_outlined), + title: const Text('Rename / recolor'), + onTap: () => + Navigator.of(context).pop(_TrackerMenuAction.edit), + ), + ListTile( + leading: const Icon(Icons.refresh), + title: const Text('Reset progress'), + onTap: () => + Navigator.of(context).pop(_TrackerMenuAction.reset), + ), + ListTile( + leading: const Icon(Icons.delete_outline), + iconColor: Theme.of(context).colorScheme.error, + textColor: Theme.of(context).colorScheme.error, + title: const Text('Delete'), + onTap: () => + Navigator.of(context).pop(_TrackerMenuAction.delete), + ), + const SizedBox(height: AppTokens.spaceS), + ], + ), + ); + }, + ); + if (action == null || !context.mounted) return; + switch (action) { + case _TrackerMenuAction.edit: + await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => CreateTrackerScreen(existing: tracker), + ), + ); + case _TrackerMenuAction.reset: + await _confirmAndRun( + context, + title: 'Reset progress?', + message: + 'All checked chapters for "${tracker.name}" will be cleared.', + destructive: true, + run: () => + ref.read(trackerServiceProvider.notifier).reset(tracker.id), + ); + case _TrackerMenuAction.delete: + await _confirmAndRun( + context, + title: 'Delete tracker?', + message: '"${tracker.name}" will be removed permanently.', + destructive: true, + run: () => + ref.read(trackerServiceProvider.notifier).delete(tracker.id), + ); + } + } + + Future _confirmAndRun( + BuildContext context, { + required String title, + required String message, + required bool destructive, + required Future Function() run, + }) async { + final bool? confirmed = await showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: Text(title), + content: Text(message), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: const Text('Cancel'), + ), + FilledButton( + style: destructive + ? FilledButton.styleFrom( + backgroundColor: Theme.of(context).colorScheme.error, + ) + : null, + onPressed: () => Navigator.of(context).pop(true), + child: const Text('Confirm'), + ), + ], + ), + ); + if (confirmed ?? false) { + await run(); + } + } +} + +enum _TrackerMenuAction { edit, reset, delete } + +class _EmptyState extends StatelessWidget { + const _EmptyState(); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(AppTokens.spaceXXL), + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.menu_book_outlined, + size: 72, + color: Theme.of(context).colorScheme.primary, + ), + const SizedBox(height: AppTokens.spaceL), + Text( + 'Start your first tracker', + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center, + ), + const SizedBox(height: AppTokens.spaceS), + Text( + 'Create a tracker to mark the chapters you have read. ' + 'Read at your own pace — there are no deadlines.', + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/stats_screen.dart b/lib/screens/stats_screen.dart new file mode 100644 index 0000000..574dcd5 --- /dev/null +++ b/lib/screens/stats_screen.dart @@ -0,0 +1,220 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../data/bible.dart'; +import '../models/tracker.dart'; +import '../services/progress.dart'; +import '../services/tracker_service.dart'; +import '../widgets/progress_bar.dart'; +import '../widgets/theme.dart'; + +class StatsScreen extends ConsumerWidget { + const StatsScreen({super.key, required this.trackerId}); + + final String trackerId; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final Tracker? tracker = ref.watch(trackerByIdProvider(trackerId)); + if (tracker == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Tracker not found')), + ); + } + final Color accent = Color(tracker.colorValue); + final TrackerProgress progress = TrackerProgress(tracker); + final int days = DateTime.now().difference(tracker.startDate).inDays; + + return Scaffold( + appBar: AppBar(title: const Text('Stats')), + body: ListView( + padding: const EdgeInsets.all(AppTokens.spaceL), + children: [ + _OverallCard(tracker: tracker, accent: accent, progress: progress), + const SizedBox(height: AppTokens.spaceL), + _SectionCard( + title: 'Old Testament', + chapters: progress.chaptersReadInTestament(Testament.old), + chaptersTotal: Bible.totalChaptersIn(Testament.old), + books: progress.booksCompleted(Testament.old), + booksTotal: Bible.totalBooksIn(Testament.old), + fraction: progress.testamentFraction(Testament.old), + accent: accent, + ), + const SizedBox(height: AppTokens.spaceL), + _SectionCard( + title: 'New Testament', + chapters: progress.chaptersReadInTestament(Testament.newT), + chaptersTotal: Bible.totalChaptersIn(Testament.newT), + books: progress.booksCompleted(Testament.newT), + booksTotal: Bible.totalBooksIn(Testament.newT), + fraction: progress.testamentFraction(Testament.newT), + accent: accent, + ), + const SizedBox(height: AppTokens.spaceL), + Card( + child: Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + 'Since you started', + style: Theme.of(context).textTheme.titleMedium, + ), + const SizedBox(height: AppTokens.spaceM), + _StatRow( + label: 'Start date', + value: _formatDate(tracker.startDate), + ), + _StatRow(label: 'Days reading', value: '$days'), + _StatRow( + label: 'Chapters read', + value: '${progress.totalRead} / ${Bible.totalChapters}', + ), + _StatRow( + label: 'Books completed', + value: '${progress.booksCompleted()} / ${Bible.totalBooks}', + ), + ], + ), + ), + ), + ], + ), + ); + } + + static String _formatDate(DateTime date) { + const List months = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', + ]; + return '${months[date.month - 1]} ${date.day}, ${date.year}'; + } +} + +class _OverallCard extends StatelessWidget { + const _OverallCard({ + required this.tracker, + required this.accent, + required this.progress, + }); + + final Tracker tracker; + final Color accent; + final TrackerProgress progress; + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text(tracker.name, style: Theme.of(context).textTheme.titleMedium), + const SizedBox(height: AppTokens.spaceS), + Text( + '${(progress.overall * 100).toStringAsFixed(1)}%', + style: Theme.of(context).textTheme.displaySmall?.copyWith( + color: accent, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: AppTokens.spaceM), + ProgressBar(value: progress.overall, color: accent, height: 10), + ], + ), + ), + ); + } +} + +class _SectionCard extends StatelessWidget { + const _SectionCard({ + required this.title, + required this.chapters, + required this.chaptersTotal, + required this.books, + required this.booksTotal, + required this.fraction, + required this.accent, + }); + + final String title; + final int chapters; + final int chaptersTotal; + final int books; + final int booksTotal; + final double fraction; + final Color accent; + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(title, style: Theme.of(context).textTheme.titleMedium), + ProgressPill(fraction: fraction, color: accent), + ], + ), + const SizedBox(height: AppTokens.spaceM), + ProgressBar(value: fraction, color: accent), + const SizedBox(height: AppTokens.spaceM), + _StatRow(label: 'Chapters', value: '$chapters / $chaptersTotal'), + _StatRow(label: 'Books', value: '$books / $booksTotal'), + ], + ), + ), + ); + } +} + +class _StatRow extends StatelessWidget { + const _StatRow({required this.label, required this.value}); + + final String label; + final String value; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: AppTokens.spaceXS), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + Text( + value, + style: Theme.of( + context, + ).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.w600), + ), + ], + ), + ); + } +} diff --git a/lib/screens/tracker_screen.dart b/lib/screens/tracker_screen.dart new file mode 100644 index 0000000..423813c --- /dev/null +++ b/lib/screens/tracker_screen.dart @@ -0,0 +1,259 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../data/bible.dart'; +import '../models/tracker.dart'; +import '../services/progress.dart'; +import '../services/tracker_service.dart'; +import '../widgets/book_tile.dart'; +import '../widgets/progress_bar.dart'; +import '../widgets/theme.dart'; +import 'book_screen.dart'; +import 'stats_screen.dart'; + +class TrackerScreen extends ConsumerWidget { + const TrackerScreen({super.key, required this.trackerId}); + + final String trackerId; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final Tracker? tracker = ref.watch(trackerByIdProvider(trackerId)); + if (tracker == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Tracker not found')), + ); + } + final Color accent = Color(tracker.colorValue); + final TrackerProgress progress = TrackerProgress(tracker); + + return Scaffold( + appBar: AppBar( + title: Text(tracker.name), + actions: [ + IconButton( + tooltip: 'Stats', + icon: const Icon(Icons.insert_chart_outlined), + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => StatsScreen(trackerId: tracker.id), + ), + ), + ), + ], + ), + body: CustomScrollView( + slivers: [ + SliverToBoxAdapter( + child: _HeaderCard( + tracker: tracker, + accent: accent, + progress: progress, + ), + ), + SliverToBoxAdapter( + child: _SectionHeader( + title: 'Old Testament', + chaptersRead: progress.chaptersReadInTestament(Testament.old), + total: Bible.totalChaptersIn(Testament.old), + ), + ), + _BooksSliver( + tracker: tracker, + accent: accent, + testament: Testament.old, + ), + SliverToBoxAdapter( + child: _SectionHeader( + title: 'New Testament', + chaptersRead: progress.chaptersReadInTestament(Testament.newT), + total: Bible.totalChaptersIn(Testament.newT), + ), + ), + _BooksSliver( + tracker: tracker, + accent: accent, + testament: Testament.newT, + ), + const SliverToBoxAdapter(child: SizedBox(height: AppTokens.spaceXL)), + ], + ), + ); + } +} + +class _HeaderCard extends StatelessWidget { + const _HeaderCard({ + required this.tracker, + required this.accent, + required this.progress, + }); + + final Tracker tracker; + final Color accent; + final TrackerProgress progress; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Card( + child: Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${(progress.overall * 100).toStringAsFixed(1)}%', + style: Theme.of(context).textTheme.headlineMedium + ?.copyWith( + color: accent, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: AppTokens.spaceXS), + Text( + '${progress.totalRead} / ${Bible.totalChapters} chapters', + style: Theme.of(context).textTheme.bodyMedium + ?.copyWith( + color: Theme.of( + context, + ).colorScheme.onSurfaceVariant, + ), + ), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + 'Started', + style: Theme.of(context).textTheme.labelSmall?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + const SizedBox(height: AppTokens.spaceXS), + Text( + _formatDate(tracker.startDate), + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ], + ), + const SizedBox(height: AppTokens.spaceL), + ProgressBar(value: progress.overall, color: accent, height: 8), + ], + ), + ), + ), + ); + } + + static String _formatDate(DateTime date) { + const List months = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + return '${months[date.month - 1]} ${date.day}, ${date.year}'; + } +} + +class _SectionHeader extends StatelessWidget { + const _SectionHeader({ + required this.title, + required this.chaptersRead, + required this.total, + }); + + final String title; + final int chaptersRead; + final int total; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.fromLTRB( + AppTokens.spaceL, + AppTokens.spaceL, + AppTokens.spaceL, + AppTokens.spaceS, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + title, + style: Theme.of( + context, + ).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.w600), + ), + Text( + '$chaptersRead / $total', + style: Theme.of(context).textTheme.labelMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ], + ), + ); + } +} + +class _BooksSliver extends ConsumerWidget { + const _BooksSliver({ + required this.tracker, + required this.accent, + required this.testament, + }); + + final Tracker tracker; + final Color accent; + final Testament testament; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final List books = Bible.books + .where((Book book) => book.testament == testament) + .toList(growable: false); + final TrackerProgress progress = TrackerProgress(tracker); + return SliverList.separated( + itemCount: books.length, + separatorBuilder: (_, __) => const Divider(indent: AppTokens.spaceXL), + itemBuilder: (BuildContext context, int index) { + final Book book = books[index]; + return BookTile( + book: book, + chaptersRead: progress.chaptersReadIn(book), + accent: accent, + onTap: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => + BookScreen(trackerId: tracker.id, bookIndex: book.index), + ), + ), + ); + }, + ); + } +} diff --git a/lib/services/progress.dart b/lib/services/progress.dart new file mode 100644 index 0000000..970e1dd --- /dev/null +++ b/lib/services/progress.dart @@ -0,0 +1,56 @@ +import '../data/bible.dart'; +import '../models/tracker.dart'; + +/// Pure progress calculations over a [Tracker]. +/// +/// Kept free of Flutter imports so it can be covered by plain unit tests. +class TrackerProgress { + TrackerProgress(this.tracker); + + final Tracker tracker; + + int chaptersReadIn(Book book) { + int count = 0; + for (int chapter = 1; chapter <= book.chapterCount; chapter++) { + if (tracker.readChapters.contains( + Bible.chapterKey(book.index, chapter), + )) { + count++; + } + } + return count; + } + + double fractionOf(Book book) { + if (book.chapterCount == 0) return 0; + return chaptersReadIn(book) / book.chapterCount; + } + + bool isBookComplete(Book book) => + chaptersReadIn(book) == book.chapterCount && book.chapterCount > 0; + + bool isBookStarted(Book book) => chaptersReadIn(book) > 0; + + int get totalRead => tracker.readChapters.length; + + double get overall => + Bible.totalChapters == 0 ? 0 : totalRead / Bible.totalChapters; + + int booksCompleted([Testament? testament]) => Bible.books + .where( + (Book book) => + (testament == null || book.testament == testament) && + isBookComplete(book), + ) + .length; + + int chaptersReadInTestament(Testament testament) => Bible.books + .where((Book book) => book.testament == testament) + .fold(0, (int sum, Book book) => sum + chaptersReadIn(book)); + + double testamentFraction(Testament testament) { + final int total = Bible.totalChaptersIn(testament); + if (total == 0) return 0; + return chaptersReadInTestament(testament) / total; + } +} diff --git a/lib/services/tracker_service.dart b/lib/services/tracker_service.dart new file mode 100644 index 0000000..e423e12 --- /dev/null +++ b/lib/services/tracker_service.dart @@ -0,0 +1,148 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:uuid/uuid.dart'; + +import '../data/bible.dart'; +import '../models/tracker.dart'; +import 'tracker_storage.dart'; + +/// Manages the list of [Tracker]s and exposes them as state to the UI. +/// +/// Kept as a plain service (no repository) because storage access is +/// simple read/write-all and there are no complex queries or caches. +class TrackerService extends StateNotifier>> { + TrackerService(this._storage, {Uuid? uuid}) + : _uuid = uuid ?? const Uuid(), + super(const AsyncValue>.loading()) { + unawaitedLoad(); + } + + final TrackerStorage _storage; + final Uuid _uuid; + + @visibleForTesting + Future unawaitedLoad() => _load(); + + Future _load() async { + try { + final List trackers = await _storage.loadAll(); + state = AsyncValue>.data(trackers); + } catch (error, stack) { + state = AsyncValue>.error(error, stack); + } + } + + Future _persist(List trackers) async { + state = AsyncValue>.data(trackers); + await _storage.saveAll(trackers); + } + + Future create({required String name, required Color color}) async { + final Tracker tracker = Tracker( + id: _uuid.v4(), + name: name, + // ignore: deprecated_member_use + colorValue: color.value, + startDate: DateTime.now(), + ); + final List next = [ + ...state.value ?? const [], + tracker, + ]; + await _persist(next); + return tracker; + } + + Future updateMeta(String id, {String? name, Color? color}) async { + final List current = state.value ?? const []; + final List next = current + .map( + (Tracker tracker) => tracker.id == id + ? tracker.copyWith( + name: name ?? tracker.name, + // ignore: deprecated_member_use + colorValue: color?.value ?? tracker.colorValue, + ) + : tracker, + ) + .toList(growable: false); + await _persist(next); + } + + Future delete(String id) async { + final List current = state.value ?? const []; + final List next = current + .where((Tracker tracker) => tracker.id != id) + .toList(growable: false); + await _persist(next); + } + + Future toggleChapter(String id, int bookIndex, int chapter) async { + final String key = Bible.chapterKey(bookIndex, chapter); + final List current = state.value ?? const []; + final List next = current + .map((Tracker tracker) { + if (tracker.id != id) return tracker; + final Set updated = {...tracker.readChapters}; + if (!updated.remove(key)) { + updated.add(key); + } + return tracker.copyWith(readChapters: updated); + }) + .toList(growable: false); + await _persist(next); + } + + Future setBookRead( + String id, + int bookIndex, { + required bool read, + }) async { + final Book book = Bible.books[bookIndex]; + final List current = state.value ?? const []; + final List next = current + .map((Tracker tracker) { + if (tracker.id != id) return tracker; + final Set updated = {...tracker.readChapters}; + for (int chapter = 1; chapter <= book.chapterCount; chapter++) { + final String key = Bible.chapterKey(bookIndex, chapter); + if (read) { + updated.add(key); + } else { + updated.remove(key); + } + } + return tracker.copyWith(readChapters: updated); + }) + .toList(growable: false); + await _persist(next); + } + + Future reset(String id) async { + final List current = state.value ?? const []; + final List next = current + .map( + (Tracker tracker) => tracker.id == id + ? tracker.copyWith(readChapters: const {}) + : tracker, + ) + .toList(growable: false); + await _persist(next); + } +} + +final StateNotifierProvider>> +trackerServiceProvider = + StateNotifierProvider>>( + (Ref ref) => TrackerService(ref.read(trackerStorageProvider)), + ); + +/// Convenience selector for a single tracker by id. +final ProviderFamily trackerByIdProvider = + Provider.family((Ref ref, String id) { + final AsyncValue> state = ref.watch(trackerServiceProvider); + return state.value?.cast().firstWhere( + (Tracker? t) => t?.id == id, + orElse: () => null, + ); + }); diff --git a/lib/services/tracker_storage.dart b/lib/services/tracker_storage.dart new file mode 100644 index 0000000..c21040b --- /dev/null +++ b/lib/services/tracker_storage.dart @@ -0,0 +1,51 @@ +import 'dart:convert'; + +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../models/tracker.dart'; + +/// Persists the list of trackers to [SharedPreferences] as JSON. +/// +/// A repository is justified here because storage is asynchronous, has +/// specialized queries (save/load all), and is consumed both by the service +/// layer and by tests with fake implementations. +class TrackerStorage { + TrackerStorage(this._prefs); + + static const String _storageKey = 'bible_tracker.trackers.v1'; + + final SharedPreferences _prefs; + + Future> loadAll() async { + final String? raw = _prefs.getString(_storageKey); + if (raw == null || raw.isEmpty) { + return []; + } + final List decoded = jsonDecode(raw) as List; + return decoded + .cast>() + .map(Tracker.fromJson) + .toList(growable: false); + } + + Future saveAll(List trackers) async { + final List> json = trackers + .map((Tracker tracker) => tracker.toJson()) + .toList(growable: false); + await _prefs.setString(_storageKey, jsonEncode(json)); + } +} + +/// Must be overridden at startup with an initialized [SharedPreferences]. +final Provider sharedPreferencesProvider = + Provider( + (Ref ref) => throw UnimplementedError( + 'sharedPreferencesProvider must be overridden before use', + ), + ); + +final Provider trackerStorageProvider = + Provider( + (Ref ref) => TrackerStorage(ref.read(sharedPreferencesProvider)), + ); diff --git a/lib/widgets/book_tile.dart b/lib/widgets/book_tile.dart new file mode 100644 index 0000000..415415b --- /dev/null +++ b/lib/widgets/book_tile.dart @@ -0,0 +1,86 @@ +import 'package:flutter/material.dart'; + +import '../data/bible.dart'; +import 'progress_bar.dart'; +import 'theme.dart'; + +class BookTile extends StatelessWidget { + const BookTile({ + super.key, + required this.book, + required this.chaptersRead, + required this.accent, + required this.onTap, + }); + + final Book book; + final int chaptersRead; + final Color accent; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + final bool complete = chaptersRead == book.chapterCount; + final bool started = chaptersRead > 0 && !complete; + final double fraction = book.chapterCount == 0 + ? 0 + : chaptersRead / book.chapterCount; + + Color leadingColor; + IconData? leadingIcon; + if (complete) { + leadingColor = accent; + leadingIcon = Icons.check_rounded; + } else if (started) { + leadingColor = accent.withValues(alpha: 0.6); + leadingIcon = null; + } else { + leadingColor = Theme.of(context).colorScheme.surfaceContainerHighest; + leadingIcon = null; + } + + return ListTile( + onTap: onTap, + leading: Container( + width: 32, + height: 32, + decoration: BoxDecoration(color: leadingColor, shape: BoxShape.circle), + alignment: Alignment.center, + child: leadingIcon != null + ? Icon(leadingIcon, size: 18, color: Colors.white) + : Text( + '${book.chapterCount}', + style: Theme.of(context).textTheme.labelMedium?.copyWith( + color: started + ? Colors.white + : Theme.of(context).colorScheme.onSurfaceVariant, + fontWeight: FontWeight.w600, + ), + ), + ), + title: Text( + book.name, + style: Theme.of( + context, + ).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.w500), + ), + subtitle: Padding( + padding: const EdgeInsets.only(top: AppTokens.spaceXS), + child: Row( + children: [ + Expanded( + child: ProgressBar(value: fraction, color: accent, height: 4), + ), + const SizedBox(width: AppTokens.spaceM), + Text( + '$chaptersRead / ${book.chapterCount}', + style: Theme.of(context).textTheme.labelSmall?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/progress_bar.dart b/lib/widgets/progress_bar.dart new file mode 100644 index 0000000..e85c8ad --- /dev/null +++ b/lib/widgets/progress_bar.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; + +import 'theme.dart'; + +/// A thin rounded progress bar used throughout the app. +class ProgressBar extends StatelessWidget { + const ProgressBar({ + super.key, + required this.value, + required this.color, + this.height = 6, + }); + + final double value; + final Color color; + final double height; + + @override + Widget build(BuildContext context) { + return ClipRRect( + borderRadius: BorderRadius.circular(height / 2), + child: LinearProgressIndicator( + value: value.clamp(0.0, 1.0), + minHeight: height, + valueColor: AlwaysStoppedAnimation(color), + backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest, + ), + ); + } +} + +/// A pill showing a percentage, colored by the tracker/book accent. +class ProgressPill extends StatelessWidget { + const ProgressPill({super.key, required this.fraction, required this.color}); + + final double fraction; + final Color color; + + @override + Widget build(BuildContext context) { + final int percent = (fraction * 100).round(); + return Container( + padding: const EdgeInsets.symmetric( + horizontal: AppTokens.spaceM, + vertical: AppTokens.spaceXS, + ), + decoration: BoxDecoration( + color: color.withValues(alpha: 0.15), + borderRadius: BorderRadius.circular(AppTokens.radiusL), + ), + child: Text( + '$percent%', + style: Theme.of(context).textTheme.labelMedium?.copyWith( + color: color, + fontWeight: FontWeight.w600, + ), + ), + ); + } +} diff --git a/lib/widgets/theme.dart b/lib/widgets/theme.dart new file mode 100644 index 0000000..ff16d9f --- /dev/null +++ b/lib/widgets/theme.dart @@ -0,0 +1,101 @@ +import 'package:flutter/material.dart'; + +/// Design tokens and theme construction for Bible Tracker. +/// +/// Refer to `DESIGN_GUIDE.md` for the rationale behind each token. +class AppTokens { + const AppTokens._(); + + // Seed color — warm, scripture-inspired indigo. + static const Color seed = Color(0xFF3F51B5); + + // Default palette offered when creating a new tracker. + static const List trackerPalette = [ + Color(0xFF3F51B5), // indigo + Color(0xFF1E88E5), // blue + Color(0xFF00897B), // teal + Color(0xFF43A047), // green + Color(0xFFFDD835), // amber + Color(0xFFFB8C00), // orange + Color(0xFFE53935), // red + Color(0xFFD81B60), // pink + Color(0xFF8E24AA), // purple + Color(0xFF6D4C41), // brown + ]; + + // Spacing scale (8pt grid). + static const double spaceXS = 4; + static const double spaceS = 8; + static const double spaceM = 12; + static const double spaceL = 16; + static const double spaceXL = 24; + static const double spaceXXL = 32; + + // Radius scale. + static const double radiusS = 8; + static const double radiusM = 12; + static const double radiusL = 16; +} + +class AppTheme { + const AppTheme._(); + + static ThemeData light() => _build(Brightness.light); + static ThemeData dark() => _build(Brightness.dark); + + static ThemeData _build(Brightness brightness) { + final ColorScheme scheme = ColorScheme.fromSeed( + seedColor: AppTokens.seed, + brightness: brightness, + ); + return ThemeData( + useMaterial3: true, + colorScheme: scheme, + scaffoldBackgroundColor: scheme.surface, + appBarTheme: AppBarTheme( + backgroundColor: scheme.surface, + foregroundColor: scheme.onSurface, + elevation: 0, + centerTitle: false, + titleTextStyle: TextStyle( + color: scheme.onSurface, + fontSize: 20, + fontWeight: FontWeight.w600, + ), + ), + cardTheme: CardThemeData( + color: scheme.surfaceContainerHigh, + elevation: 0, + margin: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(AppTokens.radiusM), + ), + ), + listTileTheme: const ListTileThemeData( + contentPadding: EdgeInsets.symmetric( + horizontal: AppTokens.spaceL, + vertical: AppTokens.spaceS, + ), + ), + dividerTheme: DividerThemeData( + color: scheme.outlineVariant, + thickness: 0.5, + space: 0, + ), + filledButtonTheme: FilledButtonThemeData( + style: FilledButton.styleFrom( + padding: const EdgeInsets.symmetric( + horizontal: AppTokens.spaceXL, + vertical: AppTokens.spaceM, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(AppTokens.radiusS), + ), + ), + ), + progressIndicatorTheme: ProgressIndicatorThemeData( + linearTrackColor: scheme.surfaceContainerHighest, + ), + ); + } +} diff --git a/lib/widgets/tracker_tile.dart b/lib/widgets/tracker_tile.dart new file mode 100644 index 0000000..5ffd930 --- /dev/null +++ b/lib/widgets/tracker_tile.dart @@ -0,0 +1,65 @@ +import 'package:flutter/material.dart'; + +import '../models/tracker.dart'; +import '../services/progress.dart'; +import 'progress_bar.dart'; +import 'theme.dart'; + +class TrackerTile extends StatelessWidget { + const TrackerTile({ + super.key, + required this.tracker, + required this.onTap, + this.onLongPress, + }); + + final Tracker tracker; + final VoidCallback onTap; + final VoidCallback? onLongPress; + + @override + Widget build(BuildContext context) { + final Color color = Color(tracker.colorValue); + final double fraction = TrackerProgress(tracker).overall; + return Card( + clipBehavior: Clip.antiAlias, + child: InkWell( + onTap: onTap, + onLongPress: onLongPress, + child: Padding( + padding: const EdgeInsets.all(AppTokens.spaceL), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + Container( + width: 12, + height: 12, + decoration: BoxDecoration( + color: color, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: AppTokens.spaceM), + Expanded( + child: Text( + tracker.name, + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.w600, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ProgressPill(fraction: fraction, color: color), + ], + ), + const SizedBox(height: AppTokens.spaceM), + ProgressBar(value: fraction, color: color), + ], + ), + ), + ), + ); + } +} diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..724bb2a --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import shared_preferences_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) +} diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..ff5ddb3 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# 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! + + 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 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f122154 --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* bible_tracker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "bible_tracker.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* bible_tracker.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* bible_tracker.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bible_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bible_tracker"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bible_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bible_tracker"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/bible_tracker.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/bible_tracker"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..dd0e9cf --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..b3c1761 --- /dev/null +++ b/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..52bd735 --- /dev/null +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = bible_tracker + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.matt.bibleTracker + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2026 com.matt. All rights reserved. diff --git a/macos/Runner/Configs/Debug.xcconfig b/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Release.xcconfig b/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/macos/Runner/Configs/Warnings.xcconfig b/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..3cc05eb --- /dev/null +++ b/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/macos/RunnerTests/RunnerTests.swift b/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..9dcfc91 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,754 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.dev" + source: hosted + version: "2.13.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: bf05f6e12cfea92d3c09308d7bcdab1906cd8a179b023269eed00c071004b957 + url: "https://pub.dev" + source: hosted + version: "4.1.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" + url: "https://pub.dev" + source: hosted + version: "9.1.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "0730c18c770d05636a8f945c32a4d7d81cb6e0f0148c8db4ad12e7748f7e49af" + url: "https://pub.dev" + source: hosted + version: "8.12.5" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" + url: "https://pub.dev" + source: hosted + version: "4.11.1" + collection: + dependency: "direct main" + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.dev" + source: hosted + version: "1.0.9" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_riverpod: + dependency: "direct main" + description: + name: flutter_riverpod + sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" + url: "https://pub.dev" + source: hosted + version: "2.5.8" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + url: "https://pub.dev" + source: hosted + version: "6.9.5" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "4546eac99e8967ea91bae633d2ca7698181d008e95fa4627330cf903d573277a" + url: "https://pub.dev" + source: hosted + version: "5.4.6" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.dev" + source: hosted + version: "1.5.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + riverpod: + dependency: transitive + description: + name: riverpod + sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf + url: "https://pub.dev" + source: hosted + version: "2.5.5" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: e8d4762b1e2e8578fc4d0fd548cebf24afd24f49719c08974df92834565e2c53 + url: "https://pub.dev" + source: hosted + version: "2.4.23" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + url: "https://pub.dev" + source: hosted + version: "1.3.7" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.dev" + source: hosted + version: "1.10.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + state_notifier: + dependency: transitive + description: + name: state_notifier + sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb + url: "https://pub.dev" + source: hosted + version: "1.0.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + url: "https://pub.dev" + source: hosted + version: "0.7.6" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" + url: "https://pub.dev" + source: hosted + version: "4.5.3" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "046d3928e16fa4dc46e8350415661755ab759d9fc97fc21b5ab295f71e4f0499" + url: "https://pub.dev" + source: hosted + version: "15.1.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..5f46720 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,34 @@ +name: bible_tracker +description: "Track your Bible reading progress at your own pace." +publish_to: 'none' + +version: 1.0.0+1 + +environment: + sdk: ^3.9.2 + +dependencies: + flutter: + sdk: flutter + + cupertino_icons: ^1.0.8 + + flutter_riverpod: ^2.6.1 + freezed_annotation: ^2.4.4 + json_annotation: ^4.9.0 + shared_preferences: ^2.3.3 + uuid: ^4.5.1 + collection: ^1.19.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + + build_runner: ^2.4.13 + freezed: ^2.5.7 + json_serializable: ^6.8.0 + mockito: ^5.4.4 + +flutter: + uses-material-design: true diff --git a/test/data/bible_test.dart b/test/data/bible_test.dart new file mode 100644 index 0000000..87a0aae --- /dev/null +++ b/test/data/bible_test.dart @@ -0,0 +1,36 @@ +import 'package:bible_tracker/data/bible.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('Bible', () { + test('has 66 books', () { + expect(Bible.books.length, 66); + expect(Bible.totalBooks, 66); + }); + + test('has 1189 chapters across all books', () { + expect(Bible.totalChapters, 1189); + }); + + test('old testament totals match canon', () { + expect(Bible.totalBooksIn(Testament.old), 39); + expect(Bible.totalChaptersIn(Testament.old), 929); + }); + + test('new testament totals match canon', () { + expect(Bible.totalBooksIn(Testament.newT), 27); + expect(Bible.totalChaptersIn(Testament.newT), 260); + }); + + test('indexes are contiguous from 0 to 65', () { + for (int i = 0; i < Bible.books.length; i++) { + expect(Bible.books[i].index, i); + } + }); + + test('chapterKey produces stable strings', () { + expect(Bible.chapterKey(0, 1), '0:1'); + expect(Bible.chapterKey(65, 22), '65:22'); + }); + }); +} diff --git a/test/models/tracker_test.dart b/test/models/tracker_test.dart new file mode 100644 index 0000000..4c3b8fd --- /dev/null +++ b/test/models/tracker_test.dart @@ -0,0 +1,38 @@ +import 'package:bible_tracker/models/tracker.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('Tracker', () { + test('JSON round-trips including read chapters', () { + final original = Tracker( + id: 'abc', + name: 'My Plan', + colorValue: 0xFF3F51B5, + startDate: DateTime.utc(2024, 1, 2, 3, 4, 5), + readChapters: const {'0:1', '0:2', '65:22'}, + ); + + final Map json = original.toJson(); + final Tracker decoded = Tracker.fromJson(json); + + expect(decoded, original); + }); + + test('copyWith replaces a subset of fields', () { + final original = Tracker( + id: 'abc', + name: 'Old', + colorValue: 0xFF000000, + startDate: DateTime(2024, 1, 1), + ); + final Tracker updated = original.copyWith( + name: 'New', + readChapters: const {'0:1'}, + ); + expect(updated.id, 'abc'); + expect(updated.name, 'New'); + expect(updated.colorValue, 0xFF000000); + expect(updated.readChapters, const {'0:1'}); + }); + }); +} diff --git a/test/screens/home_screen_test.dart b/test/screens/home_screen_test.dart new file mode 100644 index 0000000..3069e78 --- /dev/null +++ b/test/screens/home_screen_test.dart @@ -0,0 +1,46 @@ +import 'package:bible_tracker/screens/home_screen.dart'; +import 'package:bible_tracker/services/tracker_service.dart'; +import 'package:bible_tracker/services/tracker_storage.dart'; +import 'package:bible_tracker/widgets/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +Future _wrapped() async { + SharedPreferences.setMockInitialValues({}); + final prefs = await SharedPreferences.getInstance(); + return ProviderScope( + overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], + child: MaterialApp(theme: AppTheme.light(), home: const HomeScreen()), + ); +} + +void main() { + testWidgets('shows empty state when no trackers exist', (tester) async { + await tester.pumpWidget(await _wrapped()); + await tester.pumpAndSettle(); + expect(find.text('Start your first tracker'), findsOneWidget); + expect(find.text('New Tracker'), findsOneWidget); + }); + + testWidgets('creating a tracker shows it on the list', (tester) async { + await tester.pumpWidget(await _wrapped()); + await tester.pumpAndSettle(); + + final ProviderScope scope = tester.widget( + find.byType(ProviderScope), + ); + expect(scope, isNotNull); + + final BuildContext context = tester.element(find.byType(HomeScreen)); + final ProviderContainer container = ProviderScope.containerOf(context); + await container + .read(trackerServiceProvider.notifier) + .create(name: 'My Plan', color: const Color(0xFF3F51B5)); + await tester.pumpAndSettle(); + + expect(find.text('My Plan'), findsOneWidget); + expect(find.text('0%'), findsOneWidget); + }); +} diff --git a/test/services/progress_test.dart b/test/services/progress_test.dart new file mode 100644 index 0000000..63e5e88 --- /dev/null +++ b/test/services/progress_test.dart @@ -0,0 +1,68 @@ +import 'package:bible_tracker/data/bible.dart'; +import 'package:bible_tracker/models/tracker.dart'; +import 'package:bible_tracker/services/progress.dart'; +import 'package:flutter_test/flutter_test.dart'; + +Tracker _tracker({Set read = const {}}) => Tracker( + id: 't', + name: 'Test', + colorValue: 0xFF3F51B5, + startDate: DateTime(2024, 1, 1), + readChapters: read, +); + +void main() { + group('TrackerProgress', () { + test('empty tracker has 0% overall', () { + final progress = TrackerProgress(_tracker()); + expect(progress.overall, 0); + expect(progress.totalRead, 0); + expect(progress.booksCompleted(), 0); + }); + + test('counts chapters within a book', () { + final book = Bible.books[0]; + final tracker = _tracker( + read: { + Bible.chapterKey(book.index, 1), + Bible.chapterKey(book.index, 2), + Bible.chapterKey(book.index, 3), + }, + ); + final progress = TrackerProgress(tracker); + expect(progress.chaptersReadIn(book), 3); + expect(progress.fractionOf(book), closeTo(3 / book.chapterCount, 1e-9)); + expect(progress.isBookStarted(book), true); + expect(progress.isBookComplete(book), false); + }); + + test('book is complete when all chapters are read', () { + final book = Bible.books.firstWhere((Book b) => b.name == 'Jude'); + final tracker = _tracker( + read: { + for (int c = 1; c <= book.chapterCount; c++) + Bible.chapterKey(book.index, c), + }, + ); + final progress = TrackerProgress(tracker); + expect(progress.isBookComplete(book), true); + expect(progress.booksCompleted(), 1); + expect(progress.booksCompleted(Testament.newT), 1); + expect(progress.booksCompleted(Testament.old), 0); + }); + + test('overall fraction reflects all-read state', () { + final all = { + for (final Book book in Bible.books) + for (int c = 1; c <= book.chapterCount; c++) + Bible.chapterKey(book.index, c), + }; + final progress = TrackerProgress(_tracker(read: all)); + expect(progress.totalRead, Bible.totalChapters); + expect(progress.overall, 1.0); + expect(progress.booksCompleted(), Bible.totalBooks); + expect(progress.testamentFraction(Testament.old), 1.0); + expect(progress.testamentFraction(Testament.newT), 1.0); + }); + }); +} diff --git a/test/services/tracker_service_test.dart b/test/services/tracker_service_test.dart new file mode 100644 index 0000000..f0ec0d5 --- /dev/null +++ b/test/services/tracker_service_test.dart @@ -0,0 +1,180 @@ +import 'package:bible_tracker/data/bible.dart'; +import 'package:bible_tracker/models/tracker.dart'; +import 'package:bible_tracker/services/tracker_service.dart'; +import 'package:bible_tracker/services/tracker_storage.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +Future _container() async { + SharedPreferences.setMockInitialValues({}); + final prefs = await SharedPreferences.getInstance(); + return ProviderContainer( + overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], + ); +} + +Future> _waitForData(ProviderContainer container) async { + while (true) { + final AsyncValue> state = container.read( + trackerServiceProvider, + ); + if (state.hasValue) return state.value!; + await Future.delayed(const Duration(milliseconds: 5)); + } +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('starts empty after initial load', () async { + final container = await _container(); + addTearDown(container.dispose); + final List data = await _waitForData(container); + expect(data, isEmpty); + }); + + test('create adds a tracker with the given name and color', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + + final tracker = await container + .read(trackerServiceProvider.notifier) + .create(name: 'My Plan', color: const Color(0xFF123456)); + + expect(tracker.name, 'My Plan'); + expect(tracker.colorValue, const Color(0xFF123456).toARGB32()); + expect(container.read(trackerServiceProvider).value, [tracker]); + }); + + test('toggleChapter adds and then removes chapter', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + + final service = container.read(trackerServiceProvider.notifier); + final tracker = await service.create( + name: 'Plan', + color: const Color(0xFF000000), + ); + + await service.toggleChapter(tracker.id, 0, 1); + Tracker current = container.read(trackerServiceProvider).value!.single; + expect(current.readChapters, {Bible.chapterKey(0, 1)}); + + await service.toggleChapter(tracker.id, 0, 1); + current = container.read(trackerServiceProvider).value!.single; + expect(current.readChapters, isEmpty); + }); + + test('setBookRead marks all chapters of the book', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + final service = container.read(trackerServiceProvider.notifier); + final tracker = await service.create( + name: 'Plan', + color: const Color(0xFF000000), + ); + + await service.setBookRead(tracker.id, 0, read: true); + final Tracker current = container + .read(trackerServiceProvider) + .value! + .single; + final Book genesis = Bible.books[0]; + expect(current.readChapters.length, genesis.chapterCount); + for (int chapter = 1; chapter <= genesis.chapterCount; chapter++) { + expect(current.readChapters.contains(Bible.chapterKey(0, chapter)), true); + } + }); + + test('reset clears only the target tracker', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + final service = container.read(trackerServiceProvider.notifier); + final a = await service.create(name: 'A', color: const Color(0xFF111111)); + final b = await service.create(name: 'B', color: const Color(0xFF222222)); + await service.toggleChapter(a.id, 0, 1); + await service.toggleChapter(b.id, 0, 1); + + await service.reset(a.id); + + final List current = container.read(trackerServiceProvider).value!; + expect( + current.firstWhere((Tracker t) => t.id == a.id).readChapters, + isEmpty, + ); + expect( + current.firstWhere((Tracker t) => t.id == b.id).readChapters, + {Bible.chapterKey(0, 1)}, + ); + }); + + test('delete removes the tracker', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + final service = container.read(trackerServiceProvider.notifier); + final a = await service.create(name: 'A', color: const Color(0xFF111111)); + await service.create(name: 'B', color: const Color(0xFF222222)); + + await service.delete(a.id); + final List current = container.read(trackerServiceProvider).value!; + expect(current.length, 1); + expect(current.single.name, 'B'); + }); + + test('state is persisted across container instances', () async { + SharedPreferences.setMockInitialValues({}); + final prefs = await SharedPreferences.getInstance(); + + final first = ProviderContainer( + overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], + ); + await _waitForData(first); + final created = await first + .read(trackerServiceProvider.notifier) + .create(name: 'Persisted', color: const Color(0xFFAABBCC)); + await first + .read(trackerServiceProvider.notifier) + .toggleChapter(created.id, 5, 3); + first.dispose(); + + final second = ProviderContainer( + overrides: [sharedPreferencesProvider.overrideWithValue(prefs)], + ); + addTearDown(second.dispose); + final List loaded = await _waitForData(second); + + expect(loaded.length, 1); + expect(loaded.single.name, 'Persisted'); + expect(loaded.single.readChapters, {Bible.chapterKey(5, 3)}); + }); + + test('updateMeta changes name and color', () async { + final container = await _container(); + addTearDown(container.dispose); + await _waitForData(container); + final service = container.read(trackerServiceProvider.notifier); + final tracker = await service.create( + name: 'Old', + color: const Color(0xFF111111), + ); + + await service.updateMeta( + tracker.id, + name: 'New', + color: const Color(0xFF222222), + ); + final Tracker current = container + .read(trackerServiceProvider) + .value! + .single; + expect(current.name, 'New'); + expect(current.colorValue, const Color(0xFF222222).toARGB32()); + }); +}