├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── checkout.yml
│ └── release.yml
├── .gitignore
├── .metadata
├── .vscode
├── extensions.json
├── launch.json
└── settings.json
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ ├── google-services.json
│ ├── proguard-rules.pro
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── ic_launcher-playstore.png
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── deskbtm
│ │ │ │ └── nitmgpt
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ ├── launch_background.xml
│ │ │ └── notification.png
│ │ │ ├── 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
│ │ │ └── xml
│ │ │ ├── filepaths.xml
│ │ │ └── network_security_config.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── public_key.jks.base64.txt
└── settings.gradle
├── lib
├── components
│ ├── back_button.dart
│ ├── dialog.dart
│ ├── empty.dart
│ └── notification_tile.dart
├── constants.dart
├── double_pop_exit.dart
├── firebase.dart
├── firebase_options.dart
├── i18n
│ ├── en_US.dart
│ ├── i18n.dart
│ └── zh_CN.dart
├── main.dart
├── models
│ ├── realm.dart
│ ├── record.dart
│ ├── record.g.dart
│ ├── settings.dart
│ └── settings.g.dart
├── nitm.dart
├── notification_utils.dart
├── pages
│ ├── add_rules
│ │ ├── add_rules.dart
│ │ ├── rule_fields_map.dart
│ │ ├── rules_binding.dart
│ │ └── rules_controller.dart
│ ├── home
│ │ ├── home.dart
│ │ ├── home_binding.dart
│ │ ├── home_controller.dart
│ │ └── watcher_controller.dart
│ ├── index
│ │ ├── index.dart
│ │ ├── index_binding.dart
│ │ └── index_controller.dart
│ └── settings
│ │ ├── settings.dart
│ │ └── settings_controller.dart
├── permanent_listener_service
│ ├── gpt_response.dart
│ └── main.dart
├── routes.dart
├── theme.dart
└── utils.dart
├── plugins
├── chatgpt_api
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── lib
│ │ ├── chat_gpt_sdk.dart
│ │ ├── dio_proxy_adapter.dart
│ │ └── src
│ │ │ ├── client
│ │ │ ├── base_client.dart
│ │ │ ├── client.dart
│ │ │ ├── exception
│ │ │ │ ├── base_error.dart
│ │ │ │ ├── missing_token.dart
│ │ │ │ ├── openai_exception.dart
│ │ │ │ └── request_error.dart
│ │ │ ├── interceptor
│ │ │ │ └── interceptor_wrapper.dart
│ │ │ └── openai_client.dart
│ │ │ ├── logger
│ │ │ └── logger.dart
│ │ │ ├── model
│ │ │ ├── chat_complete
│ │ │ │ ├── request
│ │ │ │ │ └── ChatCompleteText.dart
│ │ │ │ └── response
│ │ │ │ │ ├── ChatCTResponse.dart
│ │ │ │ │ ├── chat_choice.dart
│ │ │ │ │ └── message.dart
│ │ │ ├── client
│ │ │ │ └── http_setup.dart
│ │ │ ├── complete_text
│ │ │ │ ├── request
│ │ │ │ │ └── complete_text.dart
│ │ │ │ └── response
│ │ │ │ │ ├── choices.dart
│ │ │ │ │ ├── complete_response.dart
│ │ │ │ │ └── usage.dart
│ │ │ ├── gen_image
│ │ │ │ ├── request
│ │ │ │ │ └── generate_image.dart
│ │ │ │ └── response
│ │ │ │ │ ├── GenImgResponse.dart
│ │ │ │ │ └── image_data.dart
│ │ │ ├── openai_engine
│ │ │ │ ├── engine_data.dart
│ │ │ │ └── engine_model.dart
│ │ │ └── openai_model
│ │ │ │ ├── openai_model_data.dart
│ │ │ │ ├── openai_models.dart
│ │ │ │ └── permission.dart
│ │ │ ├── openai.dart
│ │ │ └── utils
│ │ │ └── constants.dart
│ ├── pubspec.yaml
│ └── test
│ │ └── chat_gpt_test.dart
├── chatgpt_api_unofficial
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ │ ├── app
│ │ │ └── src
│ │ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── flutter
│ │ │ │ └── plugins
│ │ │ │ └── GeneratedPluginRegistrant.java
│ │ └── local.properties
│ ├── example
│ │ ├── .gitignore
│ │ ├── .metadata
│ │ ├── README.md
│ │ ├── analysis_options.yaml
│ │ ├── android
│ │ │ ├── .gitignore
│ │ │ ├── app
│ │ │ │ ├── build.gradle
│ │ │ │ └── src
│ │ │ │ │ ├── debug
│ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ │ ├── main
│ │ │ │ │ ├── AndroidManifest.xml
│ │ │ │ │ ├── kotlin
│ │ │ │ │ │ └── com
│ │ │ │ │ │ │ └── example
│ │ │ │ │ │ │ └── example
│ │ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ │ └── res
│ │ │ │ │ │ ├── drawable-v21
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ ├── drawable
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── values-night
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ │ └── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── profile
│ │ │ │ │ └── AndroidManifest.xml
│ │ │ ├── build.gradle
│ │ │ ├── gradle.properties
│ │ │ ├── gradle
│ │ │ │ └── wrapper
│ │ │ │ │ └── gradle-wrapper.properties
│ │ │ └── settings.gradle
│ │ ├── assets
│ │ │ └── bot.png
│ │ ├── ios
│ │ │ ├── .gitignore
│ │ │ ├── Flutter
│ │ │ │ ├── AppFrameworkInfo.plist
│ │ │ │ ├── Debug.xcconfig
│ │ │ │ └── Release.xcconfig
│ │ │ ├── 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-60x60@2x.png
│ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ └── Icon-App-83.5x83.5@2x.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
│ │ ├── lib
│ │ │ └── main.dart
│ │ ├── pubspec.lock
│ │ ├── pubspec.yaml
│ │ ├── 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
│ ├── ios
│ │ ├── Flutter
│ │ │ ├── Generated.xcconfig
│ │ │ └── flutter_export_environment.sh
│ │ └── Runner
│ │ │ ├── GeneratedPluginRegistrant.h
│ │ │ └── GeneratedPluginRegistrant.m
│ ├── lib
│ │ ├── flutter_chatgpt_api.dart
│ │ └── src
│ │ │ ├── models
│ │ │ ├── chat_message.model.dart
│ │ │ ├── chat_response.model.dart
│ │ │ ├── conversation_body.model.dart
│ │ │ ├── conversation_response_event.model.dart
│ │ │ ├── message.model.dart
│ │ │ ├── message_content.model.dart
│ │ │ ├── message_feedback_body.model.dart
│ │ │ ├── message_feedback_result.model.dart
│ │ │ ├── model.model.dart
│ │ │ ├── model_result.model.dart
│ │ │ ├── models.dart
│ │ │ ├── moderation_body.model.dart
│ │ │ ├── moderation_result.model.dart
│ │ │ ├── prompt.model.dart
│ │ │ ├── prompt_content.model.dart
│ │ │ ├── session_result.model.dart
│ │ │ └── user.model.dart
│ │ │ └── utils
│ │ │ ├── expiry_map.dart
│ │ │ └── utils.dart
│ ├── pubspec.yaml
│ └── windows
│ │ └── flutter
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
└── flutter_notification_listener
│ ├── .github
│ └── FUNDING.yml
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── android
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── kotlin
│ │ └── im
│ │ └── zoe
│ │ └── labs
│ │ └── flutter_notification_listener
│ │ ├── FlutterNotificationListenerPlugin.kt
│ │ ├── NotificationEvent.kt
│ │ ├── NotificationsHandlerService.kt
│ │ ├── RebootBroadcastReceiver.kt
│ │ └── Utils.kt
│ ├── example
│ ├── .gitignore
│ ├── .metadata
│ ├── README.md
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── build.gradle
│ │ │ └── src
│ │ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── im
│ │ │ │ │ │ └── zoe
│ │ │ │ │ │ └── labs
│ │ │ │ │ │ └── flutter_notification_listener_example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── res
│ │ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values-night
│ │ │ │ │ └── styles.xml
│ │ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ └── gradle-wrapper.properties
│ │ └── settings.gradle
│ ├── lib
│ │ └── main.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ │ └── widget_test.dart
│ ├── lib
│ ├── flutter_notification_listener.dart
│ └── src
│ │ ├── event.dart
│ │ └── plugin.dart
│ ├── pubspec.lock
│ └── pubspec.yaml
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Smartphone (please complete the following information):**
27 | - Device: [e.g. pixel]
28 | - Android Version [e.g. 13]
29 |
30 | **Additional context**
31 | Add any other context about the problem here.
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/checkout.yml:
--------------------------------------------------------------------------------
1 | # This workflow uses actions that are not certified by GitHub.
2 | # They are provided by a third-party and are governed by
3 | # separate terms of service, privacy policy, and support
4 | # documentation.
5 |
6 | name: Dart
7 |
8 | on:
9 | push:
10 | branches:
11 | - "**"
12 | tags-ignore:
13 | - "**"
14 | pull_request:
15 | branches:
16 | - "**"
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 |
21 | steps:
22 | - uses: actions/checkout@v3
23 |
24 | # Note: This workflow uses the latest stable version of the Dart SDK.
25 | # You can specify other versions if desired, see documentation here:
26 | # https://github.com/dart-lang/setup-dart/blob/main/README.md
27 | # - uses: dart-lang/setup-dart@v1
28 | - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
29 |
30 | - name: Setup flutter
31 | uses: subosito/flutter-action@v2
32 | with:
33 | channel: "stable"
34 | flutter-version: "3.7.6"
35 | cache: true
36 |
37 | # Uncomment this step to verify the use of 'dart format' on each commit.
38 | - name: Verify formatting
39 | run: |
40 | flutter pub get
41 | dart format --output=none --set-exit-if-changed .
42 |
43 | # Consider passing '--fatal-infos' for slightly stricter analysis.
44 | - name: Analyze project source
45 | run: |
46 | dart analyze
47 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: NITM release
2 |
3 | on:
4 | push:
5 | tags:
6 | - "v*.*.*"
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | permissions:
12 | contents: write
13 | env:
14 | KEY_ALIAS: ${{ secrets.NITM_KEY_ALIAS }}
15 | KEY_PASSWORD: ${{ secrets.NITM_KEY_PASSWORD }}
16 | STORE_PASSWORD: ${{ secrets.NITM_STORE_PASSWORD }}
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v3
20 |
21 | - name: Set up JDK 11
22 | uses: actions/setup-java@v2
23 | with:
24 | distribution: "zulu"
25 | java-version: "11"
26 |
27 | - name: Setup flutter
28 | uses: subosito/flutter-action@v2
29 | with:
30 | channel: "stable"
31 | flutter-version: "3.7.6"
32 | cache: true
33 |
34 | - name: Write file
35 | id: write_file
36 | uses: timheuer/base64-to-file@v1.2
37 | with:
38 | fileName: public_key.jks
39 | fileDir: ./android/
40 | encodedString: ${{ secrets.SIGNINGKEYBASE64 }}
41 |
42 | - run: flutter --version
43 | - run: flutter clean
44 | - run: flutter pub get
45 | - run: flutter build apk --split-per-abi
46 | - run: flutter build appbundle
47 |
48 | - name: Generate checksum
49 | run: |
50 | cd build/app/outputs/apk/release/
51 | for file in *; do hash=$(sha256sum "$file" | cut -d' ' -f1); echo ${hash} > "${hash}_${file%.*}.sha256"; done
52 |
53 | - name: Release
54 | uses: softprops/action-gh-release@v1
55 | with:
56 | prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') }}
57 | files: |
58 | checksum.txt
59 | build/app/outputs/bundle/release/*.aab
60 | build/app/outputs/apk/release/*
61 |
--------------------------------------------------------------------------------
/.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 | temp
19 |
20 | # The .vscode folder contains launch configuration and tasks you configure in
21 | # VS Code which you may wish to be included in version control, so this line
22 | # is commented out by default.
23 | #.vscode/
24 |
25 | # Flutter/Dart/Pub related
26 | **/doc/api/
27 | **/ios/Flutter/.last_build_id
28 | .dart_tool/
29 | .flutter-plugins
30 | .flutter-plugins-dependencies
31 | .packages
32 | .pub-cache/
33 | .pub/
34 | /build/
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Android Studio will place build artifacts here
43 | /android/app/debug
44 | /android/app/profile
45 | /android/app/release
46 |
47 | public_key.properties
48 | public.jks
--------------------------------------------------------------------------------
/.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: 7048ed95a5ad3e43d697e0c397464193991fc230
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: 7048ed95a5ad3e43d697e0c397464193991fc230
17 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
18 | - platform: android
19 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
20 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "redhat.vscode-yaml"
4 | ]
5 | }
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "nitmgpt",
9 | "request": "launch",
10 | "type": "dart"
11 | },
12 | {
13 | "name": "nitmgpt (profile mode)",
14 | "request": "launch",
15 | "type": "dart",
16 | "flutterMode": "profile"
17 | },
18 | {
19 | "name": "nitmgpt (release mode)",
20 | "request": "launch",
21 | "type": "dart",
22 | "flutterMode": "release"
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "fluttertoast",
4 | "nitm",
5 | "nitmgpt",
6 | "syncfusion",
7 | "unicons",
8 | "vsync",
9 | "xlsio"
10 | ]
11 | }
--------------------------------------------------------------------------------
/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 | constant_identifier_names: false
26 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
27 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
28 |
29 | # Additional information about this file can be found at
30 | # https://dart.dev/guides/language/analysis-options
31 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | apply plugin: 'com.android.application'
25 | // START: FlutterFire Configuration
26 | apply plugin: 'com.google.gms.google-services'
27 | apply plugin: 'com.google.firebase.crashlytics'
28 | // END: FlutterFire Configuration
29 | apply plugin: 'kotlin-android'
30 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
31 |
32 | android {
33 | compileSdkVersion flutter.compileSdkVersion
34 | ndkVersion flutter.ndkVersion
35 |
36 | compileOptions {
37 | sourceCompatibility JavaVersion.VERSION_1_8
38 | targetCompatibility JavaVersion.VERSION_1_8
39 | }
40 |
41 | defaultConfig {
42 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
43 | applicationId "com.deskbtm.nitmgpt"
44 | // You can update the following values to match your application needs.
45 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
46 | minSdkVersion 21
47 | targetSdkVersion flutter.targetSdkVersion
48 | versionCode flutterVersionCode.toInteger()
49 | versionName flutterVersionName
50 | }
51 |
52 | signingConfigs {
53 | release {
54 | keyAlias System.getenv("KEY_ALIAS")
55 | keyPassword System.getenv("KEY_PASSWORD")
56 | storeFile file("../public_key.jks")
57 | storePassword System.getenv("STORE_PASSWORD")
58 | }
59 | }
60 |
61 | buildTypes {
62 | release {
63 | // TODO: Add your own signing config for the release build.
64 | // Signing with the debug keys for now, so `flutter run --release` works.
65 | signingConfig signingConfigs.release
66 |
67 | minifyEnabled true
68 | shrinkResources true
69 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
70 | }
71 |
72 | debug {
73 | minifyEnabled false
74 | signingConfig signingConfigs.debug
75 | }
76 | }
77 |
78 | project.ext.versionCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86_64': 3]
79 |
80 | applicationVariants.all { variant ->
81 | variant.outputs.all { output ->
82 | def formattedDate = new Date().format('yyyy-MM-dd_HH-mm-ss')
83 | def abi = output.getFilter(com.android.build.OutputFile.ABI)
84 |
85 | output.versionCodeOverride = project.ext.versionCodes.get(abi, 0) * 10000 + variant.versionCode
86 | outputFileName = "nitmgpt" + "-" + buildType.name + "-v" + defaultConfig.versionName + '-' + abi + ".apk";
87 | }
88 | }
89 | }
90 |
91 | flutter {
92 | source '../..'
93 | }
94 |
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "762419633906",
4 | "project_id": "nitmgpt-b764e",
5 | "storage_bucket": "nitmgpt-b764e.appspot.com"
6 | },
7 | "client": [
8 | {
9 | "client_info": {
10 | "mobilesdk_app_id": "1:762419633906:android:17aa4c07ea8a6ac2553a6b",
11 | "android_client_info": {
12 | "package_name": "com.deskbtm.nitmgpt"
13 | }
14 | },
15 | "oauth_client": [
16 | {
17 | "client_id": "762419633906-l1inuvtagcbaii5iua630afl39jqu3ks.apps.googleusercontent.com",
18 | "client_type": 3
19 | }
20 | ],
21 | "api_key": [
22 | {
23 | "current_key": "AIzaSyALkqmYRmw2J9KMxOZBv_PMx3MuN35nuTg"
24 | }
25 | ],
26 | "services": {
27 | "appinvite_service": {
28 | "other_platform_oauth_client": [
29 | {
30 | "client_id": "762419633906-l1inuvtagcbaii5iua630afl39jqu3ks.apps.googleusercontent.com",
31 | "client_type": 3
32 | }
33 | ]
34 | }
35 | }
36 | }
37 | ],
38 | "configuration_version": "1"
39 | }
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | #Flutter Wrapper
2 | -keep class io.flutter.app.** { *; }
3 | -keep class io.flutter.plugin.** { *; }
4 | -keep class io.flutter.util.** { *; }
5 | -keep class io.flutter.view.** { *; }
6 | -keep class io.flutter.** { *; }
7 | -keep class io.flutter.plugins.** { *; }
8 | -keep class androidx.lifecycle.** { *; }
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/android/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/android/app/src/main/java/com/deskbtm/nitmgpt/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.deskbtm.nitmgpt;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/notification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/android/app/src/main/res/drawable/notification.png
--------------------------------------------------------------------------------
/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/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 | #3DDC84
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/xml/filepaths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/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.2.0'
10 | // START: FlutterFire Configuration
11 | classpath 'com.google.gms:google-services:4.3.10'
12 | classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
13 | // END: FlutterFire Configuration
14 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | mavenCentral()
22 | }
23 | }
24 |
25 | rootProject.buildDir = '../build'
26 | subprojects {
27 | project.buildDir = "${rootProject.buildDir}/${project.name}"
28 | }
29 | subprojects {
30 | project.evaluationDependsOn(':app')
31 | }
32 |
33 | task clean(type: Delete) {
34 | delete rootProject.buildDir
35 | }
36 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/components/back_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:unicons/unicons.dart';
3 |
4 | class AppBarBackButton extends StatelessWidget {
5 | const AppBarBackButton({super.key});
6 |
7 | @override
8 | Widget build(BuildContext context) {
9 | return IconButton(
10 | icon: const Icon(UniconsLine.angle_left_b),
11 | onPressed: () => Navigator.of(context).pop(),
12 | );
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/lib/components/dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 |
4 | Future showCommonDialog({
5 | TextEditingController? controller,
6 | VoidCallback? onCancel,
7 | VoidCallback? onConfirm,
8 | String cancelText = 'Cancel',
9 | String confirmText = 'Ok',
10 | Widget? description,
11 | WillPopCallback? onWillPop,
12 | String? textFieldPlaceholder,
13 | Widget? suffix,
14 | required String title,
15 | }) {
16 | return Get.defaultDialog(
17 | onWillPop: onWillPop,
18 | titlePadding: const EdgeInsets.only(top: 20),
19 | titleStyle: const TextStyle(fontSize: 19),
20 | contentPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
21 | title: title,
22 | content: Column(
23 | children: [
24 | description ?? Container(),
25 | controller == null
26 | ? Container()
27 | : FractionallySizedBox(
28 | widthFactor: 0.8,
29 | child: TextFormField(
30 | controller: controller,
31 | decoration: InputDecoration(
32 | hintText: textFieldPlaceholder,
33 | suffix: suffix,
34 | ),
35 | ),
36 | ),
37 | ],
38 | ),
39 | cancel: onCancel == null
40 | ? null
41 | : TextButton(
42 | onPressed: onCancel,
43 | child: Text(cancelText, style: const TextStyle(fontSize: 20)),
44 | ),
45 | confirm: TextButton(
46 | onPressed: onConfirm,
47 | child: Text(confirmText, style: const TextStyle(fontSize: 20)),
48 | ),
49 | );
50 | }
51 |
--------------------------------------------------------------------------------
/lib/components/empty.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Empty extends StatelessWidget {
4 | const Empty({super.key});
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Container(
9 | margin: const EdgeInsets.only(top: 20),
10 | padding: const EdgeInsets.all(15),
11 | child: Column(
12 | crossAxisAlignment: CrossAxisAlignment.start,
13 | children: [
14 | Container(width: 100, height: 15, color: Colors.grey[200]),
15 | const SizedBox(height: 16),
16 | Container(width: 140, height: 15, color: Colors.grey[200]),
17 | const SizedBox(height: 16),
18 | Container(width: 200, height: 15, color: Colors.grey[200]),
19 | const SizedBox(height: 16),
20 | const Text('EMPTY ...',
21 | style: TextStyle(color: Color.fromARGB(255, 43, 113, 90)))
22 | ],
23 | ),
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/lib/constants.dart:
--------------------------------------------------------------------------------
1 | const String documentsDirectory = '/storage/emulated/0/Documents/NITM';
2 | const String openAiKeysUrl = "https://platform.openai.com/account/api-keys";
3 | const String githubRepoUrl = "https://github.com/deskbtm/nitmgpt";
4 |
5 | const String MY_GITHUB_NAME = "Nawbc";
6 | const String REPO_NAME = "deskbtm/nitmgpt";
7 |
--------------------------------------------------------------------------------
/lib/double_pop_exit.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | // ignore: must_be_immutable
5 | class DoublePopExit extends StatelessWidget {
6 | final Widget child;
7 | DateTime? _lastPressedTime;
8 |
9 | DoublePopExit({
10 | super.key,
11 | required this.child,
12 | });
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return WillPopScope(
17 | child: child,
18 | onWillPop: () async {
19 | if (_lastPressedTime == null ||
20 | (_lastPressedTime != null &&
21 | DateTime.now().difference(_lastPressedTime!) >
22 | const Duration(milliseconds: 800))) {
23 | _lastPressedTime = DateTime.now();
24 | Fluttertoast.showToast(
25 | msg: "Press once again",
26 | );
27 | return false;
28 | }
29 | return true;
30 | },
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/firebase.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_core/firebase_core.dart';
2 | import 'package:firebase_crashlytics/firebase_crashlytics.dart';
3 | import 'package:flutter/foundation.dart';
4 |
5 | import 'firebase_options.dart';
6 |
7 | initFirebase() async {
8 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
9 |
10 | FlutterError.onError = (errorDetails) {
11 | FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
12 | };
13 | // Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
14 | PlatformDispatcher.instance.onError = (error, stack) {
15 | FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
16 | return true;
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/lib/firebase_options.dart:
--------------------------------------------------------------------------------
1 | // File generated by FlutterFire CLI.
2 | // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4 | import 'package:flutter/foundation.dart'
5 | show defaultTargetPlatform, kIsWeb, TargetPlatform;
6 |
7 | /// Default [FirebaseOptions] for use with your Firebase apps.
8 | ///
9 | /// Example:
10 | /// ```dart
11 | /// import 'firebase_options.dart';
12 | /// // ...
13 | /// await Firebase.initializeApp(
14 | /// options: DefaultFirebaseOptions.currentPlatform,
15 | /// );
16 | /// ```
17 | class DefaultFirebaseOptions {
18 | static FirebaseOptions get currentPlatform {
19 | if (kIsWeb) {
20 | throw UnsupportedError(
21 | 'DefaultFirebaseOptions have not been configured for web - '
22 | 'you can reconfigure this by running the FlutterFire CLI again.',
23 | );
24 | }
25 | switch (defaultTargetPlatform) {
26 | case TargetPlatform.android:
27 | return android;
28 | case TargetPlatform.iOS:
29 | throw UnsupportedError(
30 | 'DefaultFirebaseOptions have not been configured for ios - '
31 | 'you can reconfigure this by running the FlutterFire CLI again.',
32 | );
33 | case TargetPlatform.macOS:
34 | throw UnsupportedError(
35 | 'DefaultFirebaseOptions have not been configured for macos - '
36 | 'you can reconfigure this by running the FlutterFire CLI again.',
37 | );
38 | case TargetPlatform.windows:
39 | throw UnsupportedError(
40 | 'DefaultFirebaseOptions have not been configured for windows - '
41 | 'you can reconfigure this by running the FlutterFire CLI again.',
42 | );
43 | case TargetPlatform.linux:
44 | throw UnsupportedError(
45 | 'DefaultFirebaseOptions have not been configured for linux - '
46 | 'you can reconfigure this by running the FlutterFire CLI again.',
47 | );
48 | default:
49 | throw UnsupportedError(
50 | 'DefaultFirebaseOptions are not supported for this platform.',
51 | );
52 | }
53 | }
54 |
55 | static const FirebaseOptions android = FirebaseOptions(
56 | apiKey: 'AIzaSyALkqmYRmw2J9KMxOZBv_PMx3MuN35nuTg',
57 | appId: '1:762419633906:android:17aa4c07ea8a6ac2553a6b',
58 | messagingSenderId: '762419633906',
59 | projectId: 'nitmgpt-b764e',
60 | storageBucket: 'nitmgpt-b764e.appspot.com',
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/lib/i18n/en_US.dart:
--------------------------------------------------------------------------------
1 | // ignore: file_names
2 | const Map en_US = {
3 | '_locale': 'English',
4 | 'Settings': 'Settings',
5 | 'system': 'system',
6 | 'permission': 'permission',
7 | 'Notification listener permission': 'Notification listener permission',
8 | 'Auto start': 'Auto start',
9 | 'Battery optimization': 'Battery optimization',
10 | 'Manufacturer specific Battery Optimization':
11 | 'Manufacturer specific Battery Optimization',
12 | 'Listening': 'Listening',
13 | 'Export History': 'Export History',
14 | 'Home': 'Home',
15 | 'Select app': 'Select app',
16 | 'Match rule': 'Match rule',
17 | 'Enter regular expression': 'Enter regular expression',
18 | 'callback url': 'callback url',
19 | 'Http method': 'Http method',
20 | 'Update': 'Update',
21 | 'Done': 'Done',
22 | 'Note Bene! This app requires notification listener permission and battery optimization turned off to work.':
23 | 'Note Bene! This app requires notification listener permission and battery optimization turned off to work.',
24 | 'Battery Optimization !': 'Battery Optimization !',
25 | 'Notification Listener': 'Notification Listener',
26 | 'Start listening': 'Start listening',
27 | 'Clear records': 'Clear records',
28 | 'Custom Rules': 'Custom Rules',
29 | 'app': 'app',
30 | 'Ignore apps': 'Ignore apps',
31 | 'Some permanent notifications will always trigger notification check, so you need to ignore or close it':
32 | 'Some permanent notifications will always trigger notification check, so you need to ignore or close it.',
33 | 'Proxy': 'Proxy',
34 | 'Filter conditions (ask ChatGPT)': 'Filter conditions (ask ChatGPT)',
35 | 'Custom probability (0~1.0)': 'Custom probability (0~1.0)',
36 | 'If set, remove the notification should be more than the probability set here':
37 | 'If set, remove the notification should be more than the probability set here.',
38 | 'Advertisement probability': 'Advertisement probability',
39 | 'Spam probability': 'Spam probability',
40 | 'You could follow my Github or star this project to hide this dialog ':
41 | 'You could follow my Github or star this project to hide this dialog. ',
42 | 'Get this App': 'Get this App',
43 | 'Ignore forever': 'Ignore forever',
44 | 'Limit': 'Limit',
45 | 'reset': 'reset',
46 | 'Limit the number of ChatGPT API calls per 24 hours':
47 | 'Limit the number of ChatGPT API calls per 24 hours',
48 | 'Github account name': 'Github account name',
49 | 'Setup OpenAI API Key': 'Setup OpenAI API Key',
50 | 'Downloading update...': 'Downloading update...',
51 | 'Reset': 'Reset',
52 | 'Ok': 'Ok',
53 | 'Setup proxy': 'Setup proxy',
54 | 'Cleanup completed': 'Cleanup completed',
55 | 'You could get OpenAI API Key from ': 'You could get OpenAI API Key from ',
56 | 'Spam': 'Spam',
57 | 'Ad': 'Ad',
58 | 'Bug report': 'Bug report',
59 | 'Ignore system apps': 'Ignore system apps',
60 | 'This will exit all services': 'This will exit all services',
61 | 'Exit App': 'Exit App',
62 | };
63 |
--------------------------------------------------------------------------------
/lib/i18n/i18n.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 |
4 | import 'en_US.dart';
5 | import 'zh_CN.dart';
6 |
7 | class TranslationService extends Translations {
8 | static const fallbackLocale = Locale('zh', 'CN');
9 |
10 | static const enUS = Locale('en', 'US');
11 | static const zhCN = Locale('zh', 'CN');
12 | // static const zhCN = Locale('zh', 'CN');
13 |
14 | static Locale? from(String? code) {
15 | switch (code) {
16 | case 'en_US':
17 | return TranslationService.enUS;
18 | case 'zh_CN':
19 | return TranslationService.zhCN;
20 | default:
21 | return Get.deviceLocale;
22 | }
23 | }
24 |
25 | @override
26 | Map> get keys => {
27 | 'en_US': en_US,
28 | 'zh_CN': zh_CN,
29 | };
30 | }
31 |
--------------------------------------------------------------------------------
/lib/i18n/zh_CN.dart:
--------------------------------------------------------------------------------
1 | // ignore: file_names, non_constant_identifier_names
2 | Map zh_CN = {
3 | '_locale': '中文',
4 | 'Settings': '设置',
5 | 'system': '系统',
6 | 'permission': '权限',
7 | 'Notification listener permission': '监听通知',
8 | 'Auto start': '自启',
9 | 'Battery optimization': '电池优化',
10 | 'Manufacturer specific Battery Optimization': '针对制造商的电池优化',
11 | 'Listening': '监听中',
12 | 'Export History': '导出记录',
13 | 'Home': '主页',
14 | 'Select app': '选择应用',
15 | 'Match rule': '匹配规则',
16 | 'Enter regular expression': '使用正则表达式',
17 | 'callback url': '回调地址',
18 | 'Http method': 'Http方法',
19 | 'Update': '更新',
20 | 'Done': '完成',
21 | 'Note Bene! This app requires notification listener permission and battery optimization turned off to work.':
22 | '注意! 这个应用程序需要通知监听器许可和关闭电池优化才能工作。',
23 | 'Battery Optimization !': '电池优化 !',
24 | 'Notification Listener': '监听通知',
25 | 'Start listening': '开始监听',
26 | 'Clear records': '清除记录',
27 | 'Custom Rules': '自定义规则',
28 | 'app': '应用',
29 | 'Ignore apps': '忽略应用(多选)',
30 | 'Some permanent notifications will always trigger notification check, so you need to ignore or close it':
31 | '一些永久性的通知会一直触发通知检查,所以你需要忽略或关闭它。',
32 | 'Proxy': '代理',
33 | 'Filter conditions (ask ChatGPT)': '筛选条件 (询问chatgpt)',
34 | 'Custom probability (0~1.0)': '自定义概率(0~1.0)',
35 | 'If set, remove the notification should be more than the probability set here':
36 | '如果设置了,删除通知应超过这里设置的概率.',
37 | 'Advertisement probability': '广告的概率',
38 | 'Spam probability': '垃圾消息的概率',
39 | 'You could follow my Github or star this project to hide this dialog ':
40 | '你可以通过关注我的GitHub, 或者star这个项目, 来隐藏这个对话框。',
41 | 'Get this App': '获取该软件',
42 | 'Ignore forever': '不再显示',
43 | 'Limit': '限制',
44 | 'reset': '重置',
45 | 'Limit the number of ChatGPT API calls per 24 hours':
46 | '每24小时限制调用ChatGPT API的次数',
47 | 'Github account name': 'Github账户名',
48 | 'Setup OpenAI API Key': '设置OpenAI API密钥',
49 | 'Downloading update...': '更新中...',
50 | 'Reset': '重置',
51 | 'Ok': '确定',
52 | 'Setup proxy': '设置代理',
53 | 'Cleanup completed': '清理完成',
54 | 'You could get OpenAI API Key from ': '你可以通过以下方式获得OpenAI的API密钥 ',
55 | 'Spam': '垃圾消息',
56 | 'Ad': '广告',
57 | 'Bug report': '问题反馈',
58 | 'Ignore system apps': '忽略系统应用',
59 | 'This will exit all services': '这会退出所有服务',
60 | 'Exit App': '退出应用',
61 | };
62 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:nitmgpt/firebase.dart';
3 | import 'package:permission_handler/permission_handler.dart';
4 | import 'nitm.dart';
5 |
6 | void main() async {
7 | WidgetsFlutterBinding.ensureInitialized();
8 | await initFirebase();
9 |
10 | Map statuses = await [
11 | Permission.notification,
12 | ].request();
13 |
14 | if (statuses.values.every((v) => v.isGranted)) {
15 | runApp(const NITM());
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/models/realm.dart:
--------------------------------------------------------------------------------
1 | import 'package:nitmgpt/models/record.dart';
2 | import 'package:nitmgpt/models/settings.dart';
3 | import 'package:realm/realm.dart';
4 |
5 | var _config = Configuration.local(
6 | [
7 | Record.schema,
8 | Settings.schema,
9 | RuleFields.schema,
10 | RecordedApp.schema,
11 | ],
12 | schemaVersion: 7,
13 | );
14 |
15 | var realm = Realm(_config);
16 |
--------------------------------------------------------------------------------
/lib/models/record.dart:
--------------------------------------------------------------------------------
1 | import 'package:realm/realm.dart';
2 | part 'record.g.dart';
3 |
4 | @RealmModel()
5 | class _Record {
6 | @PrimaryKey()
7 | late ObjectId id;
8 |
9 | bool? isAd;
10 |
11 | /// The probability that this sentence is classified as an advertisement
12 | double? adProbability;
13 |
14 | bool? isSpam;
15 |
16 | double? spamProbability;
17 |
18 | int? timestamp;
19 |
20 | DateTime? createTime;
21 |
22 | String? packageName;
23 |
24 | String? appName;
25 |
26 | String? notificationText;
27 |
28 | String? notificationTitle;
29 |
30 | String? uid;
31 |
32 | String? notificationKey;
33 | }
34 |
35 | @RealmModel()
36 | class _RecordedApp {
37 | @PrimaryKey()
38 | late ObjectId id;
39 |
40 | late String packageName;
41 |
42 | late List<_Record> records;
43 | }
44 |
--------------------------------------------------------------------------------
/lib/models/settings.dart:
--------------------------------------------------------------------------------
1 | import 'package:realm/realm.dart';
2 | part 'settings.g.dart';
3 |
4 | @RealmModel()
5 | class _RuleFields {
6 | late String isAdMeaning;
7 |
8 | late String adProbabilityMeaning;
9 |
10 | late String isSpamMeaning;
11 |
12 | late String spamProbabilityMeaning;
13 |
14 | late String sentenceMeaning;
15 |
16 | Map toMap() {
17 | return {
18 | 'isAdMeaning': isAdMeaning,
19 | 'isSpamMeaning': isSpamMeaning,
20 | 'adProbabilityMeaning': adProbabilityMeaning,
21 | 'spamProbabilityMeaning': spamProbabilityMeaning,
22 | 'sentenceMeaning': sentenceMeaning,
23 | };
24 | }
25 | }
26 |
27 | @RealmModel()
28 | class _Settings {
29 | @PrimaryKey()
30 | late int id;
31 |
32 | /// Proxy uri
33 | String? proxyUri;
34 |
35 | /// OpenAi Api Key https://platform.openai.com/account/api-keys
36 | String? openAiKey;
37 |
38 | /// Preset Advertisement probability
39 | double? presetAdProbability;
40 |
41 | /// Preset spam probability
42 | double? presetSpamProbability;
43 |
44 | /// Request limit
45 | int presetLimit = 100;
46 |
47 | /// Ignore system apps
48 | bool ignoreSystemApps = true;
49 |
50 | int? limitCounter;
51 |
52 | /// Start limit timestamp
53 | DateTime? limitTimestamp;
54 |
55 | /// Rule fields
56 | _RuleFields? ruleFields;
57 |
58 | List ignoredApps = [];
59 |
60 | bool? ownedApp;
61 |
62 | String? language;
63 | }
64 |
--------------------------------------------------------------------------------
/lib/nitm.dart:
--------------------------------------------------------------------------------
1 | import 'dart:developer';
2 | import 'package:firebase_analytics/firebase_analytics.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 | import 'package:flutter_screenutil/flutter_screenutil.dart';
6 | import 'package:get/get.dart';
7 | import 'package:nitmgpt/models/settings.dart';
8 | import 'package:nitmgpt/pages/settings/settings_controller.dart';
9 | import 'package:nitmgpt/utils.dart';
10 | import 'i18n/i18n.dart';
11 | import 'notification_utils.dart';
12 | import 'pages/home/watcher_controller.dart';
13 | import 'routes.dart';
14 | import 'theme.dart';
15 |
16 | class NITM extends StatefulWidget {
17 | const NITM({super.key});
18 |
19 | @override
20 | State createState() {
21 | return _NITMState();
22 | }
23 | }
24 |
25 | class _NITMState extends State {
26 | @override
27 | void initState() {
28 | super.initState();
29 | Get.put(SettingsController(), permanent: true);
30 | Get.put(WatcherController(), permanent: true);
31 | }
32 |
33 | @override
34 | void didChangeDependencies() async {
35 | super.didChangeDependencies();
36 | await LocalNotification.init();
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | Settings settings = getSettingInstance();
42 | log('Root re-render', name: 'NITM');
43 |
44 | return ScreenUtilInit(
45 | designSize: const Size(360, 690),
46 | minTextAdapt: true,
47 | splitScreenMode: true,
48 | builder: (context, child) {
49 | return AnnotatedRegion(
50 | value: const SystemUiOverlayStyle(
51 | systemNavigationBarIconBrightness: Brightness.dark,
52 | systemNavigationBarColor: Colors.transparent,
53 | statusBarColor: Colors.transparent,
54 | statusBarIconBrightness: Brightness.dark,
55 | ),
56 | child: GetMaterialApp(
57 | defaultTransition: Transition.native,
58 | enableLog: true,
59 | translations: TranslationService(),
60 | locale: TranslationService.from(settings.language),
61 | fallbackLocale: TranslationService.fallbackLocale,
62 | navigatorObservers: [
63 | FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance)
64 | ],
65 | initialRoute: '/',
66 | getPages: routes,
67 | theme: lightThemeData,
68 | ),
69 | );
70 | },
71 | // child: DoublePopExit(),
72 | );
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/notification_utils.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 | import 'package:flutter_local_notifications/flutter_local_notifications.dart';
4 |
5 | class LocalNotification {
6 | static late FlutterLocalNotificationsPlugin plugin;
7 | static late NotificationDetails androidDetails;
8 |
9 | static Future init() async {
10 | plugin = FlutterLocalNotificationsPlugin();
11 | var android = const AndroidInitializationSettings('notification');
12 | var initSettings = InitializationSettings(android: android);
13 | await plugin.initialize(initSettings);
14 | }
15 |
16 | static Future showNotification({
17 | String channelId = '0',
18 | int index = 0,
19 | required String channelName,
20 | required String title,
21 | String? subTitle,
22 | String? payload,
23 | int maxProgress = 100,
24 | int progress = 0,
25 | bool ongoing = false,
26 | bool onlyAlertOnce = false,
27 | bool showProgress = false,
28 | bool indeterminate = false,
29 | bool autoCancel = false,
30 | bool channelShowBadge = false,
31 | Importance importance = Importance.defaultImportance,
32 | Priority priority = Priority.defaultPriority,
33 | NotificationVisibility visibility = NotificationVisibility.public,
34 | }) async {
35 | var android = AndroidNotificationDetails(
36 | channelId,
37 | channelName,
38 | priority: priority,
39 | importance: importance,
40 | ongoing: ongoing,
41 | channelShowBadge: channelShowBadge,
42 | autoCancel: autoCancel,
43 | onlyAlertOnce: onlyAlertOnce,
44 | showProgress: showProgress,
45 | indeterminate: indeterminate,
46 | visibility: visibility,
47 | maxProgress: maxProgress,
48 | color: const Color(0xFF007AFF),
49 | progress: progress,
50 | );
51 | androidDetails = NotificationDetails(android: android);
52 | await plugin.show(index, title, subTitle, androidDetails, payload: payload);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/lib/pages/add_rules/rule_fields_map.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 |
3 | class CustomField {
4 | final String field;
5 | final String name;
6 | final String means;
7 | final TextEditingController textEditingController;
8 | double? width;
9 |
10 | CustomField({
11 | required this.field,
12 | required this.name,
13 | required this.means,
14 | required this.textEditingController,
15 | this.width = 200,
16 | });
17 | }
18 |
19 | const IS_AD = 'means whether it is an advertisement';
20 | const AD_PROBABILITY =
21 | 'means the probability that this sentence is classified as an advertisement';
22 | const IS_SPAM = 'means whether it is spam';
23 | const SPAM_PROBABILITY =
24 | 'means the probability that this sentence is classified as a spam';
25 | const SENTENCE =
26 | 'means the probability that this sentence is classified as a spam';
27 |
28 | final ruleFieldsMap = {
29 | 'is_ad': CustomField(
30 | field: 'is_ad',
31 | name: 'isAdMeaning',
32 | means: IS_AD,
33 | textEditingController: TextEditingController(),
34 | ),
35 | 'ad_probability': CustomField(
36 | field: 'ad_probability',
37 | name: 'adProbabilityMeaning',
38 | means: AD_PROBABILITY,
39 | textEditingController: TextEditingController(),
40 | ),
41 | 'is_spam': CustomField(
42 | field: 'is_spam',
43 | name: 'isSpamMeaning',
44 | means: IS_SPAM,
45 | textEditingController: TextEditingController(),
46 | ),
47 | 'spam_probability': CustomField(
48 | field: 'spam_probability',
49 | name: 'spamProbabilityMeaning',
50 | means: SPAM_PROBABILITY,
51 | textEditingController: TextEditingController(),
52 | width: 150),
53 | 'sentence': CustomField(
54 | field: 'sentence',
55 | name: 'sentenceMeaning',
56 | means: SENTENCE,
57 | textEditingController: TextEditingController(),
58 | ),
59 | };
60 |
--------------------------------------------------------------------------------
/lib/pages/add_rules/rules_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'rules_controller.dart';
3 |
4 | class RulesBinding extends Bindings {
5 | @override
6 | void dependencies() {
7 | Get.lazyPut(() => RulesController());
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/pages/home/home_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'package:nitmgpt/pages/home/home_controller.dart';
3 |
4 | class HomeBinding extends Bindings {
5 | @override
6 | void dependencies() {
7 | Get.put(HomeController());
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/pages/home/home_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:nitmgpt/pages/home/watcher_controller.dart';
4 |
5 | class HomeController extends FullLifeCycleController
6 | with FullLifeCycleMixin, GetTickerProviderStateMixin {
7 | static HomeController get to => Get.find();
8 |
9 | final _watchController = WatcherController.to;
10 |
11 | TabController? tabController;
12 |
13 | _setDetectedApps() {
14 | _watchController.detectedApps.value = _watchController.getDetectedApps();
15 | }
16 |
17 | @override
18 | void onInit() {
19 | super.onInit();
20 |
21 | once(_watchController.deviceApps, (callback) {
22 | _setDetectedApps();
23 | _watchController.backgroundService
24 | .on('update_records')
25 | .listen((event) async {
26 | _setDetectedApps();
27 | update();
28 | });
29 | });
30 |
31 | ever(_watchController.detectedApps, (callback) {
32 | tabController = TabController(
33 | length: _watchController.detectedApps.length,
34 | vsync: this,
35 | initialIndex: 0);
36 |
37 | update();
38 | });
39 | }
40 |
41 | @override
42 | void onClose() {
43 | tabController?.dispose();
44 | super.onClose();
45 | }
46 |
47 | @override
48 | void onDetached() {}
49 |
50 | @override
51 | void onInactive() {}
52 |
53 | @override
54 | void onPaused() {}
55 |
56 | @override
57 | void onResumed() {
58 | update();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/pages/index/index.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:nitmgpt/double_pop_exit.dart';
4 | import 'package:unicons/unicons.dart';
5 | import 'index_controller.dart';
6 |
7 | class IndexPage extends GetView {
8 | const IndexPage({super.key});
9 |
10 | @override
11 | Widget build(BuildContext context) {
12 | return DoublePopExit(
13 | child: Scaffold(
14 | body: Navigator(
15 | key: Get.nestedKey(1),
16 | initialRoute: '/home',
17 | onGenerateRoute: controller.onGenerateRoute,
18 | ),
19 | bottomNavigationBar: Obx(
20 | () => NavigationBar(
21 | destinations: [
22 | NavigationDestination(
23 | icon: const Icon(UniconsLine.monitor_heart_rate),
24 | label: 'Home'.tr,
25 | ),
26 | NavigationDestination(
27 | icon: const Icon(UniconsLine.setting),
28 | label: 'Settings'.tr,
29 | )
30 | ],
31 | selectedIndex: controller.currentIndex.value,
32 | onDestinationSelected: controller.changePage,
33 | ),
34 | ),
35 | ),
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/pages/index/index_binding.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'index_controller.dart';
3 |
4 | class IndexBinding extends Bindings {
5 | @override
6 | void dependencies() {
7 | Get.put(IndexController(), permanent: true);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/pages/index/index_controller.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:nitmgpt/pages/home/home.dart';
4 | import 'package:nitmgpt/pages/home/home_binding.dart';
5 | import 'package:nitmgpt/pages/settings/settings.dart';
6 |
7 | class IndexController extends GetxController {
8 | static IndexController get to => Get.find();
9 |
10 | var currentIndex = 0.obs;
11 |
12 | final pages = ['/home', '/settings'];
13 |
14 | void changePage(int index) {
15 | if (currentIndex.value != index) {
16 | currentIndex.value = index;
17 | Get.toNamed(pages[index], id: 1);
18 | }
19 | }
20 |
21 | Route? onGenerateRoute(RouteSettings settings) {
22 | switch (settings.name) {
23 | case '/home':
24 | return GetPageRoute(
25 | settings: settings,
26 | transition: Transition.leftToRight,
27 | page: () => HomePage(),
28 | binding: HomeBinding(),
29 | );
30 | case '/settings':
31 | return GetPageRoute(
32 | transition: Transition.rightToLeft,
33 | settings: settings,
34 | page: () => SettingsPage(),
35 | );
36 | }
37 | return null;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/lib/permanent_listener_service/gpt_response.dart:
--------------------------------------------------------------------------------
1 | class GPTResponse {
2 | final bool? isAd;
3 | final double? adProbability;
4 | final bool? isSpam;
5 | final double? spamProbability;
6 |
7 | GPTResponse(this.isAd, this.adProbability, this.isSpam, this.spamProbability);
8 |
9 | factory GPTResponse.fromJson(Map json) => GPTResponse(
10 | json['is_ad'] as bool?,
11 | (json['ad_probability'] is int
12 | ? json['ad_probability'].toDouble()
13 | : json['ad_probability']) as double?,
14 | json['is_spam'] as bool?,
15 | (json['spam_probability'] is int
16 | ? json['spam_probability'].toDouble()
17 | : json['spam_probability']) as double?);
18 |
19 | Map toJson() => responseToJson(this);
20 |
21 | Map responseToJson(GPTResponse instance) =>
22 | {
23 | 'is_ad': instance.isAd,
24 | 'ad_probability': instance.adProbability,
25 | 'is_spam': instance.isSpam,
26 | 'spam_probability': instance.spamProbability,
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/lib/routes.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'pages/add_rules/add_rules.dart';
3 | import 'pages/add_rules/rules_binding.dart';
4 | import 'pages/index/index_binding.dart';
5 | import 'pages/index/index.dart';
6 |
7 | final routes = [
8 | GetPage(
9 | name: '/',
10 | page: () => const IndexPage(),
11 | bindings: [IndexBinding()],
12 | children: [
13 | GetPage(
14 | name: '/add_rules',
15 | page: () => AddRulesPage(),
16 | bindings: [RulesBinding()],
17 | ),
18 | ],
19 | ),
20 | ];
21 |
--------------------------------------------------------------------------------
/lib/theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | var primaryColor = const Color.fromARGB(255, 116, 170, 156);
4 |
5 | ThemeData lightThemeData = ThemeData(
6 | useMaterial3: true,
7 | colorSchemeSeed: primaryColor,
8 | floatingActionButtonTheme: const FloatingActionButtonThemeData(elevation: 3),
9 | );
10 |
--------------------------------------------------------------------------------
/lib/utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:fluttertoast/fluttertoast.dart';
4 | import 'package:get/get_connect/connect.dart';
5 | import 'package:url_launcher/url_launcher.dart';
6 |
7 | import 'models/realm.dart';
8 | import 'models/settings.dart';
9 |
10 | dynamic looseJSONParse(String content) {
11 | try {
12 | content = content.replaceAll("\n", "");
13 | var match = RegExp(r"((\[[^\}]{3,})?\{s*[^\}\{]{3,}?:.*\}([^\{]+\])?)")
14 | .firstMatch(content);
15 | String? val = match?.group(0);
16 | if (val != null) {
17 | return jsonDecode(val);
18 | }
19 |
20 | return null;
21 | } catch (e) {
22 | return null;
23 | }
24 | }
25 |
26 | Settings getSettingInstance() {
27 | Settings? s = realm.find(0);
28 | if (s == null) {
29 | realm.write(() {
30 | realm.add(Settings(0, presetLimit: 200));
31 | });
32 | s = realm.find(0);
33 | }
34 |
35 | // /// Compat alpha version.
36 | // realm.write(() {
37 | // if (s?.presetLimit == 0) {
38 | // s!.presetLimit = 200;
39 | // }
40 |
41 | // if (s?.ignoreSystemApps == null) {
42 | // s!.ignoreSystemApps = true;
43 | // }
44 | // });
45 |
46 | return s!;
47 | }
48 |
49 | Future verifyGithubStarred(String username, String repoFullName) async {
50 | var res =
51 | await GetConnect().get("https://api.github.com/users/$username/starred");
52 |
53 | if (res.isOk) {
54 | List body = res.body;
55 | for (Map item in body) {
56 | if (item['full_name'] == repoFullName) {
57 | return true;
58 | }
59 | }
60 | } else {
61 | Fluttertoast.showToast(msg: "Verify request error.");
62 | }
63 | return false;
64 | }
65 |
66 | Future verifyGithubFollowed(String username, String target) async {
67 | var res = await GetConnect()
68 | .get("https://api.github.com/users/$username/following/$target");
69 |
70 | return res.statusCode == 204;
71 | }
72 |
73 | Future open(String url) async {
74 | Uri uri = Uri.parse(url);
75 | if (await canLaunchUrl(uri)) {
76 | await launchUrl(uri, mode: LaunchMode.externalApplication);
77 | }
78 | }
79 |
80 | String getArch(String name) {
81 | switch (name) {
82 | case 'X86_64':
83 | return 'x86_64';
84 | case 'ARM64':
85 | return 'arm64-v8a';
86 | case 'ARM':
87 | return 'armeabi-v7a';
88 | default:
89 | return '';
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/.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 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | /pubspec.lock
27 | **/doc/api/
28 | .dart_tool/
29 | .packages
30 | build/
31 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: 135454af32477f815a7525073027a3ff9eff1bfd
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.0.1+4
2 |
3 | Fix bug Http status error [429] error
4 |
5 | ## 1.0.1+5
6 | Add Parameter HttpSetup
7 | - sendTimeout
8 | - connectTimeout
9 | - receiveTimeout
10 |
11 | ## 1.0.2
12 | New Feature
13 | - Generation Image With Prompt
14 | -
15 | ## 1.0.2 + 1
16 | - Fix Bug
17 |
18 | ## 1.0.2 + 3
19 | - Fix Bug
20 | - Add stop field in complete request
21 | - New example
22 | - Bloc code complete and error
23 |
24 | ## 1.0.2 + 4
25 | - Refactor and Fix Bug
26 |
27 | ## 2.0.0
28 | - add b64 field in response generate image
29 |
30 | ## 2.0.1
31 | - update client library
32 | - change method name
33 | - onCompleteText as onCompletion
34 | - onCompleteStream as onCompletionStream
35 | - Support ChatGPT 3.5 turbo
36 | - Add new Model
37 | - kChatGptTurboModel
38 | - kChatGptTurbo0301Model
39 | - New Method
40 | - onChatCompletion
41 | - onChatCompletionStream
42 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [2023] [Kasem Saikhuedong]
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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/chat_gpt_sdk.dart:
--------------------------------------------------------------------------------
1 | library chat_gpt_sdk;
2 |
3 | export 'src/openai.dart';
4 | export 'src/utils/constants.dart';
5 | export 'src/model/client/http_setup.dart';
6 | export 'src/model/complete_text/request/complete_text.dart';
7 | export 'src/model/complete_text/response/complete_response.dart';
8 | export 'src/model/gen_image/request/generate_image.dart';
9 | export 'src/model/gen_image/response/GenImgResponse.dart';
10 | export 'src/model/openai_model/openai_models.dart';
11 | export 'src/model/openai_engine/engine_model.dart';
12 | export 'src/model/chat_complete/request/ChatCompleteText.dart';
13 | export 'src/model/chat_complete/response/ChatCTResponse.dart';
14 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/dio_proxy_adapter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:dio/dio.dart';
4 | import 'package:dio/io.dart';
5 |
6 | /// Methods for managing proxies on [Dio]
7 | extension ProxyX on Dio {
8 | /// Use a proxy to connect to the internet.
9 | ///
10 | /// If [proxyUrl] is a non-empty, non-null String, connect to the proxy server.
11 | ///
12 | /// If [proxyUrl] is empty or `null`, does nothing.
13 | void useProxy(String? proxyUrl) {
14 | if (proxyUrl != null && proxyUrl.isNotEmpty) {
15 | httpClientAdapter = IOHttpClientAdapter()
16 | ..onHttpClientCreate = (client) => client
17 | ..findProxy = (url) {
18 | return 'PROXY $proxyUrl';
19 | }
20 | ..badCertificateCallback = (cert, host, post) => Platform.isAndroid;
21 | } else {
22 | httpClientAdapter = IOHttpClientAdapter();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/base_client.dart:
--------------------------------------------------------------------------------
1 | abstract class OpenAIWrapper {}
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/client.dart:
--------------------------------------------------------------------------------
1 | export 'base_client.dart';
2 | export 'openai_client.dart';
3 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/exception/base_error.dart:
--------------------------------------------------------------------------------
1 | abstract class BaseErrorWrapper implements Exception {}
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/exception/missing_token.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/client/exception/base_error.dart';
2 |
3 | class MissionTokenException extends BaseErrorWrapper {
4 | @override
5 | String toString() =>
6 | "Not Missing Your Token look more https://beta.openai.com/account/api-keys";
7 | }
8 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/exception/openai_exception.dart:
--------------------------------------------------------------------------------
1 | export 'missing_token.dart';
2 | export 'request_error.dart';
3 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/exception/request_error.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/client/exception/base_error.dart';
2 |
3 | class RequestError extends BaseErrorWrapper {
4 | final String? message;
5 | final int? code;
6 |
7 | RequestError({this.message, this.code});
8 |
9 | @override
10 | String toString() => "\nstatus code :$code message :$message\n";
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/interceptor/interceptor_wrapper.dart:
--------------------------------------------------------------------------------
1 | import 'package:dio/dio.dart';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 |
4 | import '../../utils/constants.dart';
5 |
6 | class InterceptorWrapper extends Interceptor {
7 | final SharedPreferences? prefs;
8 | final String token;
9 | InterceptorWrapper(this.prefs, this.token);
10 |
11 | @override
12 | void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
13 | final mToken = token.isEmpty ? "${prefs?.getString(kTokenKey)}" : token;
14 | options.headers.addAll(kHeader("$mToken"));
15 | return handler.next(options); // super.onRequest(options, handler);
16 | }
17 |
18 | @override
19 | void onResponse(Response response, ResponseInterceptorHandler handler) {
20 | //debugPrint('http status code => ${response.statusCode} \nresponse data => ${response.data}');
21 | super.onResponse(response, handler);
22 | }
23 |
24 | @override
25 | void onError(DioError err, ErrorInterceptorHandler handler) {
26 | //debugPrint('have Error [${err.response?.statusCode}] => Data: ${err.response?.data}');
27 | super.onError(err, handler);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/client/openai_client.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 | import 'dart:io';
4 | import 'package:chat_gpt_sdk/src/client/base_client.dart';
5 | import 'package:chat_gpt_sdk/src/client/exception/request_error.dart';
6 | import 'package:chat_gpt_sdk/src/logger/logger.dart';
7 | import 'package:dio/dio.dart';
8 |
9 | class OpenAIClient extends OpenAIWrapper {
10 | OpenAIClient({required Dio dio, bool isLogging = false}) {
11 | _dio = dio;
12 | log = Logger.instance.builder(isLogging: isLogging);
13 | }
14 |
15 | ///[_dio]
16 | late Dio _dio;
17 |
18 | ///[log]
19 | late Logger log;
20 |
21 | Future get(String url,
22 | {required T Function(Map) onSuccess}) async {
23 | try {
24 | final rawData = await _dio.get(url);
25 |
26 | if (rawData.statusCode == HttpStatus.ok) {
27 | log.debugString(
28 | "============= success ==================\nresponse body :${rawData.data}");
29 | return onSuccess(rawData.data);
30 | } else {
31 | log.errorLog(code: rawData.statusCode, error: "${rawData.data}");
32 | throw RequestError(
33 | message: "${rawData.data}", code: rawData.statusCode);
34 | }
35 | } on DioError catch (err) {
36 | throw RequestError(
37 | message: "${err.message}", code: err.response?.statusCode);
38 | }
39 | }
40 |
41 | Future post(String url, Map request,
42 | {required T Function(Map) onSuccess}) async {
43 | try {
44 | log.debugString("request body :$request");
45 |
46 | final rawData = await _dio.post(url, data: json.encode(request));
47 | if (rawData.statusCode == HttpStatus.ok) {
48 | log.debugString("status code :${rawData.statusCode}");
49 | log.debugString(
50 | "============= success ==================\nresponse body :${rawData.data}");
51 | return onSuccess(rawData.data);
52 | } else {
53 | log.errorLog(code: rawData.statusCode, error: "${rawData.data}");
54 | throw RequestError(
55 | message: "${rawData.data}", code: rawData.statusCode);
56 | }
57 | } on DioError catch (err) {
58 | throw RequestError(
59 | message: "${err.message} \ndata:${err.response?.data}",
60 | code: err.response?.statusCode);
61 | }
62 | }
63 |
64 | Stream postStream(String url, Map request) {
65 | return _dio.post(url, data: json.encode(request)).asStream();
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/logger/logger.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | abstract class ILogger {
4 | void errorLog({int? code, String? error});
5 | void debugString(String? error);
6 | Logger builder({required bool isLogging});
7 | }
8 |
9 | class Logger extends ILogger {
10 | Logger._();
11 |
12 | ///[instance]
13 | ///return instance of Logger
14 | static Logger instance = Logger._();
15 |
16 | /// [isLogging]
17 | /// use for enable log
18 | bool isLogging = false;
19 |
20 | @override
21 | Logger builder({required bool isLogging}) {
22 | this.isLogging = isLogging;
23 | return instance;
24 | }
25 |
26 | @override
27 | void errorLog({int? code, String? error}) {
28 | if (isLogging) debugPrint("status code :$code\nerror message :$error");
29 | }
30 |
31 | @override
32 | void debugString(String? error) {
33 | if (isLogging) debugPrint("$error");
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/chat_complete/response/ChatCTResponse.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/chat_complete/response/chat_choice.dart';
2 |
3 | import '../../complete_text/response/usage.dart';
4 |
5 | class ChatCTResponse {
6 | final String id;
7 | final String object;
8 | final int created;
9 | final List choices;
10 | final Usage usage;
11 |
12 | ChatCTResponse(
13 | {required this.id,
14 | required this.object,
15 | required this.created,
16 | required this.choices,
17 | required this.usage});
18 |
19 | factory ChatCTResponse.fromJson(Map json) => ChatCTResponse(
20 | id: json["id"],
21 | object: json["object"],
22 | created: json["created"],
23 | choices: List.from(
24 | json["choices"].map((x) => ChatChoice.fromJson(x))),
25 | usage: Usage.fromJson(json["usage"]),
26 | );
27 |
28 | Map toJson() => {
29 | "id": id,
30 | "object": object,
31 | "created": created,
32 | "choices": List.from(choices.map((x) => x.toJson())),
33 | "usage": usage.toJson(),
34 | };
35 | }
36 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/chat_complete/response/chat_choice.dart:
--------------------------------------------------------------------------------
1 | import 'message.dart';
2 |
3 | class ChatChoice {
4 | final int index;
5 | final Message message;
6 | final String finishReason;
7 |
8 | ChatChoice(
9 | {required this.index, required this.message, required this.finishReason});
10 |
11 | factory ChatChoice.fromJson(Map json) => ChatChoice(
12 | index: json["index"],
13 | message: Message.fromJson(json["message"]),
14 | finishReason: json["finish_reason"],
15 | );
16 |
17 | Map toJson() => {
18 | "index": index,
19 | "message": message.toJson(),
20 | "finish_reason": finishReason,
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/chat_complete/response/message.dart:
--------------------------------------------------------------------------------
1 | class Message {
2 | final String role;
3 | final String content;
4 |
5 | Message({required this.role, required this.content});
6 |
7 | factory Message.fromJson(Map json) => Message(
8 | role: json["role"],
9 | content: json["content"],
10 | );
11 |
12 | Map toJson() => {
13 | "role": role,
14 | "content": content,
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/client/http_setup.dart:
--------------------------------------------------------------------------------
1 | class HttpSetup {
2 | Duration sendTimeout;
3 | Duration connectTimeout;
4 | Duration receiveTimeout;
5 | String? proxyUrl;
6 |
7 | HttpSetup({
8 | this.sendTimeout = Duration.zero,
9 | this.connectTimeout = Duration.zero,
10 | this.receiveTimeout = Duration.zero,
11 | this.proxyUrl,
12 | });
13 |
14 | HttpSetup httpSetup() => HttpSetup()
15 | ..sendTimeout = Duration(seconds: 6)
16 | ..connectTimeout = Duration(seconds: 6)
17 | ..receiveTimeout = Duration(seconds: 6);
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/complete_text/request/complete_text.dart:
--------------------------------------------------------------------------------
1 | class CompleteText {
2 | final String prompt;
3 | final String model;
4 | final double temperature;
5 | final int maxTokens;
6 | final double topP;
7 | final double frequencyPenalty;
8 | final double presencePenalty;
9 |
10 | /// ### example use it
11 | /// - ["You:"]
12 | ///Q: Who is Batman?
13 | ///A: Batman is a fictional comic book character.
14 | /// - Chat bot
15 | /// [" Human:", " AI:"]
16 | final List? stop;
17 |
18 | CompleteText(
19 | {required this.prompt,
20 | required this.model,
21 | this.temperature = .3,
22 | this.maxTokens = 100,
23 | this.topP = 1.0,
24 | this.frequencyPenalty = .0,
25 | this.presencePenalty = .0,
26 | this.stop});
27 |
28 | factory CompleteText.fromJson(Map json) => CompleteText(
29 | prompt: json['prompt'] as String,
30 | model: json['model'] as String,
31 | temperature: (json['temperature'] as num?)?.toDouble() ?? .3,
32 | maxTokens: json['max_tokens'] as int? ?? 100,
33 | topP: (json['top_p'] as num?)?.toDouble() ?? 1.0,
34 | frequencyPenalty: (json['frequency_penalty'] as num?)?.toDouble() ?? .0,
35 | presencePenalty: (json['presence_penalty'] as num?)?.toDouble() ?? .0,
36 | );
37 | Map toJson() => _CompleteReqToJson(this);
38 |
39 | Map _CompleteReqToJson(CompleteText instance) =>
40 | {
41 | 'prompt': instance.prompt,
42 | 'model': instance.model,
43 | 'temperature': instance.temperature,
44 | 'max_tokens': instance.maxTokens,
45 | 'top_p': instance.topP,
46 | 'frequency_penalty': instance.frequencyPenalty,
47 | 'presence_penalty': instance.presencePenalty,
48 | "stop": instance.stop
49 | };
50 | }
51 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/complete_text/response/choices.dart:
--------------------------------------------------------------------------------
1 | class Choices {
2 | final String text;
3 | final int index;
4 | final dynamic logprobs;
5 | final String finish_reason;
6 |
7 | Choices(this.text, this.index, this.logprobs, this.finish_reason);
8 |
9 | factory Choices.fromJson(Map json) => Choices(
10 | json['text'] as String,
11 | json['index'] as int,
12 | json['logprobs'],
13 | json['finish_reason'] as String,
14 | );
15 |
16 | Map toJson() => _ChoicesToJson(this);
17 |
18 | Map _ChoicesToJson(Choices instance) => {
19 | 'text': instance.text,
20 | 'index': instance.index,
21 | 'logprobs': instance.logprobs,
22 | 'finish_reason': instance.finish_reason,
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/complete_text/response/complete_response.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/complete_text/response/usage.dart';
2 |
3 | import 'choices.dart';
4 |
5 | ///CT is Complete text [CTResponse]
6 | class CTResponse {
7 | final String id;
8 | final String object;
9 | final int created;
10 | final String model;
11 | final List choices;
12 | final Usage usage;
13 |
14 | CTResponse(
15 | this.id, this.object, this.created, this.model, this.choices, this.usage);
16 |
17 | factory CTResponse.fromJson(Map json) => CTResponse(
18 | json['id'] as String,
19 | json['object'] as String,
20 | json['created'] as int,
21 | json['model'] as String,
22 | (json['choices'] as List)
23 | .map((e) => Choices.fromJson(e as Map))
24 | .toList(),
25 | Usage.fromJson(json['usage'] as Map),
26 | );
27 |
28 | Map toJson() => responseToJson(this);
29 |
30 | Map responseToJson(CTResponse instance) => {
31 | 'id': instance.id,
32 | 'object': instance.object,
33 | 'created': instance.created,
34 | 'model': instance.model,
35 | 'choices': instance.choices,
36 | 'usage': instance.usage,
37 | };
38 | }
39 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/complete_text/response/usage.dart:
--------------------------------------------------------------------------------
1 | class Usage {
2 | final int promptTokens;
3 | final int? completionTokens;
4 | final int totalTokens;
5 |
6 | Usage(this.promptTokens, this.completionTokens, this.totalTokens);
7 |
8 | factory Usage.fromJson(Map json) => Usage(
9 | json['prompt_tokens'] as int,
10 | json['completion_tokens'] == null
11 | ? 0
12 | : json['completion_tokens'] as int,
13 | json['total_tokens'] as int,
14 | );
15 | Map toJson() => _UsageToJson(this);
16 |
17 | Map _UsageToJson(Usage instance) => {
18 | 'prompt_tokens': instance.promptTokens,
19 | 'completion_tokens': instance.completionTokens,
20 | 'total_tokens': instance.totalTokens,
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/gen_image/request/generate_image.dart:
--------------------------------------------------------------------------------
1 | class GenerateImage {
2 | /// prompt string Required A text description of the desired image(s). The maximum length is 1000 characters.
3 | final String prompt;
4 |
5 | ///The number of images to generate. Must be between 1 and 10.
6 | final int n;
7 |
8 | ///The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
9 | final String size;
10 |
11 | ///The format in which the generated images are returned. Must be one of url or b64_json.
12 | final String response_format;
13 |
14 | ///A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
15 | final String user;
16 |
17 | GenerateImage(this.prompt, this.n,
18 | {this.size = "1024x1024", this.response_format = "url", this.user = ""});
19 |
20 | Map toJson() => Map.of({
21 | "prompt": this.prompt,
22 | "n": this.n,
23 | "size": this.size,
24 | "response_format": this.response_format,
25 | "user": this.user
26 | });
27 | }
28 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/gen_image/response/GenImgResponse.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/gen_image/response/image_data.dart';
2 |
3 | class GenImgResponse {
4 | GenImgResponse({
5 | this.created,
6 | this.data,
7 | });
8 |
9 | int? created;
10 | List? data;
11 |
12 | factory GenImgResponse.fromJson(Map json) => GenImgResponse(
13 | created: json["created"],
14 | data: json["data"] == null
15 | ? []
16 | : List.from(
17 | json["data"]!.map((x) => ImageData.fromJson(x))),
18 | );
19 |
20 | Map toJson() => {
21 | "created": created,
22 | "data": data == null
23 | ? []
24 | : List.from(data!.map((x) => x!.toJson())),
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/gen_image/response/image_data.dart:
--------------------------------------------------------------------------------
1 | class ImageData {
2 | ImageData({this.url, this.b64Json});
3 |
4 | String? url;
5 | String? b64Json;
6 |
7 | factory ImageData.fromJson(Map json) =>
8 | ImageData(url: json["url"], b64Json: json["b64_json"]);
9 |
10 | Map toJson() => {"url": url, "b64_json": b64Json};
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/openai_engine/engine_data.dart:
--------------------------------------------------------------------------------
1 | class EngineData {
2 | final String id;
3 | final String object;
4 | final String owner;
5 | final bool ready;
6 |
7 | EngineData(this.id, this.object, this.owner, this.ready);
8 | factory EngineData.fromJson(Map json) => EngineData(
9 | json['id'] as String,
10 | json['object'] as String,
11 | json['owner'] as String,
12 | json['ready'] as bool,
13 | );
14 | Map toJson() => _EngineDataToJson(this);
15 |
16 | Map _EngineDataToJson(EngineData instance) =>
17 | {
18 | 'id': instance.id,
19 | 'object': instance.object,
20 | 'owner': instance.owner,
21 | 'ready': instance.ready,
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/openai_engine/engine_model.dart:
--------------------------------------------------------------------------------
1 | import 'engine_data.dart';
2 |
3 | class EngineModel {
4 | final List data;
5 | final String object;
6 |
7 | EngineModel(this.data, this.object);
8 | factory EngineModel.fromJson(Map json) => EngineModel(
9 | (json['data'] as List)
10 | .map((e) => EngineData.fromJson(e as Map))
11 | .toList(),
12 | json['object'] as String,
13 | );
14 |
15 | Map toJson() => _EngineModelToJson(this);
16 | Map _EngineModelToJson(EngineModel instance) =>
17 | {
18 | 'data': instance.data,
19 | 'object': instance.object,
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/openai_model/openai_model_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:chat_gpt_sdk/src/model/openai_model/permission.dart';
2 |
3 | class ModelData {
4 | final String id;
5 | final String object;
6 | final String ownerBy;
7 | final List? permission;
8 |
9 | ModelData(this.id, this.object, this.ownerBy, this.permission);
10 | factory ModelData.fromJson(Map json) => ModelData(
11 | json['id'] as String,
12 | json['object'] as String,
13 | json['owned_by'] as String,
14 | json['permission'] == null
15 | ? null
16 | : (json['permission'] as List)
17 | .map((e) => Permission.fromJson(e as Map))
18 | .toList(),
19 | );
20 |
21 | Map toJson() => {
22 | 'id': id,
23 | 'object': object,
24 | 'owned_by': ownerBy,
25 | 'permission': permission,
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/openai_model/openai_models.dart:
--------------------------------------------------------------------------------
1 | import 'openai_model_data.dart';
2 |
3 | class AiModel {
4 | final List data;
5 | final dynamic object;
6 |
7 | AiModel(this.data, this.object);
8 | factory AiModel.fromJson(Map json) => AiModel(
9 | (json['data'] as List)
10 | .map((e) => ModelData.fromJson(e as Map))
11 | .toList(),
12 | json['object'] as String,
13 | );
14 |
15 | Map toJson() => {
16 | 'data': data,
17 | 'object': object,
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/model/openai_model/permission.dart:
--------------------------------------------------------------------------------
1 | class Permission {
2 | final String id;
3 | final String object;
4 | final int created;
5 | final bool allowCreate_engine;
6 | final bool allowSampling;
7 | final bool allowLogprobs;
8 | final bool allowSearchIndices;
9 | final bool allowView;
10 | final bool allowFineTuning;
11 | final String organization;
12 | final dynamic group;
13 | final bool? isBlocking;
14 |
15 | Permission(
16 | this.id,
17 | this.object,
18 | this.created,
19 | this.allowCreate_engine,
20 | this.allowSampling,
21 | this.allowLogprobs,
22 | this.allowSearchIndices,
23 | this.allowView,
24 | this.allowFineTuning,
25 | this.organization,
26 | this.group,
27 | this.isBlocking);
28 |
29 | factory Permission.fromJson(Map json) => Permission(
30 | json['id'] as String,
31 | json['object'] as String,
32 | json['created'] as int,
33 | json['allow_create_engine'] as bool,
34 | json['allow_sampling'] as bool,
35 | json['allow_logprobs'] as bool,
36 | json['allow_search_indices'] as bool,
37 | json['allow_view'] as bool,
38 | json['allow_fine_tuning'] as bool,
39 | json['organization'] as String,
40 | json['group'],
41 | json['is_blocking'] as bool?,
42 | );
43 |
44 | Map toJson() => {
45 | 'id': id,
46 | 'object': object,
47 | 'created': created,
48 | 'allow_create_engine': allowCreate_engine,
49 | 'allow_sampling': allowSampling,
50 | 'allow_logprobs': allowLogprobs,
51 | 'allow_search_indices': allowSearchIndices,
52 | 'allow_view': allowView,
53 | 'allow_fine_tuning': allowFineTuning,
54 | 'organization': organization,
55 | 'group': group,
56 | 'is_blocking': isBlocking,
57 | };
58 | }
59 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/lib/src/utils/constants.dart:
--------------------------------------------------------------------------------
1 | /// Base ChatGPT Url
2 | const kURL = "https://api.openai.com/v1/";
3 |
4 | const kCompletion = 'completions';
5 |
6 | ///get list model
7 | const kModelList = 'models';
8 |
9 | ///get list engine
10 | const kEngineList = 'engines';
11 |
12 | ///generate image with prompt
13 | const kGenerateImage = 'images/generations';
14 |
15 | ///
16 | const kChatGptTurbo = 'chat/completions';
17 |
18 | ///model name
19 | const kTextDavinci3 = 'text-davinci-003';
20 | const kTextDavinci2 = 'text-davinci-002';
21 | const kCodeDavinci2 = 'code-davinci-002';
22 | const kChatGptTurboModel = 'gpt-3.5-turbo'; // gpt 3.5
23 | const kChatGptTurbo0301Model = 'gpt-3.5-turbo-0301';
24 |
25 | Map kHeader(String token, {String orgId = ""}) =>
26 | {"Content-Type": 'application/json', "Authorization": "Bearer $token"};
27 |
28 | Map kHeaderOrg(String orgId) =>
29 | {"Content-Type": 'application/json', "Authorization": "Bearer $orgId"};
30 |
31 | ///key data
32 | const kTokenKey = 'token';
33 | const kOrgIdKey = 'orgId';
34 |
35 | String translateEngToThai({required String word}) =>
36 | "Translate this into thai : $word";
37 | String translateThaiToEng({required String word}) =>
38 | "Translate this into English : $word";
39 | String translateToJapanese({required String word}) =>
40 | "Translate this into Japanese : $word";
41 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: chat_gpt_sdk
2 | description: create chat bot and other bot with ChatGPT SDK
3 | version: 2.0.1
4 | homepage: https://www.facebook.com/REDEVRX
5 | repository: https://github.com/redevRx/Flutter-ChatGPT
6 |
7 | environment:
8 | sdk: ">=2.19.3 <3.0.0"
9 | flutter: ">=1.17.0"
10 |
11 | dependencies:
12 | flutter:
13 | sdk: flutter
14 | dio: ^5.0.1
15 | shared_preferences: ^2.0.17
16 |
17 | dev_dependencies:
18 | flutter_test:
19 | sdk: flutter
20 |
21 | # For information on the generic Dart part of this file, see the
22 | # following page: https://dart.dev/tools/pub/pubspec
23 |
24 | # The following section is specific to Flutter packages.
25 | flutter:
26 |
27 | # To add assets to your package, add an assets section, like this:
28 | # assets:
29 | # - images/a_dot_burr.jpeg
30 | # - images/a_dot_ham.jpeg
31 | #
32 | # For details regarding assets in packages, see
33 | # https://flutter.dev/assets-and-images/#from-packages
34 | #
35 | # An image asset can refer to one or more resolution-specific "variants", see
36 | # https://flutter.dev/assets-and-images/#resolution-aware
37 |
38 | # To add custom fonts to your package, add a fonts section here,
39 | # in this "flutter" section. Each entry in this list should have a
40 | # "family" key with the font family name, and a "fonts" key with a
41 | # list giving the asset and other descriptors for the font. For
42 | # example:
43 | # fonts:
44 | # - family: Schyler
45 | # fonts:
46 | # - asset: fonts/Schyler-Regular.ttf
47 | # - asset: fonts/Schyler-Italic.ttf
48 | # style: italic
49 | # - family: Trajan Pro
50 | # fonts:
51 | # - asset: fonts/TrajanPro.ttf
52 | # - asset: fonts/TrajanPro_Bold.ttf
53 | # weight: 700
54 | #
55 | # For details regarding fonts in packages, see
56 | # https://flutter.dev/custom-fonts/#from-packages
57 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api/test/chat_gpt_test.dart:
--------------------------------------------------------------------------------
1 | void main() {}
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/.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 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | /pubspec.lock
27 | **/doc/api/
28 | .dart_tool/
29 | .packages
30 | build/
31 |
32 | test/session_token.dart
33 | example/lib/session_token.dart
34 | test/clearance_token.dart
35 | example/lib/clearance_token.dart
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
8 | channel: master
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.0.0
2 |
3 | * Initial version.
4 |
5 | ## 1.1.0
6 |
7 | * cf_clearance (clearanceToken) added.
8 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Travis Fischer
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.
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/README.md:
--------------------------------------------------------------------------------
1 | # Flutter ChatGPT API
2 |
3 | This package is a Flutter/Dart API around [ChatGPT](https://openai.com/blog/chatgpt) by [OpenAI](https://openai.com).
4 |
5 | This package requires a valid session token from ChatGPT to access its unofficial REST API.
6 |
7 | This version have been updated to use Puppeteer to log in to ChatGPT and extract the Cloudflare cf_clearance cookie and OpenAI session token. 🔥 Thanks to [Node.js ChatGPT API](https://github.com/transitive-bullshit/chatgpt-api) (unofficial)
8 |
9 | - [Demo](#demo)
10 | - [Installation](#installation)
11 | - [Usage](#usage)
12 | - [SessionToken and ClearanceToken](#sessiontoken)
13 | - [License](#license)
14 |
15 | :warning: Be Careful!
16 | - Your `user-agent` and `IP address` **must match** from the real browser window you're logged in with to the one you're using for `ChatGPTAPI`.
17 | - This means that you currently can't log in with your laptop and then run the bot on a server or proxy somewhere.
18 | - Please check `defaultHeaders`
19 | ## Demo
20 |
21 |
22 |
23 | ## Installation
24 |
25 | ```
26 | dependencies:
27 | flutter_chatgpt_api: ^1.0.0
28 | ```
29 |
30 | ## Usage
31 |
32 | ```dart
33 |
34 | import 'package:flutter_chatgpt_api/flutter_chatgpt_api.dart';
35 |
36 | _api = ChatGPTApi(
37 | sessionToken: SESSION_TOKEN,
38 | clearanceToken: CLEARANCE_TOKEN,
39 | );
40 |
41 | setState(() {
42 | _messages.add(
43 | ChatMessage(
44 | text: _textController.text,
45 | chatMessageType: ChatMessageType.user,
46 | ),
47 | );
48 | isLoading = true;
49 | });
50 |
51 | var newMessage = await _api.sendMessage(
52 | input,
53 | conversationId: _conversationId,
54 | parentMessageId: _parentMessageId,
55 | );
56 |
57 | setState(() {
58 | _conversationId = newMessage.conversationId;
59 | _parentMessageId = newMessage.messageId;
60 | isLoading = false;
61 | _messages.add(
62 | ChatMessage(
63 | text: newMessage.message,
64 | chatMessageType: ChatMessageType.bot,
65 | ),
66 | );
67 | });
68 | ```
69 | ## SessionToken
70 |
71 | To get a session token:
72 |
73 | 1. Go to https://chat.openai.com/chat and log in or sign up.
74 | 2. Open dev tools.
75 | 3. Open `Application` > `Cookies` (`Storage` > `Cookies`)
76 |
77 | 
78 |
79 | 4. Create these files and add your session token to run the tests and example respectively:
80 |
81 |
82 | Copy the value for __Secure-next-auth.session-token and save it to your environment.`example/lib/session_token.dart`
83 |
84 | Copy the value for cf_clearance and save it to your environment.
85 | `example/lib/clearance_token.dart`
86 |
87 | Should look something like this:
88 | ```dart
89 | const SESSION_TOKEN = '__Secure-next-auth.session-token from https://chat.openai.com/chat';
90 | ```
91 |
92 | ```dart
93 | const CLEARANCE_TOKEN = 'cf_clearance token from https://chat.openai.com/chat';
94 | ```
95 | ## Credit
96 |
97 | - Huge thanks to Travis Fischer for creating [Node.js ChatGPT API](https://github.com/transitive-bullshit/chatgpt-api) (unofficial) 💪
98 | - Inspired by this [ChatGPT API Dart](https://github.com/MisterJimson/chatgpt_api_dart) by [Jason Rai](https://github.com/MisterJimson) ✨
99 |
100 | ## License
101 |
102 | [MIT](https://choosealicense.com/licenses/mit/) Copyright (c) 2022, [Emre Coşkunçay](https://github.com/coskuncay)
103 |
104 | If you found this project interesting, please consider supporting my open source work by [sponsoring me](https://github.com/sponsors/coskuncay) or following me on twitter
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:
--------------------------------------------------------------------------------
1 | package io.flutter.plugins;
2 |
3 | import io.flutter.plugin.common.PluginRegistry;
4 |
5 | /**
6 | * Generated file. Do not edit.
7 | */
8 | public final class GeneratedPluginRegistrant {
9 | public static void registerWith(PluginRegistry registry) {
10 | if (alreadyRegisteredWith(registry)) {
11 | return;
12 | }
13 | }
14 |
15 | private static boolean alreadyRegisteredWith(PluginRegistry registry) {
16 | final String key = GeneratedPluginRegistrant.class.getCanonicalName();
17 | if (registry.hasPlugin(key)) {
18 | return true;
19 | }
20 | registry.registrarFor(key);
21 | return false;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/android/local.properties:
--------------------------------------------------------------------------------
1 | sdk.dir=/home/nawbc/Android/Sdk
2 | flutter.sdk=/opt/flutter
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/.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 | /linux/
33 | /windows/
34 | /macos/
35 | .pub/
36 | /build/
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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/.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: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
8 | channel: master
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
17 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
18 | - platform: android
19 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
20 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
21 | - platform: ios
22 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
23 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
24 | - platform: linux
25 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
26 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
27 | - platform: macos
28 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
29 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
30 | - platform: web
31 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
32 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
33 | - platform: windows
34 | create_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
35 | base_revision: d9fb0dd8c6b49743aa59f14dd4327b11450948cf
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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 | ndkVersion flutter.ndkVersion
31 |
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.example.example"
48 | // You can update the following values to match your application needs.
49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
50 | minSdkVersion flutter.minSdkVersion
51 | targetSdkVersion flutter.targetSdkVersion
52 | versionCode flutterVersionCode.toInteger()
53 | versionName flutterVersionName
54 | }
55 |
56 | buildTypes {
57 | release {
58 | // TODO: Add your own signing config for the release build.
59 | // Signing with the debug keys for now, so `flutter run --release` works.
60 | signingConfig signingConfigs.debug
61 | }
62 | }
63 | }
64 |
65 | flutter {
66 | source '../..'
67 | }
68 |
69 | dependencies {
70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
71 | }
72 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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.2.0'
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 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/assets/bot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/assets/bot.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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.
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | example
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/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 |
11 | void main() {
12 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
13 | // Build our app and trigger a frame.
14 | // await tester.pumpWidget(const MyApp());
15 |
16 | // Verify that our counter starts at 0.
17 | expect(find.text('0'), findsOneWidget);
18 | expect(find.text('1'), findsNothing);
19 |
20 | // Tap the '+' icon and trigger a frame.
21 | await tester.tap(find.byIcon(Icons.add));
22 | await tester.pump();
23 |
24 | // Verify that our counter has incremented.
25 | expect(find.text('0'), findsNothing);
26 | expect(find.text('1'), findsOneWidget);
27 | });
28 | }
29 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/web/favicon.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/chatgpt_api_unofficial/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | example
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/ios/Flutter/Generated.xcconfig:
--------------------------------------------------------------------------------
1 | // This is a generated file; do not edit or check into version control.
2 | FLUTTER_ROOT=/opt/flutter
3 | FLUTTER_APPLICATION_PATH=/home/nawbc/Desktop/nitmgpt/plugins/chatgpt_api_unofficial
4 | COCOAPODS_PARALLEL_CODE_SIGN=true
5 | FLUTTER_TARGET=lib/main.dart
6 | FLUTTER_BUILD_DIR=build
7 | FLUTTER_BUILD_NAME=1.1.0
8 | FLUTTER_BUILD_NUMBER=1.1.0
9 | EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
10 | EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
11 | DART_OBFUSCATION=false
12 | TRACK_WIDGET_CREATION=true
13 | TREE_SHAKE_ICONS=false
14 | PACKAGE_CONFIG=.dart_tool/package_config.json
15 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/ios/Flutter/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/opt/flutter"
4 | export "FLUTTER_APPLICATION_PATH=/home/nawbc/Desktop/nitmgpt/plugins/chatgpt_api_unofficial"
5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 | export "FLUTTER_TARGET=lib/main.dart"
7 | export "FLUTTER_BUILD_DIR=build"
8 | export "FLUTTER_BUILD_NAME=1.1.0"
9 | export "FLUTTER_BUILD_NUMBER=1.1.0"
10 | export "DART_OBFUSCATION=false"
11 | export "TRACK_WIDGET_CREATION=true"
12 | export "TREE_SHAKE_ICONS=false"
13 | export "PACKAGE_CONFIG=.dart_tool/package_config.json"
14 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/ios/Runner/GeneratedPluginRegistrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GeneratedPluginRegistrant_h
8 | #define GeneratedPluginRegistrant_h
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface GeneratedPluginRegistrant : NSObject
15 | + (void)registerWithRegistry:(NSObject*)registry;
16 | @end
17 |
18 | NS_ASSUME_NONNULL_END
19 | #endif /* GeneratedPluginRegistrant_h */
20 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/ios/Runner/GeneratedPluginRegistrant.m:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #import "GeneratedPluginRegistrant.h"
8 |
9 | @implementation GeneratedPluginRegistrant
10 |
11 | + (void)registerWithRegistry:(NSObject*)registry {
12 | }
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/chat_message.model.dart:
--------------------------------------------------------------------------------
1 | part of flutter_chatgpt_api;
2 |
3 | enum ChatMessageType { user, bot }
4 |
5 | class ChatMessage {
6 | ChatMessage({
7 | required this.text,
8 | required this.chatMessageType,
9 | });
10 |
11 | final String text;
12 | final ChatMessageType chatMessageType;
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/chat_response.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class ChatResponse {
4 | final String message;
5 | final String messageId;
6 | final String conversationId;
7 |
8 | ChatResponse({
9 | required this.message,
10 | required this.messageId,
11 | required this.conversationId,
12 | });
13 |
14 | Map toMap() {
15 | return {
16 | 'message': message,
17 | 'message_id': messageId,
18 | 'conversation_id': conversationId,
19 | };
20 | }
21 |
22 | factory ChatResponse.fromMap(Map map) {
23 | return ChatResponse(
24 | message: map['message'] ?? '',
25 | messageId: map['message_id'] ?? '',
26 | conversationId: map['conversation_id'] ?? '',
27 | );
28 | }
29 |
30 | String toJson() => json.encode(toMap());
31 |
32 | factory ChatResponse.fromJson(String source) =>
33 | ChatResponse.fromMap(json.decode(source));
34 | }
35 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/conversation_body.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_chatgpt_api/src/models/models.dart';
4 |
5 | class ConversationBody {
6 | final String? action;
7 | final String? conversationId;
8 | final List? messages;
9 | final String model;
10 | final String parentMessageId;
11 |
12 | ConversationBody({
13 | required this.action,
14 | required this.conversationId,
15 | required this.messages,
16 | required this.model,
17 | required this.parentMessageId,
18 | });
19 |
20 | Map toMap() {
21 | return {
22 | 'action': action,
23 | 'conversation_id': conversationId,
24 | 'messages': messages?.map((x) => x.toMap()).toList(),
25 | 'model': model,
26 | 'parent_message_id': parentMessageId,
27 | };
28 | }
29 |
30 | factory ConversationBody.fromMap(Map map) {
31 | return ConversationBody(
32 | action: map['action'],
33 | conversationId: map['conversation_id'],
34 | messages: map['messages'] != null
35 | ? List.from(map['messages']?.map((x) => Prompt.fromMap(x)))
36 | : null,
37 | model: map['model'] ?? '',
38 | parentMessageId: map['parent_message_id'] ?? '',
39 | );
40 | }
41 |
42 | String toJson() => json.encode(toMap());
43 |
44 | factory ConversationBody.fromJson(String source) =>
45 | ConversationBody.fromMap(json.decode(source));
46 | }
47 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/conversation_response_event.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_chatgpt_api/src/models/models.dart';
4 |
5 | class ConversationResponseEvent {
6 | final Message? message;
7 | final String conversationId;
8 | final String? error;
9 |
10 | ConversationResponseEvent({
11 | required this.message,
12 | required this.conversationId,
13 | required this.error,
14 | });
15 |
16 | Map toMap() {
17 | return {
18 | 'message': message?.toMap(),
19 | 'conversation_id': conversationId,
20 | 'error': error,
21 | };
22 | }
23 |
24 | factory ConversationResponseEvent.fromMap(Map map) {
25 | return ConversationResponseEvent(
26 | message: map['message'] != null ? Message.fromMap(map['message']) : null,
27 | conversationId: map['conversation_id'] ?? '',
28 | error: map['error'],
29 | );
30 | }
31 |
32 | String toJson() => json.encode(toMap());
33 |
34 | factory ConversationResponseEvent.fromJson(String source) =>
35 | ConversationResponseEvent.fromMap(json.decode(source));
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/message.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_chatgpt_api/src/models/message_content.model.dart';
4 |
5 | class Message {
6 | final String id;
7 | final MessageContent content;
8 | final String role;
9 | final String? user;
10 | //final dynamic endTurn;
11 | final double weight;
12 | final String recipient;
13 | //final dynamic metadata;
14 |
15 | Message({
16 | required this.id,
17 | required this.content,
18 | required this.role,
19 | required this.user,
20 | required this.weight,
21 | required this.recipient,
22 | });
23 |
24 | Map toMap() {
25 | return {
26 | 'id': id,
27 | 'content': content.toMap(),
28 | 'role': role,
29 | 'user': user,
30 | 'weight': weight,
31 | 'recipient': recipient,
32 | };
33 | }
34 |
35 | factory Message.fromMap(Map map) {
36 | return Message(
37 | id: map['id'] ?? '',
38 | content: MessageContent.fromMap(map['content']),
39 | role: map['role'] ?? '',
40 | user: map['user'],
41 | weight: map['weight']?.toDouble() ?? 0.0,
42 | recipient: map['recipient'] ?? '',
43 | );
44 | }
45 |
46 | String toJson() => json.encode(toMap());
47 |
48 | factory Message.fromJson(String source) =>
49 | Message.fromMap(json.decode(source));
50 | }
51 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/message_content.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class MessageContent {
4 | final String contentType;
5 | final List parts;
6 | MessageContent({
7 | required this.contentType,
8 | required this.parts,
9 | });
10 |
11 | Map toMap() {
12 | return {
13 | 'content_type': contentType,
14 | 'parts': parts,
15 | };
16 | }
17 |
18 | factory MessageContent.fromMap(Map map) {
19 | return MessageContent(
20 | contentType: map['content_type'] ?? '',
21 | parts: List.from(map['parts']),
22 | );
23 | }
24 |
25 | String toJson() => json.encode(toMap());
26 |
27 | factory MessageContent.fromJson(String source) =>
28 | MessageContent.fromMap(json.decode(source));
29 | }
30 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/message_feedback_body.model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_chatgpt_api/src/models/message_feedback_result.model.dart';
2 |
3 | enum MessageFeedbackTags {
4 | harmful,
5 | falseValue, // false is a reserved word
6 | notHelpful,
7 | }
8 |
9 | class MessageFeedbackBody {
10 | final String conversationId;
11 | final String messageId;
12 | final MessageFeedbackResult rating;
13 | final List? tags;
14 | final String? text;
15 |
16 | MessageFeedbackBody({
17 | required this.conversationId,
18 | required this.messageId,
19 | required this.rating,
20 | required this.tags,
21 | required this.text,
22 | });
23 | }
24 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/message_feedback_result.model.dart:
--------------------------------------------------------------------------------
1 | enum MessageFeedbackRating {
2 | thumbsUp,
3 | thumbsDown,
4 | }
5 |
6 | class MessageFeedbackResult {
7 | final String messageId;
8 | final String conversationId;
9 | final String userId;
10 | final MessageFeedbackRating rating;
11 | final String? text;
12 |
13 | MessageFeedbackResult({
14 | required this.messageId,
15 | required this.conversationId,
16 | required this.userId,
17 | required this.rating,
18 | required this.text,
19 | });
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/model.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class Model {
4 | final String slug;
5 | final int maxTokens;
6 | final bool isSpecial;
7 |
8 | Model({
9 | required this.slug,
10 | required this.maxTokens,
11 | required this.isSpecial,
12 | });
13 |
14 | Map toMap() {
15 | return {
16 | 'slug': slug,
17 | 'maxTokens': maxTokens,
18 | 'isSpecial': isSpecial,
19 | };
20 | }
21 |
22 | factory Model.fromMap(Map map) {
23 | return Model(
24 | slug: map['slug'] ?? '',
25 | maxTokens: map['maxTokens']?.toInt() ?? 0,
26 | isSpecial: map['isSpecial'] ?? false,
27 | );
28 | }
29 |
30 | String toJson() => json.encode(toMap());
31 |
32 | factory Model.fromJson(String source) => Model.fromMap(json.decode(source));
33 | }
34 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/model_result.model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_chatgpt_api/src/models/model.model.dart';
2 |
3 | class ModelsResult {
4 | final List models;
5 |
6 | ModelsResult({
7 | required this.models,
8 | });
9 | }
10 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/models.dart:
--------------------------------------------------------------------------------
1 | export 'chat_response.model.dart';
2 | export 'conversation_body.model.dart';
3 | export 'conversation_response_event.model.dart';
4 | export 'message_content.model.dart';
5 | export 'message_feedback_body.model.dart';
6 | export 'message_feedback_result.model.dart';
7 | export 'message.model.dart';
8 | export 'model_result.model.dart';
9 | export 'model.model.dart';
10 | export 'moderation_body.model.dart';
11 | export 'moderation_result.model.dart';
12 | export 'prompt_content.model.dart';
13 | export 'prompt.model.dart';
14 | export 'session_result.model.dart';
15 | export 'user.model.dart';
16 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/moderation_body.model.dart:
--------------------------------------------------------------------------------
1 | enum AvailableModerationModels {
2 | textModerationPlayground,
3 | }
4 |
5 | class ModerationsBody {
6 | final String input;
7 | final AvailableModerationModels model;
8 |
9 | ModerationsBody({
10 | required this.input,
11 | required this.model,
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/moderation_result.model.dart:
--------------------------------------------------------------------------------
1 | class ModerationsResult {
2 | final bool flagged;
3 | final bool blocked;
4 | final String moderationId;
5 |
6 | ModerationsResult({
7 | required this.flagged,
8 | required this.blocked,
9 | required this.moderationId,
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/prompt.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_chatgpt_api/src/models/models.dart';
4 |
5 | class Prompt {
6 | final PromptContent content;
7 | final String id;
8 | final String role;
9 |
10 | Prompt({
11 | required this.content,
12 | required this.id,
13 | required this.role,
14 | });
15 |
16 | Map toMap() {
17 | return {
18 | 'content': content.toMap(),
19 | 'id': id,
20 | 'role': role,
21 | };
22 | }
23 |
24 | factory Prompt.fromMap(Map map) {
25 | return Prompt(
26 | content: PromptContent.fromMap(map['content']),
27 | id: map['id'] ?? '',
28 | role: map['role'] ?? '',
29 | );
30 | }
31 |
32 | String toJson() => json.encode(toMap());
33 |
34 | factory Prompt.fromJson(String source) => Prompt.fromMap(json.decode(source));
35 | }
36 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/prompt_content.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class PromptContent {
4 | final String contentType;
5 | final List parts;
6 |
7 | PromptContent({
8 | required this.contentType,
9 | required this.parts,
10 | });
11 |
12 | Map toMap() {
13 | return {
14 | 'content_type': contentType,
15 | 'parts': parts,
16 | };
17 | }
18 |
19 | factory PromptContent.fromMap(Map map) {
20 | return PromptContent(
21 | contentType: map['content_type'] ?? '',
22 | parts: List.from(map['parts']),
23 | );
24 | }
25 |
26 | String toJson() => json.encode(toMap());
27 |
28 | factory PromptContent.fromJson(String source) =>
29 | PromptContent.fromMap(json.decode(source));
30 | }
31 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/session_result.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter_chatgpt_api/src/models/models.dart';
4 |
5 | class SessionResult {
6 | final User user;
7 | final String expires;
8 | final String accessToken;
9 |
10 | SessionResult({
11 | required this.user,
12 | required this.expires,
13 | required this.accessToken,
14 | });
15 |
16 | Map toMap() {
17 | return {
18 | 'user': user.toMap(),
19 | 'expires': expires,
20 | 'accessToken': accessToken,
21 | };
22 | }
23 |
24 | factory SessionResult.fromMap(Map map) {
25 | return SessionResult(
26 | user: User.fromMap(map['user']),
27 | expires: map['expires'] ?? '',
28 | accessToken: map['accessToken'] ?? '',
29 | );
30 | }
31 |
32 | String toJson() => json.encode(toMap());
33 |
34 | factory SessionResult.fromJson(String source) =>
35 | SessionResult.fromMap(json.decode(source));
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/models/user.model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | class User {
4 | final String id;
5 | final String name;
6 | final String email;
7 | final String image;
8 | final String picture;
9 | final List groups;
10 | final List features;
11 |
12 | User({
13 | required this.id,
14 | required this.name,
15 | required this.email,
16 | required this.image,
17 | required this.picture,
18 | required this.groups,
19 | required this.features,
20 | });
21 |
22 | Map toMap() {
23 | return {
24 | 'id': id,
25 | 'name': name,
26 | 'email': email,
27 | 'image': image,
28 | 'picture': picture,
29 | 'groups': groups,
30 | 'features': features,
31 | };
32 | }
33 |
34 | factory User.fromMap(Map map) {
35 | return User(
36 | id: map['id'] ?? '',
37 | name: map['name'] ?? '',
38 | email: map['email'] ?? '',
39 | image: map['image'] ?? '',
40 | picture: map['picture'] ?? '',
41 | groups: List.from(map['groups']),
42 | features: List.from(map['features']),
43 | );
44 | }
45 |
46 | String toJson() => json.encode(toMap());
47 |
48 | factory User.fromJson(String source) => User.fromMap(json.decode(source));
49 | }
50 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/utils/expiry_map.dart:
--------------------------------------------------------------------------------
1 | class ExpiryMap {
2 | final Map _map = {};
3 |
4 | V? operator [](K key) => _map[key];
5 |
6 | void operator []=(K key, V value) {
7 | _map[key] = value;
8 | Future.delayed(const Duration(seconds: 10), () => _map.remove(key));
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/lib/src/utils/utils.dart:
--------------------------------------------------------------------------------
1 | export 'expiry_map.dart';
2 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_chatgpt_api
2 | description: Flutter/Dart API around ChatGPT for the unofficial ChatGPT API.
3 | version: 1.1.0
4 | homepage: https://github.com/coskuncay/flutter_chatgpt_api
5 | repository: https://github.com/coskuncay/flutter_chatgpt_api
6 |
7 | environment:
8 | sdk: '>=2.18.2 <3.0.0'
9 | flutter: ">=1.17.0"
10 |
11 | dependencies:
12 | http: ^0.13.5
13 | uuid: ^3.0.7
14 |
15 | dev_dependencies:
16 | flutter_test:
17 | sdk: flutter
18 | flutter_lints: ^2.0.0
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter packages.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/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 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/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 |
--------------------------------------------------------------------------------
/plugins/chatgpt_api_unofficial/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: zoeim # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | # custom: ['https://payone.wencai.app/s/zoe'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3
8 | channel: stable
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.3.2
2 |
3 | - bugfix: with some kotlin version build error (asserts-null)
4 |
5 | ## 1.3.1
6 |
7 | - chore: imporve code style
8 | - bugfix: fix foreground when first started, #16
9 |
10 | ## 1.3.0
11 |
12 | - feature: support full notification information
13 | - chore: add funding support
14 |
15 | ## 1.2.0
16 |
17 | - feature: add unique id for notification
18 | - feature: support interactive notification
19 | - chore: add docs for readme
20 |
21 | ## 1.1.3
22 |
23 | - fix: add try catch while invoke method
24 |
25 | ## 1.1.2
26 |
27 | - hotfix: fix exception of some app send bitmap as large icon
28 |
29 | ## 1.1.1
30 |
31 | - hotfix: fix utils class miss
32 |
33 |
34 | ## 1.1.0
35 |
36 | - feature: add notification id
37 | - feature: add notification large icon
38 |
39 | ## 1.0.8
40 |
41 | - hotfix: fix start service failed after reboot
42 |
43 | ## 1.0.7
44 |
45 | - feature: add foreground service
46 |
47 | ## 1.0.6
48 |
49 | - fix: charseq cause excatpion
50 |
51 | ## 1.0.5
52 |
53 | - fix: textLines cause panic
54 | - chore: format code
55 |
56 | ## 1.0.4
57 |
58 | - chore
59 | ## 1.0.3
60 |
61 | - remove extra
62 |
63 | ## 1.0.1
64 |
65 | - fix dart in backgroun run
66 | - change the api for register handle
67 | - add log in android
68 |
69 | ## 1.0.0
70 |
71 | First implement.
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2021 wellwell.work, LLC by Zoe
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'im.zoe.labs.flutter_notification_listener'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.3.50'
6 | repositories {
7 | google()
8 | jcenter()
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:4.1.0'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | rootProject.allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | apply plugin: 'com.android.library'
25 | apply plugin: 'kotlin-android'
26 |
27 | android {
28 | compileSdkVersion 29
29 |
30 | sourceSets {
31 | main.java.srcDirs += 'src/main/kotlin'
32 | }
33 | defaultConfig {
34 | minSdkVersion 19
35 | }
36 | }
37 |
38 | dependencies {
39 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
40 | }
41 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jun 05 09:48:27 CST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'flutter_notification_listener'
2 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/android/src/main/kotlin/im/zoe/labs/flutter_notification_listener/RebootBroadcastReceiver.kt:
--------------------------------------------------------------------------------
1 | package im.zoe.labs.flutter_notification_listener
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.ComponentName
5 | import android.content.Context
6 | import android.content.Intent
7 | import android.content.pm.PackageManager
8 | import android.util.Log
9 |
10 |
11 | class RebootBroadcastReceiver : BroadcastReceiver() {
12 | override fun onReceive(context: Context, intent: Intent) {
13 | when (intent.action) {
14 | Intent.ACTION_REBOOT, Intent.ACTION_BOOT_COMPLETED -> {
15 | Log.i("NotificationListener", "Registering notification listener, after reboot!")
16 | FlutterNotificationListenerPlugin.registerAfterReboot(context)
17 | }
18 | else -> {
19 | Log.i("NotificationListener", intent.action.toString())
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_notification_listener_example
2 |
3 | Demonstrates how to use the flutter_notification_listener plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/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 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/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 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 31
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | defaultConfig {
36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37 | applicationId "im.zoe.labs.flutter_notification_listener_example"
38 | minSdkVersion 19
39 | targetSdkVersion 30
40 | versionCode flutterVersionCode.toInteger()
41 | versionName flutterVersionName
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
59 | }
60 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/kotlin/im/zoe/labs/flutter_notification_listener_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package im.zoe.labs.flutter_notification_listener_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deskbtm/nitmgpt/26237fdd4c2940c45c7d16a8a09869ca8cf7a0f3/plugins/flutter_notification_listener/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.20'
3 | // ext.kotlin_version = '1.3.50'
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:4.1.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | task clean(type: Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/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-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/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 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_notification_listener_example
2 | description: Demonstrates how to use the flutter_notification_listener plugin.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | environment:
9 | sdk: ">=2.12.0 <3.0.0"
10 |
11 | dependencies:
12 | flutter:
13 | sdk: flutter
14 |
15 | flutter_notification_listener:
16 | # When depending on this package from a real application you should use:
17 | # flutter_notification_listener: ^x.y.z
18 | # See https://dart.dev/tools/pub/dependencies#version-constraints
19 | # The example app is bundled with the plugin so we use a path dependency on
20 | # the parent directory to use the current plugin's version.
21 | path: ../
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^1.0.2
26 |
27 | dev_dependencies:
28 | flutter_test:
29 | sdk: flutter
30 |
31 | # For information on the generic Dart part of this file, see the
32 | # following page: https://dart.dev/tools/pub/pubspec
33 |
34 | # The following section is specific to Flutter.
35 | flutter:
36 |
37 | # The following line ensures that the Material Icons font is
38 | # included with your application, so that you can use the icons in
39 | # the material Icons class.
40 | uses-material-design: true
41 |
42 | # To add assets to your application, add an assets section, like this:
43 | # assets:
44 | # - images/a_dot_burr.jpeg
45 | # - images/a_dot_ham.jpeg
46 |
47 | # An image asset can refer to one or more resolution-specific "variants", see
48 | # https://flutter.dev/assets-and-images/#resolution-aware.
49 |
50 | # For details regarding adding assets from package dependencies, see
51 | # https://flutter.dev/assets-and-images/#from-packages
52 |
53 | # To add custom fonts to your application, add a fonts section here,
54 | # in this "flutter" section. Each entry in this list should have a
55 | # "family" key with the font family name, and a "fonts" key with a
56 | # list giving the asset and other descriptors for the font. For
57 | # example:
58 | # fonts:
59 | # - family: Schyler
60 | # fonts:
61 | # - asset: fonts/Schyler-Regular.ttf
62 | # - asset: fonts/Schyler-Italic.ttf
63 | # style: italic
64 | # - family: Trajan Pro
65 | # fonts:
66 | # - asset: fonts/TrajanPro.ttf
67 | # - asset: fonts/TrajanPro_Bold.ttf
68 | # weight: 700
69 | #
70 | # For details regarding fonts from package dependencies,
71 | # see https://flutter.dev/custom-fonts/#from-packages
72 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/example/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 that Flutter provides. 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 |
11 | import 'package:flutter_notification_listener_example/main.dart';
12 |
13 | void main() {
14 | testWidgets('Verify Platform version', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that platform version is retrieved.
19 | expect(
20 | find.byWidgetPredicate(
21 | (Widget widget) =>
22 | widget is Text && widget.data!.startsWith('Running on:'),
23 | ),
24 | findsOneWidget,
25 | );
26 | });
27 | }
28 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/lib/flutter_notification_listener.dart:
--------------------------------------------------------------------------------
1 | export './src/event.dart';
2 | export './src/plugin.dart';
3 |
--------------------------------------------------------------------------------
/plugins/flutter_notification_listener/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_notification_listener
2 | description: Flutter plugin to listen for all incoming notifications for Android.
3 | version: 1.3.2
4 | homepage: https://github.com/jiusanzhou/flutter_notification_listener
5 |
6 | environment:
7 | sdk: '>=2.12.0 <3.0.0'
8 | flutter: ">=1.20.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 |
18 | # For information on the generic Dart part of this file, see the
19 | # following page: https://dart.dev/tools/pub/pubspec
20 |
21 | # The following section is specific to Flutter.
22 | flutter:
23 | # This section identifies this Flutter project as a plugin project.
24 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily
25 | # be modified. They are used by the tooling to maintain consistency when
26 | # adding or updating assets for this project.
27 | plugin:
28 | platforms:
29 | android:
30 | package: im.zoe.labs.flutter_notification_listener
31 | pluginClass: FlutterNotificationListenerPlugin
32 |
33 | # To add assets to your plugin package, add an assets section, like this:
34 | # assets:
35 | # - images/a_dot_burr.jpeg
36 | # - images/a_dot_ham.jpeg
37 | #
38 | # For details regarding assets in packages, see
39 | # https://flutter.dev/assets-and-images/#from-packages
40 | #
41 | # An image asset can refer to one or more resolution-specific "variants", see
42 | # https://flutter.dev/assets-and-images/#resolution-aware.
43 |
44 | # To add custom fonts to your plugin package, add a fonts section here,
45 | # in this "flutter" section. Each entry in this list should have a
46 | # "family" key with the font family name, and a "fonts" key with a
47 | # list giving the asset and other descriptors for the font. For
48 | # example:
49 | # fonts:
50 | # - family: Schyler
51 | # fonts:
52 | # - asset: fonts/Schyler-Regular.ttf
53 | # - asset: fonts/Schyler-Italic.ttf
54 | # style: italic
55 | # - family: Trajan Pro
56 | # fonts:
57 | # - asset: fonts/TrajanPro.ttf
58 | # - asset: fonts/TrajanPro_Bold.ttf
59 | # weight: 700
60 | #
61 | # For details regarding fonts in packages, see
62 | # https://flutter.dev/custom-fonts/#from-packages
63 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: nitmgpt
2 | version: 0.0.1-alpha.2
3 | publish_to: none
4 | description: It's a watcher client for Android that auto-hide ads, spam, etc notifications via chatgpt.
5 | environment:
6 | sdk: ">=2.19.1 <3.0.0"
7 |
8 | dependencies:
9 | firebase_analytics: ^10.0.4
10 | firebase_core: ^2.1.1
11 | url_launcher: ^6.1.8
12 | flutter_local_notifications: ^13.0.0
13 | permission_handler: ^10.2.0
14 | flutter_notification_listener:
15 | path: plugins/flutter_notification_listener
16 | fluttertoast: ^8.1.2
17 | flutter_screenutil: ^5.6.1
18 | unicons: ^2.1.0
19 | get: 4.6.5
20 | flutter:
21 | sdk: flutter
22 | device_apps: ^2.2.0
23 | cached_memory_image: ^1.3.1
24 | disable_battery_optimization: ^1.1.0+1
25 | syncfusion_flutter_xlsio: ^20.1.61-beta
26 | path_provider: ^2.0.12
27 | flutter_archive: ^5.0.0
28 | package_info_plus: ^3.0.3
29 | system_info2: ^3.0.1
30 | version: ^3.0.2
31 | ota_update:
32 | git:
33 | url: https://github.com/TechGeekD/ota_update.git
34 | ref: "master"
35 | flutter_markdown: ^0.6.14
36 | markdown: ^7.0.1
37 | chat_gpt_sdk:
38 | path: plugins/chatgpt_api
39 | flutter_chatgpt_api:
40 | path: plugins/chatgpt_api_unofficial
41 | flutter_background_service: ^2.4.6
42 | flutter_background_service_android: ^3.0.3
43 | realm: ^1.0.2
44 | firebase_crashlytics: ^3.0.15
45 | intl: ^0.18.0
46 | bubble_tab_indicator: ^0.1.6
47 | tab_indicator_styler: ^2.0.0
48 |
49 | dev_dependencies:
50 | flutter_lints: ^2.0.0
51 | build_runner: ^2.3.3
52 | flutter_test:
53 | sdk: flutter
54 |
55 | flutter:
56 | uses-material-design: true
57 |
--------------------------------------------------------------------------------
/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:nitmgpt/nitm.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 NITM());
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 |
--------------------------------------------------------------------------------