├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-playstore.png │ │ ├── kotlin │ │ │ └── net │ │ │ │ └── iobb │ │ │ │ └── kohei │ │ │ │ └── scombmobile │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable │ │ │ ├── background.png │ │ │ ├── ic_notification.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── ic_launcher_background.xml │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── index.html ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ ├── BrandingImage.imageset │ │ │ └── Contents.json │ │ ├── LaunchBackground.imageset │ │ │ ├── Contents.json │ │ │ └── background.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Runner-Bridging-Header.h │ └── Runner.entitlements ├── en.lproj │ └── InfoPlist.strings └── ja.lproj │ └── InfoPlist.strings ├── lib ├── common │ ├── basic_auth_test.dart │ ├── database_exception.dart │ ├── db │ │ ├── class_cell.dart │ │ ├── class_cell_dao.dart │ │ ├── my_link_dao.dart │ │ ├── my_link_entity.dart │ │ ├── news_item_model_dao.dart │ │ ├── news_item_model_entity.dart │ │ ├── scomb_mobile_database.dart │ │ ├── scomb_mobile_database.g.dart │ │ ├── setting_dao.dart │ │ ├── setting_entity.dart │ │ ├── task.dart │ │ └── task_dao.dart │ ├── login_exception.dart │ ├── notification.dart │ ├── password_encripter.dart │ ├── scraping │ │ ├── news_scraping.dart │ │ ├── scraping_test.dart │ │ ├── surveys_scraping.dart │ │ ├── syllabus_scraping.dart │ │ ├── task_scraping.dart │ │ └── timetable_scraping.dart │ ├── shared_resource.dart │ ├── timetable_model.dart │ ├── utils.dart │ └── values.dart ├── main.dart └── ui │ ├── component │ └── timetable_component.dart │ ├── dialog │ ├── add_task_dialog.dart │ ├── class_detail_dialog.dart │ ├── color_picker_dialog.dart │ ├── loading_dialog.dart │ ├── new_class_cell_dialog.dart │ ├── selector_dialog.dart │ └── syllabus_search_dialog.dart │ ├── scomb_mobile.dart │ └── screen │ ├── class_search_screen.dart │ ├── link_list_screen.dart │ ├── login_screen.dart │ ├── network_screen.dart │ ├── news_list_screen.dart │ ├── setting_screen.dart │ ├── single_page_scomb.dart │ ├── task_calendar_screen.dart │ ├── task_list_screen.dart │ └── timetable │ ├── customized_timetable_screen.dart │ ├── my_timetable_list_screen.dart │ └── timetable_screen.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── resources ├── coop_icon.png ├── icon.png ├── official_timetable_icon.png ├── scombz_icon.png ├── sgsot.png └── splash.png ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html ├── manifest.json └── splash │ ├── img │ ├── dark-1x.png │ ├── dark-2x.png │ ├── dark-3x.png │ ├── dark-4x.png │ ├── light-1x.png │ ├── light-2x.png │ ├── light-3x.png │ └── light-4x.png │ └── style.css └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | 49 | # encfypt key 50 | /lib/keys.dart -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: f1875d570e39de09040c8f79aa13cc56baab8db1 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 17 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 18 | - platform: android 19 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 20 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 21 | - platform: ios 22 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 23 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 24 | - platform: linux 25 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 26 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 27 | - platform: macos 28 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 29 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 30 | - platform: web 31 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 32 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 33 | - platform: windows 34 | create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 35 | base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Kohei Sato 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](resources/splash.png) 2 | 3 | 芝浦工業大学の授業管理サイト"ScombZ"のスマホアプリ版。 4 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | app/keystore -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | def keystoreProperties = new Properties() 25 | def keystorePropertiesFile = rootProject.file('key.properties') 26 | if (keystorePropertiesFile.exists()) { 27 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 28 | } 29 | 30 | apply plugin: 'com.android.application' 31 | apply plugin: 'kotlin-android' 32 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 33 | 34 | android { 35 | compileSdkVersion 34 36 | ndkVersion flutter.ndkVersion 37 | 38 | signingConfigs { 39 | release { 40 | keyAlias keystoreProperties['keyAlias'] 41 | keyPassword keystoreProperties['keyPassword'] 42 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 43 | storePassword keystoreProperties['storePassword'] 44 | } 45 | } 46 | 47 | compileOptions { 48 | sourceCompatibility JavaVersion.VERSION_1_8 49 | targetCompatibility JavaVersion.VERSION_1_8 50 | } 51 | 52 | kotlinOptions { 53 | jvmTarget = '1.8' 54 | } 55 | 56 | sourceSets { 57 | main.java.srcDirs += 'src/main/kotlin' 58 | } 59 | 60 | defaultConfig { 61 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 62 | applicationId "net.iobb.koheinoapp.scombmobile" 63 | // You can update the following values to match your application needs. 64 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 65 | minSdkVersion 28 66 | targetSdkVersion 34 67 | versionCode flutterVersionCode.toInteger() 68 | versionName flutterVersionName 69 | minSdkVersion 28 70 | } 71 | 72 | buildTypes { 73 | release { 74 | // TODO: Add your own signing config for the release build. 75 | // Signing with the debug keys for now, so `flutter run --release` works. 76 | signingConfig signingConfigs.release 77 | } 78 | } 79 | } 80 | 81 | flutter { 82 | source '../..' 83 | } 84 | 85 | dependencies { 86 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 87 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 21 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/net/iobb/kohei/scombmobile/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package net.iobb.kohei.scombmobile 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/drawable/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.3' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | // flutter_local_notification 11 | if #available(iOS 10.0, *) { 12 | UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate 13 | } 14 | GeneratedPluginRegistrant.register(with: self) 15 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/BrandingImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "BrandingImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "BrandingImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "BrandingImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Scomb Mobile 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | scomb_mobile 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(MARKETING_VERSION) 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | $(CURRENT_PROJECT_VERSION) 27 | LSRequiresIPhoneOS 28 | 29 | NSAppTransportSecurity 30 | 31 | NSAllowsArbitraryLoads 32 | 33 | 34 | NSCameraUsageDescription 35 | 提出物の写真を撮るためにカメラを利用します。 36 | NSPhotoLibraryUsageDescription 37 | バックアップファイル読み込み 38 | UIApplicationSupportsIndirectInputEvents 39 | 40 | UIBackgroundModes 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIStatusBarHidden 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UISupportedInterfaceOrientations~ipad 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationPortraitUpsideDown 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | UIViewControllerBasedStatusBarAppearance 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | Runner 4 | 5 | Created by Kohei Sato on 2022/08/18. 6 | 7 | */ 8 | CFBundleDisplayName = "ScombMobile"; 9 | -------------------------------------------------------------------------------- /ios/ja.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* 2 | InfoPlist.strings 3 | Runner 4 | 5 | Created by Kohei Sato on 2022/08/18. 6 | 7 | */ 8 | -------------------------------------------------------------------------------- /lib/common/basic_auth_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_inappwebview/flutter_inappwebview.dart'; 3 | import 'package:scomb_mobile/common/values.dart'; 4 | 5 | class TestApp extends StatefulWidget { 6 | TestApp({Key? key}) : super(key: key); 7 | 8 | @override 9 | _TestAppState createState() => _TestAppState(); 10 | } 11 | 12 | class _TestAppState extends State { 13 | @override 14 | void initState() { 15 | super.initState(); 16 | } 17 | 18 | @override 19 | void dispose() { 20 | super.dispose(); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return const MaterialApp(home: InAppWebViewPage()); 26 | } 27 | } 28 | 29 | class InAppWebViewPage extends StatefulWidget { 30 | const InAppWebViewPage({Key? key}) : super(key: key); 31 | 32 | @override 33 | _InAppWebViewPageState createState() => _InAppWebViewPageState(); 34 | } 35 | 36 | class _InAppWebViewPageState extends State { 37 | late InAppWebViewController webView; 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: AppBar(title: const Text("BasicAuthWebView")), 43 | body: InAppWebView( 44 | initialUrlRequest: URLRequest(url: WebUri.uri(Uri.parse(SCOMB_LOGIN_PAGE_URL))), 45 | onWebViewCreated: (InAppWebViewController controller) { 46 | webView = controller; 47 | }, 48 | onLoadStart: (controller, url) {}, 49 | onLoadStop: (controller, url) {}, 50 | onReceivedHttpAuthRequest: (controller, challenge) async { 51 | return HttpAuthResponse( 52 | username: "USERNAME", 53 | password: "PASSWORD", 54 | action: HttpAuthResponseAction.PROCEED); 55 | }, 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/common/database_exception.dart: -------------------------------------------------------------------------------- 1 | class DatabaseException implements Exception { 2 | DatabaseException(this.message); 3 | 4 | String message; 5 | } 6 | -------------------------------------------------------------------------------- /lib/common/db/class_cell_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 3 | 4 | import '../timetable_model.dart'; 5 | import 'class_cell.dart'; 6 | 7 | @dao 8 | abstract class ClassCellDao { 9 | @Query("SELECT * FROM class_cell") 10 | Future> getAllClasses(); 11 | 12 | @Query("SELECT * FROM class_cell WHERE timetableTitle = :timetableTitle") 13 | Future> getCells(String timetableTitle); 14 | 15 | @Query( 16 | "SELECT * FROM class_cell WHERE classId = :classId AND isUserClassCell = 0 LIMIT 1") 17 | Future getCurrentClassCellByClassId(String classId); 18 | 19 | @insert 20 | Future insertClassCell(ClassCell classCell); 21 | 22 | @delete 23 | Future removeClassCell(ClassCell classCell); 24 | 25 | @Query("DELETE FROM class_cell WHERE timetableTitle = :timetableTitle") 26 | Future removeTimetable(String timetableTitle); 27 | } 28 | 29 | Future> getAllTimetables({ 30 | required Function(Map result) onFetchFinished, 31 | }) async { 32 | Map timetables = {}; 33 | 34 | var db = await AppDatabase.getDatabase(); 35 | var allCells = await db.currentClassCellDao.getAllClasses(); 36 | 37 | for (var cell in allCells) { 38 | // if my timetable, year is 0 39 | if (cell.isUserClassCell) { 40 | // new timetable model 41 | if (timetables[cell.timetableTitle] == null) { 42 | timetables[cell.timetableTitle] = TimetableModel( 43 | cell.timetableTitle, 44 | true, 45 | ); 46 | } 47 | 48 | // insert to map 49 | cell.currentTimetable = timetables[cell.timetableTitle]!; 50 | if (cell.period >= 0 && cell.dayOfWeek >= 0) { 51 | timetables[cell.timetableTitle]!.cells[cell.period][cell.dayOfWeek] = 52 | cell; 53 | } 54 | } 55 | } 56 | 57 | timetables.forEach((key, value) { 58 | print(value); 59 | }); 60 | 61 | onFetchFinished(timetables); 62 | 63 | return timetables; 64 | } 65 | -------------------------------------------------------------------------------- /lib/common/db/my_link_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | 3 | import 'my_link_entity.dart'; 4 | 5 | @dao 6 | abstract class MyLinkDao { 7 | @insert 8 | Future insertLink(MyLink linkModel); 9 | 10 | @delete 11 | Future removeLink(MyLink linkModel); 12 | 13 | @Query("SELECT * FROM my_links") 14 | Future> getAllLinks(); 15 | } 16 | -------------------------------------------------------------------------------- /lib/common/db/my_link_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import '../../ui/screen/single_page_scomb.dart'; 6 | 7 | typedef LinkButtonClickCallback = Future Function( 8 | BuildContext context, 9 | MyLink linkItemModel, 10 | ); 11 | 12 | @Entity(tableName: "my_links") 13 | class MyLink { 14 | MyLink(this.id, this.title, this.url) { 15 | icon = const Icon(Icons.link); 16 | onPressed = (context, linkItemModel) async { 17 | var uri = Uri.parse(linkItemModel.url); 18 | Navigator.push( 19 | context, 20 | MaterialPageRoute( 21 | builder: (builder) { 22 | return SinglePageScomb( 23 | uri, 24 | linkItemModel.title, 25 | shouldRemoveHeader: false, 26 | ); 27 | }, 28 | fullscreenDialog: true, 29 | ), 30 | ); 31 | }; 32 | manuallyAdded = true; 33 | } 34 | 35 | MyLink.addManually(this.title, this.url) { 36 | icon = const Icon(Icons.link); 37 | onPressed = (context, linkItemModel) async { 38 | var uri = Uri.parse(linkItemModel.url); 39 | Navigator.push( 40 | context, 41 | MaterialPageRoute( 42 | builder: (builder) { 43 | return SinglePageScomb( 44 | uri, 45 | linkItemModel.title, 46 | shouldRemoveHeader: false, 47 | ); 48 | }, 49 | fullscreenDialog: true, 50 | ), 51 | ); 52 | }; 53 | manuallyAdded = true; 54 | } 55 | 56 | MyLink.preset( 57 | this.title, 58 | this.url, 59 | this.icon, { 60 | LinkButtonClickCallback? onPressed, 61 | }) { 62 | if (onPressed != null) { 63 | this.onPressed = onPressed; 64 | } else { 65 | this.onPressed = (context, linkItemModel) async { 66 | var uri = Uri.parse(linkItemModel.url); 67 | Navigator.push( 68 | context, 69 | MaterialPageRoute( 70 | builder: (builder) { 71 | return SinglePageScomb( 72 | uri, 73 | linkItemModel.title, 74 | shouldRemoveHeader: false, 75 | ); 76 | }, 77 | fullscreenDialog: true, 78 | ), 79 | ); 80 | }; 81 | } 82 | manuallyAdded = false; 83 | } 84 | 85 | @PrimaryKey(autoGenerate: true) 86 | int? id; 87 | String title; 88 | String url; 89 | @ignore 90 | late Widget icon; 91 | @ignore 92 | late LinkButtonClickCallback onPressed; 93 | @ignore 94 | late bool manuallyAdded; 95 | 96 | dynamic toJson() => { 97 | "id": id, 98 | "title": title, 99 | "url": url, 100 | }; 101 | } 102 | -------------------------------------------------------------------------------- /lib/common/db/news_item_model_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:scomb_mobile/common/db/news_item_model_entity.dart'; 3 | 4 | @dao 5 | abstract class NewsItemModelDao { 6 | @insert 7 | Future insertNewsModel(NewsItemModel news); 8 | 9 | @Query("SELECT * FROM news_item WHERE newsId = :newsId LIMIT 1") 10 | Future getNews(String newsId); 11 | 12 | @Query("SELECT * FROM news_item") 13 | Future> getAllNews(); 14 | } 15 | -------------------------------------------------------------------------------- /lib/common/db/news_item_model_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | 3 | @Entity(tableName: "news_item") 4 | class NewsItemModel { 5 | @primaryKey 6 | // "data1" in html attr 7 | String newsId; 8 | String data2; 9 | String title; 10 | String category; 11 | String domain; 12 | String publishTime; 13 | String tags; 14 | bool unread; 15 | 16 | NewsItemModel( 17 | this.newsId, 18 | this.data2, 19 | this.title, 20 | this.category, 21 | this.domain, 22 | this.publishTime, 23 | this.tags, 24 | this.unread, 25 | ); 26 | 27 | @override 28 | String toString() { 29 | return "NewsItemModel(newsId=$newsId, data2=$data2, title=$title, category=$category, domain=$domain, publishTime=$publishTime, tags=$tags)"; 30 | } 31 | 32 | dynamic toJson() => { 33 | "newsId": newsId, 34 | "data2": data2, 35 | "title": title, 36 | "category": category, 37 | "domain": domain, 38 | "publishTime": publishTime, 39 | "tags": tags, 40 | "unread": unread, 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /lib/common/db/setting_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:scomb_mobile/common/db/setting_entity.dart'; 3 | 4 | @dao 5 | abstract class SettingDao { 6 | @Query("SELECT * FROM settings WHERE settingKey = :settingKey") 7 | Future getSetting(String settingKey); 8 | 9 | @Query("SELECT * FROM settings") 10 | Future> getAllSetting(); 11 | 12 | // onConflict = replace 13 | @insert 14 | Future insertSetting(Setting setting); 15 | 16 | @Query("DELETE FROM settings WHERE settingKey = :settingKey") 17 | Future deleteSetting(String settingKey); 18 | 19 | @Query("DELETE FROM settings") 20 | Future deleteAllSettings(); 21 | } 22 | -------------------------------------------------------------------------------- /lib/common/db/setting_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | 3 | import '../values.dart'; 4 | 5 | @Entity(tableName: "settings") 6 | class Setting { 7 | Setting(this.settingKey, this.settingValue); 8 | 9 | @primaryKey 10 | String settingKey; 11 | 12 | String? settingValue; 13 | 14 | @override 15 | bool operator ==(Object other) { 16 | if (other is Setting) { 17 | return (other.settingValue == settingValue && 18 | other.settingKey == settingKey); 19 | } else { 20 | return false; 21 | } 22 | } 23 | 24 | @override 25 | String toString() { 26 | return "Setting($settingKey=$settingValue)"; 27 | } 28 | 29 | dynamic toJson() => { 30 | "settingKey": settingKey, 31 | "settingValue": settingValue, 32 | }; 33 | } 34 | 35 | class SettingKeys { 36 | static String USERNAME = "username"; 37 | static String PASSWORD = "password"; 38 | static String SESSION_ID = "session_id"; 39 | static String ENABLED_AUTO_LOGIN = "enabled_auto_login"; 40 | static String SECTION = "section"; 41 | 42 | static String TIMETABLE_LAST_UPDATE = "timetable_last_update"; 43 | static String TIMETABLE_UPDATE_INTERVAL = "timetable_update_interval"; 44 | static String TIMETABLE_YEAR = "timetable_year"; 45 | static String TIMETABLE_TERM = "timetable_term"; 46 | 47 | static String NOTIFICATION_TIMING = "notification_timing"; 48 | static String TODAYS_TASK_NOTIFICATION_TIME = "todays_task_notification_time"; 49 | 50 | static String THEME_COLOR = "theme_color"; 51 | static String AES_IV = "aes_iv"; 52 | } 53 | 54 | class SettingValues { 55 | static Map TIMETABLE_UPDATE_INTERVAL = { 56 | "1日": 86400000 * 1, 57 | "2日": 86400000 * 2, 58 | "1週間": 86400000 * 7, 59 | "2週間": 86400000 * 14, 60 | "4週間": 86400000 * 28, 61 | }; 62 | 63 | static Map TIMETABLE_TERM = { 64 | "前期": Term.FIRST, 65 | "後期": Term.SECOND, 66 | }; 67 | 68 | static Map NOTIFICATION_TIMING = { 69 | "10分前": 60000 * 10, 70 | "30分前": 60000 * 30, 71 | "1時間前": 60000 * 60, 72 | "2時間前": 60000 * 60 * 2, 73 | "3時間前": 60000 * 60 * 3, 74 | "6時間前": 60000 * 60 * 6, 75 | "1日前": 60000 * 60 * 24, 76 | }; 77 | 78 | static Map SECTION = { 79 | "工学部": "ko1", 80 | "システム理工学部": "sys", 81 | "デザイン工学部": "dsn", 82 | "建築学部": "arc", 83 | }; 84 | } 85 | -------------------------------------------------------------------------------- /lib/common/db/task.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:scomb_mobile/common/db/class_cell.dart'; 3 | import 'package:scomb_mobile/common/utils.dart'; 4 | 5 | @Entity(tableName: "task") 6 | class Task { 7 | String title; 8 | late String className; 9 | late int taskType; 10 | int deadline; 11 | late String url; 12 | 13 | late String classId; 14 | late String reportId; 15 | @primaryKey 16 | late String id; 17 | int? customColor; 18 | late bool addManually; 19 | late bool done; 20 | 21 | // for inflate survey 22 | Task( 23 | this.title, 24 | this.className, 25 | this.taskType, 26 | this.deadline, 27 | this.url, 28 | this.reportId, 29 | this.classId, 30 | this.customColor, 31 | this.addManually, 32 | this.done, 33 | ) { 34 | id = "$taskType-$classId-$reportId"; 35 | } 36 | 37 | // for inflate task or test 38 | Task.idFromUrl( 39 | this.title, 40 | this.className, 41 | this.taskType, 42 | this.deadline, 43 | this.url, 44 | this.customColor, 45 | this.addManually, 46 | ) { 47 | var uri = Uri.parse(url); 48 | classId = uri.queryParameters["idnumber"]!; 49 | 50 | String? reportId = uri.queryParameters["reportId"]; 51 | String? examId = uri.queryParameters["examinationId"]; 52 | if (reportId != null) { 53 | this.reportId = reportId; 54 | } else if (examId != null) { 55 | this.reportId = examId; 56 | } else { 57 | this.reportId = ""; 58 | } 59 | 60 | id = "$taskType-$classId-${this.reportId}"; 61 | done = false; 62 | } 63 | 64 | Task.userTask( 65 | this.title, 66 | ClassCell? relatedClass, 67 | this.taskType, 68 | this.deadline, 69 | ) { 70 | addManually = true; 71 | url = relatedClass?.url ?? ""; 72 | className = relatedClass?.name ?? ""; 73 | classId = relatedClass?.classId ?? ""; 74 | reportId = "usertask${DateTime.now().millisecondsSinceEpoch.hashCode}"; 75 | customColor = relatedClass?.customColorInt; 76 | id = "$taskType-$classId-$reportId"; 77 | done = false; 78 | } 79 | 80 | @override 81 | bool operator ==(Object other) { 82 | if (other is Task) { 83 | return (other.id == id); 84 | } else { 85 | return false; 86 | } 87 | } 88 | 89 | @override 90 | String toString() { 91 | return "Task { id=$id, title=$title, className=$className, taskType=$taskType, deadline=${timeToString(deadline)}, url=$url, classId=$classId, reportId=$reportId, customColor=$customColor, done=$done } "; 92 | } 93 | 94 | dynamic toJson() => { 95 | "id": id, 96 | "title": title, 97 | "className": className, 98 | "taskType": taskType, 99 | "deadline": deadline, 100 | "url": url, 101 | "reportId": reportId, 102 | "classId": classId, 103 | "customColor": customColor, 104 | "addManually": addManually, 105 | "done": done, 106 | }; 107 | } 108 | -------------------------------------------------------------------------------- /lib/common/db/task_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:scomb_mobile/common/db/task.dart'; 3 | 4 | @dao 5 | abstract class TaskDao { 6 | @insert 7 | Future insertTask(Task task); 8 | 9 | @Query("SELECT * FROM task") 10 | Future> getAllTasks(); 11 | 12 | @Query("SELECT * FROM task WHERE id = :id") 13 | Future getTask(String id); 14 | 15 | @Query("DELETE FROM task WHERE id = :id") 16 | Future removeTask(String id); 17 | } 18 | -------------------------------------------------------------------------------- /lib/common/login_exception.dart: -------------------------------------------------------------------------------- 1 | class LoginException implements Exception { 2 | LoginException(this.message); 3 | 4 | String message; 5 | } 6 | -------------------------------------------------------------------------------- /lib/common/notification.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 3 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 4 | import 'package:scomb_mobile/common/db/setting_entity.dart'; 5 | import 'package:scomb_mobile/common/utils.dart'; 6 | import 'package:timezone/timezone.dart' as tz; 7 | 8 | import 'db/task.dart'; 9 | 10 | Future cancelNotification({int? notificationId}) async { 11 | final plugin = FlutterLocalNotificationsPlugin(); 12 | 13 | if (notificationId == null) { 14 | await plugin.cancelAll(); 15 | } else { 16 | await plugin.cancel(notificationId); 17 | } 18 | } 19 | 20 | Future registerTaskNotification(Task task, {AppDatabase? db}) async { 21 | db ??= await AppDatabase.getDatabase(); 22 | final plugin = FlutterLocalNotificationsPlugin(); 23 | 24 | // -------- task deadline notification --------- 25 | var notificationTimingSetting = 26 | await db.currentSettingDao.getSetting(SettingKeys.NOTIFICATION_TIMING); 27 | int notifyBefore = int.parse( 28 | notificationTimingSetting?.settingValue ?? (60000 * 60).toString(), 29 | ); 30 | int taskDeadlineNotifyTime = task.deadline - notifyBefore; 31 | if (taskDeadlineNotifyTime < DateTime.now().millisecondsSinceEpoch) { 32 | taskDeadlineNotifyTime = DateTime.now().millisecondsSinceEpoch + 1000; 33 | } 34 | 35 | plugin.zonedSchedule( 36 | task.id.hashCode, 37 | "課題締め切り", 38 | "${task.title} (${timeToString(task.deadline)})", 39 | tz.TZDateTime.fromMillisecondsSinceEpoch( 40 | tz.UTC, 41 | taskDeadlineNotifyTime, 42 | ), 43 | const NotificationDetails( 44 | android: AndroidNotificationDetails( 45 | "SCOMB_MOBILE_TASK_NOTIFICATION", 46 | "課題締め切り通知", 47 | channelDescription: "締め切り時刻の近い課題を通知します", 48 | importance: Importance.high, 49 | priority: Priority.high, 50 | ), 51 | iOS: DarwinNotificationDetails(), 52 | ), 53 | uiLocalNotificationDateInterpretation: 54 | UILocalNotificationDateInterpretation.absoluteTime, 55 | androidAllowWhileIdle: true, 56 | ); 57 | print( 58 | "resumed_task_notification ${timeToString(taskDeadlineNotifyTime)} (${task.title})"); 59 | 60 | // -------- today's task notification --------- 61 | var notifyTimeSetting = (await db.currentSettingDao 62 | .getSetting(SettingKeys.TODAYS_TASK_NOTIFICATION_TIME)) 63 | ?.settingValue ?? 64 | "8:00"; 65 | var todaysTaskNotifyTime = TimeOfDay( 66 | hour: int.parse(notifyTimeSetting.split(":")[0]), 67 | minute: int.parse( 68 | notifyTimeSetting.split(":")[1], 69 | ), 70 | ); 71 | 72 | var deadlineDate = DateTime.fromMillisecondsSinceEpoch(task.deadline); 73 | var resumeTime = DateTime( 74 | deadlineDate.year, 75 | deadlineDate.month, 76 | deadlineDate.day, 77 | todaysTaskNotifyTime.hour, 78 | todaysTaskNotifyTime.minute, 79 | ); 80 | 81 | if (resumeTime.millisecondsSinceEpoch < 82 | DateTime.now().millisecondsSinceEpoch) { 83 | return; 84 | } 85 | 86 | plugin.zonedSchedule( 87 | ("${task.id}-today").hashCode, 88 | "今日締め切りの課題", 89 | "${task.title} (${timeToString(task.deadline)})", 90 | tz.TZDateTime.fromMillisecondsSinceEpoch( 91 | tz.UTC, 92 | resumeTime.millisecondsSinceEpoch, 93 | ), 94 | const NotificationDetails( 95 | android: AndroidNotificationDetails( 96 | "SCOMB_MOBILE_TODAYS_TASK_NOTIFICATION", 97 | "今日締切の課題", 98 | channelDescription: "今日締め切りの全ての課題を指定時刻に通知します", 99 | importance: Importance.high, 100 | priority: Priority.high, 101 | ), 102 | iOS: DarwinNotificationDetails(), 103 | ), 104 | uiLocalNotificationDateInterpretation: 105 | UILocalNotificationDateInterpretation.absoluteTime, 106 | androidAllowWhileIdle: true, 107 | ); 108 | print("resumed_todays_task_notification $resumeTime (${task.title})"); 109 | } 110 | 111 | Future registerAllTaskNotification(List tasks) async { 112 | var db = await AppDatabase.getDatabase(); 113 | for (var task in tasks) { 114 | registerTaskNotification(task, db: db); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/common/password_encripter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:encrypt/encrypt.dart'; 5 | import 'package:floor/floor.dart'; 6 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 7 | import 'package:scomb_mobile/common/db/setting_entity.dart'; 8 | 9 | // TODO create file(/lib/keys.dart) and define const value of encrypt key here. 10 | import '../keys.dart' as keys; 11 | 12 | /// 暗号化関数 13 | /// 14 | /// [plainText]を[ENCRYPT_KEY_32]で暗号化する 15 | Future encryptAES(String? plainText) async { 16 | final key = Key.fromUtf8(keys.ENCRYPT_KEY_32); 17 | final iv = await getIV(); 18 | final encryptor = Encrypter(AES(key)); 19 | final encrypted = encryptor.encrypt(plainText ?? "", iv: iv); 20 | return encrypted.base64; 21 | } 22 | 23 | /// 復号化関数 24 | /// 25 | /// [plainText]を[ENCRYPT_KEY_32]で復号化する 26 | Future decryptAES(String? encryptedBase64Text) async { 27 | final key = Key.fromUtf8(keys.ENCRYPT_KEY_32); 28 | final iv = await getIV(); 29 | final encryptor = Encrypter(AES(key)); 30 | final decrypted = encryptor.decrypt64(encryptedBase64Text!, iv: iv); 31 | return decrypted; 32 | } 33 | 34 | Future getIV() async { 35 | var db = await AppDatabase.getDatabase(); 36 | 37 | IV iv; 38 | try { 39 | iv = IV.fromBase64((await db.currentSettingDao.getSetting(SettingKeys.AES_IV))!.settingValue!); 40 | } catch (e) { 41 | iv = IV.fromLength(16); 42 | db.currentSettingDao.insertSetting(Setting(SettingKeys.AES_IV, iv.base64)); 43 | } 44 | return iv; 45 | } 46 | -------------------------------------------------------------------------------- /lib/common/scraping/news_scraping.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:html/parser.dart'; 3 | import 'package:scomb_mobile/common/db/news_item_model_entity.dart'; 4 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 5 | 6 | import '../login_exception.dart'; 7 | import '../shared_resource.dart'; 8 | import '../values.dart'; 9 | 10 | Future> fetchAllNews() async { 11 | List result = []; 12 | 13 | var dio = Dio(); 14 | dio.options.baseUrl = NEWS_LIST_PAGE_URL; 15 | 16 | Response? response = await dio.get( 17 | NEWS_LIST_PAGE_URL, 18 | options: Options( 19 | headers: { 20 | "Cookie": "$SESSION_COOKIE_ID=$sessionId", 21 | }, 22 | ), 23 | ); 24 | 25 | var document = parse(response.data); 26 | var currentUrl = "https://${response.realUri.host}${response.realUri.path}"; 27 | 28 | if (currentUrl == SCOMB_LOGGED_OUT_PAGE_URL) { 29 | throw LoginException("セッションIDの有効期限切れ"); 30 | } 31 | 32 | for (var element in document.getElementsByClassName(NEWS_LIST_ITEM_CSS_NM)) { 33 | try { 34 | var linkText = 35 | element.getElementsByClassName(NEWS_LIST_ITEM_TITLE_CSS_NM)[0]; 36 | String title = linkText.text; 37 | String data1 = linkText.attributes[NEWS_ID_ATTR_NM]!; 38 | String data2 = linkText.attributes[NEWS_CATEGORY_ATTR_NM]!; 39 | String category = 40 | element.getElementsByClassName(NEWS_CATEGORY_CSS_NM)[0].text; 41 | String domain = 42 | element.getElementsByClassName(NEWS_DOMAIN_CSS_NM)[0].text; 43 | String publishTime = element 44 | .getElementsByClassName(NEWS_PUBLISH_TIME_CSS_NM)[0] 45 | .children[0] 46 | .text; 47 | 48 | String tags = ""; 49 | element.getElementsByClassName(NEWS_TAG_CSS_NM).forEach( 50 | (tag) { 51 | if (!tag.classes.contains(NEWS_TAG_HIDDEN_CSS_NM)) { 52 | if (!tags.contains(tag.text)) { 53 | tags += "${tag.text},"; 54 | } 55 | } 56 | }, 57 | ); 58 | 59 | var db = await AppDatabase.getDatabase(); 60 | NewsItemModel? oldNews = await db.currentNewsItemModelDao.getNews(data1); 61 | 62 | bool unread = tags.contains("未読"); 63 | if (oldNews != null) { 64 | unread = oldNews.unread; 65 | } 66 | 67 | NewsItemModel news = NewsItemModel( 68 | data1, 69 | data2, 70 | title, 71 | category, 72 | domain, 73 | publishTime, 74 | tags, 75 | unread, 76 | ); 77 | print(news); 78 | result.add(news); 79 | 80 | await db.currentNewsItemModelDao.insertNewsModel(news); 81 | } catch (e, stackTrace) { 82 | print(e); 83 | } 84 | } 85 | 86 | return result; 87 | } 88 | -------------------------------------------------------------------------------- /lib/common/scraping/scraping_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:html/parser.dart' show parse; 2 | import 'package:http/http.dart' as http; 3 | import 'package:http/http.dart'; 4 | 5 | import '../values.dart'; 6 | 7 | void main() async { 8 | var sessionId = "ZjdmM2FiYzgtOWUxMy00MDFiLTllMGYtZGU3MzdlNjI5ZmMz"; 9 | 10 | Response? response; 11 | try { 12 | response = await http.get( 13 | Uri.parse(SURVEY_LIST_PAGE_URL), 14 | headers: { 15 | "Cookie": "$SESSION_COOKIE_ID=$sessionId", 16 | }, 17 | ); 18 | } catch (e) { 19 | return null; 20 | } 21 | 22 | var document = parse(response.body); 23 | 24 | var contents = document.getElementsByClassName("result-list"); 25 | 26 | contents.forEach((element) { 27 | print(element.text); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /lib/common/scraping/surveys_scraping.dart: -------------------------------------------------------------------------------- 1 | import 'package:html/dom.dart'; 2 | import 'package:html/parser.dart'; 3 | import 'package:http/http.dart' as http; 4 | import 'package:http/http.dart'; 5 | import 'package:scomb_mobile/common/login_exception.dart'; 6 | import 'package:scomb_mobile/common/utils.dart'; 7 | import 'package:scomb_mobile/common/values.dart'; 8 | 9 | import '../db/scomb_mobile_database.dart'; 10 | import '../db/task.dart'; 11 | import '../shared_resource.dart'; 12 | 13 | Future fetchSurveys( 14 | String? sessionId, 15 | ) async { 16 | Response? response = await http.get( 17 | Uri.parse(SURVEY_LIST_PAGE_URL), 18 | headers: { 19 | "Cookie": "$SESSION_COOKIE_ID=$sessionId", 20 | }, 21 | ); 22 | 23 | var document = parse(response.body); 24 | 25 | var currentUrl = 26 | "https://${response.request?.url.host}${response.request?.url.path}"; 27 | if (currentUrl == SCOMB_LOGGED_OUT_PAGE_URL) { 28 | throw LoginException("セッションIDの有効期限切れ"); 29 | } 30 | 31 | await _constructSurveys(document); 32 | } 33 | 34 | Future _constructSurveys(Document document) async { 35 | var db = await AppDatabase.getDatabase(); 36 | 37 | var contents = document.getElementsByClassName("result-list"); 38 | 39 | for (var row in contents) { 40 | if (row.children.length < 7) continue; 41 | var surveyId = row.children[0].attributes["value"]; 42 | var classId = row.children[1].attributes["value"]; 43 | 44 | if (surveyId == null || classId == null) continue; 45 | 46 | // if this survey is done, skip this 47 | var isDone = false; 48 | row.children[2] 49 | .getElementsByClassName("portal-surveys-status") 50 | .forEach((tag) { 51 | if (tag.text == "済み") { 52 | isDone = true; 53 | } 54 | }); 55 | 56 | var title = row.children[2].children[0].text; 57 | 58 | if (row.children[3].children.length < 3) continue; 59 | var deadline = row.children[3].children[2].text; 60 | 61 | if (row.children[5].children.isEmpty) continue; 62 | var surveyDomain = row.children[5].children[0].text; 63 | 64 | // custom color from timetable 65 | int? customColor; 66 | var classCellFromDB = 67 | await db.currentClassCellDao.getCurrentClassCellByClassId(classId); 68 | customColor = classCellFromDB?.customColorInt; 69 | 70 | String url; 71 | // surveys from others 72 | if (classId == "") { 73 | url = "$SURVEY_PAGE_URL?surveyId=$surveyId"; 74 | } 75 | // surveys from LMS 76 | else { 77 | url = "$LMS_SURVEY_PAGE_URL?idnumber=$classId&surveyId=$surveyId"; 78 | } 79 | 80 | var newSurvey = Task( 81 | title, 82 | surveyDomain, 83 | TaskType.SURVEY, 84 | stringToTime(deadline, includeSecond: false), 85 | url, 86 | surveyId, 87 | classId, 88 | customColor, 89 | false, 90 | isDone, 91 | ); 92 | 93 | // if already exists, merge task 94 | addOrReplaceTask(newSurvey, true); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/common/scraping/syllabus_scraping.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:fluttertoast/fluttertoast.dart'; 3 | import 'package:html/parser.dart'; 4 | import 'package:scomb_mobile/common/db/class_cell.dart'; 5 | import 'package:scomb_mobile/common/utils.dart'; 6 | import 'package:scomb_mobile/common/values.dart'; 7 | 8 | import '../timetable_model.dart'; 9 | 10 | // import 'package:http/http.dart'; 11 | 12 | Future> fetchAllSyllabusSearchResult(String url) async { 13 | Map result = {}; 14 | 15 | Dio dio = Dio(); 16 | Response? response = await dio.get>( 17 | url, 18 | options: Options(responseType: ResponseType.bytes), 19 | ); 20 | 21 | var bodyString = await convertEUCJPtoUTF8(response.data); 22 | 23 | var document = parse(bodyString); 24 | 25 | for (int i = 0; i < 200; i++) { 26 | var searchResult = document.getElementById("hit_$i"); 27 | if (searchResult == null) continue; 28 | 29 | result[searchResult.text] = searchResult.attributes["href"] ?? ""; 30 | } 31 | 32 | return result; 33 | } 34 | 35 | Future fetchClassDetail( 36 | String url, 37 | TimetableModel timetable, 38 | ) async { 39 | Dio dio = Dio(); 40 | Response? response = await dio.get(url); 41 | var document = parse(response.data); 42 | 43 | ClassCell? result; 44 | 45 | try { 46 | String? name = 47 | document.body?.children[0].children[0].children[0].children[0].text; 48 | 49 | String? teacher = document.body?.children[0].children[0].children[3] 50 | .children[0].children[0].children[0].children[0].children[2].text; 51 | 52 | String? syllabusUrl = document 53 | .body 54 | ?.children[0] 55 | .children[0] 56 | .children[5] 57 | .children[1] 58 | .children[2] 59 | .children[0] 60 | .children[1] 61 | .children[1] 62 | .children[0] 63 | .children[0] 64 | .attributes["href"]; 65 | 66 | var infoTable = document.body?.children[0].children[0].children[5] 67 | .children[0].children[0].children[0]; 68 | 69 | String? room = infoTable?.children[3].children[1].text; 70 | 71 | var classTimeString = infoTable?.children[1].children[1].text 72 | .replaceAll("1", "1") 73 | .replaceAll("2", "2") 74 | .replaceAll("3", "3") 75 | .replaceAll("4", "4") 76 | .replaceAll("5", "5") 77 | .replaceAll("6", "6") 78 | .replaceAll("7", "7"); 79 | String? periodString = classTimeString?.substring(2, 4); 80 | String? dayOfWeekString = classTimeString?.substring(0, 2); 81 | int? period = findMapKeyFromValue(PERIOD_MAP, periodString!); 82 | int? dayOfWeek = 83 | findMapKeyFromValue(DAY_OF_WEEK_MAP, dayOfWeekString!); 84 | 85 | if (name == null || period == null || dayOfWeek == null) { 86 | return null; 87 | } 88 | 89 | result = ClassCell.user( 90 | "${timetable.title}/user_class_cell/${DateTime.now().millisecondsSinceEpoch}", 91 | period, 92 | dayOfWeek, 93 | true, 94 | timetable.title, 95 | null, 96 | null, 97 | name, 98 | teacher, 99 | room, 100 | null, 101 | null, 102 | null, 103 | syllabusUrl, 104 | timetable, 105 | 0, 106 | ); 107 | } catch (e, stacktrace) { 108 | print(e); 109 | print(stacktrace); 110 | Fluttertoast.showToast(msg: "授業詳細を取得できませんでした"); 111 | } 112 | 113 | return result; 114 | } 115 | -------------------------------------------------------------------------------- /lib/common/scraping/task_scraping.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:html/dom.dart'; 3 | import 'package:html/parser.dart'; 4 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 5 | import 'package:scomb_mobile/common/db/task.dart'; 6 | import 'package:scomb_mobile/common/login_exception.dart'; 7 | import 'package:scomb_mobile/common/utils.dart'; 8 | import 'package:scomb_mobile/common/values.dart'; 9 | 10 | import '../shared_resource.dart'; 11 | 12 | Future fetchTasks( 13 | String? sessionId, 14 | ) async { 15 | var dio = Dio(); 16 | dio.options.baseUrl = TASK_LIST_PAGE_URL; 17 | 18 | Response? response = await dio.get( 19 | TASK_LIST_PAGE_URL, 20 | options: Options( 21 | headers: { 22 | "Cookie": "$SESSION_COOKIE_ID=$sessionId", 23 | }, 24 | ), 25 | ); 26 | 27 | var document = parse(response.data); 28 | var currentUrl = "https://${response.realUri.host}${response.realUri.path}"; 29 | 30 | if (currentUrl == SCOMB_LOGGED_OUT_PAGE_URL) { 31 | throw LoginException("セッションIDの有効期限切れ"); 32 | } 33 | 34 | await _constructTasks(document); 35 | } 36 | 37 | Future _constructTasks(Document document) async { 38 | var db = await AppDatabase.getDatabase(); 39 | var tasksFromDB = await db.currentTaskDao.getAllTasks(); 40 | 41 | var taskRows = document.getElementsByClassName(TASK_LIST_CSS_CLASS_NM); 42 | for (var row in taskRows) { 43 | if (row.children.length < 5) continue; 44 | 45 | var className = row.children[0].text; 46 | 47 | late int taskType; 48 | if (row.children[1].text.contains("課題")) { 49 | taskType = TaskType.TASK; 50 | } else if (row.children[1].text.contains("テスト")) { 51 | taskType = TaskType.TEST; 52 | } else if (row.children[1].text.contains("アンケート")) { 53 | taskType = TaskType.SURVEY; 54 | } else { 55 | taskType = TaskType.OTHERS; 56 | } 57 | 58 | if (row.children[2].children.isEmpty) continue; 59 | var title = row.children[2].children[0].text; 60 | 61 | var url = "$SCOMBZ_DOMAIN${row.children[2].children[0].attributes["href"]}"; 62 | 63 | var deadlineElement = 64 | row.getElementsByClassName(TASK_LIST_DEADLINE_CULUMN_CSS_NM); 65 | if (deadlineElement.isEmpty) continue; 66 | if (deadlineElement[0].children.length < 2) continue; 67 | var deadline = stringToTime(deadlineElement[0].children[1].text); 68 | 69 | var newTask = Task.idFromUrl( 70 | title, 71 | className, 72 | taskType, 73 | deadline, 74 | url, 75 | null, 76 | false, 77 | ); 78 | 79 | // custom color from timetable 80 | var classCellFromDB = await db.currentClassCellDao 81 | .getCurrentClassCellByClassId(newTask.classId); 82 | newTask.customColor = classCellFromDB?.customColorInt; 83 | 84 | // if already exists 85 | addOrReplaceTask(newTask, true); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/common/scraping/timetable_scraping.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:html/dom.dart'; 3 | import 'package:html/parser.dart' show parse; 4 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 5 | import 'package:scomb_mobile/common/login_exception.dart'; 6 | import 'package:scomb_mobile/common/values.dart'; 7 | 8 | import '../db/class_cell.dart'; 9 | import '../shared_resource.dart'; 10 | 11 | // if returned null, permission denied 12 | Future fetchTimetable( 13 | String? sessionId, 14 | int year, 15 | String term, 16 | ) async { 17 | var url = "$SCOMB_TIMETABLE_URL?risyunen=$year&kikanCd=$term"; 18 | 19 | var dio = Dio(); 20 | dio.options.baseUrl = url; 21 | 22 | Response? response = await dio.get( 23 | url, 24 | options: Options( 25 | headers: { 26 | "Cookie": "$SESSION_COOKIE_ID=$sessionId", 27 | }, 28 | ), 29 | ); 30 | 31 | var document = parse(response.data); 32 | var currentUrl = "https://${response.realUri.host}${response.realUri.path}"; 33 | 34 | if (currentUrl == SCOMB_LOGGED_OUT_PAGE_URL) { 35 | throw LoginException("セッションIDの有効期限切れ"); 36 | } 37 | 38 | await _constructTimetableArray(document, year, term); 39 | } 40 | 41 | Future _constructTimetableArray( 42 | Document doc, int year, String term) async { 43 | var db = await AppDatabase.getDatabase(); 44 | String timetableTitle = "$year-$term"; 45 | 46 | var cellsInDB = await db.currentClassCellDao.getCells(timetableTitle); 47 | 48 | var timetableRows = doc.getElementsByClassName(TIMETABLE_ROW_CSS_CLASS_NM); 49 | for (var r = 0; r < timetableRows.length; r++) { 50 | var timetableCells = 51 | timetableRows[r].getElementsByClassName(TIMETABLE_CELL_CSS_CLASS_NM); 52 | for (var c = 0; c < timetableCells.length; c++) { 53 | var timetableCell = timetableCells[c]; 54 | 55 | // if no class 56 | if (timetableCell.children.isEmpty) continue; 57 | 58 | // get header and detail element 59 | var cellHeader = timetableCell 60 | .getElementsByClassName(TIMETABLE_CELL_HEADER_CSS_CLASS_NM); 61 | if (cellHeader.isEmpty) continue; 62 | var cellDetail = timetableCell 63 | .getElementsByClassName(TIMETABLE_CELL_DETAIL_CSS_CLASS_NM); 64 | if (cellDetail.isEmpty) continue; 65 | 66 | // header 67 | var id = cellHeader[0].attributes["id"]; 68 | var name = cellHeader[0].text; 69 | 70 | // detail 71 | if (cellDetail[0].children.isEmpty) continue; 72 | var room = cellDetail[0].children[0].attributes["title"]; 73 | var teachers = ""; 74 | for (var teacher in cellDetail[0].children[0].children) { 75 | if (teacher.text != "【教室】") { 76 | teachers += teacher.text; 77 | } 78 | } 79 | 80 | if (id == null) continue; 81 | var newCell = ClassCell( 82 | id, 83 | r, 84 | c, 85 | false, 86 | timetableTitle, 87 | year, 88 | term, 89 | name, 90 | teachers, 91 | room, 92 | null, 93 | CLASS_PAGE_URL.replaceFirst("\${classId}", id), 94 | null, 95 | null, 96 | null, 97 | ); 98 | sharedTimetable.cells[r][c] = newCell; 99 | 100 | // merge old timetable and new one 101 | for (var cellInDB in cellsInDB) { 102 | if (cellInDB.classId == newCell.classId) { 103 | newCell.customColorInt = cellInDB.customColorInt; 104 | newCell.note = cellInDB.note; 105 | newCell.syllabusUrl = cellInDB.syllabusUrl; 106 | cellsInDB.remove(cellInDB); 107 | break; 108 | } 109 | } 110 | await db.currentClassCellDao.insertClassCell(newCell); 111 | 112 | print("class_from_server : $newCell"); 113 | } 114 | } 115 | 116 | // remove classes that are localDB but not in Scomb 117 | for (var removeTargetCell in cellsInDB) { 118 | await db.currentClassCellDao.removeClassCell(removeTargetCell); 119 | removeTargetCell.timetableTitle = "unregistered"; 120 | await db.currentClassCellDao.insertClassCell(removeTargetCell); 121 | print("removed $removeTargetCell"); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /lib/common/shared_resource.dart: -------------------------------------------------------------------------------- 1 | // shared resource 2 | import 'package:flutter/material.dart'; 3 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 4 | import 'package:scomb_mobile/common/notification.dart'; 5 | import 'package:scomb_mobile/common/timetable_model.dart'; 6 | import 'package:scomb_mobile/common/utils.dart'; 7 | 8 | import 'db/task.dart'; 9 | 10 | String? sessionId; 11 | String? userName; 12 | 13 | TimetableModel sharedTimetable = 14 | TimetableModel("$timetableYear-$timetableTerm", false); 15 | bool timetableInitialized = false; 16 | int? timetableYear; 17 | String? timetableTerm; 18 | 19 | // ------------- task_list----------- 20 | List taskList = []; 21 | bool taskListInitialized = false; 22 | void sortTasks() { 23 | taskList.sort((a, b) => a.deadline.compareTo(b.deadline)); 24 | } 25 | 26 | void addOrReplaceTask(Task newTask, bool fromServer) { 27 | // deadline over 28 | if (newTask.deadline < DateTime.now().millisecondsSinceEpoch) return; 29 | 30 | // detect conflicting 31 | int? conflictedTaskIndex; 32 | for (int i = 0; i < taskList.length; i++) { 33 | if (taskList[i] == newTask) { 34 | conflictedTaskIndex = i; 35 | } 36 | } 37 | 38 | if (fromServer) { 39 | if (conflictedTaskIndex == null) { 40 | taskList.add(newTask); 41 | print("task_from_scomb(add) : $newTask"); 42 | } 43 | // on conflict, replace task 44 | else { 45 | taskList.removeAt(conflictedTaskIndex); 46 | taskList.add(newTask); 47 | // add from server and replace -> scomb task is done 48 | print("task_from_scomb(replace) : $newTask"); 49 | } 50 | } else { 51 | if (conflictedTaskIndex == null) { 52 | taskList.add(newTask); 53 | // for judging if scomb task done 54 | if (!newTask.addManually) { 55 | newTask.done = true; 56 | } 57 | print("task_from_db(add) : $newTask"); 58 | } 59 | // on conflict, replace task 60 | else { 61 | taskList.removeAt(conflictedTaskIndex); 62 | taskList.add(newTask); 63 | print("task_from_db(replace) : $newTask"); 64 | } 65 | } 66 | 67 | _saveToDB(newTask); 68 | } 69 | 70 | Future _saveToDB(Task newTask) async { 71 | var db = await AppDatabase.getDatabase(); 72 | 73 | // does not exist in db, register notification 74 | var tasksFromDB = await db.currentTaskDao.getAllTasks(); 75 | var isAlreadyExists = false; 76 | for (var taskFromDb in tasksFromDB) { 77 | if (taskFromDb.id == newTask.id) { 78 | isAlreadyExists = true; 79 | break; 80 | } 81 | } 82 | if (!isAlreadyExists) { 83 | registerTaskNotification(newTask, db: db); 84 | } 85 | 86 | // replace 87 | db.currentTaskDao.insertTask(newTask); 88 | } 89 | 90 | MaterialColor themeColor = MaterialColor( 91 | hexToColor("#FF90CAF9").value, 92 | getSwatch( 93 | hexToColor("#FF90CAF9"), 94 | ), 95 | ); 96 | -------------------------------------------------------------------------------- /lib/common/timetable_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scomb_mobile/common/db/scomb_mobile_database.dart'; 3 | 4 | import '../ui/dialog/new_class_cell_dialog.dart'; 5 | import 'db/class_cell.dart'; 6 | 7 | class TimetableModel { 8 | TimetableModel(this.title, this.isUserClassCell) { 9 | cells = createEmptyTimetable(); 10 | } 11 | 12 | late List> cells; 13 | String title; 14 | bool isUserClassCell; 15 | 16 | @override 17 | String toString() { 18 | var s = "TimetableModel.$title{"; 19 | applyToAllCells((classCell) { 20 | s += "${classCell?.name ?? ""},"; 21 | }); 22 | return "$s}"; 23 | } 24 | 25 | int getSumOfNumberOfCredit() { 26 | var sum = 0; 27 | List alreadyCountedClass = []; 28 | applyToAllCells((classCell) { 29 | if (classCell?.numberOfCredit != null && 30 | !alreadyCountedClass.contains(classCell)) { 31 | sum += classCell!.numberOfCredit!; 32 | alreadyCountedClass.add(classCell); 33 | } 34 | }); 35 | return sum; 36 | } 37 | 38 | void clearTimetable() { 39 | for (int r = 0; r < cells.length; r++) { 40 | for (int c = 0; c < cells[0].length; c++) { 41 | cells[r][c] = null; 42 | } 43 | } 44 | } 45 | 46 | Future addCell(ClassCell cell) async { 47 | var db = await AppDatabase.getDatabase(); 48 | 49 | // remove old cell 50 | var oldCell = cells[cell.period][cell.dayOfWeek]; 51 | if (oldCell != null) { 52 | await removeCell(oldCell, db); 53 | } 54 | 55 | await db.currentClassCellDao.insertClassCell(cell); 56 | if (cell.period >= 0 && cell.dayOfWeek >= 0) { 57 | cells[cell.period][cell.dayOfWeek] = cell; 58 | } 59 | } 60 | 61 | Future applyToAllCells( 62 | void Function(ClassCell? classCell) process) async { 63 | for (int r = 0; r < cells.length; r++) { 64 | for (int c = 0; c < cells[0].length; c++) { 65 | process(cells[r][c]); 66 | } 67 | } 68 | } 69 | 70 | List> createEmptyTimetable() { 71 | List> timetable = [ 72 | [null, null, null, null, null, null], 73 | [null, null, null, null, null, null], 74 | [null, null, null, null, null, null], 75 | [null, null, null, null, null, null], 76 | [null, null, null, null, null, null], 77 | [null, null, null, null, null, null], 78 | [null, null, null, null, null, null], 79 | ]; 80 | return timetable; 81 | } 82 | 83 | Future removeCell(ClassCell cell, AppDatabase db) async { 84 | if (cell.period >= 0 && cell.dayOfWeek >= 0) { 85 | cells[cell.period][cell.dayOfWeek] = null; 86 | } 87 | print("removed $cell"); 88 | await db.currentClassCellDao.removeClassCell(cell); 89 | } 90 | 91 | Future showNewClassCellDialog(int row, int col, BuildContext context, 92 | {ClassCell? classCell}) async { 93 | ClassCell? dialogResponse = await showDialog( 94 | context: context, 95 | barrierDismissible: false, 96 | builder: (_) { 97 | return NewClassCellDialog( 98 | row, 99 | col, 100 | this, 101 | editingClassCell: classCell, 102 | ); 103 | }, 104 | ); 105 | 106 | if (dialogResponse != null) { 107 | await addCell(dialogResponse); 108 | } 109 | } 110 | 111 | Map getColorAndCreditMap() { 112 | Map colorAndCreditMap = {}; 113 | 114 | applyToAllCells((classCell) { 115 | if (classCell != null) { 116 | if (colorAndCreditMap[ 117 | classCell.customColorInt ?? Colors.white70.value] != 118 | null) { 119 | colorAndCreditMap[classCell.customColorInt ?? Colors.white70.value] = 120 | colorAndCreditMap[ 121 | classCell.customColorInt ?? Colors.white70.value]! + 122 | (classCell.numberOfCredit ?? 0); 123 | } else { 124 | colorAndCreditMap[classCell.customColorInt ?? Colors.white70.value] = 125 | classCell.numberOfCredit ?? 0; 126 | } 127 | } 128 | }); 129 | 130 | return colorAndCreditMap; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/common/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | import 'dart:ui'; 3 | 4 | import 'package:charset_converter/charset_converter.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:intl/intl.dart'; 7 | import 'package:scomb_mobile/common/values.dart'; 8 | 9 | String timeToString(int time) { 10 | var now = DateTime.now(); 11 | var date = DateTime.fromMillisecondsSinceEpoch(time); 12 | 13 | var result = ""; 14 | if (now.year == date.year && now.month == date.month && now.day == date.day) { 15 | var formatter = DateFormat("HH:mm"); 16 | result = "今日 ${formatter.format(date)}"; 17 | } else if (now.year == date.year && 18 | now.month == date.month && 19 | now.day == date.day - 1) { 20 | var formatter = DateFormat("HH:mm"); 21 | result = "明日 ${formatter.format(date)}"; 22 | } else if (now.year == date.year && 23 | now.month == date.month && 24 | now.day == date.day + 1) { 25 | var formatter = DateFormat("HH:mm"); 26 | result = "昨日 ${formatter.format(date)}"; 27 | } else { 28 | var formatter = DateFormat("yyyy/MM/dd HH:mm"); 29 | result = formatter.format(date); 30 | } 31 | return result; 32 | } 33 | 34 | int stringToTime(String time, {bool includeSecond = true}) { 35 | var formatter = DateFormat("yyyy/MM/dd HH:mm:ss"); 36 | if (!includeSecond) { 37 | formatter = DateFormat("yyyy/MM/dd HH:mm"); 38 | } 39 | return formatter.parse(time).millisecondsSinceEpoch; 40 | } 41 | 42 | Color hexToColor(String hexString, {String alphaChannel = 'FF'}) { 43 | return Color(int.parse(hexString.replaceFirst('#', '0x$alphaChannel'))); 44 | } 45 | 46 | String getCurrentTerm() { 47 | var today = DateTime.now(); 48 | if (3 < today.month && today.month < 9) { 49 | return Term.FIRST; 50 | } else { 51 | return Term.SECOND; 52 | } 53 | } 54 | 55 | int getCurrentYear() { 56 | var today = DateTime.now(); 57 | if (today.month < 3) { 58 | return today.year - 1; 59 | } else { 60 | return today.year; 61 | } 62 | } 63 | 64 | // return only last one 65 | T1? findMapKeyFromValue(Map map, T2 targetValue) { 66 | T1? resultKey; 67 | map.forEach((key, value) { 68 | if (targetValue == value) { 69 | resultKey = key; 70 | } 71 | }); 72 | return resultKey; 73 | } 74 | 75 | String genHiddenText(String text) { 76 | var result = ""; 77 | for (int i = 0; i < text.length; i++) { 78 | result += "•"; 79 | } 80 | return result; 81 | } 82 | 83 | bool isSameDay(DateTime d1, DateTime d2) { 84 | return d1.year == d2.year && d1.month == d2.month && d1.day == d2.day; 85 | } 86 | 87 | Future convertUrlQueryString(String queryValue, 88 | {String encode = "utf-8"}) async { 89 | var charArray = await CharsetConverter.encode(encode, queryValue); 90 | var queryString = ""; 91 | charArray.forEach((element) { 92 | var hexChar = element.toRadixString(16).toUpperCase(); 93 | queryString += "%$hexChar"; 94 | }); 95 | 96 | return queryString; 97 | } 98 | 99 | Future convertEUCJPtoUTF8(List charArray) async { 100 | var string = CharsetConverter.decode("EUC-JP", Uint8List.fromList(charArray)); 101 | return string; 102 | } 103 | 104 | Map getSwatch(Color color) { 105 | final hslColor = HSLColor.fromColor(color); 106 | final lightness = hslColor.lightness; 107 | 108 | /// if [500] is the default color, there are at LEAST five 109 | /// steps below [500]. (i.e. 400, 300, 200, 100, 50.) A 110 | /// divisor of 5 would mean [50] is a lightness of 1.0 or 111 | /// a color of #ffffff. A value of six would be near white 112 | /// but not quite. 113 | final lowDivisor = 6; 114 | 115 | /// if [500] is the default color, there are at LEAST four 116 | /// steps above [500]. A divisor of 4 would mean [900] is 117 | /// a lightness of 0.0 or color of #000000 118 | final highDivisor = 5; 119 | 120 | final lowStep = (1.0 - lightness) / lowDivisor; 121 | final highStep = lightness / highDivisor; 122 | 123 | return { 124 | 50: (hslColor.withLightness(lightness + (lowStep * 5))).toColor(), 125 | 100: (hslColor.withLightness(lightness + (lowStep * 4))).toColor(), 126 | 200: (hslColor.withLightness(lightness + (lowStep * 3))).toColor(), 127 | 300: (hslColor.withLightness(lightness + (lowStep * 2))).toColor(), 128 | 400: (hslColor.withLightness(lightness + lowStep)).toColor(), 129 | 500: (hslColor.withLightness(lightness)).toColor(), 130 | 600: (hslColor.withLightness(lightness - highStep)).toColor(), 131 | 700: (hslColor.withLightness(lightness - (highStep * 2))).toColor(), 132 | 800: (hslColor.withLightness(lightness - (highStep * 3))).toColor(), 133 | 900: (hslColor.withLightness(lightness - (highStep * 4))).toColor(), 134 | }; 135 | } 136 | -------------------------------------------------------------------------------- /lib/common/values.dart: -------------------------------------------------------------------------------- 1 | const SCOMBZ_DOMAIN = "https://scombz.shibaura-it.ac.jp"; 2 | const SCOMB_LOGIN_PAGE_URL = "https://scombz.shibaura-it.ac.jp/saml/login?idp=http://adfs.sic.shibaura-it.ac.jp/adfs/services/trust"; 3 | const SCOMB_HOME_URL = "https://scombz.shibaura-it.ac.jp/portal/home"; 4 | const SCOMB_LOGGED_OUT_PAGE_URL = "https://scombz.shibaura-it.ac.jp/login"; 5 | const SCOMB_TIMETABLE_URL = "https://scombz.shibaura-it.ac.jp/lms/timetable"; 6 | const CLASS_PAGE_URL = "https://scombz.shibaura-it.ac.jp/lms/course?idnumber=\${classId}"; 7 | const TASK_LIST_PAGE_URL = "https://scombz.shibaura-it.ac.jp/lms/task"; 8 | const SURVEY_LIST_PAGE_URL = "https://scombz.shibaura-it.ac.jp/portal/surveys/list"; 9 | const SURVEY_PAGE_URL = "https://scombz.shibaura-it.ac.jp/portal/surveys/take"; 10 | const LMS_SURVEY_PAGE_URL = "https://scombz.shibaura-it.ac.jp/lms/course/surveys/take"; 11 | const TWITTER_URL = "https://twitter.com/ScombMobile"; 12 | const GITHUB_URL = "https://github.com/kouheisatou/ScombMobileFlutter"; 13 | const PRIVACY_POLICY_URL = "https://kouheisatou.github.io/ScombMobileFlutter/"; 14 | const SYLLABUS_SEARCH_URL = "http://syllabus.sic.shibaura-it.ac.jp/namazu/namazu.cgi?ajaxmode=true&query=\${className}&whence=0&idxname=\${admissionYearAndSection}&max=20&result=normal&sort=score"; 15 | const TIMETABLE_PAGE_URL = "http://timetable.sic.shibaura-it.ac.jp/table/\${yearCode}/Timetable\${sectionCode}\${departmentCode}01\${termCode}\${gradeCode}.html"; 16 | const TIMETABLE_LIST_PAGE_URL = "http://timetable.sic.shibaura-it.ac.jp/"; 17 | const NEWS_LIST_PAGE_URL = "https://scombz.shibaura-it.ac.jp/portal/home/information/list"; 18 | const NEWS_DETAIL_PAGE_URL = "https://scombz.shibaura-it.ac.jp/portal/home/information/detail_direct?informationId=\${newsId}&selectCategoryCd=\${data2}&idnumber="; 19 | 20 | // ScombのCookieとして保存されているセッションIDのキー 21 | const SESSION_COOKIE_ID = "SESSION"; 22 | 23 | // Scombに2段階認証が未設定でログインしようとすると出る"2要素認証は無効になっています。"確認画面の"次へ"ボタンのhtmlのid 24 | const TWO_STEP_VERIFICATION_LOGIN_BUTTON_ID = "continueButton"; 25 | 26 | // サイトのヘッダー要素ID 27 | const HEADER_ELEMENT_ID = "page_head"; 28 | // サイトのフッター要素ID 29 | const FOOTER_ELEMENT_ID = "page_foot"; 30 | 31 | // --------時間割CSS---------- 32 | // 時間割のテーブル1行のCSSクラス名 33 | const TIMETABLE_ROW_CSS_CLASS_NM = "div-table-data-row"; 34 | // 時間割の1マスのCSSクラス名 35 | const TIMETABLE_CELL_CSS_CLASS_NM = "div-table-cell"; 36 | // 時間割のマス内のトップボタンCSSクラス名 37 | const TIMETABLE_CELL_HEADER_CSS_CLASS_NM = "timetable-course-top-btn"; 38 | // 時間割のマス内の詳細情報CSSクラス名 39 | const TIMETABLE_CELL_DETAIL_CSS_CLASS_NM = "div-table-cell-detail"; 40 | // 教室名のattributeキー 41 | const TIMETABLE_ROOM_ATTR_KEY = "title"; 42 | 43 | // --------課題一覧ページCSS--------- 44 | // 課題1行分のCSS 45 | const TASK_LIST_CSS_CLASS_NM = "result_list_line"; 46 | // 課題行の科目名列のCSS 47 | const TASK_LIST_CLASS_CULUMN_CSS_NM = "tasklist-course"; 48 | // 課題行の課題タイプ列のCSS 49 | const TASK_LIST_TYPE_CULUMN_CSS_NM = "tasklist-contents"; 50 | // 課題行の課題タイトル列のCSS 51 | const TASK_LIST_TITLE_CULUMN_CSS_NM = "tasklist-title"; 52 | // 課題行の締切列のCSS 53 | const TASK_LIST_DEADLINE_CULUMN_CSS_NM = "tasklist-deadline"; 54 | 55 | // --------アンケート一覧ページCSS--------- 56 | // アンケート1行分のCSS 57 | const SURVEY_ROW_CSS_NM = "result-list"; 58 | 59 | // --------お知らせ一覧ページ-------- 60 | const NEWS_LIST_ITEM_CSS_NM = "contents-display-flex"; 61 | const NEWS_LIST_ITEM_TITLE_CSS_NM = "link-txt"; 62 | const NEWS_ID_ATTR_NM = "data1"; 63 | const NEWS_CATEGORY_ATTR_NM = "data2"; 64 | const NEWS_CATEGORY_CSS_NM = "portal-information-list-type"; 65 | const NEWS_DOMAIN_CSS_NM = "portal-information-list-division"; 66 | const NEWS_PUBLISH_TIME_CSS_NM = "portal-information-list-date"; 67 | const NEWS_TAG_CSS_NM = "portal-information-priority"; 68 | const NEWS_TAG_HIDDEN_CSS_NM = "contents-hidden"; 69 | 70 | class Term { 71 | static String FIRST = "10"; 72 | static String SECOND = "20"; 73 | } 74 | 75 | class DayOfWeek { 76 | static int MONDAY = 0; 77 | static int TUESDAY = 1; 78 | static int WEDNESDEY = 2; 79 | static int THURSDAY = 3; 80 | static int FRIDAY = 4; 81 | static int SATURDAY = 5; 82 | static int SUNDAY = 6; 83 | } 84 | 85 | class TaskType { 86 | static const int TASK = 0; 87 | static const int TEST = 1; 88 | static const int SURVEY = 2; 89 | static const int OTHERS = 3; 90 | } 91 | 92 | Map TASK_TYPE_MAP = { 93 | 0: "課題", 94 | 1: "テスト", 95 | 2: "アンケート", 96 | 3: "その他", 97 | }; 98 | 99 | Map DAY_OF_WEEK_MAP = { 100 | 0: "月曜", 101 | 1: "火曜", 102 | 2: "水曜", 103 | 3: "木曜", 104 | 4: "金曜", 105 | 5: "土曜", 106 | }; 107 | 108 | Map PERIOD_MAP = { 109 | 0: "1限", 110 | 1: "2限", 111 | 2: "3限", 112 | 3: "4限", 113 | 4: "5限", 114 | 5: "6限", 115 | 6: "7限", 116 | }; 117 | 118 | Map> PERIOD_TIME_MAP = { 119 | 0: ["09:00", "10:40"], 120 | 1: ["10:50", "12:30"], 121 | 2: ["13:20", "15:00"], 122 | 3: ["15:10", "16:50"], 123 | 4: ["17:00", "18:40"], 124 | 5: ["18:50", "20:30"], 125 | 6: ["21:40", "23:10"], 126 | }; 127 | 128 | Map TERM_DISP_NAME_MAP = { 129 | "10": "前期", 130 | "20": "後期", 131 | }; 132 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 5 | import 'package:scomb_mobile/ui/scomb_mobile.dart'; 6 | 7 | void main() { 8 | runApp(const ScombMobile()); 9 | // runApp(TestApp()); 10 | initNotification(); 11 | } 12 | 13 | Future initNotification() async { 14 | // init notification 15 | var plugin = FlutterLocalNotificationsPlugin(); 16 | await plugin.initialize( 17 | const InitializationSettings( 18 | iOS: DarwinInitializationSettings(), 19 | android: AndroidInitializationSettings("@drawable/ic_notification"), 20 | ), 21 | ); 22 | 23 | if (Platform.isAndroid) { 24 | const AndroidNotificationChannel todaysTaskChannel = 25 | AndroidNotificationChannel( 26 | "SCOMB_MOBILE_TODAYS_TASK_NOTIFICATION", 27 | "今日締切の課題", 28 | description: "今日締め切りの全ての課題を指定時刻に通知します", 29 | importance: Importance.max, 30 | ); 31 | 32 | await plugin 33 | .resolvePlatformSpecificImplementation< 34 | AndroidFlutterLocalNotificationsPlugin>() 35 | ?.createNotificationChannel(todaysTaskChannel); 36 | 37 | const AndroidNotificationChannel taskChannel = AndroidNotificationChannel( 38 | "SCOMB_MOBILE_TASK_NOTIFICATION", 39 | "課題締め切り通知", 40 | description: "締め切り時刻の近い課題を通知します", 41 | importance: Importance.max, 42 | ); 43 | 44 | await plugin 45 | .resolvePlatformSpecificImplementation< 46 | AndroidFlutterLocalNotificationsPlugin>() 47 | ?.createNotificationChannel(taskChannel); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/ui/dialog/color_picker_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_colorpicker/flutter_colorpicker.dart'; 3 | 4 | import '../../common/utils.dart'; 5 | 6 | class ColorPickerDialog extends StatelessWidget { 7 | int? selectedColor; 8 | Color? defaultColor; 9 | 10 | ColorPickerDialog({this.defaultColor, Key? key}) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return BlockPicker( 15 | pickerColor: Colors.black, 16 | availableColors: [ 17 | hexToColor("#FFEF9A9A"), 18 | hexToColor("#FFF48FB1"), 19 | hexToColor("#FFCE93D8"), 20 | hexToColor("#FFB39DDB"), 21 | hexToColor("#FF9FA8DA"), 22 | hexToColor("#FF90CAF9"), 23 | hexToColor("#FF81D4FA"), 24 | hexToColor("#FF80DEEA"), 25 | hexToColor("#FF80CBC4"), 26 | hexToColor("#FFA5D6A7"), 27 | hexToColor("#FFC5E1A5"), 28 | hexToColor("#FFE6EE9C"), 29 | hexToColor("#FFFFF59D"), 30 | hexToColor("#FFFFE082"), 31 | hexToColor("#FFFFCC80"), 32 | hexToColor("#FFFFAB91"), 33 | hexToColor("#FFBCAAA4"), 34 | // default color 35 | defaultColor != null ? defaultColor! : Colors.blueGrey 36 | ], 37 | layoutBuilder: (context, colors, child) { 38 | return Center( 39 | child: SizedBox( 40 | width: 300, 41 | height: 150, 42 | child: GridView.count( 43 | physics: const NeverScrollableScrollPhysics(), 44 | crossAxisCount: 6, 45 | crossAxisSpacing: 5, 46 | mainAxisSpacing: 5, 47 | children: [ 48 | for (Color color in colors) child(color), 49 | ], 50 | ), 51 | ), 52 | ); 53 | }, 54 | onColorChanged: (color) { 55 | selectedColor = color.value; 56 | Navigator.pop(context, color.value); 57 | }, 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/ui/dialog/loading_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoadingDialog extends StatelessWidget { 4 | LoadingDialog(); 5 | late BuildContext context; 6 | bool isLoading = true; 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | isLoading = true; 11 | this.context = context; 12 | return SimpleDialog( 13 | contentPadding: const EdgeInsets.all(20), 14 | children: [ 15 | Row( 16 | mainAxisAlignment: MainAxisAlignment.center, 17 | mainAxisSize: MainAxisSize.max, 18 | children: const [ 19 | Text("読み込み中"), 20 | SizedBox(width: 20), 21 | CircularProgressIndicator(), 22 | ], 23 | ) 24 | ], 25 | ); 26 | } 27 | 28 | void close() { 29 | isLoading = false; 30 | Navigator.pop(context); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ui/dialog/selector_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SelectorDialog extends StatelessWidget { 4 | SelectorDialog(this.selectionMap, this.onPressed, 5 | {this.description, this.selectedKey}); 6 | 7 | String? description; 8 | 9 | Map selectionMap; 10 | String? selectedKey; 11 | Future Function(String key, T? value) onPressed; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return SimpleDialog( 16 | titleTextStyle: const TextStyle(color: Colors.grey), 17 | title: description != null 18 | ? Container( 19 | decoration: const BoxDecoration( 20 | border: Border( 21 | bottom: BorderSide(width: 1, color: Colors.grey), 22 | ), 23 | ), 24 | child: Padding( 25 | padding: const EdgeInsets.only( 26 | bottom: 30, 27 | right: 20, 28 | left: 20, 29 | top: 10, 30 | ), 31 | child: Text( 32 | description!, 33 | textAlign: TextAlign.center, 34 | ), 35 | ), 36 | ) 37 | : null, 38 | children: buildList(context), 39 | ); 40 | } 41 | 42 | List buildList(BuildContext context) { 43 | List listChildren = []; 44 | 45 | listChildren.add( 46 | const Divider( 47 | height: 1, 48 | ), 49 | ); 50 | selectionMap.forEach((key, value) { 51 | listChildren.add(buildRow(key, context)); 52 | }); 53 | 54 | return listChildren; 55 | } 56 | 57 | Widget buildRow(String text, BuildContext context) { 58 | return Column( 59 | children: [ 60 | SizedBox( 61 | width: double.infinity, 62 | child: InkWell( 63 | onTap: () async { 64 | Navigator.pop(context, text); 65 | await onPressed(text, selectionMap[text]); 66 | }, 67 | child: Align( 68 | alignment: Alignment.center, 69 | child: Padding( 70 | padding: const EdgeInsets.all(20), 71 | child: Text( 72 | text, 73 | style: TextStyle( 74 | fontWeight: (selectedKey == text) 75 | ? FontWeight.bold 76 | : FontWeight.normal, 77 | ), 78 | ), 79 | ), 80 | ), 81 | ), 82 | ), 83 | const Divider( 84 | height: 1, 85 | ) 86 | ], 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/ui/dialog/syllabus_search_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fluttertoast/fluttertoast.dart'; 3 | import 'package:scomb_mobile/ui/dialog/selector_dialog.dart'; 4 | 5 | import '../../common/db/scomb_mobile_database.dart'; 6 | import '../../common/db/setting_entity.dart'; 7 | import '../../common/scraping/syllabus_scraping.dart'; 8 | import '../../common/shared_resource.dart'; 9 | import '../../common/utils.dart'; 10 | import '../../common/values.dart'; 11 | 12 | typedef InputUrlManuallyCallback = Future Function(); 13 | 14 | Future showSyllabusSearchResultDialog(BuildContext context, 15 | String? searchString, InputUrlManuallyCallback? inputUrlManually, 16 | {String? section}) async { 17 | String? syllabusUrl; 18 | var db = await AppDatabase.getDatabase(); 19 | 20 | // recover section setting from db 21 | if (section == null) { 22 | section = (await db.currentSettingDao.getSetting(SettingKeys.SECTION)) 23 | ?.settingValue; 24 | if (section == null) { 25 | Fluttertoast.showToast(msg: "設定で学部を設定してください"); 26 | } 27 | } 28 | 29 | // encode url query 30 | var queryString = await convertUrlQueryString( 31 | searchString?.replaceAll(RegExp("[1-9A-Z1-9]"), "") ?? "", 32 | encode: "EUC-JP", 33 | ); 34 | 35 | // construct syllabus url 36 | var syllabusResultUrl = SYLLABUS_SEARCH_URL 37 | .replaceFirst("\${className}", queryString) 38 | .replaceFirst("\${admissionYearAndSection}", "$timetableYear%2F$section"); 39 | 40 | // syllabus search result 41 | var results = await fetchAllSyllabusSearchResult( 42 | syllabusResultUrl, 43 | ); 44 | if (inputUrlManually != null) { 45 | results["[ URLを直接入力する ]"] = ""; 46 | } 47 | 48 | // select same name class 49 | bool noMatch = true; 50 | results.forEach((key, value) { 51 | if (key == searchString) { 52 | syllabusUrl = value; 53 | noMatch = false; 54 | } 55 | }); 56 | 57 | // no matched name 58 | if (noMatch) { 59 | String? dialogResponse = await showDialog( 60 | context: context, 61 | builder: (_) { 62 | return SelectorDialog( 63 | results, 64 | (key, value) async {}, 65 | description: results.isNotEmpty 66 | ? "複数の検索結果が見つかりました" 67 | : "検索条件にマッチする授業が見つかりませんでした", 68 | ); 69 | }, 70 | ); 71 | 72 | if (dialogResponse == null) { 73 | return null; 74 | } else if (dialogResponse == "[ URLを直接入力する ]") { 75 | if (inputUrlManually != null) { 76 | syllabusUrl = await inputUrlManually(); 77 | } 78 | } else { 79 | syllabusUrl = results[dialogResponse] ?? ""; 80 | } 81 | } 82 | 83 | return syllabusUrl; 84 | } 85 | -------------------------------------------------------------------------------- /lib/ui/scomb_mobile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scomb_mobile/common/shared_resource.dart'; 3 | import 'package:scomb_mobile/ui/screen/link_list_screen.dart'; 4 | import 'package:scomb_mobile/ui/screen/news_list_screen.dart'; 5 | import 'package:scomb_mobile/ui/screen/setting_screen.dart'; 6 | import 'package:scomb_mobile/ui/screen/task_list_screen.dart'; 7 | import 'package:scomb_mobile/ui/screen/timetable/timetable_screen.dart'; 8 | 9 | import '../common/db/scomb_mobile_database.dart'; 10 | import '../common/db/setting_entity.dart'; 11 | import '../common/utils.dart'; 12 | 13 | class ScombMobile extends StatefulWidget { 14 | const ScombMobile({Key? key}) : super(key: key); 15 | 16 | @override 17 | State createState() { 18 | return ScombMobileState(); 19 | } 20 | } 21 | 22 | class ScombMobileState extends State { 23 | final List _screens = []; 24 | 25 | ScombMobileState() { 26 | _screens.add(TimetableScreen("時間割")); 27 | _screens.add(TaskListScreen("課題・テスト一覧")); 28 | _screens.add(LinkListScreen()); 29 | _screens.add(NewsScreen("お知らせ")); 30 | _screens.add(SettingScreen(this)); 31 | } 32 | 33 | int selectedIndex = 0; 34 | 35 | @override 36 | void initState() { 37 | getThemeColor(); 38 | super.initState(); 39 | } 40 | 41 | Future getThemeColor() async { 42 | var db = await AppDatabase.getDatabase(); 43 | String? color = 44 | (await db.currentSettingDao.getSetting(SettingKeys.THEME_COLOR)) 45 | ?.settingValue; 46 | if (color != null) { 47 | try { 48 | var colorInt = int.parse(color); 49 | themeColor = MaterialColor(colorInt, getSwatch(Color(colorInt))); 50 | } catch (e) { 51 | print(e); 52 | } 53 | } 54 | setState(() {}); 55 | } 56 | 57 | @override 58 | Widget build(BuildContext context) { 59 | return MaterialApp( 60 | builder: (context, child) { 61 | return MediaQuery( 62 | data: MediaQuery.of(context).copyWith(textScaleFactor: 0.8), 63 | child: child!, 64 | ); 65 | }, 66 | debugShowCheckedModeBanner: false, 67 | title: "ScombMobile", 68 | theme: ThemeData( 69 | primarySwatch: themeColor, 70 | useMaterial3: false, 71 | ), 72 | home: Scaffold( 73 | // if selected index null, attach login screen 74 | body: _screens[selectedIndex], 75 | // if login screen, disable bottom nav 76 | bottomNavigationBar: BottomNavigationBar( 77 | // set bottom selection last 78 | currentIndex: selectedIndex, 79 | onTap: (int index) { 80 | setState(() { 81 | selectedIndex = index; 82 | }); 83 | }, 84 | items: const [ 85 | BottomNavigationBarItem( 86 | icon: Icon(Icons.table_chart), 87 | label: "時間割", 88 | ), 89 | BottomNavigationBarItem( 90 | icon: Icon(Icons.task), 91 | label: "課題", 92 | ), 93 | BottomNavigationBarItem( 94 | icon: Icon(Icons.open_in_new), 95 | label: "リンク", 96 | ), 97 | BottomNavigationBarItem( 98 | icon: Icon(Icons.notifications), 99 | label: "お知らせ", 100 | ), 101 | BottomNavigationBarItem( 102 | icon: Icon(Icons.settings), 103 | label: "設定", 104 | ), 105 | ], 106 | type: BottomNavigationBarType.fixed, 107 | )), 108 | ); 109 | } 110 | 111 | void setThemeColor(Color color) { 112 | setState(() { 113 | themeColor = MaterialColor( 114 | color.value, 115 | getSwatch(color), 116 | ); 117 | }); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /lib/ui/screen/class_search_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:scomb_mobile/common/values.dart'; 4 | import 'package:scomb_mobile/ui/screen/single_page_scomb.dart'; 5 | 6 | import '../../common/db/class_cell_dao.dart'; 7 | import '../../common/timetable_model.dart'; 8 | import '../dialog/selector_dialog.dart'; 9 | import '../dialog/syllabus_search_dialog.dart'; 10 | 11 | class ClassSearchScreen extends StatefulWidget { 12 | @override 13 | State createState() => _ClassSearchScreenState(); 14 | } 15 | 16 | class _ClassSearchScreenState extends State { 17 | var syllabusSearchStringTextFieldController = TextEditingController(); 18 | final focusNode = FocusNode(); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return GestureDetector( 23 | onTap: () { 24 | focusNode.requestFocus(); 25 | }, 26 | child: Scaffold( 27 | resizeToAvoidBottomInset: false, 28 | appBar: AppBar( 29 | title: const Text("授業検索"), 30 | ), 31 | body: Padding( 32 | padding: const EdgeInsets.all(8.0), 33 | child: Column( 34 | children: [ 35 | Row( 36 | children: [ 37 | Expanded( 38 | child: Focus( 39 | focusNode: focusNode, 40 | child: TextFormField( 41 | controller: syllabusSearchStringTextFieldController, 42 | ), 43 | ), 44 | ), 45 | OutlinedButton( 46 | onPressed: () async { 47 | var syllabusUrl = await showSyllabusSearchResultDialog( 48 | context, 49 | syllabusSearchStringTextFieldController.text, 50 | null, 51 | ); 52 | if (syllabusUrl == "" || syllabusUrl == null) return; 53 | Navigator.push( 54 | context, 55 | MaterialPageRoute( 56 | builder: (buildContext) { 57 | return SinglePageScomb( 58 | Uri.parse(syllabusUrl), 59 | syllabusSearchStringTextFieldController.text, 60 | ); 61 | }, 62 | ), 63 | ); 64 | focusNode.requestFocus(); 65 | }, 66 | child: const Text("シラバス検索"), 67 | ), 68 | ], 69 | ), 70 | OutlinedButton( 71 | onPressed: () async { 72 | // get all timetables 73 | Map allTimetables = 74 | await getAllTimetables( 75 | onFetchFinished: (_) {}, 76 | ); 77 | 78 | // show timetable selection dialog 79 | var selectedTimetableTitle = await showDialog( 80 | context: context, 81 | builder: (_) { 82 | return SelectorDialog( 83 | allTimetables, 84 | (key, value) async {}, 85 | description: "追加先の時間割を選択してください", 86 | ); 87 | }, 88 | ); 89 | if (selectedTimetableTitle == null || 90 | allTimetables[selectedTimetableTitle] == null) { 91 | return; 92 | } 93 | 94 | Navigator.push( 95 | context, 96 | MaterialPageRoute( 97 | fullscreenDialog: true, 98 | builder: (buildContext) { 99 | return SinglePageScomb( 100 | Uri.parse(TIMETABLE_PAGE_URL 101 | .replaceAll("\${yearCode}", "2022") 102 | .replaceAll("\${sectionCode}", "1") 103 | .replaceAll("\${departmentCode}", "F") 104 | .replaceAll("\${termCode}", "2") 105 | .replaceAll("\${gradeCode}", "3")), 106 | "時間割検索", 107 | shouldShowAddNewClassButton: true, 108 | timetable: allTimetables[selectedTimetableTitle]!, 109 | ); 110 | }, 111 | ), 112 | ); 113 | }, 114 | child: const Text("時間割ページを表示"), 115 | ), 116 | ], 117 | ), 118 | ), 119 | ), 120 | ); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/ui/screen/news_list_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:scomb_mobile/common/scraping/news_scraping.dart'; 5 | import 'package:scomb_mobile/common/values.dart'; 6 | import 'package:scomb_mobile/ui/screen/network_screen.dart'; 7 | import 'package:scomb_mobile/ui/screen/single_page_scomb.dart'; 8 | 9 | import '../../common/db/news_item_model_entity.dart'; 10 | import '../../common/db/scomb_mobile_database.dart'; 11 | 12 | class NewsScreen extends NetworkScreen { 13 | NewsScreen(super.title, {Key? key}) : super(key: key); 14 | 15 | List news = []; 16 | bool newsFetched = false; 17 | 18 | @override 19 | NetworkScreenState createState() => NewsScreenState(); 20 | } 21 | 22 | class NewsScreenState extends NetworkScreenState { 23 | @override 24 | Future getDataOffLine() async {} 25 | 26 | @override 27 | Future getFromServerAndSaveToSharedResource(savedSessionId) async { 28 | if (widget.newsFetched) return; 29 | isLoading = true; 30 | widget.news = await fetchAllNews(); 31 | isLoading = false; 32 | widget.newsFetched = true; 33 | } 34 | 35 | @override 36 | Widget innerBuild() { 37 | return RefreshIndicator( 38 | onRefresh: refreshData, 39 | child: ListView.builder( 40 | itemCount: widget.news.length, 41 | itemBuilder: (BuildContext context, int index) { 42 | return Column( 43 | children: [ 44 | InkWell( 45 | onTap: () async { 46 | Navigator.push( 47 | context, 48 | MaterialPageRoute( 49 | builder: (context) => SinglePageScomb( 50 | Uri.parse( 51 | NEWS_DETAIL_PAGE_URL.replaceAll("\${newsId}", widget.news[index].newsId).replaceAll("\${data2}", widget.news[index].data2), 52 | ), 53 | widget.news[index].title, 54 | ), 55 | fullscreenDialog: true, 56 | ), 57 | ); 58 | 59 | // remove unread badge 60 | setState(() { 61 | widget.news[index].unread = false; 62 | }); 63 | var db = await AppDatabase.getDatabase(); 64 | await db.currentNewsItemModelDao.insertNewsModel(widget.news[index]); 65 | }, 66 | onLongPress: () { 67 | print(widget.news[index]); 68 | }, 69 | child: Padding( 70 | padding: const EdgeInsets.all(8.0), 71 | child: Opacity( 72 | opacity: widget.news[index].unread ? 0.4 : 1, 73 | child: ListTile( 74 | subtitle: Padding( 75 | padding: const EdgeInsets.fromLTRB(0, 5, 0, 0), 76 | child: Row( 77 | children: [ 78 | Expanded( 79 | child: Text( 80 | widget.news[index].domain, 81 | overflow: TextOverflow.ellipsis, 82 | ), 83 | ), 84 | Text(widget.news[index].publishTime), 85 | ], 86 | ), 87 | ), 88 | title: Text( 89 | widget.news[index].title, 90 | overflow: TextOverflow.ellipsis, 91 | maxLines: 2, 92 | ), 93 | ), 94 | ), 95 | ), 96 | ), 97 | const Divider( 98 | height: 0.5, 99 | ), 100 | ], 101 | ); 102 | }, 103 | ), 104 | ); 105 | } 106 | 107 | @override 108 | Future refreshData() async { 109 | widget.newsFetched = false; 110 | isLoading = true; 111 | widget.news = await fetchAllNews(); 112 | isLoading = false; 113 | widget.newsFetched = true; 114 | setState(() {}); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/ui/screen/timetable/customized_timetable_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:fluttertoast/fluttertoast.dart'; 4 | import 'package:scomb_mobile/common/timetable_model.dart'; 5 | import 'package:scomb_mobile/ui/component/timetable_component.dart'; 6 | 7 | import '../../../common/values.dart'; 8 | import '../single_page_scomb.dart'; 9 | 10 | class CustomizedTimetableScreen extends StatefulWidget { 11 | CustomizedTimetableScreen(this.timetable, {super.key}); 12 | 13 | TimetableModel timetable; 14 | 15 | @override 16 | State createState() => 17 | _CustomizedTimetableScreenState(); 18 | } 19 | 20 | class _CustomizedTimetableScreenState extends State { 21 | @override 22 | void initState() { 23 | Fluttertoast.showToast(msg: "マスを長押しして編集"); 24 | super.initState(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | resizeToAvoidBottomInset: false, 31 | appBar: AppBar( 32 | title: Text( 33 | widget.timetable.title, 34 | ), 35 | ), 36 | body: Column( 37 | children: [ 38 | Container( 39 | width: double.infinity, 40 | decoration: const BoxDecoration( 41 | border: Border( 42 | bottom: BorderSide(color: Colors.grey, width: 0.2), 43 | ), 44 | ), 45 | child: Row( 46 | children: [ 47 | Expanded( 48 | child: SingleChildScrollView( 49 | scrollDirection: Axis.horizontal, 50 | child: Row(children: buildNumberOfCreditRow()), 51 | ), 52 | ), 53 | Padding( 54 | padding: const EdgeInsets.only(right: 8), 55 | child: OutlinedButton( 56 | onPressed: () async { 57 | await Navigator.push( 58 | context, 59 | MaterialPageRoute( 60 | fullscreenDialog: true, 61 | builder: (buildContext) { 62 | return SinglePageScomb( 63 | Uri.parse(TIMETABLE_LIST_PAGE_URL), 64 | "時間割検索", 65 | shouldShowAddNewClassButton: true, 66 | timetable: widget.timetable, 67 | ); 68 | }, 69 | ), 70 | ); 71 | setState(() {}); 72 | }, 73 | child: const Text("時間割サイトから配置"), 74 | ), 75 | ) 76 | ], 77 | ), 78 | ), 79 | Expanded( 80 | child: TimetableComponent( 81 | widget.timetable, 82 | true, 83 | isEditMode: true, 84 | onUpdatedUi: () { 85 | setState(() {}); 86 | }, 87 | ), 88 | ), 89 | ], 90 | ), 91 | ); 92 | } 93 | 94 | List buildNumberOfCreditRow() { 95 | List list = [ 96 | Padding( 97 | padding: const EdgeInsets.all(8.0), 98 | child: Text( 99 | "計${widget.timetable.getSumOfNumberOfCredit()}単位", 100 | style: const TextStyle(color: Colors.black54), 101 | ), 102 | ) 103 | ]; 104 | widget.timetable.getColorAndCreditMap().forEach((key, value) { 105 | list.add(Padding( 106 | padding: const EdgeInsets.all(8.0), 107 | child: Container( 108 | decoration: BoxDecoration( 109 | border: Border( 110 | bottom: BorderSide( 111 | color: 112 | (key == Colors.white70.value) ? Colors.white : Color(key), 113 | ), 114 | ), 115 | ), 116 | child: Text( 117 | "$value単位", 118 | style: TextStyle( 119 | shadows: [ 120 | Shadow( 121 | blurRadius: 10, 122 | color: 123 | (key == Colors.white70.value) ? Colors.white : Color(key), 124 | ), 125 | ], 126 | color: Colors.black26, 127 | ), 128 | ), 129 | ), 130 | )); 131 | }); 132 | return list; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void fl_register_plugins(FlPluginRegistry* registry) { 13 | g_autoptr(FlPluginRegistrar) charset_converter_registrar = 14 | fl_plugin_registry_get_registrar_for_plugin(registry, "CharsetConverterPlugin"); 15 | charset_converter_plugin_register_with_registrar(charset_converter_registrar); 16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 19 | } 20 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | charset_converter 7 | url_launcher_linux 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "scomb_mobile"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "scomb_mobile"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import flutter_inappwebview_macos 9 | import flutter_local_notifications 10 | import in_app_review 11 | import path_provider_foundation 12 | import share_plus 13 | import sqflite 14 | import url_launcher_macos 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) 18 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 19 | InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) 20 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 21 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 22 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 23 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - flutter_local_notifications (0.0.1): 3 | - FlutterMacOS 4 | - FlutterMacOS (1.0.0) 5 | - FMDB (2.7.5): 6 | - FMDB/standard (= 2.7.5) 7 | - FMDB/standard (2.7.5) 8 | - package_info_plus_macos (0.0.1): 9 | - FlutterMacOS 10 | - sqflite (0.0.2): 11 | - FlutterMacOS 12 | - FMDB (>= 2.7.5) 13 | - url_launcher_macos (0.0.1): 14 | - FlutterMacOS 15 | 16 | DEPENDENCIES: 17 | - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`) 18 | - FlutterMacOS (from `Flutter/ephemeral`) 19 | - package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`) 20 | - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) 21 | - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) 22 | 23 | SPEC REPOS: 24 | trunk: 25 | - FMDB 26 | 27 | EXTERNAL SOURCES: 28 | flutter_local_notifications: 29 | :path: Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos 30 | FlutterMacOS: 31 | :path: Flutter/ephemeral 32 | package_info_plus_macos: 33 | :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos 34 | sqflite: 35 | :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos 36 | url_launcher_macos: 37 | :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos 38 | 39 | SPEC CHECKSUMS: 40 | flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4 41 | FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 42 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 43 | package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c 44 | sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea 45 | url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 46 | 47 | PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c 48 | 49 | COCOAPODS: 1.11.3 50 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = scomb_mobile 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.scombMobile 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: scomb_mobile 2 | description: A new Flutter project. 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | # android version code 5 | version: 2.6.0+41 6 | 7 | environment: 8 | sdk: ">=2.17.6 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | # web view 14 | flutter_inappwebview: ^6.0.0 15 | # http 16 | http: ^1.2.1 17 | html: ^0.15.4 18 | dio: ^5.4.2+1 19 | cookie_jar: ^4.0.8 20 | dio_cookie_manager: ^3.1.1 21 | # toast 22 | fluttertoast: ^8.2.4 23 | intl: ^0.19.0 24 | # icon 25 | flutter_native_splash: ^2.4.0 26 | flutter_launcher_icons: ^0.13.1 27 | cupertino_icons: ^1.0.6 28 | # db 29 | floor: ^1.4.2 30 | # open default browser 31 | url_launcher: ^6.2.6 32 | # color picker 33 | flutter_colorpicker: ^1.1.0 34 | # calendar 35 | table_calendar: ^3.1.1 36 | # notification 37 | flutter_local_notifications: ^17.0.0 38 | timezone: ^0.9.2 39 | # data time picker 40 | flutter_datetime_picker_plus: ^2.1.0 41 | # slidable 42 | flutter_slidable: ^3.1.0 43 | # settings_ui 44 | settings_ui: ^2.0.2 45 | # app review 46 | in_app_review: ^2.0.9 47 | # charset_converter: 48 | charset_converter: ^2.2.0 49 | # encrypt 50 | encrypt: ^5.0.3 51 | # share 52 | share_plus: ^8.0.3 53 | path_provider: ^2.1.3 54 | file_picker: ^8.0.0+1 55 | 56 | flutter_native_splash: 57 | image: "resources/splash.png" 58 | color: "F5F5F5" 59 | flutter_icons: 60 | android: true 61 | ios: true 62 | image_path: "resources/icon.png" 63 | 64 | dev_dependencies: 65 | flutter_test: 66 | sdk: flutter 67 | flutter_lints: ^3.0.2 68 | # DB 69 | floor_generator: ^1.4.2 70 | build_runner: ^2.4.9 71 | 72 | flutter: 73 | uses-material-design: true 74 | assets: 75 | - resources/ 76 | -------------------------------------------------------------------------------- /resources/coop_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/coop_icon.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/icon.png -------------------------------------------------------------------------------- /resources/official_timetable_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/official_timetable_icon.png -------------------------------------------------------------------------------- /resources/scombz_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/scombz_icon.png -------------------------------------------------------------------------------- /resources/sgsot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/sgsot.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/resources/splash.png -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | import 'package:scomb_mobile/ui/scomb_mobile.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(const ScombMobile()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | scomb_mobile 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 63 | 64 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scomb_mobile", 3 | "short_name": "scomb_mobile", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /web/splash/img/dark-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/dark-1x.png -------------------------------------------------------------------------------- /web/splash/img/dark-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/dark-2x.png -------------------------------------------------------------------------------- /web/splash/img/dark-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/dark-3x.png -------------------------------------------------------------------------------- /web/splash/img/dark-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/dark-4x.png -------------------------------------------------------------------------------- /web/splash/img/light-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/light-1x.png -------------------------------------------------------------------------------- /web/splash/img/light-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/light-2x.png -------------------------------------------------------------------------------- /web/splash/img/light-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/light-3x.png -------------------------------------------------------------------------------- /web/splash/img/light-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/web/splash/img/light-4x.png -------------------------------------------------------------------------------- /web/splash/style.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin:0; 3 | height:100%; 4 | background: #F5F5F5; 5 | 6 | background-size: 100% 100%; 7 | } 8 | 9 | .center { 10 | margin: 0; 11 | position: absolute; 12 | top: 50%; 13 | left: 50%; 14 | -ms-transform: translate(-50%, -50%); 15 | transform: translate(-50%, -50%); 16 | } 17 | 18 | .contain { 19 | display:block; 20 | width:100%; height:100%; 21 | object-fit: contain; 22 | } 23 | 24 | .stretch { 25 | display:block; 26 | width:100%; height:100%; 27 | } 28 | 29 | .cover { 30 | display:block; 31 | width:100%; height:100%; 32 | object-fit: cover; 33 | } 34 | 35 | @media (prefers-color-scheme: dark) { 36 | body { 37 | margin:0; 38 | height:100%; 39 | background: #F5F5F5; 40 | 41 | background-size: 100% 100%; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(scomb_mobile LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "scomb_mobile") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | CharsetConverterPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("CharsetConverterPlugin")); 16 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | charset_converter 7 | share_plus 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Disable Windows macros that collide with C++ standard library functions. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 25 | 26 | # Add dependency libraries and include directories. Add any application-specific 27 | # dependencies here. 28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 30 | 31 | # Run the Flutter tool portions of the build. This must not be removed. 32 | add_dependencies(${BINARY_NAME} flutter_assemble) 33 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "scomb_mobile" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "scomb_mobile" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "scomb_mobile.exe" "\0" 98 | VALUE "ProductName", "scomb_mobile" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"scomb_mobile", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouheisatou/ScombMobileFlutter/15e01adf1cb07c49af43d12b1a77b637d8b945b5/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------