diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml
index d62d376..3bdd500 100644
--- a/.github/workflows/dart.yml
+++ b/.github/workflows/dart.yml
@@ -241,12 +241,12 @@ jobs:
prerelease: false
generate_release_notes: true
body: |
- ## 🎉 TeleBook ${{ steps.version.outputs.VERSION }}
+ ## 🎉 tele_book ${{ steps.version.outputs.VERSION }}
### 📦 下载
- - **Android**: [TeleBook-android-${{ steps.version.outputs.VERSION }}.apk]
- - **Windows**: [TeleBook-windows-${{ steps.version.outputs.VERSION }}.zip]
- - **iOS**: [TeleBook-ios-${{ steps.version.outputs.VERSION }}.ipa]
+ - **Android**: [tele_book-android-${{ steps.version.outputs.VERSION }}.apk]
+ - **Windows**: [tele_book-windows-${{ steps.version.outputs.VERSION }}.zip]
+ - **iOS**: [tele_book-ios-${{ steps.version.outputs.VERSION }}.ipa]
### 📝 更新内容
详见下方自动生成的更新日志。
diff --git a/.gitignore b/.gitignore
index 9b00b0e..9f8609c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,4 +52,4 @@ app.*.map.json
keystore_base64.txt
pubspec.lock
-
+*.sqlite
diff --git a/.metadata b/.metadata
index c5f4036..768732a 100644
--- a/.metadata
+++ b/.metadata
@@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6"
+ revision: "559ffa3f75e7402d65a8def9c28389a9b2e6fe42"
channel: "stable"
project_type: app
@@ -13,11 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
- base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ - platform: android
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ - platform: ios
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
- platform: linux
- create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
- base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ - platform: macos
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ - platform: web
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ - platform: windows
+ create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
+ base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
# User provided section
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 9403522..9a2e3cc 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -26,3 +26,7 @@ linter:
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
+
+analyzer:
+ plugins:
+ - custom_lint
\ No newline at end of file
diff --git a/android/.gitignore b/android/.gitignore
index 6f56801..be3943c 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -5,9 +5,10 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
+.cxx/
# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
diff --git a/android/app/build.gradle b/android/app/build.gradle
deleted file mode 100644
index adacd45..0000000
--- a/android/app/build.gradle
+++ /dev/null
@@ -1,115 +0,0 @@
-plugins {
- id "com.android.application"
- id "kotlin-android"
- id "dev.flutter.flutter-gradle-plugin"
-}
-
-def localProperties = new java.util.Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def keystoreProperties = new java.util.Properties()
-def keystorePropertiesFile = rootProject.file('key.properties')
-if (keystorePropertiesFile.exists()) {
- keystoreProperties.load(new java.io.FileInputStream(keystorePropertiesFile))
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
-
-def updatePubspecVersion() {
- def versionPropsFile = file('../../version.properties')
- if (versionPropsFile.canRead()) {
- def versionProps = new java.util.Properties()
- versionProps.load(new java.io.FileInputStream(versionPropsFile))
-
- def versionName = versionProps['VERSION_NAME']
- def versionCode = versionProps['VERSION_CODE']
-
- def pubspecFile = file('../../pubspec.yaml')
- def pubspecContent = pubspecFile.text
- def newContent = pubspecContent.replaceAll(
- /version:\s*[\d.]+\+\d+/,
- "version: ${versionName}+${versionCode}"
- )
- pubspecFile.text = newContent
- }
-}
-
-preBuild.doFirst {
- updatePubspecVersion()
-}
-
-android {
- namespace "com.dorkytiger.tele_book"
- compileSdkVersion flutter.compileSdkVersion
- ndkVersion "28.2.13676358"
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_21
- targetCompatibility JavaVersion.VERSION_21
- }
-
- kotlinOptions {
- jvmTarget = '21'
- }
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
-
- defaultConfig {
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.dorkytiger.tele_book"
- // You can update the following values to match your application needs.
- // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdkVersion flutter.minSdkVersion
- targetSdkVersion flutter.targetSdkVersion
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- }
-
- signingConfigs {
- release {
- if (keystorePropertiesFile.exists()) {
- keyAlias keystoreProperties['keyAlias']
- keyPassword keystoreProperties['keyPassword']
- storeFile file(keystoreProperties['storeFile'])
- storePassword keystoreProperties['storePassword']
- }
- }
- }
-
- buildTypes {
- release {
- // Only assign the release signingConfig when a release keystore is present.
- // This avoids Gradle trying to use an empty 'release' signingConfig when
- // key.properties is not provided (which causes the missing storeFile error).
- if (keystorePropertiesFile.exists()) {
- signingConfig signingConfigs.release
- }
- }
- debug {
- // Use the default debug signing (do not force the release signingConfig).
- // When key.properties is absent, this prevents the missing storeFile error
- // during debug builds.
- }
- }
-}
-
-flutter {
- source '../..'
-}
-
-dependencies {}
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
new file mode 100644
index 0000000..93d9c29
--- /dev/null
+++ b/android/app/build.gradle.kts
@@ -0,0 +1,45 @@
+plugins {
+ id("com.android.application")
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id("dev.flutter.flutter-gradle-plugin")
+}
+
+android {
+ namespace = "com.example.tele_book"
+ compileSdk = flutter.compileSdkVersion
+ ndkVersion = flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId = "com.example.tele_book"
+ // 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")
+ }
+ }
+}
+
+kotlin {
+ compilerOptions {
+ jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
+ }
+}
+
+flutter {
+ source = "../.."
+}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 2fa2f43..ed13ab7 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
-
+
@@ -13,30 +12,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/android/app/src/main/kotlin/com/dorkytiger/tele_book/MainActivity.kt b/android/app/src/main/kotlin/com/dorkytiger/tele_book/MainActivity.kt
deleted file mode 100644
index eb0eba8..0000000
--- a/android/app/src/main/kotlin/com/dorkytiger/tele_book/MainActivity.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.dorkytiger.tele_book
-
-import android.app.NotificationChannel
-import android.app.NotificationManager
-import android.os.Build
-import android.os.Bundle
-import io.flutter.embedding.android.FlutterActivity
-
-class MainActivity: FlutterActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- // 创建下载通知渠道
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
-
- // 创建下载通知渠道
- val downloadChannel = NotificationChannel(
- "background_downloader",
- "下载管理",
- NotificationManager.IMPORTANCE_LOW
- ).apply {
- description = "显示文件下载进度和状态"
- setShowBadge(false)
- enableVibration(false)
- }
- notificationManager.createNotificationChannel(downloadChannel)
-
- // 创建前台服务通知渠道
- val foregroundChannel = NotificationChannel(
- "background_downloader_foreground",
- "后台下载服务",
- NotificationManager.IMPORTANCE_LOW
- ).apply {
- description = "保持后台下载服务运行"
- setShowBadge(false)
- enableVibration(false)
- }
- notificationManager.createNotificationChannel(foregroundChannel)
- }
- }
-}
diff --git a/android/app/src/main/kotlin/com/example/tele_book/MainActivity.kt b/android/app/src/main/kotlin/com/example/tele_book/MainActivity.kt
new file mode 100644
index 0000000..06da5b9
--- /dev/null
+++ b/android/app/src/main/kotlin/com/example/tele_book/MainActivity.kt
@@ -0,0 +1,5 @@
+package com.example.tele_book
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity : FlutterActivity()
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
index 0e22fd1..db77bb4 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png 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
index 0e22fd1..17987b7 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png 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
index 0e22fd1..09d4391 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png 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
index 0e22fd1..d5f1c8d 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png 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
index 0e22fd1..4d6372e 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml
index 04f2faf..399f698 100644
--- a/android/app/src/profile/AndroidManifest.xml
+++ b/android/app/src/profile/AndroidManifest.xml
@@ -3,10 +3,5 @@
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
-
-
-
-
-
diff --git a/android/build.gradle b/android/build.gradle
deleted file mode 100644
index 930a713..0000000
--- a/android/build.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-buildscript {
- ext.kotlin_version = '2.3.0'
- repositories {
- google()
- mavenCentral()
-
- }
-
-}
-
-
-rootProject.buildDir = '../build'
-subprojects {
- project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
- project.evaluationDependsOn(':app')
-}
-
-tasks.register("clean", Delete) {
- delete rootProject.buildDir
-}
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/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html
deleted file mode 100644
index 6589a90..0000000
--- a/android/build/reports/problems/problems-report.html
+++ /dev/null
@@ -1,659 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Gradle Configuration Cache
-
-
-
-
-
-
- Loading...
-
-
-
-
-
-
-
diff --git a/android/gradle.properties b/android/gradle.properties
index 598d13f..e96108c 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,3 +1,6 @@
-org.gradle.jvmargs=-Xmx4G
+org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
-android.enableJetifier=true
+# This newDsl flag was added by the Flutter template
+android.newDsl=false
+# This builtInKotlin flag was added by the Flutter template
+android.builtInKotlin=false
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 6388f31..2d428bf 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
diff --git a/android/key.properties.example b/android/key.properties.example
deleted file mode 100644
index c9d3d0d..0000000
--- a/android/key.properties.example
+++ /dev/null
@@ -1,4 +0,0 @@
-storePassword=1234abcD
-keyPassword=1234abcD
-keyAlias=dorkytiger
-storeFile=upload-keystore.jks
\ No newline at end of file
diff --git a/android/settings.gradle b/android/settings.gradle
deleted file mode 100644
index bd05419..0000000
--- a/android/settings.gradle
+++ /dev/null
@@ -1,30 +0,0 @@
-pluginManagement {
- def flutterSdkPath = {
- def properties = new Properties()
- file("local.properties").withInputStream { properties.load(it) }
- def flutterSdkPath = properties.getProperty("flutter.sdk")
- assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
- return flutterSdkPath
- }
- settings.ext.flutterSdkPath = flutterSdkPath()
-
- includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
-
- repositories {
- google()
- mavenCentral()
- gradlePluginPortal()
- }
-
- plugins {
- id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
- }
-}
-
-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.3.0" apply false
-}
-
-include ":app"
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
new file mode 100644
index 0000000..c21f0c5
--- /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 "9.0.1" apply false
+ id("org.jetbrains.kotlin.android") version "2.3.20" apply false
+}
+
+include(":app")
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 70d90c4..bc7cb92 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
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 */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
7A07A4ADD59CDFBF626C66F9 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2313121B4CEE6A8FDF62CC94 /* Pods_RunnerTests.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -52,6 +53,7 @@
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 = ""; };
7761669B9BB3378222FA1675 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
7A02C1B51900805359BB2217 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
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 = ""; };
@@ -72,6 +74,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
B6B4894B7BD412271BA4F633 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -98,6 +101,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
+ 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@@ -198,13 +202,15 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
0FAAAE3FD367FFA7A864DA02 /* [CP] Embed Pods Frameworks */,
- B0CA94AB8D604043F6F08669 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ );
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
@@ -238,6 +244,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ );
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -318,23 +327,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
- B0CA94AB8D604043F6F08669 /* [CP] Copy Pods Resources */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Copy Pods Resources";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
- showEnvVarsInLog = 0;
- };
CEDD2AE7CF389940B93D98E0 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -758,6 +750,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index e3773d4..c3fedb2 100644
--- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -5,6 +5,24 @@
+
+
+
+
+
+
+
+
+
+
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
- TeleBook
+ tele_book
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -15,7 +15,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- TeleBook
+ tele_book
CFBundlePackageType
APPL
CFBundleShortVersionString
diff --git a/ios/Runner/SceneDelegate.swift b/ios/Runner/SceneDelegate.swift
new file mode 100644
index 0000000..b9ce8ea
--- /dev/null
+++ b/ios/Runner/SceneDelegate.swift
@@ -0,0 +1,6 @@
+import Flutter
+import UIKit
+
+class SceneDelegate: FlutterSceneDelegate {
+
+}
diff --git a/lib/common/widget/empty_widget.dart b/lib/common/widget/empty_widget.dart
new file mode 100644
index 0000000..28a393b
--- /dev/null
+++ b/lib/common/widget/empty_widget.dart
@@ -0,0 +1,29 @@
+import 'package:flutter/cupertino.dart';
+
+class CustomEmptyWidget extends StatelessWidget {
+ final IconData? icon;
+ final String? text;
+
+ const CustomEmptyWidget({super.key, this.icon, this.text});
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(height: 40),
+ Icon(
+ icon ?? CupertinoIcons.infinite,
+ size: 60,
+ color: CupertinoColors.systemGrey,
+ ),
+ SizedBox(height: 20),
+ Text(
+ text ?? "暂无数据",
+ style: TextStyle(fontSize: 16, color: CupertinoColors.systemGrey),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/common/widget/error_widget.dart b/lib/common/widget/error_widget.dart
new file mode 100644
index 0000000..4be84d9
--- /dev/null
+++ b/lib/common/widget/error_widget.dart
@@ -0,0 +1,76 @@
+import 'dart:math';
+
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:forui/forui.dart';
+
+class CustomErrorWidget extends StatelessWidget {
+ final String? errorMessage;
+ final StackTrace? stackTrace;
+ final VoidCallback? onRetry;
+
+ const CustomErrorWidget({
+ Key? key,
+ this.errorMessage,
+ this.stackTrace,
+ this.onRetry,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ padding: EdgeInsets.all(16),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: .start,
+
+ children: [
+ Text('发生错误',style: context.theme.typography.body.xl2.copyWith(
+ fontWeight: .w600,
+ color: context.theme.colors.error,
+ height: 1.5
+ ),),
+ SizedBox(height: 8),
+ Text('$errorMessage',style: context.theme.typography.body.sm.copyWith(
+ color: context.theme.colors.destructive
+ ),),
+ SizedBox(height: 8),
+ if (stackTrace != null)
+ FButton(
+ onPress: () {
+ showDialog(
+ context: context,
+ builder: (context) => AlertDialog(
+ title: Text('错误详情'),
+ content: SingleChildScrollView(
+ child: Text(stackTrace.toString()),
+ ),
+ actions: [
+ TextButton(
+ onPressed: () => Navigator.of(context).pop(),
+ child: Text('关闭'),
+ ),
+ ],
+ ),
+ );
+ },
+ child: Text("查看详情"),
+ ),
+ ],
+ ),
+ ),
+ ),
+
+ SizedBox(height: 8),
+ if (onRetry != null)
+ ElevatedButton(onPressed: onRetry, child: Text('重试')),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/common/widget/f_adaptive_dialog.dart b/lib/common/widget/f_adaptive_dialog.dart
new file mode 100644
index 0000000..d2eb276
--- /dev/null
+++ b/lib/common/widget/f_adaptive_dialog.dart
@@ -0,0 +1,103 @@
+import 'package:flutter/material.dart';
+import 'package:forui/forui.dart';
+
+class FAdaptiveDialog extends StatelessWidget {
+ final FDialogStyleDelta style;
+ final Animation? animation;
+ final Widget title;
+ final Widget body;
+ final List actions;
+ const FAdaptiveDialog({
+ required this.title,
+ required this.body,
+ required this.actions,
+ this.style = const .context(),
+ this.animation,
+ super.key,
+ });
+ @override
+ Widget build(BuildContext context) => FDialog.adaptive(
+ style: style,
+ animation: animation,
+ horizontalBuilder: (context, style) {
+ final touch = context.platformVariant.touch;
+ return Padding(
+ padding: touch
+ ? const .symmetric(horizontal: 16, vertical: 18)
+ : const .symmetric(horizontal: 16, vertical: 14),
+ child: Column(
+ crossAxisAlignment: .start,
+ mainAxisSize: .min,
+ children: [
+ Padding(
+ padding: touch
+ ? const .only(left: 8, right: 8, bottom: 9)
+ : const .only(bottom: 5),
+ child: DefaultTextStyle.merge(
+ style: style.titleTextStyle,
+ child: title,
+ ),
+ ),
+ Flexible(
+ child: Padding(
+ padding: touch
+ ? const .only(left: 8, right: 8, bottom: 20)
+ : const .only(bottom: 16),
+ child: DefaultTextStyle.merge(
+ style: style.bodyTextStyle,
+ child: body,
+ ),
+ ),
+ ),
+ Row(
+ mainAxisAlignment: .end,
+ spacing: touch ? 10 : 8,
+ children: touch
+ ? [for (final action in actions) Expanded(child: action)]
+ : actions,
+ ),
+ ],
+ ),
+ );
+ },
+ verticalBuilder: (context, style) {
+ final touch = context.platformVariant.touch;
+ return Padding(
+ padding: touch
+ ? const .symmetric(horizontal: 16, vertical: 18)
+ : const .symmetric(horizontal: 16, vertical: 14),
+ child: Column(
+ crossAxisAlignment: .start,
+ mainAxisSize: .min,
+ children: [
+ Padding(
+ padding: touch
+ ? const .only(left: 8, right: 8, bottom: 9)
+ : const .only(left: 8, right: 8, bottom: 5),
+ child: DefaultTextStyle.merge(
+ style: style.titleTextStyle,
+ child: title,
+ ),
+ ),
+ Flexible(
+ child: Padding(
+ padding: touch
+ ? const .only(left: 8, right: 8, bottom: 20)
+ : const .only(left: 8, right: 8, bottom: 16),
+ child: DefaultTextStyle.merge(
+ style: style.bodyTextStyle,
+ child: body,
+ ),
+ ),
+ ),
+ Column(
+ mainAxisSize: .min,
+ spacing: touch ? 10 : 8,
+ children: actions,
+ ),
+ ],
+ ),
+ );
+ },
+ );
+}
\ No newline at end of file
diff --git a/lib/common/widget/f_sheet_content.dart b/lib/common/widget/f_sheet_content.dart
new file mode 100644
index 0000000..a980241
--- /dev/null
+++ b/lib/common/widget/f_sheet_content.dart
@@ -0,0 +1,67 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:forui/forui.dart';
+
+class FSheetContent extends StatelessWidget {
+ final FLayout side;
+ final Widget child;
+
+ const FSheetContent({super.key, required this.side, required this.child});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ height: .infinity,
+ width: .infinity,
+ decoration: BoxDecoration(
+ color: context.theme.colors.background,
+ border: side.vertical
+ ? .symmetric(
+ horizontal: BorderSide(color: context.theme.colors.border),
+ )
+ : .symmetric(
+ vertical: BorderSide(color: context.theme.colors.border),
+ ),
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Padding(
+ padding: const .symmetric(horizontal: 15, vertical: 8.0),
+ child: child,
+ ),
+ );
+ }
+
+ static Widget drag() {
+ return Center(
+ child: Container(
+ margin: const EdgeInsets.only(top: 8, bottom: 4),
+ width: 40,
+ height: 4,
+ decoration: BoxDecoration(
+ color: Colors.grey[400],
+ borderRadius: BorderRadius.circular(2),
+ ),
+ ),
+ );
+ }
+
+ static Widget title(BuildContext context, String title) {
+ return Text(
+ title,
+ style: context.theme.typography.display.xl2.copyWith(
+ fontWeight: .w600,
+ color: context.theme.colors.foreground,
+ height: 1.5,
+ ),
+ );
+ }
+
+ static Widget subTitle(BuildContext context, String subTitle) {
+ return Text(
+ subTitle,
+ style: context.theme.typography.body.sm.copyWith(
+ color: context.theme.colors.mutedForeground,
+ ),
+ );
+ }
+}
diff --git a/lib/common/widget/f_text.dart b/lib/common/widget/f_text.dart
new file mode 100644
index 0000000..a984836
--- /dev/null
+++ b/lib/common/widget/f_text.dart
@@ -0,0 +1,24 @@
+import 'package:flutter/cupertino.dart';
+import 'package:forui/forui.dart';
+
+class FText {
+static Widget title(BuildContext context,String title){
+ return Text(
+ title,
+ style: context.theme.typography.display.xl2.copyWith(
+ fontWeight: .w600,
+ color: context.theme.colors.foreground,
+ height: 1.5,
+ ),
+ );
+ }
+
+ static Widget subTitle(BuildContext context, String subTitle) {
+ return Text(
+ subTitle,
+ style: context.theme.typography.body.sm.copyWith(
+ color: context.theme.colors.mutedForeground,
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/common/widget/task_item_widget.dart b/lib/common/widget/task_item_widget.dart
index b56ed29..c3430bc 100644
--- a/lib/common/widget/task_item_widget.dart
+++ b/lib/common/widget/task_item_widget.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:forui/forui.dart';
import 'package:tele_book/common/widget/network_image_widget.dart';
class TaskItemWidget extends StatelessWidget {
@@ -21,35 +22,12 @@ class TaskItemWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return GestureDetector(
- onTap: onTap,
- child: Row(
- children: [
- NetworkImageWidget(imageUrl: coverUrl),
- Expanded(
- child: ListTile(
- title: Text(
- title,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: Theme.of(context).textTheme.bodyLarge,
- ),
- subtitle: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "状态: $status",
- style: Theme.of(context).textTheme.bodyMedium,
- ),
- SizedBox(height: 8),
- LinearProgressIndicator(value: progress,borderRadius: BorderRadius.circular(4),),
- ],
- ),
- trailing: trailing,
- ),
- ),
- ],
- ),
+ return FItem(
+ onPress: onTap,
+ prefix: NetworkImageWidget(imageUrl: coverUrl),
+ title: Text(title, maxLines: 2),
+ subtitle: Text("$status ${(progress * 100).toStringAsFixed(1)}%"),
+ suffix: trailing,
);
}
}
diff --git a/lib/core/db/app_database.dart b/lib/core/db/app_database.dart
index 857c0a2..f01bd61 100644
--- a/lib/core/db/app_database.dart
+++ b/lib/core/db/app_database.dart
@@ -1,25 +1,71 @@
+import 'dart:io';
+
import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart';
-import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
-
+import 'package:riverpod/riverpod.dart';
import 'package:tele_book/feature/book/datasource/local/book_local_datasource.dart';
import 'package:tele_book/feature/book/model/table/book_table.dart';
+import 'package:tele_book/feature/collection/datasource/local/collection_book_local_datasource.dart';
+import 'package:tele_book/feature/collection/datasource/local/collection_local_datasource.dart';
+import 'package:tele_book/feature/collection/model/table/collection_book_table.dart';
+import 'package:tele_book/feature/collection/model/table/collection_table.dart';
import 'converter/string_list_converter.dart';
part 'app_database.g.dart';
-@DriftDatabase(tables: [BookTable], daos: [BookLocalDatasource])
+@DriftDatabase(
+ tables: [BookTable, CollectionTable, CollectionBookTable],
+ daos: [
+ BookLocalDatasource,
+ CollectionLocalDatasource,
+ CollectionBookLocalDatasource,
+ ],
+)
class AppDatabase extends _$AppDatabase {
// Allow injecting a QueryExecutor for tests. If null, use the default on-disk executor.
AppDatabase([QueryExecutor? executor])
: super((executor ?? _openConnection()));
@override
- int get schemaVersion => 1;
+ int get schemaVersion => 2;
+
+ @override
+ MigrationStrategy get migration => MigrationStrategy(
+ onUpgrade: (migrator, from, to) async {
+ // 破坏性更新:删除所有表并重建
+ await customStatement('PRAGMA foreign_keys = OFF');
+ final tableNames = allTables.map((t) => t.actualTableName).toList();
+ for (final name in tableNames) {
+ await customStatement('DROP TABLE IF EXISTS "$name"');
+ }
+ await migrator.createAll();
+ await customStatement('PRAGMA foreign_keys = ON');
+ },
+ );
static QueryExecutor _openConnection() {
- return driftDatabase(name: 'tele_book');
+ return driftDatabase(
+ name: 'tele_book',
+ native: DriftNativeOptions(
+ databaseDirectory: () async {
+ if (Platform.isIOS || Platform.isAndroid) {
+ final dbFolder = await getApplicationDocumentsDirectory();
+ print('Database path: ${dbFolder.path}');
+ return dbFolder.path;
+ } else {
+ // For desktop platforms, use the current directory
+ return Directory.current.path;
+ }
+ },
+ ),
+ );
}
}
+
+final databaseProvider = Provider((ref) {
+ final db = AppDatabase();
+ ref.onDispose(() => db.close());
+ return db;
+});
diff --git a/lib/core/db/app_database.g.dart b/lib/core/db/app_database.g.dart
index f08d276..2539a3c 100644
--- a/lib/core/db/app_database.g.dart
+++ b/lib/core/db/app_database.g.dart
@@ -36,6 +36,26 @@ class $BookTableTable extends BookTable
type: DriftSqlType.string,
requiredDuringInsert: true,
).withConverter>($BookTableTable.$converterlocalSubPaths);
+ static const VerificationMeta _coverSubPathMeta = const VerificationMeta(
+ 'coverSubPath',
+ );
+ @override
+ late final GeneratedColumn coverSubPath = GeneratedColumn(
+ 'cover_sub_path',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ @override
+ late final GeneratedColumnWithTypeConverter?, String>
+ previewSubPaths = GeneratedColumn(
+ 'preview_sub_paths',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ ).withConverter?>($BookTableTable.$converterpreviewSubPathsn);
static const VerificationMeta _readCountMeta = const VerificationMeta(
'readCount',
);
@@ -77,6 +97,8 @@ class $BookTableTable extends BookTable
id,
name,
localSubPaths,
+ coverSubPath,
+ previewSubPaths,
readCount,
currentPage,
createdAt,
@@ -104,6 +126,15 @@ class $BookTableTable extends BookTable
} else if (isInserting) {
context.missing(_nameMeta);
}
+ if (data.containsKey('cover_sub_path')) {
+ context.handle(
+ _coverSubPathMeta,
+ coverSubPath.isAcceptableOrUnknown(
+ data['cover_sub_path']!,
+ _coverSubPathMeta,
+ ),
+ );
+ }
if (data.containsKey('read_count')) {
context.handle(
_readCountMeta,
@@ -148,6 +179,16 @@ class $BookTableTable extends BookTable
data['${effectivePrefix}local_sub_paths'],
)!,
),
+ coverSubPath: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}cover_sub_path'],
+ ),
+ previewSubPaths: $BookTableTable.$converterpreviewSubPathsn.fromSql(
+ attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}preview_sub_paths'],
+ ),
+ ),
readCount: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}read_count'],
@@ -170,12 +211,20 @@ class $BookTableTable extends BookTable
static JsonTypeConverter2, String, List>
$converterlocalSubPaths = const StringListConverter();
+ static JsonTypeConverter2, String, List>
+ $converterpreviewSubPaths = const StringListConverter();
+ static JsonTypeConverter2?, String?, List?>
+ $converterpreviewSubPathsn = JsonTypeConverter2.asNullable(
+ $converterpreviewSubPaths,
+ );
}
class BookTableData extends DataClass implements Insertable {
final int id;
final String name;
final List localSubPaths;
+ final String? coverSubPath;
+ final List? previewSubPaths;
final int readCount;
final int currentPage;
final DateTime createdAt;
@@ -183,6 +232,8 @@ class BookTableData extends DataClass implements Insertable {
required this.id,
required this.name,
required this.localSubPaths,
+ this.coverSubPath,
+ this.previewSubPaths,
required this.readCount,
required this.currentPage,
required this.createdAt,
@@ -197,6 +248,14 @@ class BookTableData extends DataClass implements Insertable {
$BookTableTable.$converterlocalSubPaths.toSql(localSubPaths),
);
}
+ if (!nullToAbsent || coverSubPath != null) {
+ map['cover_sub_path'] = Variable(coverSubPath);
+ }
+ if (!nullToAbsent || previewSubPaths != null) {
+ map['preview_sub_paths'] = Variable(
+ $BookTableTable.$converterpreviewSubPathsn.toSql(previewSubPaths),
+ );
+ }
map['read_count'] = Variable(readCount);
map['current_page'] = Variable(currentPage);
map['created_at'] = Variable(createdAt);
@@ -208,6 +267,12 @@ class BookTableData extends DataClass implements Insertable {
id: Value(id),
name: Value(name),
localSubPaths: Value(localSubPaths),
+ coverSubPath: coverSubPath == null && nullToAbsent
+ ? const Value.absent()
+ : Value(coverSubPath),
+ previewSubPaths: previewSubPaths == null && nullToAbsent
+ ? const Value.absent()
+ : Value(previewSubPaths),
readCount: Value(readCount),
currentPage: Value(currentPage),
createdAt: Value(createdAt),
@@ -225,6 +290,10 @@ class BookTableData extends DataClass implements Insertable {
localSubPaths: $BookTableTable.$converterlocalSubPaths.fromJson(
serializer.fromJson>(json['localSubPaths']),
),
+ coverSubPath: serializer.fromJson(json['coverSubPath']),
+ previewSubPaths: $BookTableTable.$converterpreviewSubPathsn.fromJson(
+ serializer.fromJson?>(json['previewSubPaths']),
+ ),
readCount: serializer.fromJson(json['readCount']),
currentPage: serializer.fromJson(json['currentPage']),
createdAt: serializer.fromJson(json['createdAt']),
@@ -239,6 +308,10 @@ class BookTableData extends DataClass implements Insertable {
'localSubPaths': serializer.toJson>(
$BookTableTable.$converterlocalSubPaths.toJson(localSubPaths),
),
+ 'coverSubPath': serializer.toJson(coverSubPath),
+ 'previewSubPaths': serializer.toJson?>(
+ $BookTableTable.$converterpreviewSubPathsn.toJson(previewSubPaths),
+ ),
'readCount': serializer.toJson(readCount),
'currentPage': serializer.toJson(currentPage),
'createdAt': serializer.toJson(createdAt),
@@ -249,6 +322,8 @@ class BookTableData extends DataClass implements Insertable {
int? id,
String? name,
List? localSubPaths,
+ Value coverSubPath = const Value.absent(),
+ Value?> previewSubPaths = const Value.absent(),
int? readCount,
int? currentPage,
DateTime? createdAt,
@@ -256,6 +331,10 @@ class BookTableData extends DataClass implements Insertable {
id: id ?? this.id,
name: name ?? this.name,
localSubPaths: localSubPaths ?? this.localSubPaths,
+ coverSubPath: coverSubPath.present ? coverSubPath.value : this.coverSubPath,
+ previewSubPaths: previewSubPaths.present
+ ? previewSubPaths.value
+ : this.previewSubPaths,
readCount: readCount ?? this.readCount,
currentPage: currentPage ?? this.currentPage,
createdAt: createdAt ?? this.createdAt,
@@ -267,6 +346,12 @@ class BookTableData extends DataClass implements Insertable {
localSubPaths: data.localSubPaths.present
? data.localSubPaths.value
: this.localSubPaths,
+ coverSubPath: data.coverSubPath.present
+ ? data.coverSubPath.value
+ : this.coverSubPath,
+ previewSubPaths: data.previewSubPaths.present
+ ? data.previewSubPaths.value
+ : this.previewSubPaths,
readCount: data.readCount.present ? data.readCount.value : this.readCount,
currentPage: data.currentPage.present
? data.currentPage.value
@@ -281,6 +366,8 @@ class BookTableData extends DataClass implements Insertable {
..write('id: $id, ')
..write('name: $name, ')
..write('localSubPaths: $localSubPaths, ')
+ ..write('coverSubPath: $coverSubPath, ')
+ ..write('previewSubPaths: $previewSubPaths, ')
..write('readCount: $readCount, ')
..write('currentPage: $currentPage, ')
..write('createdAt: $createdAt')
@@ -289,8 +376,16 @@ class BookTableData extends DataClass implements Insertable {
}
@override
- int get hashCode =>
- Object.hash(id, name, localSubPaths, readCount, currentPage, createdAt);
+ int get hashCode => Object.hash(
+ id,
+ name,
+ localSubPaths,
+ coverSubPath,
+ previewSubPaths,
+ readCount,
+ currentPage,
+ createdAt,
+ );
@override
bool operator ==(Object other) =>
identical(this, other) ||
@@ -298,6 +393,8 @@ class BookTableData extends DataClass implements Insertable {
other.id == this.id &&
other.name == this.name &&
other.localSubPaths == this.localSubPaths &&
+ other.coverSubPath == this.coverSubPath &&
+ other.previewSubPaths == this.previewSubPaths &&
other.readCount == this.readCount &&
other.currentPage == this.currentPage &&
other.createdAt == this.createdAt);
@@ -307,6 +404,8 @@ class BookTableCompanion extends UpdateCompanion {
final Value id;
final Value name;
final Value> localSubPaths;
+ final Value coverSubPath;
+ final Value?> previewSubPaths;
final Value readCount;
final Value currentPage;
final Value createdAt;
@@ -314,6 +413,8 @@ class BookTableCompanion extends UpdateCompanion {
this.id = const Value.absent(),
this.name = const Value.absent(),
this.localSubPaths = const Value.absent(),
+ this.coverSubPath = const Value.absent(),
+ this.previewSubPaths = const Value.absent(),
this.readCount = const Value.absent(),
this.currentPage = const Value.absent(),
this.createdAt = const Value.absent(),
@@ -322,6 +423,8 @@ class BookTableCompanion extends UpdateCompanion {
this.id = const Value.absent(),
required String name,
required List localSubPaths,
+ this.coverSubPath = const Value.absent(),
+ this.previewSubPaths = const Value.absent(),
this.readCount = const Value.absent(),
this.currentPage = const Value.absent(),
this.createdAt = const Value.absent(),
@@ -331,6 +434,8 @@ class BookTableCompanion extends UpdateCompanion {
Expression? id,
Expression? name,
Expression? localSubPaths,
+ Expression? coverSubPath,
+ Expression? previewSubPaths,
Expression? readCount,
Expression? currentPage,
Expression? createdAt,
@@ -339,6 +444,8 @@ class BookTableCompanion extends UpdateCompanion {
if (id != null) 'id': id,
if (name != null) 'name': name,
if (localSubPaths != null) 'local_sub_paths': localSubPaths,
+ if (coverSubPath != null) 'cover_sub_path': coverSubPath,
+ if (previewSubPaths != null) 'preview_sub_paths': previewSubPaths,
if (readCount != null) 'read_count': readCount,
if (currentPage != null) 'current_page': currentPage,
if (createdAt != null) 'created_at': createdAt,
@@ -349,6 +456,8 @@ class BookTableCompanion extends UpdateCompanion {
Value? id,
Value? name,
Value>? localSubPaths,
+ Value? coverSubPath,
+ Value?>? previewSubPaths,
Value? readCount,
Value? currentPage,
Value? createdAt,
@@ -357,6 +466,8 @@ class BookTableCompanion extends UpdateCompanion {
id: id ?? this.id,
name: name ?? this.name,
localSubPaths: localSubPaths ?? this.localSubPaths,
+ coverSubPath: coverSubPath ?? this.coverSubPath,
+ previewSubPaths: previewSubPaths ?? this.previewSubPaths,
readCount: readCount ?? this.readCount,
currentPage: currentPage ?? this.currentPage,
createdAt: createdAt ?? this.createdAt,
@@ -377,6 +488,14 @@ class BookTableCompanion extends UpdateCompanion {
$BookTableTable.$converterlocalSubPaths.toSql(localSubPaths.value),
);
}
+ if (coverSubPath.present) {
+ map['cover_sub_path'] = Variable(coverSubPath.value);
+ }
+ if (previewSubPaths.present) {
+ map['preview_sub_paths'] = Variable(
+ $BookTableTable.$converterpreviewSubPathsn.toSql(previewSubPaths.value),
+ );
+ }
if (readCount.present) {
map['read_count'] = Variable(readCount.value);
}
@@ -395,6 +514,8 @@ class BookTableCompanion extends UpdateCompanion {
..write('id: $id, ')
..write('name: $name, ')
..write('localSubPaths: $localSubPaths, ')
+ ..write('coverSubPath: $coverSubPath, ')
+ ..write('previewSubPaths: $previewSubPaths, ')
..write('readCount: $readCount, ')
..write('currentPage: $currentPage, ')
..write('createdAt: $createdAt')
@@ -403,113 +524,731 @@ class BookTableCompanion extends UpdateCompanion {
}
}
-abstract class _$AppDatabase extends GeneratedDatabase {
- _$AppDatabase(QueryExecutor e) : super(e);
- $AppDatabaseManager get managers => $AppDatabaseManager(this);
- late final $BookTableTable bookTable = $BookTableTable(this);
- late final BookLocalDatasource bookLocalDatasource = BookLocalDatasource(
- this as AppDatabase,
- );
+class $CollectionTableTable extends CollectionTable
+ with TableInfo<$CollectionTableTable, CollectionTableData> {
@override
- Iterable> get allTables =>
- allSchemaEntities.whereType>();
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ $CollectionTableTable(this.attachedDatabase, [this._alias]);
+ static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
- List get allSchemaEntities => [bookTable];
-}
-
-typedef $$BookTableTableCreateCompanionBuilder =
- BookTableCompanion Function({
- Value id,
- required String name,
- required List localSubPaths,
- Value readCount,
- Value currentPage,
- Value createdAt,
- });
-typedef $$BookTableTableUpdateCompanionBuilder =
- BookTableCompanion Function({
- Value id,
- Value name,
- Value> localSubPaths,
- Value readCount,
- Value currentPage,
- Value createdAt,
- });
-
-class $$BookTableTableFilterComposer
- extends Composer<_$AppDatabase, $BookTableTable> {
- $$BookTableTableFilterComposer({
- required super.$db,
- required super.$table,
- super.joinBuilder,
- super.$addJoinBuilderToRootComposer,
- super.$removeJoinBuilderFromRootComposer,
- });
- ColumnFilters get id => $composableBuilder(
- column: $table.id,
- builder: (column) => ColumnFilters(column),
+ late final GeneratedColumn id = GeneratedColumn(
+ 'id',
+ aliasedName,
+ false,
+ hasAutoIncrement: true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'PRIMARY KEY AUTOINCREMENT',
+ ),
);
-
- ColumnFilters get name => $composableBuilder(
- column: $table.name,
- builder: (column) => ColumnFilters(column),
+ static const VerificationMeta _nameMeta = const VerificationMeta('name');
+ @override
+ late final GeneratedColumn name = GeneratedColumn(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
);
-
- ColumnWithTypeConverterFilters, List, String>
- get localSubPaths => $composableBuilder(
- column: $table.localSubPaths,
- builder: (column) => ColumnWithTypeConverterFilters(column),
+ static const VerificationMeta _descriptionMeta = const VerificationMeta(
+ 'description',
);
-
- ColumnFilters get readCount => $composableBuilder(
- column: $table.readCount,
- builder: (column) => ColumnFilters(column),
+ @override
+ late final GeneratedColumn description = GeneratedColumn(
+ 'description',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
);
-
- ColumnFilters get currentPage => $composableBuilder(
- column: $table.currentPage,
- builder: (column) => ColumnFilters(column),
+ static const VerificationMeta _coverImageSubPathMeta = const VerificationMeta(
+ 'coverImageSubPath',
);
+ @override
+ late final GeneratedColumn coverImageSubPath =
+ GeneratedColumn(
+ 'cover_image_sub_path',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ @override
+ List get $columns => [
+ id,
+ name,
+ description,
+ coverImageSubPath,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'collection_table';
+ @override
+ VerificationContext validateIntegrity(
+ Insertable instance, {
+ bool isInserting = false,
+ }) {
+ final context = VerificationContext();
+ final data = instance.toColumns(true);
+ if (data.containsKey('id')) {
+ context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
+ }
+ if (data.containsKey('name')) {
+ context.handle(
+ _nameMeta,
+ name.isAcceptableOrUnknown(data['name']!, _nameMeta),
+ );
+ } else if (isInserting) {
+ context.missing(_nameMeta);
+ }
+ if (data.containsKey('description')) {
+ context.handle(
+ _descriptionMeta,
+ description.isAcceptableOrUnknown(
+ data['description']!,
+ _descriptionMeta,
+ ),
+ );
+ }
+ if (data.containsKey('cover_image_sub_path')) {
+ context.handle(
+ _coverImageSubPathMeta,
+ coverImageSubPath.isAcceptableOrUnknown(
+ data['cover_image_sub_path']!,
+ _coverImageSubPathMeta,
+ ),
+ );
+ }
+ return context;
+ }
- ColumnFilters get createdAt => $composableBuilder(
- column: $table.createdAt,
- builder: (column) => ColumnFilters(column),
- );
+ @override
+ Set get $primaryKey => {id};
+ @override
+ CollectionTableData map(Map data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return CollectionTableData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ description: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}description'],
+ ),
+ coverImageSubPath: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}cover_image_sub_path'],
+ ),
+ );
+ }
+
+ @override
+ $CollectionTableTable createAlias(String alias) {
+ return $CollectionTableTable(attachedDatabase, alias);
+ }
}
-class $$BookTableTableOrderingComposer
- extends Composer<_$AppDatabase, $BookTableTable> {
- $$BookTableTableOrderingComposer({
- required super.$db,
- required super.$table,
- super.joinBuilder,
- super.$addJoinBuilderToRootComposer,
- super.$removeJoinBuilderFromRootComposer,
+class CollectionTableData extends DataClass
+ implements Insertable {
+ final int id;
+ final String name;
+ final String? description;
+ final String? coverImageSubPath;
+ const CollectionTableData({
+ required this.id,
+ required this.name,
+ this.description,
+ this.coverImageSubPath,
});
- ColumnOrderings get id => $composableBuilder(
- column: $table.id,
- builder: (column) => ColumnOrderings(column),
- );
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ map['id'] = Variable(id);
+ map['name'] = Variable(name);
+ if (!nullToAbsent || description != null) {
+ map['description'] = Variable(description);
+ }
+ if (!nullToAbsent || coverImageSubPath != null) {
+ map['cover_image_sub_path'] = Variable(coverImageSubPath);
+ }
+ return map;
+ }
- ColumnOrderings get name => $composableBuilder(
- column: $table.name,
- builder: (column) => ColumnOrderings(column),
- );
+ CollectionTableCompanion toCompanion(bool nullToAbsent) {
+ return CollectionTableCompanion(
+ id: Value(id),
+ name: Value(name),
+ description: description == null && nullToAbsent
+ ? const Value.absent()
+ : Value(description),
+ coverImageSubPath: coverImageSubPath == null && nullToAbsent
+ ? const Value.absent()
+ : Value(coverImageSubPath),
+ );
+ }
- ColumnOrderings get localSubPaths => $composableBuilder(
- column: $table.localSubPaths,
- builder: (column) => ColumnOrderings(column),
- );
+ factory CollectionTableData.fromJson(
+ Map json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return CollectionTableData(
+ id: serializer.fromJson(json['id']),
+ name: serializer.fromJson(json['name']),
+ description: serializer.fromJson(json['description']),
+ coverImageSubPath: serializer.fromJson(
+ json['coverImageSubPath'],
+ ),
+ );
+ }
+ @override
+ Map toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return {
+ 'id': serializer.toJson(id),
+ 'name': serializer.toJson(name),
+ 'description': serializer.toJson(description),
+ 'coverImageSubPath': serializer.toJson(coverImageSubPath),
+ };
+ }
- ColumnOrderings get readCount => $composableBuilder(
- column: $table.readCount,
- builder: (column) => ColumnOrderings(column),
+ CollectionTableData copyWith({
+ int? id,
+ String? name,
+ Value description = const Value.absent(),
+ Value coverImageSubPath = const Value.absent(),
+ }) => CollectionTableData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ description: description.present ? description.value : this.description,
+ coverImageSubPath: coverImageSubPath.present
+ ? coverImageSubPath.value
+ : this.coverImageSubPath,
);
+ CollectionTableData copyWithCompanion(CollectionTableCompanion data) {
+ return CollectionTableData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ description: data.description.present
+ ? data.description.value
+ : this.description,
+ coverImageSubPath: data.coverImageSubPath.present
+ ? data.coverImageSubPath.value
+ : this.coverImageSubPath,
+ );
+ }
- ColumnOrderings get currentPage => $composableBuilder(
- column: $table.currentPage,
- builder: (column) => ColumnOrderings(column),
- );
+ @override
+ String toString() {
+ return (StringBuffer('CollectionTableData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('description: $description, ')
+ ..write('coverImageSubPath: $coverImageSubPath')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(id, name, description, coverImageSubPath);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is CollectionTableData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.description == this.description &&
+ other.coverImageSubPath == this.coverImageSubPath);
+}
+
+class CollectionTableCompanion extends UpdateCompanion {
+ final Value id;
+ final Value name;
+ final Value description;
+ final Value coverImageSubPath;
+ const CollectionTableCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.description = const Value.absent(),
+ this.coverImageSubPath = const Value.absent(),
+ });
+ CollectionTableCompanion.insert({
+ this.id = const Value.absent(),
+ required String name,
+ this.description = const Value.absent(),
+ this.coverImageSubPath = const Value.absent(),
+ }) : name = Value(name);
+ static Insertable custom({
+ Expression? id,
+ Expression? name,
+ Expression? description,
+ Expression? coverImageSubPath,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (description != null) 'description': description,
+ if (coverImageSubPath != null) 'cover_image_sub_path': coverImageSubPath,
+ });
+ }
+
+ CollectionTableCompanion copyWith({
+ Value? id,
+ Value? name,
+ Value? description,
+ Value? coverImageSubPath,
+ }) {
+ return CollectionTableCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ description: description ?? this.description,
+ coverImageSubPath: coverImageSubPath ?? this.coverImageSubPath,
+ );
+ }
+
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ if (id.present) {
+ map['id'] = Variable(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable(name.value);
+ }
+ if (description.present) {
+ map['description'] = Variable(description.value);
+ }
+ if (coverImageSubPath.present) {
+ map['cover_image_sub_path'] = Variable(coverImageSubPath.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('CollectionTableCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('description: $description, ')
+ ..write('coverImageSubPath: $coverImageSubPath')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class $CollectionBookTableTable extends CollectionBookTable
+ with TableInfo<$CollectionBookTableTable, CollectionBookTableData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ $CollectionBookTableTable(this.attachedDatabase, [this._alias]);
+ static const VerificationMeta _idMeta = const VerificationMeta('id');
+ @override
+ late final GeneratedColumn id = GeneratedColumn(
+ 'id',
+ aliasedName,
+ false,
+ hasAutoIncrement: true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'PRIMARY KEY AUTOINCREMENT',
+ ),
+ );
+ static const VerificationMeta _collectionIdMeta = const VerificationMeta(
+ 'collectionId',
+ );
+ @override
+ late final GeneratedColumn collectionId = GeneratedColumn(
+ 'collection_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ static const VerificationMeta _bookIdMeta = const VerificationMeta('bookId');
+ @override
+ late final GeneratedColumn bookId = GeneratedColumn(
+ 'book_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ @override
+ List get $columns => [id, collectionId, bookId];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'collection_book_table';
+ @override
+ VerificationContext validateIntegrity(
+ Insertable instance, {
+ bool isInserting = false,
+ }) {
+ final context = VerificationContext();
+ final data = instance.toColumns(true);
+ if (data.containsKey('id')) {
+ context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
+ }
+ if (data.containsKey('collection_id')) {
+ context.handle(
+ _collectionIdMeta,
+ collectionId.isAcceptableOrUnknown(
+ data['collection_id']!,
+ _collectionIdMeta,
+ ),
+ );
+ } else if (isInserting) {
+ context.missing(_collectionIdMeta);
+ }
+ if (data.containsKey('book_id')) {
+ context.handle(
+ _bookIdMeta,
+ bookId.isAcceptableOrUnknown(data['book_id']!, _bookIdMeta),
+ );
+ } else if (isInserting) {
+ context.missing(_bookIdMeta);
+ }
+ return context;
+ }
+
+ @override
+ Set get $primaryKey => {id};
+ @override
+ CollectionBookTableData map(
+ Map data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return CollectionBookTableData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}id'],
+ )!,
+ collectionId: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}collection_id'],
+ )!,
+ bookId: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}book_id'],
+ )!,
+ );
+ }
+
+ @override
+ $CollectionBookTableTable createAlias(String alias) {
+ return $CollectionBookTableTable(attachedDatabase, alias);
+ }
+}
+
+class CollectionBookTableData extends DataClass
+ implements Insertable {
+ final int id;
+ final int collectionId;
+ final int bookId;
+ const CollectionBookTableData({
+ required this.id,
+ required this.collectionId,
+ required this.bookId,
+ });
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ map['id'] = Variable(id);
+ map['collection_id'] = Variable(collectionId);
+ map['book_id'] = Variable(bookId);
+ return map;
+ }
+
+ CollectionBookTableCompanion toCompanion(bool nullToAbsent) {
+ return CollectionBookTableCompanion(
+ id: Value(id),
+ collectionId: Value(collectionId),
+ bookId: Value(bookId),
+ );
+ }
+
+ factory CollectionBookTableData.fromJson(
+ Map json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return CollectionBookTableData(
+ id: serializer.fromJson(json['id']),
+ collectionId: serializer.fromJson(json['collectionId']),
+ bookId: serializer.fromJson(json['bookId']),
+ );
+ }
+ @override
+ Map toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return {
+ 'id': serializer.toJson(id),
+ 'collectionId': serializer.toJson(collectionId),
+ 'bookId': serializer.toJson(bookId),
+ };
+ }
+
+ CollectionBookTableData copyWith({int? id, int? collectionId, int? bookId}) =>
+ CollectionBookTableData(
+ id: id ?? this.id,
+ collectionId: collectionId ?? this.collectionId,
+ bookId: bookId ?? this.bookId,
+ );
+ CollectionBookTableData copyWithCompanion(CollectionBookTableCompanion data) {
+ return CollectionBookTableData(
+ id: data.id.present ? data.id.value : this.id,
+ collectionId: data.collectionId.present
+ ? data.collectionId.value
+ : this.collectionId,
+ bookId: data.bookId.present ? data.bookId.value : this.bookId,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('CollectionBookTableData(')
+ ..write('id: $id, ')
+ ..write('collectionId: $collectionId, ')
+ ..write('bookId: $bookId')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(id, collectionId, bookId);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is CollectionBookTableData &&
+ other.id == this.id &&
+ other.collectionId == this.collectionId &&
+ other.bookId == this.bookId);
+}
+
+class CollectionBookTableCompanion
+ extends UpdateCompanion {
+ final Value id;
+ final Value collectionId;
+ final Value bookId;
+ const CollectionBookTableCompanion({
+ this.id = const Value.absent(),
+ this.collectionId = const Value.absent(),
+ this.bookId = const Value.absent(),
+ });
+ CollectionBookTableCompanion.insert({
+ this.id = const Value.absent(),
+ required int collectionId,
+ required int bookId,
+ }) : collectionId = Value(collectionId),
+ bookId = Value(bookId);
+ static Insertable custom({
+ Expression? id,
+ Expression? collectionId,
+ Expression? bookId,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (collectionId != null) 'collection_id': collectionId,
+ if (bookId != null) 'book_id': bookId,
+ });
+ }
+
+ CollectionBookTableCompanion copyWith({
+ Value? id,
+ Value? collectionId,
+ Value? bookId,
+ }) {
+ return CollectionBookTableCompanion(
+ id: id ?? this.id,
+ collectionId: collectionId ?? this.collectionId,
+ bookId: bookId ?? this.bookId,
+ );
+ }
+
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ if (id.present) {
+ map['id'] = Variable(id.value);
+ }
+ if (collectionId.present) {
+ map['collection_id'] = Variable(collectionId.value);
+ }
+ if (bookId.present) {
+ map['book_id'] = Variable(bookId.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('CollectionBookTableCompanion(')
+ ..write('id: $id, ')
+ ..write('collectionId: $collectionId, ')
+ ..write('bookId: $bookId')
+ ..write(')'))
+ .toString();
+ }
+}
+
+abstract class _$AppDatabase extends GeneratedDatabase {
+ _$AppDatabase(QueryExecutor e) : super(e);
+ $AppDatabaseManager get managers => $AppDatabaseManager(this);
+ late final $BookTableTable bookTable = $BookTableTable(this);
+ late final $CollectionTableTable collectionTable = $CollectionTableTable(
+ this,
+ );
+ late final $CollectionBookTableTable collectionBookTable =
+ $CollectionBookTableTable(this);
+ late final BookLocalDatasource bookLocalDatasource = BookLocalDatasource(
+ this as AppDatabase,
+ );
+ late final CollectionLocalDatasource collectionLocalDatasource =
+ CollectionLocalDatasource(this as AppDatabase);
+ late final CollectionBookLocalDatasource collectionBookLocalDatasource =
+ CollectionBookLocalDatasource(this as AppDatabase);
+ @override
+ Iterable> get allTables =>
+ allSchemaEntities.whereType>();
+ @override
+ List get allSchemaEntities => [
+ bookTable,
+ collectionTable,
+ collectionBookTable,
+ ];
+}
+
+typedef $$BookTableTableCreateCompanionBuilder =
+ BookTableCompanion Function({
+ Value id,
+ required String name,
+ required List localSubPaths,
+ Value coverSubPath,
+ Value?> previewSubPaths,
+ Value readCount,
+ Value currentPage,
+ Value createdAt,
+ });
+typedef $$BookTableTableUpdateCompanionBuilder =
+ BookTableCompanion Function({
+ Value id,
+ Value name,
+ Value> localSubPaths,
+ Value coverSubPath,
+ Value?> previewSubPaths,
+ Value readCount,
+ Value currentPage,
+ Value createdAt,
+ });
+
+class $$BookTableTableFilterComposer
+ extends Composer<_$AppDatabase, $BookTableTable> {
+ $$BookTableTableFilterComposer({
+ required super.$db,
+ required super.$table,
+ super.joinBuilder,
+ super.$addJoinBuilderToRootComposer,
+ super.$removeJoinBuilderFromRootComposer,
+ });
+ ColumnFilters get id => $composableBuilder(
+ column: $table.id,
+ builder: (column) => ColumnFilters(column),
+ );
+
+ ColumnFilters get name => $composableBuilder(
+ column: $table.name,
+ builder: (column) => ColumnFilters(column),
+ );
+
+ ColumnWithTypeConverterFilters, List, String>
+ get localSubPaths => $composableBuilder(
+ column: $table.localSubPaths,
+ builder: (column) => ColumnWithTypeConverterFilters(column),
+ );
+
+ ColumnFilters get coverSubPath => $composableBuilder(
+ column: $table.coverSubPath,
+ builder: (column) => ColumnFilters(column),
+ );
+
+ ColumnWithTypeConverterFilters?, List, String>
+ get previewSubPaths => $composableBuilder(
+ column: $table.previewSubPaths,
+ builder: (column) => ColumnWithTypeConverterFilters(column),
+ );
+
+ ColumnFilters get readCount => $composableBuilder(
+ column: $table.readCount,
+ builder: (column) => ColumnFilters(column),
+ );
+
+ ColumnFilters get currentPage => $composableBuilder(
+ column: $table.currentPage,
+ builder: (column) => ColumnFilters(column),
+ );
+
+ ColumnFilters get createdAt => $composableBuilder(
+ column: $table.createdAt,
+ builder: (column) => ColumnFilters(column),
+ );
+}
+
+class $$BookTableTableOrderingComposer
+ extends Composer<_$AppDatabase, $BookTableTable> {
+ $$BookTableTableOrderingComposer({
+ required super.$db,
+ required super.$table,
+ super.joinBuilder,
+ super.$addJoinBuilderToRootComposer,
+ super.$removeJoinBuilderFromRootComposer,
+ });
+ ColumnOrderings get id => $composableBuilder(
+ column: $table.id,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get name => $composableBuilder(
+ column: $table.name,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get localSubPaths => $composableBuilder(
+ column: $table.localSubPaths,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get coverSubPath => $composableBuilder(
+ column: $table.coverSubPath,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get previewSubPaths => $composableBuilder(
+ column: $table.previewSubPaths,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get readCount => $composableBuilder(
+ column: $table.readCount,
+ builder: (column) => ColumnOrderings(column),
+ );
+
+ ColumnOrderings get currentPage => $composableBuilder(
+ column: $table.currentPage,
+ builder: (column) => ColumnOrderings(column),
+ );
ColumnOrderings get createdAt => $composableBuilder(
column: $table.createdAt,
@@ -538,6 +1277,17 @@ class $$BookTableTableAnnotationComposer
builder: (column) => column,
);
+ GeneratedColumn get coverSubPath => $composableBuilder(
+ column: $table.coverSubPath,
+ builder: (column) => column,
+ );
+
+ GeneratedColumnWithTypeConverter