diff --git a/.gitignore b/.gitignore index 25a05ff..3cbf407 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,4 @@ app.*.map.json !.idea/codeStyles/ !.idea/dictionaries/ !.idea/runConfigurations/ +/.fvmrc diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..4bec4ea --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,117 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index b4e33ce..42cbbdc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -21,14 +21,25 @@ "request": "launch", "type": "dart", "program": "lib/main_staging.dart", - "args": ["--flavor", "staging", "--target", "lib/main_staging.dart"] + "args": [ + "--flavor", + "staging", + "--target", + "lib/main_staging.dart" + ] }, { "name": "Launch production", "request": "launch", "type": "dart", + "flutterMode": "release", "program": "lib/main_production.dart", - "args": ["--flavor", "production", "--target", "lib/main_production.dart"] + "args": [ + "--flavor", + "production", + "--target", + "lib/main_production.dart" + ] } ] -} +} \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index fa798a8..a4c790c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,3 +1,12 @@ +analyzer: + exclude: + - '**.freezed.dart' + - '**.g.dart' + - '**.gr.dart' + - '**.gen.dart' + - '**/app_localizations**.dart' + - '**/generated_plugin_registrant.dart' + include: package:very_good_analysis/analysis_options.5.1.0.yaml linter: rules: diff --git a/android/app/build.gradle b/android/app/build.gradle index ec53d92..7fa3e1d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,10 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "kotlin-kapt" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -27,11 +29,6 @@ if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "com.BBKDevelopment.VMerge" compileSdkVersion localProperties.getProperty('flutter.compileSdkVersion').toInteger() @@ -51,10 +48,7 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.BBKDevelopment.VMerge" - // 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 localProperties.getProperty('flutter.minSdkVersion').toInteger() targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger() versionCode flutterVersionCode.toInteger() @@ -80,7 +74,7 @@ android { } flavorDimensions "default" - productFlavors { + productFlavors { production { dimension "default" applicationIdSuffix "" @@ -115,7 +109,6 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.github.bumptech.glide:glide:4.14.2' kapt 'com.github.bumptech.glide:compiler:4.14.2' } \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 7e39c2a..c46807a 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,12 @@ the Flutter tool needs it to communicate with the running application to allow setting breakpoints, to provide hot reload, etc. --> - + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b503be1..d2a1f81 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,29 +1,36 @@ - - + + + + + android:icon="@mipmap/ic_launcher" + android:label="${appName}"> + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" /> - - + + + + + diff --git a/android/build.gradle b/android/build.gradle index f7eb7f6..8f31e8c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.7.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() @@ -28,4 +15,4 @@ subprojects { tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 6b66533..8bd70f3 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..05e070b 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +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 + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.0" apply false +} + +include ":app" \ No newline at end of file diff --git a/assets/fonts/README.txt b/assets/fonts/roboto_mono/README.txt similarity index 100% rename from assets/fonts/README.txt rename to assets/fonts/roboto_mono/README.txt diff --git a/assets/fonts/RobotoMono-Bold.ttf b/assets/fonts/roboto_mono/RobotoMono-Bold.ttf similarity index 100% rename from assets/fonts/RobotoMono-Bold.ttf rename to assets/fonts/roboto_mono/RobotoMono-Bold.ttf diff --git a/assets/fonts/RobotoMono-BoldItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-BoldItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-BoldItalic.ttf diff --git a/assets/fonts/RobotoMono-ExtraLight.ttf b/assets/fonts/roboto_mono/RobotoMono-ExtraLight.ttf similarity index 100% rename from assets/fonts/RobotoMono-ExtraLight.ttf rename to assets/fonts/roboto_mono/RobotoMono-ExtraLight.ttf diff --git a/assets/fonts/RobotoMono-ExtraLightItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-ExtraLightItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-ExtraLightItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-ExtraLightItalic.ttf diff --git a/assets/fonts/RobotoMono-Italic.ttf b/assets/fonts/roboto_mono/RobotoMono-Italic.ttf similarity index 100% rename from assets/fonts/RobotoMono-Italic.ttf rename to assets/fonts/roboto_mono/RobotoMono-Italic.ttf diff --git a/assets/fonts/RobotoMono-Light.ttf b/assets/fonts/roboto_mono/RobotoMono-Light.ttf similarity index 100% rename from assets/fonts/RobotoMono-Light.ttf rename to assets/fonts/roboto_mono/RobotoMono-Light.ttf diff --git a/assets/fonts/RobotoMono-LightItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-LightItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-LightItalic.ttf diff --git a/assets/fonts/RobotoMono-Medium.ttf b/assets/fonts/roboto_mono/RobotoMono-Medium.ttf similarity index 100% rename from assets/fonts/RobotoMono-Medium.ttf rename to assets/fonts/roboto_mono/RobotoMono-Medium.ttf diff --git a/assets/fonts/RobotoMono-MediumItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-MediumItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-MediumItalic.ttf diff --git a/assets/fonts/RobotoMono-Regular.ttf b/assets/fonts/roboto_mono/RobotoMono-Regular.ttf similarity index 100% rename from assets/fonts/RobotoMono-Regular.ttf rename to assets/fonts/roboto_mono/RobotoMono-Regular.ttf diff --git a/assets/fonts/RobotoMono-SemiBold.ttf b/assets/fonts/roboto_mono/RobotoMono-SemiBold.ttf similarity index 100% rename from assets/fonts/RobotoMono-SemiBold.ttf rename to assets/fonts/roboto_mono/RobotoMono-SemiBold.ttf diff --git a/assets/fonts/RobotoMono-SemiBoldItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-SemiBoldItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-SemiBoldItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-SemiBoldItalic.ttf diff --git a/assets/fonts/RobotoMono-Thin.ttf b/assets/fonts/roboto_mono/RobotoMono-Thin.ttf similarity index 100% rename from assets/fonts/RobotoMono-Thin.ttf rename to assets/fonts/roboto_mono/RobotoMono-Thin.ttf diff --git a/assets/fonts/RobotoMono-ThinItalic.ttf b/assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf similarity index 100% rename from assets/fonts/RobotoMono-ThinItalic.ttf rename to assets/fonts/roboto_mono/RobotoMono-ThinItalic.ttf diff --git a/assets/images/application_logo.svg b/assets/images/application_logo.svg deleted file mode 100644 index 392614b..0000000 --- a/assets/images/application_logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/bbk_logo.png b/assets/images/bbk_logo.png deleted file mode 100644 index f0bd352..0000000 Binary files a/assets/images/bbk_logo.png and /dev/null differ diff --git a/assets/images/camera.svg b/assets/images/camera.svg deleted file mode 100644 index a3c7194..0000000 --- a/assets/images/camera.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/close.svg b/assets/images/close.svg index 3078ac7..40f990c 100644 --- a/assets/images/close.svg +++ b/assets/images/close.svg @@ -1,3 +1,3 @@ - + diff --git a/assets/images/cut.svg b/assets/images/cut.svg deleted file mode 100644 index bc63dd4..0000000 --- a/assets/images/cut.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/description.svg b/assets/images/description.svg new file mode 100644 index 0000000..c6b9592 --- /dev/null +++ b/assets/images/description.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/error.svg b/assets/images/error.svg new file mode 100644 index 0000000..cf763e3 --- /dev/null +++ b/assets/images/error.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/home.svg b/assets/images/home.svg deleted file mode 100644 index 21cb404..0000000 --- a/assets/images/home.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/license.svg b/assets/images/license.svg index bf06bf8..dec45f0 100644 --- a/assets/images/license.svg +++ b/assets/images/license.svg @@ -1,5 +1,3 @@ - - - - + + diff --git a/assets/images/mail.svg b/assets/images/mail.svg index 2afd7c0..090bcae 100644 --- a/assets/images/mail.svg +++ b/assets/images/mail.svg @@ -1,3 +1,3 @@ - - + + diff --git a/assets/images/merge.svg b/assets/images/merge.svg new file mode 100644 index 0000000..2115f87 --- /dev/null +++ b/assets/images/merge.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/mini_logo.svg b/assets/images/mini_logo.svg deleted file mode 100644 index 768438c..0000000 --- a/assets/images/mini_logo.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/assets/images/more.svg b/assets/images/more.svg index d48923f..bad0b58 100644 --- a/assets/images/more.svg +++ b/assets/images/more.svg @@ -1,3 +1,3 @@ - - + + diff --git a/assets/images/palette.svg b/assets/images/palette.svg new file mode 100644 index 0000000..692789a --- /dev/null +++ b/assets/images/palette.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/privacy.svg b/assets/images/privacy.svg index 78cbfcd..7e4c796 100644 --- a/assets/images/privacy.svg +++ b/assets/images/privacy.svg @@ -1,3 +1,3 @@ - - + + diff --git a/assets/images/save.svg b/assets/images/save.svg index 24a2f47..259a3b5 100644 --- a/assets/images/save.svg +++ b/assets/images/save.svg @@ -1,4 +1,3 @@ - - - + + diff --git a/assets/images/setting.svg b/assets/images/setting.svg deleted file mode 100644 index 666bc5b..0000000 --- a/assets/images/setting.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/settings.svg b/assets/images/settings.svg new file mode 100644 index 0000000..90e0e0c --- /dev/null +++ b/assets/images/settings.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/star.svg b/assets/images/star.svg index d313d5f..27a4853 100644 --- a/assets/images/star.svg +++ b/assets/images/star.svg @@ -1,3 +1,3 @@ - - + + diff --git a/assets/images/terms.svg b/assets/images/terms.svg deleted file mode 100644 index 64523b4..0000000 --- a/assets/images/terms.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/video.svg b/assets/images/video.svg new file mode 100644 index 0000000..f130380 --- /dev/null +++ b/assets/images/video.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/vmerge.png b/assets/images/vmerge.png new file mode 100644 index 0000000..b6c20d7 Binary files /dev/null and b/assets/images/vmerge.png differ diff --git a/assets/licenses/material_design_icons.txt b/assets/licenses/material_design_icons.txt new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/assets/licenses/material_design_icons.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/assets/licenses/material_icons.txt b/assets/licenses/material_icons.txt new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/assets/licenses/material_icons.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/assets/fonts/LICENSE.txt b/assets/licenses/roboto_mono.txt similarity index 100% rename from assets/fonts/LICENSE.txt rename to assets/licenses/roboto_mono.txt diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..7e7e7f6 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/l10n.yaml b/l10n.yaml index 12156bf..1f2add2 100644 --- a/l10n.yaml +++ b/l10n.yaml @@ -1,6 +1,7 @@ -arb-dir: lib/l10n/arb +arb-dir: lib/src/core/l10n/arb template-arb-file: app_en.arb -output-dir: lib/l10n +output-dir: lib/src/core/l10n output-localization-file: app_localizations.dart nullable-getter: false -synthetic-package: false \ No newline at end of file +synthetic-package: false +format: true \ No newline at end of file diff --git a/lib/app/widgets/app.dart b/lib/app/widgets/app.dart deleted file mode 100644 index e8c41bb..0000000 --- a/lib/app/widgets/app.dart +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:bottom_navy_bar/bottom_navy_bar.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:get/get.dart'; -import 'package:vmerge/controllers/controllers.dart'; -import 'package:vmerge/controllers/home_page_controller.dart'; -import 'package:vmerge/utilities/utilities.dart'; -import 'package:vmerge/views/views.dart'; - -class App extends StatelessWidget { - const App({super.key}); - - @override - Widget build(BuildContext context) { - return GetMaterialApp( - debugShowCheckedModeBanner: false, - themeMode: ThemeMode.dark, - darkTheme: appTheme, - home: VSoundPageView(), - ); - } -} - -class VSoundPageView extends StatelessWidget { - VSoundPageView({super.key}) { - _bottomBarController = Get.put(BottomBarController()); - _editPageController = Get.put(EditPageController()); - _homePageController = Get.put(HomePageController()); - _morePageController = Get.put(MorePageController()); - } - late final BottomBarController _bottomBarController; - late final EditPageController _editPageController; - late final HomePageController _homePageController; - late final MorePageController _morePageController; - - @override - Widget build(BuildContext context) { - return Scaffold( - body: SizedBox.expand( - child: PageView( - controller: _bottomBarController.pageController, - physics: const NeverScrollableScrollPhysics(), - onPageChanged: (index) async { - _bottomBarController.updateCurrentIndex(index); - if (index == 1) { - _editPageController.getAnimationController.duration = - kEditPageInAnimationDuration; - await _editPageController.getAnimationController.forward(); - if (_homePageController.getVideoList.length == 2) { - _editPageController - .updateAssets(_homePageController.getVideoList); - } - } - if (index == 2) { - _morePageController.getBeginList.clear(); - _morePageController.getEndList.clear(); - _morePageController.getAnimationController.duration = - kMorePageInAnimationDuration; - await _morePageController.getAnimationController.forward(); - } - }, - children: [ - HomePage(), - const EditPage(), - MorePage(), - ], - ), - ), - bottomNavigationBar: Container( - padding: const EdgeInsets.symmetric(horizontal: 14), - color: kPrimaryColor, - child: Obx(() { - return BottomNavyBar( - selectedIndex: _bottomBarController.currentIndex, - onItemSelected: (index) async { - if (_bottomBarController.currentIndex == 1 && index != 1) { - _editPageController.getAnimationController.duration = - kEditPageOutAnimationDuration; - await _editPageController.getAnimationController.reverse(); - } - if (_bottomBarController.currentIndex == 2 && index != 2) { - _morePageController.getAnimationController.duration = - kMorePageOutAnimationDuration; - await _morePageController.getAnimationController.reverse(); - } - _bottomBarController.updateCurrentIndex(index); - _bottomBarController.pageController.jumpToPage(index); - }, - backgroundColor: kPrimaryColor, - items: [ - BottomNavyBarItem( - activeColor: kPrimaryWhiteColor, - inactiveColor: kPrimaryWhiteColor, - title: const Text('Home', style: kSemiBoldTextStyle), - textAlign: TextAlign.center, - icon: SvgPicture.asset(kHomeIconPath), - ), - BottomNavyBarItem( - activeColor: kPrimaryWhiteColor, - inactiveColor: kPrimaryWhiteColor, - title: const Text('Edit', style: kSemiBoldTextStyle), - textAlign: TextAlign.center, - icon: SvgPicture.asset(kCutIconPath), - ), - BottomNavyBarItem( - activeColor: kPrimaryWhiteColor, - inactiveColor: kPrimaryWhiteColor, - title: const Text('More', style: kSemiBoldTextStyle), - textAlign: TextAlign.center, - icon: SvgPicture.asset(kMoreIconPath), - ), - ], - ); - }), - ), - ); - } -} diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index a40ffde..a8195ea 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -6,9 +6,26 @@ import 'dart:async'; import 'dart:developer'; import 'package:bloc/bloc.dart'; +import 'package:ffmpeg_service/ffmpeg_service.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:wechat_assets_picker/wechat_assets_picker.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:get_it/get_it.dart'; +import 'package:launch_review_service/launch_review_service.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:path/path.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:url_launcher_service/url_launcher_service.dart'; +import 'package:video_player/video_player.dart'; +import 'package:video_player_service/video_player_service.dart'; +import 'package:vmerge/src/app/app.dart'; +import 'package:vmerge/src/config/config.dart'; +import 'package:vmerge/src/core/core.dart'; +import 'package:vmerge/src/features/merge/merge.dart'; +import 'package:wakelock_service/wakelock_service.dart'; + +final getIt = GetIt.instance; class AppBlocObserver extends BlocObserver { const AppBlocObserver(); @@ -33,11 +50,119 @@ Future bootstrap(FutureOr Function() builder) async { Bloc.observer = const AppBlocObserver(); + LicenseRegistry.addLicense(() async* { + final robotoMono = await rootBundle.loadString(Assets.licenses.robotoMono); + final materialDesignIcons = + await rootBundle.loadString(Assets.licenses.materialDesignIcons); + final materialIcons = + await rootBundle.loadString(Assets.licenses.materialIcons); + + yield LicenseEntryWithLineBreaks(['roboto-mono'], robotoMono); + yield LicenseEntryWithLineBreaks( + ['material-design-icons'], + materialDesignIcons, + ); + yield LicenseEntryWithLineBreaks(['material-icons'], materialIcons); + }); + final widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); - // FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); - SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); - await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); - await PhotoManager.clearFileCache(); + FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); + + await Future.wait( + [ + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]), + setup(), + ], + ).onError((error, stackTrace) => [log('$error', stackTrace: stackTrace)]); runApp(await builder()); } + +Future setup() async { + final objectBoxService = await ObjectBoxService.create(); + final packageInfo = await PackageInfo.fromPlatform(); + + getIt + ..registerFactoryParam( + (color, _) => LightAppTheme(color), + instanceName: '$LightAppTheme', + ) + ..registerFactoryParam( + (color, _) => DarkAppTheme(color), + instanceName: '$DarkAppTheme', + ) + ..registerLazySingleton(() => objectBoxService) + ..registerLazySingleton( + () => ObjectBoxThemeConfigurationService( + service: getIt(), + ), + ) + ..registerLazySingleton( + () => ThemeConfigurationRepositoryImpl( + localService: getIt(), + ), + ) + ..registerLazySingleton( + () => GetThemeConfigurationUseCase( + repository: getIt(), + ), + ) + ..registerLazySingleton( + () => SaveThemeConfigurationUseCase( + repository: getIt(), + ), + ) + ..registerLazySingleton( + () => ObjectBoxMergeSettingsService( + service: getIt(), + ), + ) + ..registerLazySingleton( + () => MergeSettingsRepositoryImpl( + localService: getIt(), + ), + ) + ..registerLazySingleton( + () => GetMergeSettingsUseCase( + repository: getIt(), + ), + ) + ..registerLazySingleton( + () => SaveMergeSettingsUseCase( + repository: getIt(), + ), + ) + ..registerLazySingleton( + () => packageInfo, + ) + ..registerLazySingleton( + () => LaunchReviewService(androidAppId: getIt().packageName), + ) + ..registerLazySingleton( + () => const UrlLauncherService(), + ) + ..registerLazySingleton( + FFmpegService.new, + ) + ..registerLazySingleton( + () => const WakelockService(), + ) + ..registerFactory( + () => VideoPlayerService(options: VideoPlayerOptions()), + ); +} + +final class ObjectBoxService { + ObjectBoxService._create(this.store); + + /// The Store of this app. + final Store store; + + /// Creates an instance of ObjectBoxService to use throughout the app. + static Future create() async { + final appDocsDir = await getApplicationDocumentsDirectory(); + final store = + await openStore(directory: join(appDocsDir.path, 'vmerge_db')); + return ObjectBoxService._create(store); + } +} diff --git a/lib/components/components.dart b/lib/components/components.dart deleted file mode 100644 index 0dcbd9e..0000000 --- a/lib/components/components.dart +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -export 'save_modal_bottom_sheet.dart'; -export 'settings_modal_bottom_sheet.dart'; -export 'video_thumbnail.dart'; -export 'vmerge_app_bar.dart'; diff --git a/lib/components/save_modal_bottom_sheet.dart b/lib/components/save_modal_bottom_sheet.dart deleted file mode 100644 index 9d5fa79..0000000 --- a/lib/components/save_modal_bottom_sheet.dart +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:get/get.dart'; -import 'package:vmerge/controllers/controllers.dart'; -import 'package:vmerge/utilities/utilities.dart'; - -class SaveModalBottomSheet extends StatelessWidget { - SaveModalBottomSheet({super.key}) { - _editPageController = Get.find(); - } - - late final EditPageController _editPageController; - - @override - Widget build(BuildContext context) { - return Material( - color: Colors.transparent, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 22), - decoration: const BoxDecoration( - color: kPrimaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(22), - topRight: Radius.circular(22), - ), - ), - child: SafeArea( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(width: kIconSize), - const Text( - kSaveToAlbumText, - style: kBoldTextStyle, - ), - InkWell( - onTap: () { - if (_editPageController.status == kSuccessText) { - Get.back(); - } - }, - overlayColor: MaterialStateProperty.all(Colors.transparent), - highlightColor: Colors.transparent, - child: Obx( - () => _editPageController.status == kSuccessText - ? SvgPicture.asset( - kCloseIconPath, - width: kIconSize, - color: kPrimaryWhiteColor.withOpacity(1), - ) - : const SizedBox(width: kIconSize), - ), - ), - ], - ), - const SizedBox(height: 32), - _buildTimeSlider(), - const SizedBox(height: 32), - Obx( - () => Text( - _editPageController.status, - style: kMediumTextStyle, - ), - ), - const SizedBox(height: 20), - ], - ), - ), - ), - ); - } - - SizedBox _buildTimeSlider() { - return SizedBox( - height: 120, - width: 120, - child: Obx( - () => Stack( - fit: StackFit.expand, - children: [ - CircularProgressIndicator( - backgroundColor: kPrimaryWhiteColor.withOpacity(0.7), - strokeWidth: 8, - value: _editPageController.progressPercentage / 100, - valueColor: const AlwaysStoppedAnimation( - kPrimaryWhiteColor, - ), - ), - Center( - child: _editPageController.status == kSuccessText - ? const Icon( - Icons.check_rounded, - color: kPrimaryWhiteColor, - size: kIconSize, - ) - : Text( - '${_editPageController.progressPercentage.round()}%', - textAlign: TextAlign.center, - style: kBoldTextStyle.copyWith(color: kPrimaryWhiteColor), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/components/settings_modal_bottom_sheet.dart b/lib/components/settings_modal_bottom_sheet.dart deleted file mode 100644 index 8bf0b27..0000000 --- a/lib/components/settings_modal_bottom_sheet.dart +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:get/get.dart'; -import 'package:vmerge/controllers/controllers.dart'; -import 'package:vmerge/utilities/utilities.dart'; - -class SettingsModalBottomSheet extends StatelessWidget { - SettingsModalBottomSheet({super.key}) { - _editPageController = Get.find(); - } - - late final EditPageController _editPageController; - - @override - Widget build(BuildContext context) { - return Material( - color: Colors.transparent, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 22), - decoration: const BoxDecoration( - color: kPrimaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(22), - topRight: Radius.circular(22), - ), - ), - child: SafeArea( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(width: kIconSize), - const Text( - kSettingsText, - style: kBoldTextStyle, - ), - InkWell( - onTap: Get.back, - overlayColor: MaterialStateProperty.all(Colors.transparent), - highlightColor: Colors.transparent, - child: SvgPicture.asset( - kCloseIconPath, - width: kIconSize, - ), - ), - ], - ), - const SizedBox(height: 32), - const Text(kVideoSpeedText, style: kRegularTextStyle), - const SizedBox(height: 32), - _buildSpeedSlider(context), - const SizedBox(height: 32), - const Text(kVideoQualityText, style: kRegularTextStyle), - const SizedBox(height: 32), - _buildQualitySlider(context), - const SizedBox(height: 20), - ], - ), - ), - ), - ); - } - - SliderTheme _buildSpeedSlider(BuildContext context) { - return _getSliderTheme( - context: context, - child: Obx(() { - return Slider( - value: _editPageController.speedValue, - max: 7, - divisions: 7, - label: _editPageController.speedValueText, - onChanged: (value) { - _editPageController.setSpeed(value); - }, - ); - }), - ); - } - - SliderTheme _buildQualitySlider(BuildContext context) { - return _getSliderTheme( - context: context, - child: Obx(() { - return Slider( - value: _editPageController.qualityValue, - max: 6, - divisions: 6, - label: _editPageController.qualityValueText, - onChanged: (value) { - _editPageController.setQuality(value); - }, - ); - }), - ); - } - - SliderTheme _getSliderTheme({ - required BuildContext context, - required Widget child, - }) { - return SliderTheme( - data: SliderTheme.of(context).copyWith( - activeTrackColor: kPrimaryWhiteColor, - inactiveTrackColor: kPrimaryWhiteColor, - trackShape: const RoundedRectSliderTrackShape(), - trackHeight: 2, - thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 12), - thumbColor: kPrimaryWhiteColor, - overlayColor: kPrimaryWhiteColor.withOpacity(0.3), - overlayShape: const RoundSliderOverlayShape(overlayRadius: 28), - tickMarkShape: const RoundSliderTickMarkShape(), - activeTickMarkColor: kPrimaryWhiteColor, - inactiveTickMarkColor: kPrimaryWhiteColor, - valueIndicatorShape: const PaddleSliderValueIndicatorShape(), - valueIndicatorColor: kPrimaryWhiteColor, - valueIndicatorTextStyle: - kSmallTextStyle.copyWith(color: kPrimaryColorDark), - ), - child: child, - ); - } -} diff --git a/lib/components/video_thumbnail.dart b/lib/components/video_thumbnail.dart deleted file mode 100644 index 1df9cf3..0000000 --- a/lib/components/video_thumbnail.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:vmerge/models/models.dart'; -import 'package:vmerge/utilities/utilities.dart'; - -class VideoThumbnail extends StatelessWidget { - const VideoThumbnail({super.key, this.video}); - - final Video? video; - - @override - Widget build(BuildContext context) { - return ClipRRect( - borderRadius: BorderRadius.circular(kGridViewItemsBorderRadius), - child: SizedBox( - height: 120, - width: 120, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - child: Container( - color: video != null ? kPrimaryColorDark : kPrimaryWhiteColor, - child: video != null - ? Image.memory(video!.image!, fit: BoxFit.cover) - : const Icon( - Icons.video_library_rounded, - color: kPrimaryColor, - size: 60, - ), - ), - ), - Container( - height: 18, - color: kPrimaryColor, - alignment: Alignment.center, - child: Text( - video != null - ? TimeFormatter.format( - duration: Duration(seconds: video!.duration!), - ) - : 'NON', - style: kRegularTextStyle, - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/components/vmerge_app_bar.dart b/lib/components/vmerge_app_bar.dart deleted file mode 100644 index 38fa30d..0000000 --- a/lib/components/vmerge_app_bar.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:get/get.dart'; -import 'package:vmerge/utilities/constants.dart'; - -class VMergeAppBar extends StatelessWidget implements PreferredSizeWidget { - const VMergeAppBar({super.key}); - - @override - Widget build(BuildContext context) { - return AppBar( - title: SvgPicture.asset( - kMiniLogoIconPath, - height: Get.size.height * 0.04, - ), - centerTitle: true, - ); - } - - @override - Size get preferredSize => const Size.fromHeight(kToolbarHeight); -} diff --git a/lib/controllers/bottom_bar_controller.dart b/lib/controllers/bottom_bar_controller.dart deleted file mode 100644 index 346a452..0000000 --- a/lib/controllers/bottom_bar_controller.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -class BottomBarController extends GetxController { - late final RxInt _currentIndex; - late final PageController _pageController; - - int get currentIndex => _currentIndex.value; - PageController get pageController => _pageController; - - @override - void onInit() { - super.onInit(); - _currentIndex = 0.obs; - _pageController = PageController(); - } - - void updateCurrentIndex(int index) { - _currentIndex.value = index; - } -} diff --git a/lib/controllers/controllers.dart b/lib/controllers/controllers.dart deleted file mode 100644 index 219a821..0000000 --- a/lib/controllers/controllers.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -export 'bottom_bar_controller.dart'; -export 'edit_page_controller.dart'; -export 'more_page_controller.dart'; diff --git a/lib/controllers/edit_page_controller.dart b/lib/controllers/edit_page_controller.dart deleted file mode 100644 index 62a5a43..0000000 --- a/lib/controllers/edit_page_controller.dart +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2021 BBK Development. All rights reserved. -// Use of this source code is governed by a GPL-style license that can be found -// in the LICENSE file. - -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:flutter_ffmpeg/flutter_ffmpeg.dart'; -import 'package:get/get.dart'; -import 'package:image_gallery_saver/image_gallery_saver.dart'; -import 'package:path/path.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:video_player/video_player.dart'; -import 'package:vmerge/components/components.dart'; -import 'package:vmerge/models/models.dart'; -import 'package:vmerge/utilities/utilities.dart'; - -class EditPageController extends GetxController - with GetSingleTickerProviderStateMixin { - late final FlutterFFmpeg _flutterFFmpeg; - late final FlutterFFmpegConfig _fFmpegConfig; - late final VideoPlayerOptions _videoPlayerOptions; - late final AnimationController _animationController; - late final Animation _staggeredAnimation; - late final RxDouble _speedValue; - late final RxDouble _qualityValue; - late final RxDouble _progressPercentage; - late final RxList