merge
This commit is contained in:
commit
da77c3969f
|
@ -8,6 +8,7 @@
|
|||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
|
@ -39,4 +40,10 @@ app.*.symbols
|
|||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
lib/generated/
|
||||
|
||||
# Android Studio will place build artifacts here
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
packages/*/pubspec.lock
|
||||
|
|
39
.metadata
39
.metadata
|
@ -1,10 +1,45 @@
|
|||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
# This file should be version controlled.
|
||||
|
||||
version:
|
||||
revision: d408d302e22179d598f467e11da5dd968dbdc9ec
|
||||
revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
channel: stable
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: android
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: ios
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: linux
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: macos
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: web
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
- platform: windows
|
||||
create_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
base_revision: 676cefaaff197f27424942307668886253e1ec35
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "all",
|
||||
"dependsOn": ["root", "gql_github", "gql_gitlab", "github_trending"]
|
||||
},
|
||||
{
|
||||
"label": "root",
|
||||
"type": "dart",
|
||||
"command": "dart",
|
||||
"args": ["run", "build_runner", "watch"]
|
||||
},
|
||||
{
|
||||
"label": "gql_github",
|
||||
"type": "dart",
|
||||
"command": "dart",
|
||||
"cwd": "packages/gql_github",
|
||||
"args": ["run", "build_runner", "watch"]
|
||||
},
|
||||
{
|
||||
"label": "gql_gitlab",
|
||||
"type": "dart",
|
||||
"command": "dart",
|
||||
"cwd": "packages/gql_gitlab",
|
||||
"args": ["run", "build_runner", "watch"]
|
||||
},
|
||||
{
|
||||
"label": "github_trending",
|
||||
"type": "dart",
|
||||
"command": "dart",
|
||||
"cwd": "packages/github_trending",
|
||||
"args": ["run", "build_runner", "watch"]
|
||||
}
|
||||
]
|
||||
}
|
21
SECURITY.md
21
SECURITY.md
|
@ -1,21 +0,0 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 5.1.x | :white_check_mark: |
|
||||
| 5.0.x | :x: |
|
||||
| 4.0.x | :white_check_mark: |
|
||||
| < 4.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
This follows contributing guidelines, as well as the follimg ones.
|
||||
1. Title the vunerablilty
|
||||
2. Describe the vunerablity in as much detail as possible
|
||||
3. Give steps on how to reproduce the vunerablilty
|
||||
4. Add media on the vunerablity, if possible
|
|
@ -1,3 +1,45 @@
|
|||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at
|
||||
# https://dart-lang.github.io/linter/lints/index.html.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
prefer_single_quotes: true
|
||||
always_use_package_imports: true
|
||||
sort_constructors_first: true
|
||||
sort_unnamed_constructors_first: true
|
||||
avoid_types_on_closure_parameters: true
|
||||
omit_local_variable_types: true
|
||||
prefer_final_in_for_each: true
|
||||
prefer_final_locals: true
|
||||
use_super_parameters: true
|
||||
use_key_in_widget_constructors: false # waiting for auto fix: https://github.com/dart-lang/sdk/issues/50056
|
||||
avoid_print: false # TODO:
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
todo: ignore
|
||||
fixme: ignore
|
||||
exclude:
|
||||
- lib/**/*.g.dart
|
||||
- "**/*.gql.dart"
|
||||
- "**/*.g.dart"
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
|
|
|
@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
|
|||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
|
|
@ -26,21 +26,29 @@ apply plugin: 'kotlin-android'
|
|||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 32 // flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "io.github.pd4d10.gittouch"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||
minSdkVersion 19 // flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.github.pd4d10.gittouch">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.github.pd4d10.gittouch">
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
<application
|
||||
android:label="GitTouch"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
|
@ -26,15 +20,6 @@
|
|||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<!-- Displays an Android View that continues showing the launch screen
|
||||
Drawable until Flutter paints its first frame, then this splash
|
||||
screen fades out. A splash screen is useful to avoid any visual
|
||||
gap between the end of Android's launch screen and the painting of
|
||||
Flutter's first frame. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.SplashScreenDrawable"
|
||||
android:resource="@drawable/launch_background"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
Flutter draws its first frame -->
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">@android:color/white</item>
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.github.pd4d10.gittouch">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = '1.3.50'
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ buildscript {
|
|||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
|
|
56
build.yaml
56
build.yaml
|
@ -1,56 +0,0 @@
|
|||
targets:
|
||||
$default:
|
||||
builders:
|
||||
gql_build|ast_builder:
|
||||
enabled: true
|
||||
gql_build|schema_builder:
|
||||
enabled: true
|
||||
options:
|
||||
schema: git_touch|lib/graphql/schema.graphql
|
||||
type_overrides:
|
||||
DateTime:
|
||||
name: DateTime
|
||||
URI:
|
||||
name: String
|
||||
GitObjectID:
|
||||
name: String
|
||||
gql_build|data_builder:
|
||||
enabled: true
|
||||
options:
|
||||
schema: git_touch|lib/graphql/schema.graphql
|
||||
type_overrides:
|
||||
DateTime:
|
||||
name: DateTime
|
||||
URI:
|
||||
name: String
|
||||
GitObjectID:
|
||||
name: String
|
||||
gql_build|var_builder:
|
||||
enabled: true
|
||||
options:
|
||||
schema: git_touch|lib/graphql/schema.graphql
|
||||
type_overrides:
|
||||
DateTime:
|
||||
name: DateTime
|
||||
URI:
|
||||
name: String
|
||||
GitObjectID:
|
||||
name: String
|
||||
gql_build|serializer_builder:
|
||||
enabled: true
|
||||
options:
|
||||
schema: git_touch|lib/graphql/schema.graphql
|
||||
custom_serializers:
|
||||
- import: package:git_touch/utils/date_time_serializer.dart
|
||||
name: DateTimeSerializer
|
||||
ferry_generator|req_builder:
|
||||
enabled: true
|
||||
options:
|
||||
schema: git_touch|lib/graphql/schema.graphql
|
||||
type_overrides:
|
||||
DateTime:
|
||||
name: DateTime
|
||||
URI:
|
||||
name: String
|
||||
GitObjectID:
|
||||
name: String
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +1,4 @@
|
|||
**/dgph
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
|
@ -18,6 +19,7 @@ Flutter/App.framework
|
|||
Flutter/Flutter.framework
|
||||
Flutter/Flutter.podspec
|
||||
Flutter/Generated.xcconfig
|
||||
Flutter/ephemeral/
|
||||
Flutter/app.flx
|
||||
Flutter/app.zip
|
||||
Flutter/flutter_assets/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
|
@ -21,6 +21,6 @@
|
|||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.0</string>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '9.0'
|
||||
# platform :ios, '11.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
|
|
@ -2,39 +2,42 @@ PODS:
|
|||
- Flutter (1.0.0)
|
||||
- launch_review (0.0.1):
|
||||
- Flutter
|
||||
- package_info (0.0.1):
|
||||
- maps_launcher (0.0.1):
|
||||
- Flutter
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- Sentry (7.1.3):
|
||||
- Sentry/Core (= 7.1.3)
|
||||
- Sentry/Core (7.1.3)
|
||||
- path_provider_ios (0.0.1):
|
||||
- Flutter
|
||||
- Sentry (7.27.1):
|
||||
- Sentry/Core (= 7.27.1)
|
||||
- Sentry/Core (7.27.1)
|
||||
- sentry_flutter (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- Sentry (~> 7.1.3)
|
||||
- share (0.0.1):
|
||||
- Sentry (~> 7.27.1)
|
||||
- share_plus (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences (0.0.1):
|
||||
- shared_preferences_ios (0.0.1):
|
||||
- Flutter
|
||||
- uni_links (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher (0.0.1):
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
- webview_flutter (0.0.1):
|
||||
- webview_flutter_wkwebview (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- launch_review (from `.symlinks/plugins/launch_review/ios`)
|
||||
- package_info (from `.symlinks/plugins/package_info/ios`)
|
||||
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
|
||||
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
|
||||
- share (from `.symlinks/plugins/share/ios`)
|
||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
|
||||
- uni_links (from `.symlinks/plugins/uni_links/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
|
@ -45,36 +48,39 @@ EXTERNAL SOURCES:
|
|||
:path: Flutter
|
||||
launch_review:
|
||||
:path: ".symlinks/plugins/launch_review/ios"
|
||||
package_info:
|
||||
:path: ".symlinks/plugins/package_info/ios"
|
||||
maps_launcher:
|
||||
:path: ".symlinks/plugins/maps_launcher/ios"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
path_provider_ios:
|
||||
:path: ".symlinks/plugins/path_provider_ios/ios"
|
||||
sentry_flutter:
|
||||
:path: ".symlinks/plugins/sentry_flutter/ios"
|
||||
share:
|
||||
:path: ".symlinks/plugins/share/ios"
|
||||
shared_preferences:
|
||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||
share_plus:
|
||||
:path: ".symlinks/plugins/share_plus/ios"
|
||||
shared_preferences_ios:
|
||||
:path: ".symlinks/plugins/shared_preferences_ios/ios"
|
||||
uni_links:
|
||||
:path: ".symlinks/plugins/uni_links/ios"
|
||||
url_launcher:
|
||||
:path: ".symlinks/plugins/url_launcher/ios"
|
||||
webview_flutter:
|
||||
:path: ".symlinks/plugins/webview_flutter/ios"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
webview_flutter_wkwebview:
|
||||
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
launch_review: 75d5a956ba8eaa493e9c9d4bf4c05e505e8d5ed0
|
||||
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
||||
maps_launcher: 2e5b6a2d664ec6c27f82ffa81b74228d770ab203
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
Sentry: 6d963d64804dd06d96e778be729613f481394312
|
||||
sentry_flutter: f20d4f199442900fbdab2b8496f1d2091d8b94d9
|
||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
|
||||
Sentry: bc644307e2eb6a4c9c55cf117a80b895bb2a25a7
|
||||
sentry_flutter: 649559f0512e00d3f6fc92cf51f74bc2fe68d1d3
|
||||
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
||||
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
|
||||
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||
webview_flutter: 9f491a9b5a66f2573946a389b2677987b0ff8c0b
|
||||
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
|
||||
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f
|
||||
|
||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
||||
|
||||
COCOAPODS: 1.10.1
|
||||
COCOAPODS: 1.11.3
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
37EE18F57BCDEA525EB92F36 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B20C9E04554129631AB8EE78 /* Pods_Runner.framework */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
FA131E1B3A78EEDD359ED551 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75205C87EE834F576A3F9103 /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
|
@ -30,14 +30,15 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
03BC239D24FE0B4D9A1D2D83 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
346CC1AE8457DF6B48B85A03 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2F67270DBA3C43464E2F44EE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
75205C87EE834F576A3F9103 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
9220593D71312B73EFB9B261 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
@ -45,8 +46,7 @@
|
|||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AE6CD52BC7D64064E7B512FF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
B20C9E04554129631AB8EE78 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B984CAF4E26B4FACF6C11EC5 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -54,24 +54,13 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37EE18F57BCDEA525EB92F36 /* Pods_Runner.framework in Frameworks */,
|
||||
FA131E1B3A78EEDD359ED551 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2E2AB605F70DF2344A2B9E92 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AE6CD52BC7D64064E7B512FF /* Pods-Runner.debug.xcconfig */,
|
||||
346CC1AE8457DF6B48B85A03 /* Pods-Runner.release.xcconfig */,
|
||||
03BC239D24FE0B4D9A1D2D83 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -89,8 +78,8 @@
|
|||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
2E2AB605F70DF2344A2B9E92 /* Pods */,
|
||||
A3B00A29EAF11D6D1B02DEAB /* Frameworks */,
|
||||
A28BA2DF970A8F973E2CD5D0 /* Pods */,
|
||||
B48C5EFD064AE0D1E1B42C23 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -117,10 +106,21 @@
|
|||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A3B00A29EAF11D6D1B02DEAB /* Frameworks */ = {
|
||||
A28BA2DF970A8F973E2CD5D0 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B20C9E04554129631AB8EE78 /* Pods_Runner.framework */,
|
||||
2F67270DBA3C43464E2F44EE /* Pods-Runner.debug.xcconfig */,
|
||||
9220593D71312B73EFB9B261 /* Pods-Runner.release.xcconfig */,
|
||||
B984CAF4E26B4FACF6C11EC5 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B48C5EFD064AE0D1E1B42C23 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
75205C87EE834F576A3F9103 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
|
@ -132,14 +132,14 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
CB11531C1F26F7678F621EA7 /* [CP] Check Pods Manifest.lock */,
|
||||
2B6DD7B668196BD9756C3725 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
58A5FDDED951DFF2FCF219F9 /* [CP] Embed Pods Frameworks */,
|
||||
C34908B9EA82FDA61F8BDAA0 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
@ -156,7 +156,7 @@
|
|||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1020;
|
||||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
|
@ -198,52 +198,7 @@
|
|||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
58A5FDDED951DFF2FCF219F9 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
CB11531C1F26F7678F621EA7 /* [CP] Check Pods Manifest.lock */ = {
|
||||
2B6DD7B668196BD9756C3725 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
|
@ -265,6 +220,51 @@
|
|||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
C34908B9EA82FDA61F8BDAA0 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
@ -340,7 +340,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
|
@ -357,15 +357,10 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.github.pd4d10.gitTouch;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -422,7 +417,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -471,11 +466,12 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
|
@ -489,15 +485,10 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.github.pd4d10.gitTouch;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -516,15 +507,10 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.github.pd4d10.gitTouch;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -27,8 +27,6 @@
|
|||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
|
@ -38,8 +36,8 @@
|
|||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
|
@ -61,8 +59,6 @@
|
|||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -4,11 +4,6 @@
|
|||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleLocalizations</key>
|
||||
<array>
|
||||
<string>en</string>
|
||||
<string>hi</string>
|
||||
</array>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>GitTouch</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
|
@ -63,5 +58,7 @@
|
|||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
119
lib/app.dart
119
lib/app.dart
|
@ -1,78 +1,77 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/home.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/router.dart';
|
||||
import 'package:intl/locale.dart' as l;
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
final LocaleListResolutionCallback localeListResolutionCallback =
|
||||
(locales, supportedLocales) {
|
||||
// 1. user set locale
|
||||
// 2. system locale
|
||||
try {
|
||||
if (theme.locale != null) {
|
||||
final intlLocale = l.Locale.parse(theme.locale!);
|
||||
locales = [
|
||||
Locale.fromSubtags(
|
||||
languageCode: intlLocale.languageCode,
|
||||
countryCode: intlLocale.countryCode,
|
||||
scriptCode: intlLocale.scriptCode,
|
||||
),
|
||||
...locales!
|
||||
];
|
||||
}
|
||||
} catch (err) {
|
||||
print(err);
|
||||
}
|
||||
|
||||
for (final locale in locales!) {
|
||||
// this is necessary because Flutter only handles zh_Hans -> zh
|
||||
// and would not handle non-exist language code
|
||||
if (AppLocalizations.delegate.isSupported(locale)) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. if none match, use the default
|
||||
return supportedLocales.firstWhere((l) => l.languageCode == 'en');
|
||||
};
|
||||
|
||||
return Container(
|
||||
return AntTheme(
|
||||
key: auth.rootKey,
|
||||
child: theme.theme == AppThemeType.cupertino
|
||||
? CupertinoApp(
|
||||
theme: CupertinoThemeData(brightness: theme.brightness),
|
||||
home: Home(),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
localeListResolutionCallback: localeListResolutionCallback,
|
||||
)
|
||||
: MaterialApp(
|
||||
theme: ThemeData(
|
||||
brightness: theme.brightness,
|
||||
primaryColor:
|
||||
theme.brightness == Brightness.dark ? null : Colors.white,
|
||||
accentColor: theme.palette.primary,
|
||||
scaffoldBackgroundColor: theme.palette.background,
|
||||
pageTransitionsTheme: PageTransitionsTheme(
|
||||
builders: {
|
||||
TargetPlatform.android: ZoomPageTransitionsBuilder(),
|
||||
},
|
||||
data: AntThemeData(brightness: theme.brightness),
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
final antTheme = AntTheme.of(context);
|
||||
|
||||
return CupertinoApp.router(
|
||||
routeInformationProvider: router.routeInformationProvider,
|
||||
routeInformationParser: router.routeInformationParser,
|
||||
routerDelegate: router.routerDelegate,
|
||||
theme: CupertinoThemeData(
|
||||
brightness: theme.brightness,
|
||||
primaryColor: antTheme.colorPrimary,
|
||||
scaffoldBackgroundColor: antTheme.colorBox,
|
||||
textTheme: CupertinoTextThemeData(
|
||||
textStyle: TextStyle(
|
||||
fontSize: antTheme.fontSizeMain,
|
||||
color: antTheme.colorText,
|
||||
),
|
||||
),
|
||||
home: Home(),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
localeListResolutionCallback: localeListResolutionCallback,
|
||||
),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
localeListResolutionCallback: (locales, supportedLocales) {
|
||||
// 1. user set locale
|
||||
// 2. system locale
|
||||
try {
|
||||
if (theme.locale != null) {
|
||||
final intlLocale = l.Locale.parse(theme.locale!);
|
||||
locales = [
|
||||
Locale.fromSubtags(
|
||||
languageCode: intlLocale.languageCode,
|
||||
countryCode: intlLocale.countryCode,
|
||||
scriptCode: intlLocale.scriptCode,
|
||||
),
|
||||
...locales!
|
||||
];
|
||||
}
|
||||
} catch (err) {
|
||||
print(err);
|
||||
}
|
||||
|
||||
for (final locale in locales!) {
|
||||
// this is necessary because Flutter only handles zh_Hans -> zh
|
||||
// and would not handle non-exist language code
|
||||
if (AppLocalizations.delegate.isSupported(locale)) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. if none match, use the default
|
||||
return supportedLocales.firstWhere((l) => l.languageCode == 'en');
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
159
lib/home.dart
159
lib/home.dart
|
@ -1,39 +1,40 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/notification.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/screens/bb_explore.dart';
|
||||
import 'package:git_touch/screens/bb_teams.dart';
|
||||
import 'package:git_touch/screens/bb_user.dart';
|
||||
import 'package:git_touch/screens/ge_search.dart';
|
||||
import 'package:git_touch/screens/ge_user.dart';
|
||||
import 'package:git_touch/screens/gh_news.dart';
|
||||
import 'package:git_touch/screens/gh_notification.dart';
|
||||
import 'package:git_touch/screens/gh_search.dart';
|
||||
import 'package:git_touch/screens/gh_trending.dart';
|
||||
import 'package:git_touch/screens/gh_user.dart';
|
||||
import 'package:git_touch/screens/gl_explore.dart';
|
||||
import 'package:git_touch/screens/gl_groups.dart';
|
||||
import 'package:git_touch/screens/gl_search.dart';
|
||||
import 'package:git_touch/screens/gl_user.dart';
|
||||
import 'package:git_touch/screens/go_search.dart';
|
||||
import 'package:git_touch/screens/go_user.dart';
|
||||
import 'package:git_touch/screens/gt_orgs.dart';
|
||||
import 'package:git_touch/screens/gt_user.dart';
|
||||
import 'package:git_touch/screens/gl_explore.dart';
|
||||
import 'package:git_touch/screens/gl_groups.dart';
|
||||
import 'package:git_touch/screens/gl_user.dart';
|
||||
import 'package:git_touch/screens/login.dart';
|
||||
import 'package:git_touch/screens/gh_notification.dart';
|
||||
import 'package:git_touch/screens/gh_user.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:launch_review/launch_review.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/screens/gh_news.dart';
|
||||
import 'package:git_touch/screens/gh_search.dart';
|
||||
import 'package:git_touch/screens/gh_trending.dart';
|
||||
import 'package:git_touch/screens/ge_search.dart';
|
||||
import 'package:github/github.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:launch_review/launch_review.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
class Home extends StatefulWidget {
|
||||
@override
|
||||
_HomeState createState() => _HomeState();
|
||||
State<Home> createState() => _HomeState();
|
||||
}
|
||||
|
||||
class _HomeState extends State<Home> {
|
||||
|
@ -47,7 +48,7 @@ class _HomeState extends State<Home> {
|
|||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
Future.delayed(Duration(seconds: 5), () async {
|
||||
Future.delayed(const Duration(seconds: 5), () async {
|
||||
final latest = await GitHub()
|
||||
.repositories
|
||||
.getLatestRelease(RepositorySlug.full('git-touch/git-touch'));
|
||||
|
@ -57,13 +58,13 @@ class _HomeState extends State<Home> {
|
|||
.compareTo(Version.parse(current)) ==
|
||||
1) {
|
||||
final res = await context.read<ThemeModel>().showConfirm(context,
|
||||
Text('New version released. Would you like to download it?'));
|
||||
const Text('New version released. Would you like to download it?'));
|
||||
if (res == true) {
|
||||
if (Platform.isIOS) {
|
||||
// go to app store
|
||||
LaunchReview.launch(writeReview: false);
|
||||
} else {
|
||||
context.read<ThemeModel>().push(context, latest.htmlUrl!);
|
||||
context.pushUrl(latest.htmlUrl!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +92,7 @@ class _HomeState extends State<Home> {
|
|||
case 3:
|
||||
return GhSearchScreen();
|
||||
case 4:
|
||||
return GhViewer();
|
||||
return const GhViewerScreen();
|
||||
}
|
||||
break;
|
||||
case PlatformType.gitlab:
|
||||
|
@ -103,7 +104,7 @@ class _HomeState extends State<Home> {
|
|||
case 2:
|
||||
return GlSearchScreen();
|
||||
case 3:
|
||||
return GlUserScreen(null);
|
||||
return const GlUserScreen(null);
|
||||
}
|
||||
break;
|
||||
case PlatformType.bitbucket:
|
||||
|
@ -113,13 +114,13 @@ class _HomeState extends State<Home> {
|
|||
case 1:
|
||||
return BbTeamsScreen();
|
||||
case 2:
|
||||
return BbUserScreen(null);
|
||||
return const BbUserScreen(null);
|
||||
}
|
||||
break;
|
||||
case PlatformType.gitea:
|
||||
switch (index) {
|
||||
case 0:
|
||||
return GtOrgsScreen();
|
||||
return const GtOrgsScreen();
|
||||
case 1:
|
||||
return GtUserScreen(auth.activeAccount!.login, isViewer: true);
|
||||
}
|
||||
|
@ -143,8 +144,7 @@ class _HomeState extends State<Home> {
|
|||
}
|
||||
|
||||
Widget _buildNotificationIcon(BuildContext context, IconData iconData) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
int count = Provider.of<NotificationModel>(context).count;
|
||||
final count = Provider.of<NotificationModel>(context).count;
|
||||
if (count == 0) {
|
||||
return Icon(iconData);
|
||||
}
|
||||
|
@ -154,10 +154,11 @@ class _HomeState extends State<Home> {
|
|||
children: <Widget>[
|
||||
Icon(iconData),
|
||||
Positioned(
|
||||
right: -2,
|
||||
top: -2,
|
||||
child: Icon(Octicons.primitive_dot,
|
||||
color: theme.palette.primary, size: 14))
|
||||
right: -2,
|
||||
top: -2,
|
||||
child: Icon(Octicons.dot_fill,
|
||||
color: AntTheme.of(context).colorPrimary, size: 14),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -180,23 +181,23 @@ class _HomeState extends State<Home> {
|
|||
|
||||
List<BottomNavigationBarItem> _buildNavigationItems(String platform) {
|
||||
final search = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.search_outline),
|
||||
activeIcon: Icon(Ionicons.search),
|
||||
icon: const Icon(Ionicons.search_outline),
|
||||
activeIcon: const Icon(Ionicons.search),
|
||||
label: AppLocalizations.of(context)!.search,
|
||||
);
|
||||
final group = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.people_outline),
|
||||
activeIcon: Icon(Ionicons.people),
|
||||
icon: const Icon(Ionicons.people_outline),
|
||||
activeIcon: const Icon(Ionicons.people),
|
||||
label: AppLocalizations.of(context)!.organizations,
|
||||
);
|
||||
final me = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.person_outline),
|
||||
activeIcon: Icon(Ionicons.person),
|
||||
icon: const Icon(Ionicons.person_outline),
|
||||
activeIcon: const Icon(Ionicons.person),
|
||||
label: AppLocalizations.of(context)!.me,
|
||||
);
|
||||
final explore = BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.compass_outline),
|
||||
activeIcon: Icon(Ionicons.compass),
|
||||
icon: const Icon(Ionicons.compass_outline),
|
||||
activeIcon: const Icon(Ionicons.compass),
|
||||
label: AppLocalizations.of(context)!.explore,
|
||||
);
|
||||
|
||||
|
@ -204,8 +205,8 @@ class _HomeState extends State<Home> {
|
|||
case PlatformType.github:
|
||||
return [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.newspaper_outline),
|
||||
activeIcon: Icon(Ionicons.newspaper),
|
||||
icon: const Icon(Ionicons.newspaper_outline),
|
||||
activeIcon: const Icon(Ionicons.newspaper),
|
||||
label: AppLocalizations.of(context)!.news,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
|
@ -215,8 +216,8 @@ class _HomeState extends State<Home> {
|
|||
label: AppLocalizations.of(context)!.notification,
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Ionicons.flame_outline),
|
||||
activeIcon: Icon(Ionicons.flame),
|
||||
icon: const Icon(Ionicons.flame_outline),
|
||||
activeIcon: const Icon(Ionicons.flame),
|
||||
label: AppLocalizations.of(context)!.trending,
|
||||
),
|
||||
search,
|
||||
|
@ -238,7 +239,6 @@ class _HomeState extends State<Home> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
|
||||
if (auth.activeAccount == null) {
|
||||
|
@ -247,56 +247,35 @@ class _HomeState extends State<Home> {
|
|||
|
||||
final navigationItems = _buildNavigationItems(auth.activeAccount!.platform);
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return !(await getNavigatorKey(auth.activeTab)
|
||||
.currentState
|
||||
?.maybePop())!;
|
||||
},
|
||||
child: CupertinoTabScaffold(
|
||||
tabBuilder: (context, index) {
|
||||
return CupertinoTabView(
|
||||
navigatorKey: getNavigatorKey(index),
|
||||
builder: (context) {
|
||||
return _buildScreen(index);
|
||||
},
|
||||
);
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return !(await getNavigatorKey(auth.activeTab)
|
||||
.currentState
|
||||
?.maybePop())!;
|
||||
},
|
||||
child: CupertinoTabScaffold(
|
||||
tabBuilder: (context, index) {
|
||||
return CupertinoTabView(
|
||||
navigatorKey: getNavigatorKey(index),
|
||||
builder: (context) {
|
||||
return _buildScreen(index);
|
||||
},
|
||||
tabBar: CupertinoTabBar(
|
||||
items: navigationItems,
|
||||
currentIndex: auth.activeTab,
|
||||
onTap: (index) {
|
||||
if (auth.activeTab == index) {
|
||||
getNavigatorKey(index)
|
||||
.currentState
|
||||
?.popUntil((route) => route.isFirst);
|
||||
} else {
|
||||
auth.setActiveTab(index);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
default:
|
||||
return Scaffold(
|
||||
body: IndexedStack(
|
||||
index: auth.activeTab,
|
||||
children: [
|
||||
for (var i = 0; i < navigationItems.length; i++) _buildScreen(i)
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
selectedItemColor: theme.palette.primary,
|
||||
items: navigationItems,
|
||||
currentIndex: auth.activeTab,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: (int index) {
|
||||
);
|
||||
},
|
||||
tabBar: CupertinoTabBar(
|
||||
items: navigationItems,
|
||||
currentIndex: auth.activeTab,
|
||||
onTap: (index) {
|
||||
if (auth.activeTab == index) {
|
||||
getNavigatorKey(index)
|
||||
.currentState
|
||||
?.popUntil((route) => route.isFirst);
|
||||
} else {
|
||||
auth.setActiveTab(index);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,18 +115,6 @@
|
|||
"@dark": {
|
||||
"description": "dark mode"
|
||||
},
|
||||
"scaffoldTheme": "Scaffold Theme",
|
||||
"@scaffoldTheme": {
|
||||
"description": "Kind of theme - cupertino or material"
|
||||
},
|
||||
"cupertino": "Cupertino",
|
||||
"@cupertino": {
|
||||
"description": "Cupertino scaffold theme"
|
||||
},
|
||||
"material": "Material",
|
||||
"@material": {
|
||||
"description": "Material scaffold theme"
|
||||
},
|
||||
"codeTheme": "Code Theme",
|
||||
"@codeTheme": {
|
||||
"description": "code theme"
|
||||
|
@ -494,7 +482,7 @@
|
|||
},
|
||||
"reviewed": "reviewed",
|
||||
"@reviewed": {
|
||||
"description": "reviewed"
|
||||
"description": "reviewed"
|
||||
},
|
||||
"mergedEventMessage": "merged commit {commit} into {mergeRefName}",
|
||||
"@mergedEventMessage": {
|
||||
|
@ -692,10 +680,10 @@
|
|||
"description": "example: repo1,repo2 were added to the installation id ID",
|
||||
"placeholders": {
|
||||
"repos": {
|
||||
"type": "String"
|
||||
"type": "String"
|
||||
},
|
||||
"id": {
|
||||
"type": "String"
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -707,7 +695,7 @@
|
|||
"type": "String"
|
||||
},
|
||||
"id": {
|
||||
"type": "String"
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -749,7 +737,7 @@
|
|||
},
|
||||
"was": "was",
|
||||
"@was": {
|
||||
"description": "was"
|
||||
"description": "was"
|
||||
},
|
||||
"convertProjectCard": "converted the project card into an issue",
|
||||
"@convertProjectCard": {
|
||||
|
@ -785,7 +773,7 @@
|
|||
},
|
||||
"made": "made",
|
||||
"@made": {
|
||||
"description": "made"
|
||||
"description": "made"
|
||||
},
|
||||
"public": "public",
|
||||
"@public": {
|
||||
|
@ -825,7 +813,7 @@
|
|||
"type": "String"
|
||||
},
|
||||
"affectedRange": {
|
||||
"type": "String"
|
||||
"type": "String"
|
||||
},
|
||||
"action": {
|
||||
"type": "String"
|
||||
|
@ -840,7 +828,7 @@
|
|||
"type": "String"
|
||||
},
|
||||
"action": {
|
||||
"type": "String"
|
||||
"type": "String"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/app.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
import 'package:git_touch/models/notification.dart';
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
void main() async {
|
||||
|
@ -29,39 +25,6 @@ void main() async {
|
|||
codeModel.init(),
|
||||
]);
|
||||
|
||||
CommonRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(CommonRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
GitlabRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(GitlabRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
GiteaRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(GiteaRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
BitbucketRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(BitbucketRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
GithubRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(GithubRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
GiteeRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(GiteeRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
GogsRouter.routes.forEach((screen) {
|
||||
themeModel.router.define(GogsRouter.prefix + screen.path,
|
||||
handler: Handler(handlerFunc: screen.handler));
|
||||
});
|
||||
// To match status bar color to app bar color
|
||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
));
|
||||
|
||||
runApp(MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(create: (context) => notificationModel),
|
||||
|
@ -69,7 +32,7 @@ void main() async {
|
|||
ChangeNotifierProvider(create: (context) => authModel),
|
||||
ChangeNotifierProvider(create: (context) => codeModel),
|
||||
],
|
||||
child: MyApp(),
|
||||
child: const MyApp(),
|
||||
));
|
||||
},
|
||||
);
|
||||
|
|
|
@ -4,14 +4,7 @@ part 'account.g.dart';
|
|||
|
||||
@JsonSerializable(includeIfNull: false)
|
||||
class Account {
|
||||
String platform;
|
||||
String domain;
|
||||
String token;
|
||||
String login;
|
||||
String avatarUrl;
|
||||
int? gitlabId; // For GitLab
|
||||
String? appPassword; // For Bitbucket
|
||||
String? accountId; // For Bitbucket
|
||||
// For Bitbucket
|
||||
|
||||
// equals(Account a) {
|
||||
// final uri = Uri.parse(domain);
|
||||
|
@ -38,6 +31,14 @@ class Account {
|
|||
|
||||
factory Account.fromJson(Map<String, dynamic> json) =>
|
||||
_$AccountFromJson(json);
|
||||
String platform;
|
||||
String domain;
|
||||
String token;
|
||||
String login;
|
||||
String avatarUrl;
|
||||
int? gitlabId; // For GitLab
|
||||
String? appPassword; // For Bitbucket
|
||||
String? accountId;
|
||||
|
||||
Map<String, dynamic> toJson() => _$AccountToJson(this);
|
||||
}
|
||||
|
|
|
@ -6,18 +6,16 @@ part of 'account.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Account _$AccountFromJson(Map<String, dynamic> json) {
|
||||
return Account(
|
||||
platform: json['platform'] as String,
|
||||
domain: json['domain'] as String,
|
||||
token: json['token'] as String,
|
||||
login: json['login'] as String,
|
||||
avatarUrl: json['avatarUrl'] as String,
|
||||
gitlabId: json['gitlabId'] as int?,
|
||||
appPassword: json['appPassword'] as String?,
|
||||
accountId: json['accountId'] as String?,
|
||||
);
|
||||
}
|
||||
Account _$AccountFromJson(Map<String, dynamic> json) => Account(
|
||||
platform: json['platform'] as String,
|
||||
domain: json['domain'] as String,
|
||||
token: json['token'] as String,
|
||||
login: json['login'] as String,
|
||||
avatarUrl: json['avatarUrl'] as String,
|
||||
gitlabId: json['gitlabId'] as int?,
|
||||
appPassword: json['appPassword'] as String?,
|
||||
accountId: json['accountId'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AccountToJson(Account instance) {
|
||||
final val = <String, dynamic>{
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:ferry/ferry.dart';
|
||||
import 'package:git_touch/utils/nil_store.dart';
|
||||
// import 'package:in_app_review/in_app_review.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
import 'package:fimber/fimber.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/models/account.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/models/gitea.dart';
|
||||
import 'package:git_touch/models/gitee.dart';
|
||||
import 'package:git_touch/models/gitlab.dart';
|
||||
import 'package:git_touch/models/gogs.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:github/github.dart';
|
||||
import 'package:gql_http_link/gql_http_link.dart';
|
||||
import 'package:fimber/fimber.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:uni_links/uni_links.dart';
|
||||
import 'package:nanoid/nanoid.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'account.dart';
|
||||
import 'gitlab.dart';
|
||||
import 'gogs.dart';
|
||||
import 'package:uni_links/uni_links.dart';
|
||||
// import 'package:in_app_review/in_app_review.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
const clientId = 'df930d7d2e219f26142a';
|
||||
|
||||
|
@ -34,16 +34,16 @@ class PlatformType {
|
|||
}
|
||||
|
||||
class DataWithPage<T> {
|
||||
T data;
|
||||
int cursor;
|
||||
bool hasMore;
|
||||
int total;
|
||||
DataWithPage({
|
||||
required this.data,
|
||||
required this.cursor,
|
||||
required this.hasMore,
|
||||
required this.total,
|
||||
});
|
||||
T data;
|
||||
int cursor;
|
||||
bool hasMore;
|
||||
int total;
|
||||
}
|
||||
|
||||
class AuthModel with ChangeNotifier {
|
||||
|
@ -85,7 +85,7 @@ class AuthModel with ChangeNotifier {
|
|||
|
||||
// https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow
|
||||
Future<void> _onSchemeDetected(Uri? uri) async {
|
||||
await closeWebView();
|
||||
await closeInAppWebView();
|
||||
|
||||
loading = true;
|
||||
notifyListeners();
|
||||
|
@ -107,7 +107,7 @@ class AuthModel with ChangeNotifier {
|
|||
await loginWithToken(token);
|
||||
}
|
||||
|
||||
Future<void> loginWithToken(String token) async {
|
||||
Future<void> loginWithToken(String t) async {
|
||||
try {
|
||||
final queryData = await query('''
|
||||
{
|
||||
|
@ -116,12 +116,12 @@ class AuthModel with ChangeNotifier {
|
|||
avatarUrl
|
||||
}
|
||||
}
|
||||
''', token);
|
||||
''', t);
|
||||
|
||||
await _addAccount(Account(
|
||||
platform: PlatformType.github,
|
||||
domain: 'https://github.com',
|
||||
token: token,
|
||||
token: t,
|
||||
login: queryData['viewer']['login'] as String,
|
||||
avatarUrl: queryData['viewer']['avatarUrl'] as String,
|
||||
));
|
||||
|
@ -144,11 +144,7 @@ class AuthModel with ChangeNotifier {
|
|||
throw info['message'];
|
||||
}
|
||||
if (info['error'] != null) {
|
||||
throw info['error'] +
|
||||
'. ' +
|
||||
(info['error_description'] != null
|
||||
? info['error_description']
|
||||
: '');
|
||||
throw info['error'] + '. ' + (info['error_description'] ?? '');
|
||||
}
|
||||
final user = GitlabUser.fromJson(info);
|
||||
await _addAccount(Account(
|
||||
|
@ -204,7 +200,7 @@ class AuthModel with ChangeNotifier {
|
|||
hasMore: next != null,
|
||||
total: int.tryParse(
|
||||
res.headers['X-Total'] ?? res.headers['x-total'] ?? '') ??
|
||||
TOTAL_COUNT_FALLBACK,
|
||||
kTotalCountFallback,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -241,7 +237,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
late http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -289,7 +285,7 @@ class AuthModel with ChangeNotifier {
|
|||
Future<DataWithPage> fetchGiteaWithPage(String path,
|
||||
{int? page, int? limit}) async {
|
||||
page = page ?? 1;
|
||||
limit = limit ?? PAGE_SIZE;
|
||||
limit = limit ?? kPageSize;
|
||||
|
||||
var uri = Uri.parse('${activeAccount!.domain}/api/v1$path');
|
||||
uri = uri.replace(
|
||||
|
@ -305,9 +301,9 @@ class AuthModel with ChangeNotifier {
|
|||
return DataWithPage(
|
||||
data: info,
|
||||
cursor: page + 1,
|
||||
hasMore: info is List && info.length > 0,
|
||||
hasMore: info is List && info.isNotEmpty,
|
||||
total: int.tryParse(res.headers['x-total-count'] ?? '') ??
|
||||
TOTAL_COUNT_FALLBACK,
|
||||
kTotalCountFallback,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -345,7 +341,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
late http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -393,7 +389,7 @@ class AuthModel with ChangeNotifier {
|
|||
Future<DataWithPage> fetchGogsWithPage(String path,
|
||||
{int? page, int? limit}) async {
|
||||
page = page ?? 1;
|
||||
limit = limit ?? PAGE_SIZE;
|
||||
limit = limit ?? kPageSize;
|
||||
|
||||
var uri = Uri.parse('${activeAccount!.domain}/api/v1$path');
|
||||
uri = uri.replace(
|
||||
|
@ -409,9 +405,9 @@ class AuthModel with ChangeNotifier {
|
|||
return DataWithPage(
|
||||
data: info,
|
||||
cursor: page + 1,
|
||||
hasMore: info is List && info.length > 0,
|
||||
hasMore: info is List && info.isNotEmpty,
|
||||
total: int.tryParse(res.headers['x-total-count'] ?? '') ??
|
||||
TOTAL_COUNT_FALLBACK,
|
||||
kTotalCountFallback,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -421,7 +417,7 @@ class AuthModel with ChangeNotifier {
|
|||
Map<String, dynamic> body = const {},
|
||||
}) async {
|
||||
http.Response res;
|
||||
Map<String, String> headers = {
|
||||
final headers = <String, String>{
|
||||
'Authorization': 'token $token',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
};
|
||||
|
@ -480,7 +476,7 @@ class AuthModel with ChangeNotifier {
|
|||
Future<DataWithPage> fetchGiteeWithPage(String path,
|
||||
{int? page, int? limit}) async {
|
||||
page = page ?? 1;
|
||||
limit = limit ?? PAGE_SIZE;
|
||||
limit = limit ?? kPageSize;
|
||||
|
||||
var uri = Uri.parse('${activeAccount!.domain}/api/v5$path');
|
||||
uri = uri.replace(
|
||||
|
@ -495,7 +491,7 @@ class AuthModel with ChangeNotifier {
|
|||
|
||||
final totalPage = int.tryParse(res.headers['total_page'] ?? '');
|
||||
final totalCount =
|
||||
int.tryParse(res.headers['total_count'] ?? '') ?? TOTAL_COUNT_FALLBACK;
|
||||
int.tryParse(res.headers['total_count'] ?? '') ?? kTotalCountFallback;
|
||||
|
||||
return DataWithPage(
|
||||
data: info,
|
||||
|
@ -546,7 +542,7 @@ class AuthModel with ChangeNotifier {
|
|||
userInfo: '${activeAccount!.login}:${activeAccount!.appPassword}',
|
||||
path: input.path,
|
||||
queryParameters: {
|
||||
'pagelen': PAGE_SIZE.toString(),
|
||||
'pagelen': kPageSize.toString(),
|
||||
...input.queryParameters
|
||||
},
|
||||
);
|
||||
|
@ -615,11 +611,11 @@ class AuthModel with ChangeNotifier {
|
|||
Fimber.e('getUriLinksStream failed', ex: err);
|
||||
});
|
||||
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
// Read accounts
|
||||
try {
|
||||
String? str = prefs.getString(StorageKeys.accounts);
|
||||
final str = prefs.getString(StorageKeys.accounts);
|
||||
// Fimber.d('read accounts: $str');
|
||||
_accounts = (json.decode(str ?? '[]') as List)
|
||||
.map((item) => Account.fromJson(item))
|
||||
|
@ -668,7 +664,8 @@ class AuthModel with ChangeNotifier {
|
|||
StorageKeys.getDefaultStartTabKey(activeAccount!.platform)) ??
|
||||
0;
|
||||
_ghClient = null;
|
||||
_gqlClient = null;
|
||||
_ghGqlClient = null;
|
||||
_glGqlClient = null;
|
||||
notifyListeners();
|
||||
|
||||
// TODO: strategy
|
||||
|
@ -684,41 +681,48 @@ class AuthModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
// http timeout
|
||||
var _timeoutDuration = Duration(seconds: 10);
|
||||
final _timeoutDuration = const Duration(seconds: 10);
|
||||
// var _timeoutDuration = Duration(seconds: 1);
|
||||
|
||||
GitHub? _ghClient;
|
||||
GitHub get ghClient {
|
||||
if (_ghClient == null) {
|
||||
_ghClient = GitHub(auth: Authentication.withToken(token));
|
||||
}
|
||||
_ghClient ??= GitHub(auth: Authentication.withToken(token));
|
||||
return _ghClient!;
|
||||
}
|
||||
|
||||
Client? _gqlClient;
|
||||
Client get gqlClient {
|
||||
if (_gqlClient == null) {
|
||||
_gqlClient = Client(
|
||||
link: HttpLink(
|
||||
_apiPrefix + '/graphql',
|
||||
defaultHeaders: {HttpHeaders.authorizationHeader: 'token $token'},
|
||||
),
|
||||
cache: Cache(store: NilStore()),
|
||||
);
|
||||
}
|
||||
|
||||
return _gqlClient!;
|
||||
Client? _ghGqlClient;
|
||||
Client get ghGqlClient {
|
||||
return _ghGqlClient ??= Client(
|
||||
link: HttpLink(
|
||||
'$_apiPrefix/graphql',
|
||||
defaultHeaders: {HttpHeaders.authorizationHeader: 'token $token'},
|
||||
),
|
||||
// https://ferrygraphql.com/docs/fetch-policies#default-fetchpolicies
|
||||
defaultFetchPolicies: {OperationType.query: FetchPolicy.NetworkOnly},
|
||||
);
|
||||
}
|
||||
|
||||
Future<dynamic> query(String query, [String? _token]) async {
|
||||
if (_token == null) {
|
||||
_token = token;
|
||||
}
|
||||
Client? _glGqlClient;
|
||||
Client get glGqlClient {
|
||||
return _glGqlClient ??= Client(
|
||||
link: HttpLink(
|
||||
Uri.parse(activeAccount!.domain)
|
||||
.replace(path: '/api/graphql')
|
||||
.toString(),
|
||||
defaultHeaders: {'Private-Token': token},
|
||||
),
|
||||
// https://ferrygraphql.com/docs/fetch-policies#default-fetchpolicies
|
||||
defaultFetchPolicies: {OperationType.query: FetchPolicy.NetworkOnly},
|
||||
);
|
||||
}
|
||||
|
||||
Future<dynamic> query(String query, [String? t]) async {
|
||||
t ??= token;
|
||||
|
||||
final res = await http
|
||||
.post(Uri.parse(_apiPrefix + '/graphql'),
|
||||
.post(Uri.parse('$_apiPrefix/graphql'),
|
||||
headers: {
|
||||
HttpHeaders.authorizationHeader: 'token $_token',
|
||||
HttpHeaders.authorizationHeader: 'token $t',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
},
|
||||
body: json.encode({'query': query}))
|
||||
|
@ -740,7 +744,7 @@ class AuthModel with ChangeNotifier {
|
|||
final repoScope = publicOnly ? 'public_repo' : 'repo';
|
||||
final scope = Uri.encodeComponent(
|
||||
['user', repoScope, 'read:org', 'notifications'].join(','));
|
||||
launchUrl(
|
||||
launchStringUrl(
|
||||
'https://github.com/login/oauth/authorize?client_id=$clientId&redirect_uri=gittouch://login&scope=$scope&state=$_oauthState',
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,39 +1,42 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'bitbucket.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbPagination {
|
||||
String? next;
|
||||
List values;
|
||||
BbPagination({required this.values});
|
||||
factory BbPagination.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbPaginationFromJson(json);
|
||||
String? next;
|
||||
List values;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbRepoOwner {
|
||||
BbRepoOwner();
|
||||
factory BbRepoOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbRepoOwnerFromJson(json);
|
||||
String? nickname;
|
||||
String? displayName;
|
||||
String? type; // user, team
|
||||
Map<String, dynamic>? links;
|
||||
String? get avatarUrl => links!['avatar']['href'];
|
||||
BbRepoOwner();
|
||||
factory BbRepoOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbRepoOwnerFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbUser extends BbRepoOwner {
|
||||
BbUser();
|
||||
factory BbUser.fromJson(Map<String, dynamic> json) => _$BbUserFromJson(json);
|
||||
String? username;
|
||||
bool? isStaff;
|
||||
DateTime? createdOn;
|
||||
String? accountId;
|
||||
BbUser();
|
||||
factory BbUser.fromJson(Map<String, dynamic> json) => _$BbUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbRepo {
|
||||
BbRepo();
|
||||
factory BbRepo.fromJson(Map<String, dynamic> json) => _$BbRepoFromJson(json);
|
||||
String? name;
|
||||
BbRepoOwner? owner;
|
||||
String? website;
|
||||
|
@ -50,51 +53,52 @@ class BbRepo {
|
|||
Map<String, dynamic>? links;
|
||||
String get ownerLogin => fullName!.split('/')[0]; // owner has no username
|
||||
String? get avatarUrl => links!['avatar']['href'];
|
||||
BbRepo();
|
||||
factory BbRepo.fromJson(Map<String, dynamic> json) => _$BbRepoFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbRepoMainbranch {
|
||||
String? type;
|
||||
String? name;
|
||||
BbRepoMainbranch();
|
||||
factory BbRepoMainbranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbRepoMainbranchFromJson(json);
|
||||
String? type;
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbTree {
|
||||
BbTree({required this.type, required this.path});
|
||||
factory BbTree.fromJson(Map<String, dynamic> json) => _$BbTreeFromJson(json);
|
||||
String type;
|
||||
String path;
|
||||
int? size;
|
||||
Map<String, dynamic>? links;
|
||||
BbTree({required this.type, required this.path});
|
||||
factory BbTree.fromJson(Map<String, dynamic> json) => _$BbTreeFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbCommit {
|
||||
BbCommit();
|
||||
factory BbCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommitFromJson(json);
|
||||
String? message;
|
||||
DateTime? date;
|
||||
String? hash;
|
||||
BbCommitAuthor? author;
|
||||
BbCommit();
|
||||
factory BbCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommitFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbCommitAuthor {
|
||||
String? raw;
|
||||
BbRepoOwner? user;
|
||||
BbCommitAuthor();
|
||||
factory BbCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommitAuthorFromJson(json);
|
||||
String? raw;
|
||||
BbRepoOwner? user;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbIssues {
|
||||
BbIssues();
|
||||
factory BbIssues.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbIssuesFromJson(json);
|
||||
String? priority;
|
||||
String? state;
|
||||
BbRepo? repository;
|
||||
|
@ -103,50 +107,47 @@ class BbIssues {
|
|||
DateTime? createdOn;
|
||||
Map<String, dynamic>? links;
|
||||
String? get issueLink => links!['self']['href'];
|
||||
BbIssues();
|
||||
factory BbIssues.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbIssuesFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbPulls {
|
||||
BbPulls();
|
||||
factory BbPulls.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbPullsFromJson(json);
|
||||
String? description;
|
||||
BbRepoOwner? author;
|
||||
String? title;
|
||||
Map<String, dynamic>? links;
|
||||
String? get pullRequestLink => links!['self']['href'];
|
||||
DateTime? createdOn;
|
||||
BbPulls();
|
||||
factory BbPulls.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbPullsFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbCommentContent {
|
||||
String? raw;
|
||||
String? markup;
|
||||
String? html;
|
||||
BbCommentContent();
|
||||
factory BbCommentContent.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommentContentFromJson(json);
|
||||
String? raw;
|
||||
String? markup;
|
||||
String? html;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbComment {
|
||||
BbComment();
|
||||
factory BbComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommentFromJson(json);
|
||||
String? createdOn;
|
||||
String? updatedOn;
|
||||
BbCommentContent? content;
|
||||
BbRepoOwner? user;
|
||||
BbComment();
|
||||
factory BbComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommentFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbBranch {
|
||||
String? name;
|
||||
String? type;
|
||||
BbBranch();
|
||||
factory BbBranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbBranchFromJson(json);
|
||||
String? name;
|
||||
String? type;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,9 @@ part of 'bitbucket.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BbPagination _$BbPaginationFromJson(Map<String, dynamic> json) {
|
||||
return BbPagination(
|
||||
values: json['values'] as List<dynamic>,
|
||||
)..next = json['next'] as String?;
|
||||
}
|
||||
BbPagination _$BbPaginationFromJson(Map<String, dynamic> json) => BbPagination(
|
||||
values: json['values'] as List<dynamic>,
|
||||
)..next = json['next'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BbPaginationToJson(BbPagination instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -18,13 +16,11 @@ Map<String, dynamic> _$BbPaginationToJson(BbPagination instance) =>
|
|||
'values': instance.values,
|
||||
};
|
||||
|
||||
BbRepoOwner _$BbRepoOwnerFromJson(Map<String, dynamic> json) {
|
||||
return BbRepoOwner()
|
||||
..nickname = json['nickname'] as String?
|
||||
..displayName = json['display_name'] as String?
|
||||
..type = json['type'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
}
|
||||
BbRepoOwner _$BbRepoOwnerFromJson(Map<String, dynamic> json) => BbRepoOwner()
|
||||
..nickname = json['nickname'] as String?
|
||||
..displayName = json['display_name'] as String?
|
||||
..type = json['type'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
|
||||
Map<String, dynamic> _$BbRepoOwnerToJson(BbRepoOwner instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -34,19 +30,17 @@ Map<String, dynamic> _$BbRepoOwnerToJson(BbRepoOwner instance) =>
|
|||
'links': instance.links,
|
||||
};
|
||||
|
||||
BbUser _$BbUserFromJson(Map<String, dynamic> json) {
|
||||
return BbUser()
|
||||
..nickname = json['nickname'] as String?
|
||||
..displayName = json['display_name'] as String?
|
||||
..type = json['type'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?
|
||||
..username = json['username'] as String?
|
||||
..isStaff = json['is_staff'] as bool?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..accountId = json['account_id'] as String?;
|
||||
}
|
||||
BbUser _$BbUserFromJson(Map<String, dynamic> json) => BbUser()
|
||||
..nickname = json['nickname'] as String?
|
||||
..displayName = json['display_name'] as String?
|
||||
..type = json['type'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?
|
||||
..username = json['username'] as String?
|
||||
..isStaff = json['is_staff'] as bool?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..accountId = json['account_id'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BbUserToJson(BbUser instance) => <String, dynamic>{
|
||||
'nickname': instance.nickname,
|
||||
|
@ -59,31 +53,29 @@ Map<String, dynamic> _$BbUserToJson(BbUser instance) => <String, dynamic>{
|
|||
'account_id': instance.accountId,
|
||||
};
|
||||
|
||||
BbRepo _$BbRepoFromJson(Map<String, dynamic> json) {
|
||||
return BbRepo()
|
||||
..name = json['name'] as String?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..website = json['website'] as String?
|
||||
..language = json['language'] as String?
|
||||
..size = json['size'] as int?
|
||||
..type = json['type'] as String?
|
||||
..isPrivate = json['is_private'] as bool?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..updatedOn = json['updated_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_on'] as String)
|
||||
..description = json['description'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..slug = json['slug'] as String?
|
||||
..mainbranch = json['mainbranch'] == null
|
||||
? null
|
||||
: BbRepoMainbranch.fromJson(json['mainbranch'] as Map<String, dynamic>)
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
}
|
||||
BbRepo _$BbRepoFromJson(Map<String, dynamic> json) => BbRepo()
|
||||
..name = json['name'] as String?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..website = json['website'] as String?
|
||||
..language = json['language'] as String?
|
||||
..size = json['size'] as int?
|
||||
..type = json['type'] as String?
|
||||
..isPrivate = json['is_private'] as bool?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..updatedOn = json['updated_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_on'] as String)
|
||||
..description = json['description'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..slug = json['slug'] as String?
|
||||
..mainbranch = json['mainbranch'] == null
|
||||
? null
|
||||
: BbRepoMainbranch.fromJson(json['mainbranch'] as Map<String, dynamic>)
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
|
||||
Map<String, dynamic> _$BbRepoToJson(BbRepo instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
|
@ -102,11 +94,10 @@ Map<String, dynamic> _$BbRepoToJson(BbRepo instance) => <String, dynamic>{
|
|||
'links': instance.links,
|
||||
};
|
||||
|
||||
BbRepoMainbranch _$BbRepoMainbranchFromJson(Map<String, dynamic> json) {
|
||||
return BbRepoMainbranch()
|
||||
..type = json['type'] as String?
|
||||
..name = json['name'] as String?;
|
||||
}
|
||||
BbRepoMainbranch _$BbRepoMainbranchFromJson(Map<String, dynamic> json) =>
|
||||
BbRepoMainbranch()
|
||||
..type = json['type'] as String?
|
||||
..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BbRepoMainbranchToJson(BbRepoMainbranch instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -114,14 +105,12 @@ Map<String, dynamic> _$BbRepoMainbranchToJson(BbRepoMainbranch instance) =>
|
|||
'name': instance.name,
|
||||
};
|
||||
|
||||
BbTree _$BbTreeFromJson(Map<String, dynamic> json) {
|
||||
return BbTree(
|
||||
type: json['type'] as String,
|
||||
path: json['path'] as String,
|
||||
)
|
||||
..size = json['size'] as int?
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
}
|
||||
BbTree _$BbTreeFromJson(Map<String, dynamic> json) => BbTree(
|
||||
type: json['type'] as String,
|
||||
path: json['path'] as String,
|
||||
)
|
||||
..size = json['size'] as int?
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
|
||||
Map<String, dynamic> _$BbTreeToJson(BbTree instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
|
@ -130,16 +119,13 @@ Map<String, dynamic> _$BbTreeToJson(BbTree instance) => <String, dynamic>{
|
|||
'links': instance.links,
|
||||
};
|
||||
|
||||
BbCommit _$BbCommitFromJson(Map<String, dynamic> json) {
|
||||
return BbCommit()
|
||||
..message = json['message'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String)
|
||||
..hash = json['hash'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: BbCommitAuthor.fromJson(json['author'] as Map<String, dynamic>);
|
||||
}
|
||||
BbCommit _$BbCommitFromJson(Map<String, dynamic> json) => BbCommit()
|
||||
..message = json['message'] as String?
|
||||
..date = json['date'] == null ? null : DateTime.parse(json['date'] as String)
|
||||
..hash = json['hash'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: BbCommitAuthor.fromJson(json['author'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$BbCommitToJson(BbCommit instance) => <String, dynamic>{
|
||||
'message': instance.message,
|
||||
|
@ -148,13 +134,12 @@ Map<String, dynamic> _$BbCommitToJson(BbCommit instance) => <String, dynamic>{
|
|||
'author': instance.author,
|
||||
};
|
||||
|
||||
BbCommitAuthor _$BbCommitAuthorFromJson(Map<String, dynamic> json) {
|
||||
return BbCommitAuthor()
|
||||
..raw = json['raw'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
}
|
||||
BbCommitAuthor _$BbCommitAuthorFromJson(Map<String, dynamic> json) =>
|
||||
BbCommitAuthor()
|
||||
..raw = json['raw'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$BbCommitAuthorToJson(BbCommitAuthor instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -162,22 +147,20 @@ Map<String, dynamic> _$BbCommitAuthorToJson(BbCommitAuthor instance) =>
|
|||
'user': instance.user,
|
||||
};
|
||||
|
||||
BbIssues _$BbIssuesFromJson(Map<String, dynamic> json) {
|
||||
return BbIssues()
|
||||
..priority = json['priority'] as String?
|
||||
..state = json['state'] as String?
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: BbRepo.fromJson(json['repository'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..reporter = json['reporter'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['reporter'] as Map<String, dynamic>)
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
}
|
||||
BbIssues _$BbIssuesFromJson(Map<String, dynamic> json) => BbIssues()
|
||||
..priority = json['priority'] as String?
|
||||
..state = json['state'] as String?
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: BbRepo.fromJson(json['repository'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..reporter = json['reporter'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['reporter'] as Map<String, dynamic>)
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String)
|
||||
..links = json['links'] as Map<String, dynamic>?;
|
||||
|
||||
Map<String, dynamic> _$BbIssuesToJson(BbIssues instance) => <String, dynamic>{
|
||||
'priority': instance.priority,
|
||||
|
@ -189,18 +172,16 @@ Map<String, dynamic> _$BbIssuesToJson(BbIssues instance) => <String, dynamic>{
|
|||
'links': instance.links,
|
||||
};
|
||||
|
||||
BbPulls _$BbPullsFromJson(Map<String, dynamic> json) {
|
||||
return BbPulls()
|
||||
..description = json['description'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String);
|
||||
}
|
||||
BbPulls _$BbPullsFromJson(Map<String, dynamic> json) => BbPulls()
|
||||
..description = json['description'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..links = json['links'] as Map<String, dynamic>?
|
||||
..createdOn = json['created_on'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_on'] as String);
|
||||
|
||||
Map<String, dynamic> _$BbPullsToJson(BbPulls instance) => <String, dynamic>{
|
||||
'description': instance.description,
|
||||
|
@ -210,12 +191,11 @@ Map<String, dynamic> _$BbPullsToJson(BbPulls instance) => <String, dynamic>{
|
|||
'created_on': instance.createdOn?.toIso8601String(),
|
||||
};
|
||||
|
||||
BbCommentContent _$BbCommentContentFromJson(Map<String, dynamic> json) {
|
||||
return BbCommentContent()
|
||||
..raw = json['raw'] as String?
|
||||
..markup = json['markup'] as String?
|
||||
..html = json['html'] as String?;
|
||||
}
|
||||
BbCommentContent _$BbCommentContentFromJson(Map<String, dynamic> json) =>
|
||||
BbCommentContent()
|
||||
..raw = json['raw'] as String?
|
||||
..markup = json['markup'] as String?
|
||||
..html = json['html'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BbCommentContentToJson(BbCommentContent instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -224,17 +204,15 @@ Map<String, dynamic> _$BbCommentContentToJson(BbCommentContent instance) =>
|
|||
'html': instance.html,
|
||||
};
|
||||
|
||||
BbComment _$BbCommentFromJson(Map<String, dynamic> json) {
|
||||
return BbComment()
|
||||
..createdOn = json['created_on'] as String?
|
||||
..updatedOn = json['updated_on'] as String?
|
||||
..content = json['content'] == null
|
||||
? null
|
||||
: BbCommentContent.fromJson(json['content'] as Map<String, dynamic>)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
}
|
||||
BbComment _$BbCommentFromJson(Map<String, dynamic> json) => BbComment()
|
||||
..createdOn = json['created_on'] as String?
|
||||
..updatedOn = json['updated_on'] as String?
|
||||
..content = json['content'] == null
|
||||
? null
|
||||
: BbCommentContent.fromJson(json['content'] as Map<String, dynamic>)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: BbRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$BbCommentToJson(BbComment instance) => <String, dynamic>{
|
||||
'created_on': instance.createdOn,
|
||||
|
@ -243,11 +221,9 @@ Map<String, dynamic> _$BbCommentToJson(BbComment instance) => <String, dynamic>{
|
|||
'user': instance.user,
|
||||
};
|
||||
|
||||
BbBranch _$BbBranchFromJson(Map<String, dynamic> json) {
|
||||
return BbBranch()
|
||||
..name = json['name'] as String?
|
||||
..type = json['type'] as String?;
|
||||
}
|
||||
BbBranch _$BbBranchFromJson(Map<String, dynamic> json) => BbBranch()
|
||||
..name = json['name'] as String?
|
||||
..type = json['type'] as String?;
|
||||
|
||||
Map<String, dynamic> _$BbBranchToJson(BbBranch instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
|
|
|
@ -1,41 +1,56 @@
|
|||
import 'package:fimber/fimber.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_highlight/theme_map.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class CodeModel with ChangeNotifier {
|
||||
static var themes = themeMap.keys.toList();
|
||||
static const fontSizes = [12, 13, 14, 15, 16, 17, 18, 19, 20];
|
||||
static const fontFamilies = [
|
||||
static final fontFamilies = [
|
||||
'System',
|
||||
'JetBrains Mono',
|
||||
'Fira Code',
|
||||
'Inconsolata',
|
||||
'PT Mono',
|
||||
'Source Code Pro',
|
||||
'Ubuntu Mono',
|
||||
'Cascadia Code',
|
||||
|
||||
// https://fonts.google.com/?category=Monospace
|
||||
...GoogleFonts.asMap().keys.where((element) =>
|
||||
element.endsWith('Mono') ||
|
||||
[
|
||||
'Inconsolata',
|
||||
'Source Code Pro',
|
||||
'Nanum Gothic Coding',
|
||||
'Cousine',
|
||||
'Anonymous Pro',
|
||||
'Courier Prime',
|
||||
'VT323',
|
||||
'Fira Code'
|
||||
].contains(element)),
|
||||
];
|
||||
|
||||
String _theme = 'vs';
|
||||
String _themeDark = 'vs2015';
|
||||
int _fontSize = 14;
|
||||
String _fontFamily = 'JetBrains Mono';
|
||||
String _fontFamily = 'System';
|
||||
|
||||
String get theme => _theme;
|
||||
String get themeDark => _themeDark;
|
||||
|
||||
int get fontSize => _fontSize;
|
||||
String get fontFamily => _fontFamily;
|
||||
String get fontFamilyUsed =>
|
||||
_fontFamily == 'System' ? CommonStyle.monospace : _fontFamily;
|
||||
TextStyle get fontStyle {
|
||||
if (_fontFamily == 'System') {
|
||||
return TextStyle(
|
||||
fontFamily: CommonStyle.monospace, fontSize: fontSize.toDouble());
|
||||
} else {
|
||||
return GoogleFonts.getFont(_fontFamily, fontSize: fontSize.toDouble());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> init() async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
var vh = prefs.getString(StorageKeys.codeTheme);
|
||||
var vdh = prefs.getString(StorageKeys.codeThemeDark);
|
||||
var vs = prefs.getInt(StorageKeys.iCodeFontSize);
|
||||
var vf = prefs.getString(StorageKeys.codeFontFamily);
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final vh = prefs.getString(StorageKeys.codeTheme);
|
||||
final vdh = prefs.getString(StorageKeys.codeThemeDark);
|
||||
final vs = prefs.getInt(StorageKeys.iCodeFontSize);
|
||||
final vf = prefs.getString(StorageKeys.codeFontFamily);
|
||||
|
||||
Fimber.d('read code: $vh, $vs, $vf');
|
||||
if (themeMap.keys.contains(vh)) {
|
||||
|
@ -55,7 +70,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setTheme(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeTheme, v);
|
||||
Fimber.d('write code theme: $v');
|
||||
|
@ -65,7 +80,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setThemeDark(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeThemeDark, v);
|
||||
Fimber.d('write code theme dark: $v');
|
||||
|
@ -75,7 +90,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setFontSize(int v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setInt(StorageKeys.iCodeFontSize, v);
|
||||
Fimber.d('write code font size: $v');
|
||||
|
@ -85,7 +100,7 @@ class CodeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
setFontFamily(String v) async {
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(StorageKeys.codeFontFamily, v);
|
||||
Fimber.d('write code font family: $v');
|
||||
|
|
|
@ -4,18 +4,21 @@ part 'gitea.g.dart';
|
|||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaUser {
|
||||
GiteaUser();
|
||||
factory GiteaUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaUserFromJson(json);
|
||||
int? id;
|
||||
String? login;
|
||||
String? fullName;
|
||||
String? avatarUrl;
|
||||
DateTime? created;
|
||||
GiteaUser();
|
||||
factory GiteaUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaOrg {
|
||||
GiteaOrg();
|
||||
factory GiteaOrg.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaOrgFromJson(json);
|
||||
int? id;
|
||||
String? username;
|
||||
String? fullName;
|
||||
|
@ -23,13 +26,13 @@ class GiteaOrg {
|
|||
String? description;
|
||||
String? website;
|
||||
String? location;
|
||||
GiteaOrg();
|
||||
factory GiteaOrg.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaOrgFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaRepository {
|
||||
GiteaRepository();
|
||||
factory GiteaRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaRepositoryFromJson(json);
|
||||
int? id;
|
||||
GiteaUser? owner;
|
||||
String? name;
|
||||
|
@ -41,34 +44,33 @@ class GiteaRepository {
|
|||
int? size;
|
||||
int? openIssuesCount;
|
||||
int? openPrCounter;
|
||||
GiteaRepository();
|
||||
factory GiteaRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaRepositoryFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaTree {
|
||||
GiteaTree({required this.type, required this.name});
|
||||
factory GiteaTree.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaTreeFromJson(json);
|
||||
String type;
|
||||
String name;
|
||||
String? path;
|
||||
int? size;
|
||||
String? downloadUrl;
|
||||
GiteaTree({required this.type, required this.name});
|
||||
factory GiteaTree.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaTreeFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaBlob extends GiteaTree {
|
||||
String? content;
|
||||
GiteaBlob({required String type, required String name})
|
||||
: super(name: name, type: type);
|
||||
GiteaBlob({required super.type, required super.name});
|
||||
factory GiteaBlob.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaBlobFromJson(json);
|
||||
String? content;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaCommit {
|
||||
GiteaCommit();
|
||||
factory GiteaCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommitFromJson(json);
|
||||
int? number;
|
||||
GiteaUser? author;
|
||||
String? title;
|
||||
|
@ -76,33 +78,33 @@ class GiteaCommit {
|
|||
GiteaCommitDetail? commit;
|
||||
String? sha;
|
||||
String? htmlUrl;
|
||||
GiteaCommit();
|
||||
factory GiteaCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommitFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaCommitDetail {
|
||||
String? message;
|
||||
GiteaCommitAuthor? author;
|
||||
GiteaCommitAuthor? committer;
|
||||
GiteaCommitDetail();
|
||||
factory GiteaCommitDetail.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommitDetailFromJson(json);
|
||||
String? message;
|
||||
GiteaCommitAuthor? author;
|
||||
GiteaCommitAuthor? committer;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaCommitAuthor {
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
GiteaCommitAuthor();
|
||||
factory GiteaCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommitAuthorFromJson(json);
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaIssue {
|
||||
GiteaIssue();
|
||||
factory GiteaIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaIssueFromJson(json);
|
||||
String? title;
|
||||
String? body;
|
||||
int? number;
|
||||
|
@ -112,31 +114,31 @@ class GiteaIssue {
|
|||
String? state;
|
||||
String? htmlUrl;
|
||||
List<GiteaLabel>? labels;
|
||||
GiteaIssue();
|
||||
factory GiteaIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaIssueFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaLabel {
|
||||
String? color;
|
||||
String? name;
|
||||
GiteaLabel();
|
||||
factory GiteaLabel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaLabelFromJson(json);
|
||||
String? color;
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaHeatmapItem {
|
||||
int? timestamp;
|
||||
int? contributions;
|
||||
GiteaHeatmapItem();
|
||||
factory GiteaHeatmapItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaHeatmapItemFromJson(json);
|
||||
int? timestamp;
|
||||
int? contributions;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteaComment {
|
||||
GiteaComment();
|
||||
factory GiteaComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommentFromJson(json);
|
||||
String? body;
|
||||
DateTime? createdAt;
|
||||
String? htmlUrl;
|
||||
|
@ -144,7 +146,4 @@ class GiteaComment {
|
|||
DateTime? updatedAt;
|
||||
int? id;
|
||||
GiteaUser? user;
|
||||
GiteaComment();
|
||||
factory GiteaComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteaCommentFromJson(json);
|
||||
}
|
||||
|
|
|
@ -6,16 +6,14 @@ part of 'gitea.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GiteaUser _$GiteaUserFromJson(Map<String, dynamic> json) {
|
||||
return GiteaUser()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..created = json['created'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created'] as String);
|
||||
}
|
||||
GiteaUser _$GiteaUserFromJson(Map<String, dynamic> json) => GiteaUser()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..created = json['created'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created'] as String);
|
||||
|
||||
Map<String, dynamic> _$GiteaUserToJson(GiteaUser instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
|
@ -25,16 +23,14 @@ Map<String, dynamic> _$GiteaUserToJson(GiteaUser instance) => <String, dynamic>{
|
|||
'created': instance.created?.toIso8601String(),
|
||||
};
|
||||
|
||||
GiteaOrg _$GiteaOrgFromJson(Map<String, dynamic> json) {
|
||||
return GiteaOrg()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..website = json['website'] as String?
|
||||
..location = json['location'] as String?;
|
||||
}
|
||||
GiteaOrg _$GiteaOrgFromJson(Map<String, dynamic> json) => GiteaOrg()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..website = json['website'] as String?
|
||||
..location = json['location'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteaOrgToJson(GiteaOrg instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
|
@ -46,24 +42,23 @@ Map<String, dynamic> _$GiteaOrgToJson(GiteaOrg instance) => <String, dynamic>{
|
|||
'location': instance.location,
|
||||
};
|
||||
|
||||
GiteaRepository _$GiteaRepositoryFromJson(Map<String, dynamic> json) {
|
||||
return GiteaRepository()
|
||||
..id = json['id'] as int?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..starsCount = json['stars_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..website = json['website'] as String?
|
||||
..size = json['size'] as int?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..openPrCounter = json['open_pr_counter'] as int?;
|
||||
}
|
||||
GiteaRepository _$GiteaRepositoryFromJson(Map<String, dynamic> json) =>
|
||||
GiteaRepository()
|
||||
..id = json['id'] as int?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..name = json['name'] as String?
|
||||
..description = json['description'] as String?
|
||||
..starsCount = json['stars_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..website = json['website'] as String?
|
||||
..size = json['size'] as int?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..openPrCounter = json['open_pr_counter'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteaRepositoryToJson(GiteaRepository instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -80,15 +75,13 @@ Map<String, dynamic> _$GiteaRepositoryToJson(GiteaRepository instance) =>
|
|||
'open_pr_counter': instance.openPrCounter,
|
||||
};
|
||||
|
||||
GiteaTree _$GiteaTreeFromJson(Map<String, dynamic> json) {
|
||||
return GiteaTree(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?;
|
||||
}
|
||||
GiteaTree _$GiteaTreeFromJson(Map<String, dynamic> json) => GiteaTree(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteaTreeToJson(GiteaTree instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
|
@ -98,16 +91,14 @@ Map<String, dynamic> _$GiteaTreeToJson(GiteaTree instance) => <String, dynamic>{
|
|||
'download_url': instance.downloadUrl,
|
||||
};
|
||||
|
||||
GiteaBlob _$GiteaBlobFromJson(Map<String, dynamic> json) {
|
||||
return GiteaBlob(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
}
|
||||
GiteaBlob _$GiteaBlobFromJson(Map<String, dynamic> json) => GiteaBlob(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteaBlobToJson(GiteaBlob instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
|
@ -118,20 +109,18 @@ Map<String, dynamic> _$GiteaBlobToJson(GiteaBlob instance) => <String, dynamic>{
|
|||
'content': instance.content,
|
||||
};
|
||||
|
||||
GiteaCommit _$GiteaCommitFromJson(Map<String, dynamic> json) {
|
||||
return GiteaCommit()
|
||||
..number = json['number'] as int?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GiteaCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
}
|
||||
GiteaCommit _$GiteaCommitFromJson(Map<String, dynamic> json) => GiteaCommit()
|
||||
..number = json['number'] as int?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GiteaCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteaCommitToJson(GiteaCommit instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -144,16 +133,16 @@ Map<String, dynamic> _$GiteaCommitToJson(GiteaCommit instance) =>
|
|||
'html_url': instance.htmlUrl,
|
||||
};
|
||||
|
||||
GiteaCommitDetail _$GiteaCommitDetailFromJson(Map<String, dynamic> json) {
|
||||
return GiteaCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteaCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GiteaCommitAuthor.fromJson(json['committer'] as Map<String, dynamic>);
|
||||
}
|
||||
GiteaCommitDetail _$GiteaCommitDetailFromJson(Map<String, dynamic> json) =>
|
||||
GiteaCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteaCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GiteaCommitAuthor.fromJson(
|
||||
json['committer'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GiteaCommitDetailToJson(GiteaCommitDetail instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -162,13 +151,12 @@ Map<String, dynamic> _$GiteaCommitDetailToJson(GiteaCommitDetail instance) =>
|
|||
'committer': instance.committer,
|
||||
};
|
||||
|
||||
GiteaCommitAuthor _$GiteaCommitAuthorFromJson(Map<String, dynamic> json) {
|
||||
return GiteaCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
}
|
||||
GiteaCommitAuthor _$GiteaCommitAuthorFromJson(Map<String, dynamic> json) =>
|
||||
GiteaCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
|
||||
Map<String, dynamic> _$GiteaCommitAuthorToJson(GiteaCommitAuthor instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -177,24 +165,22 @@ Map<String, dynamic> _$GiteaCommitAuthorToJson(GiteaCommitAuthor instance) =>
|
|||
'date': instance.date?.toIso8601String(),
|
||||
};
|
||||
|
||||
GiteaIssue _$GiteaIssueFromJson(Map<String, dynamic> json) {
|
||||
return GiteaIssue()
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..number = json['number'] as int?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..comments = json['comments'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..state = json['state'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteaLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
GiteaIssue _$GiteaIssueFromJson(Map<String, dynamic> json) => GiteaIssue()
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..number = json['number'] as int?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..comments = json['comments'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..state = json['state'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteaLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
Map<String, dynamic> _$GiteaIssueToJson(GiteaIssue instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -209,11 +195,9 @@ Map<String, dynamic> _$GiteaIssueToJson(GiteaIssue instance) =>
|
|||
'labels': instance.labels,
|
||||
};
|
||||
|
||||
GiteaLabel _$GiteaLabelFromJson(Map<String, dynamic> json) {
|
||||
return GiteaLabel()
|
||||
..color = json['color'] as String?
|
||||
..name = json['name'] as String?;
|
||||
}
|
||||
GiteaLabel _$GiteaLabelFromJson(Map<String, dynamic> json) => GiteaLabel()
|
||||
..color = json['color'] as String?
|
||||
..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteaLabelToJson(GiteaLabel instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -221,11 +205,10 @@ Map<String, dynamic> _$GiteaLabelToJson(GiteaLabel instance) =>
|
|||
'name': instance.name,
|
||||
};
|
||||
|
||||
GiteaHeatmapItem _$GiteaHeatmapItemFromJson(Map<String, dynamic> json) {
|
||||
return GiteaHeatmapItem()
|
||||
..timestamp = json['timestamp'] as int?
|
||||
..contributions = json['contributions'] as int?;
|
||||
}
|
||||
GiteaHeatmapItem _$GiteaHeatmapItemFromJson(Map<String, dynamic> json) =>
|
||||
GiteaHeatmapItem()
|
||||
..timestamp = json['timestamp'] as int?
|
||||
..contributions = json['contributions'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteaHeatmapItemToJson(GiteaHeatmapItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -233,22 +216,20 @@ Map<String, dynamic> _$GiteaHeatmapItemToJson(GiteaHeatmapItem instance) =>
|
|||
'contributions': instance.contributions,
|
||||
};
|
||||
|
||||
GiteaComment _$GiteaCommentFromJson(Map<String, dynamic> json) {
|
||||
return GiteaComment()
|
||||
..body = json['body'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..originalAuthor = json['original_author'] as String?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..id = json['id'] as int?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['user'] as Map<String, dynamic>);
|
||||
}
|
||||
GiteaComment _$GiteaCommentFromJson(Map<String, dynamic> json) => GiteaComment()
|
||||
..body = json['body'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..originalAuthor = json['original_author'] as String?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..id = json['id'] as int?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteaUser.fromJson(json['user'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GiteaCommentToJson(GiteaComment instance) =>
|
||||
<String, dynamic>{
|
||||
|
|
|
@ -4,6 +4,9 @@ part 'gitee.g.dart';
|
|||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeUser {
|
||||
GiteeUser();
|
||||
factory GiteeUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeUserFromJson(json);
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
String? name;
|
||||
|
@ -16,24 +19,24 @@ class GiteeUser {
|
|||
int? stared;
|
||||
int? watched;
|
||||
DateTime? createdAt;
|
||||
GiteeUser();
|
||||
factory GiteeUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeListUser {
|
||||
GiteeListUser();
|
||||
factory GiteeListUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeListUserFromJson(json);
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
String? name;
|
||||
String? htmlUrl;
|
||||
GiteeListUser();
|
||||
factory GiteeListUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeListUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeRepo {
|
||||
GiteeRepo();
|
||||
factory GiteeRepo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeRepoFromJson(json);
|
||||
GiteeRepoNamespace? namespace;
|
||||
GiteeRepoOwner? owner;
|
||||
String? path;
|
||||
|
@ -51,90 +54,90 @@ class GiteeRepo {
|
|||
int? openIssuesCount;
|
||||
bool? pullRequestsEnabled;
|
||||
String? defaultBranch;
|
||||
GiteeRepo();
|
||||
factory GiteeRepo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeRepoFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeRepoOwner {
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
GiteeRepoOwner();
|
||||
factory GiteeRepoOwner.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeRepoOwnerFromJson(json);
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeRepoNamespace {
|
||||
String? path;
|
||||
GiteeRepoNamespace();
|
||||
factory GiteeRepoNamespace.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeRepoNamespaceFromJson(json);
|
||||
String? path;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeCommit {
|
||||
GiteeCommit();
|
||||
factory GiteeCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitFromJson(json);
|
||||
GiteeUser? author;
|
||||
GiteeCommitDetail? commit;
|
||||
String? sha;
|
||||
String? htmlUrl;
|
||||
List<GiteeCommitFile>? files;
|
||||
GiteeCommit();
|
||||
factory GiteeCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeCommitDetail {
|
||||
String? message;
|
||||
GiteeCommitAuthor? author;
|
||||
GiteeCommitAuthor? committer;
|
||||
GiteeCommitDetail();
|
||||
factory GiteeCommitDetail.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitDetailFromJson(json);
|
||||
String? message;
|
||||
GiteeCommitAuthor? author;
|
||||
GiteeCommitAuthor? committer;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeCommitAuthor {
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
GiteeCommitAuthor();
|
||||
factory GiteeCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitAuthorFromJson(json);
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeTreeItem {
|
||||
GiteeTreeItem({required this.path, required this.type});
|
||||
factory GiteeTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeTreeItemFromJson(json);
|
||||
String path;
|
||||
String type;
|
||||
String? sha;
|
||||
int? size;
|
||||
GiteeTreeItem({required this.path, required this.type});
|
||||
factory GiteeTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeTreeItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeBlob {
|
||||
String? content;
|
||||
GiteeBlob();
|
||||
factory GiteeBlob.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeBlobFromJson(json);
|
||||
String? content;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeLabel {
|
||||
String? color;
|
||||
String? name;
|
||||
GiteeLabel();
|
||||
factory GiteeLabel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeLabelFromJson(json);
|
||||
String? color;
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeIssue {
|
||||
GiteeIssue();
|
||||
factory GiteeIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeIssueFromJson(json);
|
||||
int? comments;
|
||||
String? commentsUrl;
|
||||
String? createdAt;
|
||||
|
@ -149,13 +152,13 @@ class GiteeIssue {
|
|||
String? number;
|
||||
List<GiteeLabel>? labels;
|
||||
int? id;
|
||||
GiteeIssue();
|
||||
factory GiteeIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeIssueFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteePull {
|
||||
GiteePull();
|
||||
factory GiteePull.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteePullFromJson(json);
|
||||
String? commentsUrl;
|
||||
String? createdAt;
|
||||
String? htmlUrl;
|
||||
|
@ -168,34 +171,34 @@ class GiteePull {
|
|||
List<GiteeLabel>? labels;
|
||||
int? number;
|
||||
int? id;
|
||||
GiteePull();
|
||||
factory GiteePull.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteePullFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeComment {
|
||||
GiteeComment();
|
||||
factory GiteeComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommentFromJson(json);
|
||||
int? id;
|
||||
String? body;
|
||||
String? createdAt;
|
||||
GiteeRepoOwner? user;
|
||||
GiteeComment();
|
||||
factory GiteeComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommentFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteePatch {
|
||||
String? diff;
|
||||
GiteePatch();
|
||||
factory GiteePatch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteePatchFromJson(json);
|
||||
String? diff;
|
||||
}
|
||||
|
||||
// Two different classes because of variable type mismatch
|
||||
// for additions, deletions, patch
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteePullFile {
|
||||
GiteePullFile();
|
||||
factory GiteePullFile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteePullFileFromJson(json);
|
||||
String? additions;
|
||||
String? deletions;
|
||||
String? blobUrl;
|
||||
|
@ -203,13 +206,13 @@ class GiteePullFile {
|
|||
String? sha;
|
||||
String? status;
|
||||
GiteePatch? patch;
|
||||
GiteePullFile();
|
||||
factory GiteePullFile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteePullFileFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeCommitFile {
|
||||
GiteeCommitFile();
|
||||
factory GiteeCommitFile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitFileFromJson(json);
|
||||
int? additions;
|
||||
int? deletions;
|
||||
int? changes;
|
||||
|
@ -218,24 +221,21 @@ class GiteeCommitFile {
|
|||
String? sha;
|
||||
String? status;
|
||||
String? patch;
|
||||
GiteeCommitFile();
|
||||
factory GiteeCommitFile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeCommitFileFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeContributor {
|
||||
String? name;
|
||||
int? contributions;
|
||||
GiteeContributor();
|
||||
factory GiteeContributor.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeContributorFromJson(json);
|
||||
String? name;
|
||||
int? contributions;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GiteeBranch {
|
||||
String? name;
|
||||
GiteeBranch();
|
||||
factory GiteeBranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GiteeBranchFromJson(json);
|
||||
String? name;
|
||||
}
|
||||
|
|
|
@ -6,23 +6,21 @@ part of 'gitee.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GiteeUser _$GiteeUserFromJson(Map<String, dynamic> json) {
|
||||
return GiteeUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..name = json['name'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..bio = json['bio'] as String?
|
||||
..blog = json['blog'] as String?
|
||||
..publicRepos = json['public_repos'] as int?
|
||||
..followers = json['followers'] as int?
|
||||
..following = json['following'] as int?
|
||||
..stared = json['stared'] as int?
|
||||
..watched = json['watched'] as int?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
}
|
||||
GiteeUser _$GiteeUserFromJson(Map<String, dynamic> json) => GiteeUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..name = json['name'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..bio = json['bio'] as String?
|
||||
..blog = json['blog'] as String?
|
||||
..publicRepos = json['public_repos'] as int?
|
||||
..followers = json['followers'] as int?
|
||||
..following = json['following'] as int?
|
||||
..stared = json['stared'] as int?
|
||||
..watched = json['watched'] as int?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
|
||||
Map<String, dynamic> _$GiteeUserToJson(GiteeUser instance) => <String, dynamic>{
|
||||
'login': instance.login,
|
||||
|
@ -39,13 +37,12 @@ Map<String, dynamic> _$GiteeUserToJson(GiteeUser instance) => <String, dynamic>{
|
|||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
GiteeListUser _$GiteeListUserFromJson(Map<String, dynamic> json) {
|
||||
return GiteeListUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..name = json['name'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
}
|
||||
GiteeListUser _$GiteeListUserFromJson(Map<String, dynamic> json) =>
|
||||
GiteeListUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..name = json['name'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeListUserToJson(GiteeListUser instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -55,32 +52,30 @@ Map<String, dynamic> _$GiteeListUserToJson(GiteeListUser instance) =>
|
|||
'html_url': instance.htmlUrl,
|
||||
};
|
||||
|
||||
GiteeRepo _$GiteeRepoFromJson(Map<String, dynamic> json) {
|
||||
return GiteeRepo()
|
||||
..namespace = json['namespace'] == null
|
||||
? null
|
||||
: GiteeRepoNamespace.fromJson(json['namespace'] as Map<String, dynamic>)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..path = json['path'] as String?
|
||||
..description = json['description'] as String?
|
||||
..private = json['private'] as bool?
|
||||
..public = json['public'] as bool?
|
||||
..internal = json['internal'] as bool?
|
||||
..fork = json['fork'] as bool?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..stargazersCount = json['stargazers_count'] as int?
|
||||
..watchersCount = json['watchers_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..license = json['license'] as String?
|
||||
..homepage = json['homepage'] as String?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..pullRequestsEnabled = json['pull_requests_enabled'] as bool?
|
||||
..defaultBranch = json['default_branch'] as String?;
|
||||
}
|
||||
GiteeRepo _$GiteeRepoFromJson(Map<String, dynamic> json) => GiteeRepo()
|
||||
..namespace = json['namespace'] == null
|
||||
? null
|
||||
: GiteeRepoNamespace.fromJson(json['namespace'] as Map<String, dynamic>)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..path = json['path'] as String?
|
||||
..description = json['description'] as String?
|
||||
..private = json['private'] as bool?
|
||||
..public = json['public'] as bool?
|
||||
..internal = json['internal'] as bool?
|
||||
..fork = json['fork'] as bool?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..stargazersCount = json['stargazers_count'] as int?
|
||||
..watchersCount = json['watchers_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..license = json['license'] as String?
|
||||
..homepage = json['homepage'] as String?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..pullRequestsEnabled = json['pull_requests_enabled'] as bool?
|
||||
..defaultBranch = json['default_branch'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeRepoToJson(GiteeRepo instance) => <String, dynamic>{
|
||||
'namespace': instance.namespace,
|
||||
|
@ -102,11 +97,10 @@ Map<String, dynamic> _$GiteeRepoToJson(GiteeRepo instance) => <String, dynamic>{
|
|||
'default_branch': instance.defaultBranch,
|
||||
};
|
||||
|
||||
GiteeRepoOwner _$GiteeRepoOwnerFromJson(Map<String, dynamic> json) {
|
||||
return GiteeRepoOwner()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?;
|
||||
}
|
||||
GiteeRepoOwner _$GiteeRepoOwnerFromJson(Map<String, dynamic> json) =>
|
||||
GiteeRepoOwner()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeRepoOwnerToJson(GiteeRepoOwner instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -114,29 +108,26 @@ Map<String, dynamic> _$GiteeRepoOwnerToJson(GiteeRepoOwner instance) =>
|
|||
'avatar_url': instance.avatarUrl,
|
||||
};
|
||||
|
||||
GiteeRepoNamespace _$GiteeRepoNamespaceFromJson(Map<String, dynamic> json) {
|
||||
return GiteeRepoNamespace()..path = json['path'] as String?;
|
||||
}
|
||||
GiteeRepoNamespace _$GiteeRepoNamespaceFromJson(Map<String, dynamic> json) =>
|
||||
GiteeRepoNamespace()..path = json['path'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeRepoNamespaceToJson(GiteeRepoNamespace instance) =>
|
||||
<String, dynamic>{
|
||||
'path': instance.path,
|
||||
};
|
||||
|
||||
GiteeCommit _$GiteeCommitFromJson(Map<String, dynamic> json) {
|
||||
return GiteeCommit()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteeUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GiteeCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..files = (json['files'] as List<dynamic>?)
|
||||
?.map((e) => GiteeCommitFile.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
GiteeCommit _$GiteeCommitFromJson(Map<String, dynamic> json) => GiteeCommit()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteeUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GiteeCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..files = (json['files'] as List<dynamic>?)
|
||||
?.map((e) => GiteeCommitFile.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
Map<String, dynamic> _$GiteeCommitToJson(GiteeCommit instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -147,16 +138,16 @@ Map<String, dynamic> _$GiteeCommitToJson(GiteeCommit instance) =>
|
|||
'files': instance.files,
|
||||
};
|
||||
|
||||
GiteeCommitDetail _$GiteeCommitDetailFromJson(Map<String, dynamic> json) {
|
||||
return GiteeCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteeCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GiteeCommitAuthor.fromJson(json['committer'] as Map<String, dynamic>);
|
||||
}
|
||||
GiteeCommitDetail _$GiteeCommitDetailFromJson(Map<String, dynamic> json) =>
|
||||
GiteeCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GiteeCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GiteeCommitAuthor.fromJson(
|
||||
json['committer'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GiteeCommitDetailToJson(GiteeCommitDetail instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -165,13 +156,12 @@ Map<String, dynamic> _$GiteeCommitDetailToJson(GiteeCommitDetail instance) =>
|
|||
'committer': instance.committer,
|
||||
};
|
||||
|
||||
GiteeCommitAuthor _$GiteeCommitAuthorFromJson(Map<String, dynamic> json) {
|
||||
return GiteeCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
}
|
||||
GiteeCommitAuthor _$GiteeCommitAuthorFromJson(Map<String, dynamic> json) =>
|
||||
GiteeCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
|
||||
Map<String, dynamic> _$GiteeCommitAuthorToJson(GiteeCommitAuthor instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -180,14 +170,13 @@ Map<String, dynamic> _$GiteeCommitAuthorToJson(GiteeCommitAuthor instance) =>
|
|||
'date': instance.date?.toIso8601String(),
|
||||
};
|
||||
|
||||
GiteeTreeItem _$GiteeTreeItemFromJson(Map<String, dynamic> json) {
|
||||
return GiteeTreeItem(
|
||||
path: json['path'] as String,
|
||||
type: json['type'] as String,
|
||||
)
|
||||
..sha = json['sha'] as String?
|
||||
..size = json['size'] as int?;
|
||||
}
|
||||
GiteeTreeItem _$GiteeTreeItemFromJson(Map<String, dynamic> json) =>
|
||||
GiteeTreeItem(
|
||||
path: json['path'] as String,
|
||||
type: json['type'] as String,
|
||||
)
|
||||
..sha = json['sha'] as String?
|
||||
..size = json['size'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteeTreeItemToJson(GiteeTreeItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -197,19 +186,16 @@ Map<String, dynamic> _$GiteeTreeItemToJson(GiteeTreeItem instance) =>
|
|||
'size': instance.size,
|
||||
};
|
||||
|
||||
GiteeBlob _$GiteeBlobFromJson(Map<String, dynamic> json) {
|
||||
return GiteeBlob()..content = json['content'] as String?;
|
||||
}
|
||||
GiteeBlob _$GiteeBlobFromJson(Map<String, dynamic> json) =>
|
||||
GiteeBlob()..content = json['content'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeBlobToJson(GiteeBlob instance) => <String, dynamic>{
|
||||
'content': instance.content,
|
||||
};
|
||||
|
||||
GiteeLabel _$GiteeLabelFromJson(Map<String, dynamic> json) {
|
||||
return GiteeLabel()
|
||||
..color = json['color'] as String?
|
||||
..name = json['name'] as String?;
|
||||
}
|
||||
GiteeLabel _$GiteeLabelFromJson(Map<String, dynamic> json) => GiteeLabel()
|
||||
..color = json['color'] as String?
|
||||
..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeLabelToJson(GiteeLabel instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -217,29 +203,27 @@ Map<String, dynamic> _$GiteeLabelToJson(GiteeLabel instance) =>
|
|||
'name': instance.name,
|
||||
};
|
||||
|
||||
GiteeIssue _$GiteeIssueFromJson(Map<String, dynamic> json) {
|
||||
return GiteeIssue()
|
||||
..comments = json['comments'] as int?
|
||||
..commentsUrl = json['comments_url'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..updatedAt = json['updated_at'] as String?
|
||||
..body = json['body'] as String?
|
||||
..bodyHtml = json['body_html'] as String?
|
||||
..title = json['title'] as String?
|
||||
..state = json['state'] as String?
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GiteeRepo.fromJson(json['repository'] as Map<String, dynamic>)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..number = json['number'] as String?
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteeLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..id = json['id'] as int?;
|
||||
}
|
||||
GiteeIssue _$GiteeIssueFromJson(Map<String, dynamic> json) => GiteeIssue()
|
||||
..comments = json['comments'] as int?
|
||||
..commentsUrl = json['comments_url'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..updatedAt = json['updated_at'] as String?
|
||||
..body = json['body'] as String?
|
||||
..bodyHtml = json['body_html'] as String?
|
||||
..title = json['title'] as String?
|
||||
..state = json['state'] as String?
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GiteeRepo.fromJson(json['repository'] as Map<String, dynamic>)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..number = json['number'] as String?
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteeLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..id = json['id'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteeIssueToJson(GiteeIssue instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -259,25 +243,23 @@ Map<String, dynamic> _$GiteeIssueToJson(GiteeIssue instance) =>
|
|||
'id': instance.id,
|
||||
};
|
||||
|
||||
GiteePull _$GiteePullFromJson(Map<String, dynamic> json) {
|
||||
return GiteePull()
|
||||
..commentsUrl = json['comments_url'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..updatedAt = json['updated_at'] as String?
|
||||
..body = json['body'] as String?
|
||||
..bodyHtml = json['body_html'] as String?
|
||||
..title = json['title'] as String?
|
||||
..state = json['state'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteeLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..number = json['number'] as int?
|
||||
..id = json['id'] as int?;
|
||||
}
|
||||
GiteePull _$GiteePullFromJson(Map<String, dynamic> json) => GiteePull()
|
||||
..commentsUrl = json['comments_url'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..updatedAt = json['updated_at'] as String?
|
||||
..body = json['body'] as String?
|
||||
..bodyHtml = json['body_html'] as String?
|
||||
..title = json['title'] as String?
|
||||
..state = json['state'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GiteeLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..number = json['number'] as int?
|
||||
..id = json['id'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteePullToJson(GiteePull instance) => <String, dynamic>{
|
||||
'comments_url': instance.commentsUrl,
|
||||
|
@ -294,15 +276,13 @@ Map<String, dynamic> _$GiteePullToJson(GiteePull instance) => <String, dynamic>{
|
|||
'id': instance.id,
|
||||
};
|
||||
|
||||
GiteeComment _$GiteeCommentFromJson(Map<String, dynamic> json) {
|
||||
return GiteeComment()
|
||||
..id = json['id'] as int?
|
||||
..body = json['body'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
}
|
||||
GiteeComment _$GiteeCommentFromJson(Map<String, dynamic> json) => GiteeComment()
|
||||
..id = json['id'] as int?
|
||||
..body = json['body'] as String?
|
||||
..createdAt = json['created_at'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GiteeRepoOwner.fromJson(json['user'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GiteeCommentToJson(GiteeComment instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -312,27 +292,25 @@ Map<String, dynamic> _$GiteeCommentToJson(GiteeComment instance) =>
|
|||
'user': instance.user,
|
||||
};
|
||||
|
||||
GiteePatch _$GiteePatchFromJson(Map<String, dynamic> json) {
|
||||
return GiteePatch()..diff = json['diff'] as String?;
|
||||
}
|
||||
GiteePatch _$GiteePatchFromJson(Map<String, dynamic> json) =>
|
||||
GiteePatch()..diff = json['diff'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteePatchToJson(GiteePatch instance) =>
|
||||
<String, dynamic>{
|
||||
'diff': instance.diff,
|
||||
};
|
||||
|
||||
GiteePullFile _$GiteePullFileFromJson(Map<String, dynamic> json) {
|
||||
return GiteePullFile()
|
||||
..additions = json['additions'] as String?
|
||||
..deletions = json['deletions'] as String?
|
||||
..blobUrl = json['blob_url'] as String?
|
||||
..filename = json['filename'] as String?
|
||||
..sha = json['sha'] as String?
|
||||
..status = json['status'] as String?
|
||||
..patch = json['patch'] == null
|
||||
? null
|
||||
: GiteePatch.fromJson(json['patch'] as Map<String, dynamic>);
|
||||
}
|
||||
GiteePullFile _$GiteePullFileFromJson(Map<String, dynamic> json) =>
|
||||
GiteePullFile()
|
||||
..additions = json['additions'] as String?
|
||||
..deletions = json['deletions'] as String?
|
||||
..blobUrl = json['blob_url'] as String?
|
||||
..filename = json['filename'] as String?
|
||||
..sha = json['sha'] as String?
|
||||
..status = json['status'] as String?
|
||||
..patch = json['patch'] == null
|
||||
? null
|
||||
: GiteePatch.fromJson(json['patch'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GiteePullFileToJson(GiteePullFile instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -345,17 +323,16 @@ Map<String, dynamic> _$GiteePullFileToJson(GiteePullFile instance) =>
|
|||
'patch': instance.patch,
|
||||
};
|
||||
|
||||
GiteeCommitFile _$GiteeCommitFileFromJson(Map<String, dynamic> json) {
|
||||
return GiteeCommitFile()
|
||||
..additions = json['additions'] as int?
|
||||
..deletions = json['deletions'] as int?
|
||||
..changes = json['changes'] as int?
|
||||
..blobUrl = json['blob_url'] as String?
|
||||
..filename = json['filename'] as String?
|
||||
..sha = json['sha'] as String?
|
||||
..status = json['status'] as String?
|
||||
..patch = json['patch'] as String?;
|
||||
}
|
||||
GiteeCommitFile _$GiteeCommitFileFromJson(Map<String, dynamic> json) =>
|
||||
GiteeCommitFile()
|
||||
..additions = json['additions'] as int?
|
||||
..deletions = json['deletions'] as int?
|
||||
..changes = json['changes'] as int?
|
||||
..blobUrl = json['blob_url'] as String?
|
||||
..filename = json['filename'] as String?
|
||||
..sha = json['sha'] as String?
|
||||
..status = json['status'] as String?
|
||||
..patch = json['patch'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeCommitFileToJson(GiteeCommitFile instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -369,11 +346,10 @@ Map<String, dynamic> _$GiteeCommitFileToJson(GiteeCommitFile instance) =>
|
|||
'patch': instance.patch,
|
||||
};
|
||||
|
||||
GiteeContributor _$GiteeContributorFromJson(Map<String, dynamic> json) {
|
||||
return GiteeContributor()
|
||||
..name = json['name'] as String?
|
||||
..contributions = json['contributions'] as int?;
|
||||
}
|
||||
GiteeContributor _$GiteeContributorFromJson(Map<String, dynamic> json) =>
|
||||
GiteeContributor()
|
||||
..name = json['name'] as String?
|
||||
..contributions = json['contributions'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GiteeContributorToJson(GiteeContributor instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -381,9 +357,8 @@ Map<String, dynamic> _$GiteeContributorToJson(GiteeContributor instance) =>
|
|||
'contributions': instance.contributions,
|
||||
};
|
||||
|
||||
GiteeBranch _$GiteeBranchFromJson(Map<String, dynamic> json) {
|
||||
return GiteeBranch()..name = json['name'] as String?;
|
||||
}
|
||||
GiteeBranch _$GiteeBranchFromJson(Map<String, dynamic> json) =>
|
||||
GiteeBranch()..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GiteeBranchToJson(GiteeBranch instance) =>
|
||||
<String, dynamic>{
|
||||
|
|
|
@ -6,6 +6,10 @@ part 'github.g.dart';
|
|||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEvent {
|
||||
GithubEvent();
|
||||
|
||||
factory GithubEvent.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventFromJson(json);
|
||||
GithubEventUser? actor;
|
||||
String? type;
|
||||
GithubEventRepo? repo;
|
||||
|
@ -14,48 +18,41 @@ class GithubEvent {
|
|||
|
||||
Tuple2<String, String>? _repo;
|
||||
String get repoOwner {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(repo!.name!);
|
||||
}
|
||||
_repo ??= parseRepositoryFullName(repo!.name!);
|
||||
return _repo!.item1;
|
||||
}
|
||||
|
||||
String get repoName {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(repo!.name!);
|
||||
}
|
||||
_repo ??= parseRepositoryFullName(repo!.name!);
|
||||
return _repo!.item2;
|
||||
}
|
||||
|
||||
GithubEvent();
|
||||
|
||||
factory GithubEvent.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventUser {
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
|
||||
GithubEventUser();
|
||||
|
||||
factory GithubEventUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventUserFromJson(json);
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventRepo {
|
||||
String? name;
|
||||
|
||||
GithubEventRepo();
|
||||
|
||||
factory GithubEventRepo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventRepoFromJson(json);
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventPayload {
|
||||
GithubEventPayload();
|
||||
|
||||
factory GithubEventPayload.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventPayloadFromJson(json);
|
||||
GithubEventIssue? issue;
|
||||
GithubEventIssue? pullRequest;
|
||||
GithubEventComment? comment;
|
||||
|
@ -76,14 +73,14 @@ class GithubEventPayload {
|
|||
GithubCheckrunItem? checkRun;
|
||||
GithubCheckSuiteItem? checkSuite;
|
||||
GithubContentReferenceItem? contentReference;
|
||||
GithubEventPayload();
|
||||
|
||||
factory GithubEventPayload.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventPayloadFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventIssue {
|
||||
GithubEventIssue();
|
||||
|
||||
factory GithubEventIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventIssueFromJson(json);
|
||||
String? title;
|
||||
GithubEventUser? user;
|
||||
int? number;
|
||||
|
@ -95,51 +92,47 @@ class GithubEventIssue {
|
|||
DateTime? createdAt;
|
||||
|
||||
bool get isPullRequestComment => pullRequest != null;
|
||||
|
||||
GithubEventIssue();
|
||||
|
||||
factory GithubEventIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventIssueFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventComment {
|
||||
String? body;
|
||||
GithubEventUser? user;
|
||||
String? commitId;
|
||||
String? htmlUrl;
|
||||
|
||||
GithubEventComment();
|
||||
|
||||
factory GithubEventComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventCommentFromJson(json);
|
||||
String? body;
|
||||
GithubEventUser? user;
|
||||
String? commitId;
|
||||
String? htmlUrl;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventCommit {
|
||||
String? sha;
|
||||
String? message;
|
||||
|
||||
GithubEventCommit();
|
||||
|
||||
factory GithubEventCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventCommitFromJson(json);
|
||||
String? sha;
|
||||
String? message;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubEventRelease {
|
||||
String? htmlUrl;
|
||||
String? tagName;
|
||||
|
||||
GithubEventRelease();
|
||||
|
||||
factory GithubEventRelease.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubEventReleaseFromJson(json);
|
||||
String? htmlUrl;
|
||||
String? tagName;
|
||||
}
|
||||
|
||||
// Notification
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubNotificationItem {
|
||||
GithubNotificationItem();
|
||||
|
||||
factory GithubNotificationItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubNotificationItemFromJson(json);
|
||||
String? id;
|
||||
GithubNotificationItemSubject? subject;
|
||||
DateTime? updatedAt;
|
||||
|
@ -150,182 +143,169 @@ class GithubNotificationItem {
|
|||
String? state;
|
||||
|
||||
String get key => '_$hashCode';
|
||||
|
||||
GithubNotificationItem();
|
||||
|
||||
factory GithubNotificationItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubNotificationItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubNotificationItemSubject {
|
||||
GithubNotificationItemSubject();
|
||||
|
||||
factory GithubNotificationItemSubject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubNotificationItemSubjectFromJson(json);
|
||||
String? title;
|
||||
String? type;
|
||||
String? url;
|
||||
|
||||
int? _number;
|
||||
int? get number {
|
||||
if (_number == null) {
|
||||
_number = int.parse(url?.split('/').last ?? '0');
|
||||
}
|
||||
_number ??= int.parse(url?.split('/').last ?? '0');
|
||||
return _number;
|
||||
}
|
||||
|
||||
GithubNotificationItemSubject();
|
||||
|
||||
factory GithubNotificationItemSubject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubNotificationItemSubjectFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubNotificationItemRepo {
|
||||
String? fullName;
|
||||
|
||||
Tuple2<String, String>? _repo;
|
||||
String get owner {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(fullName!);
|
||||
}
|
||||
return _repo!.item1;
|
||||
}
|
||||
|
||||
String get name {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(fullName!);
|
||||
}
|
||||
return _repo!.item2;
|
||||
}
|
||||
|
||||
GithubNotificationItemRepo();
|
||||
|
||||
factory GithubNotificationItemRepo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubNotificationItemRepoFromJson(json);
|
||||
String? fullName;
|
||||
|
||||
Tuple2<String, String>? _repo;
|
||||
String get owner {
|
||||
_repo ??= parseRepositoryFullName(fullName!);
|
||||
return _repo!.item1;
|
||||
}
|
||||
|
||||
String get name {
|
||||
_repo ??= parseRepositoryFullName(fullName!);
|
||||
return _repo!.item2;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubTreeItem {
|
||||
GithubTreeItem();
|
||||
factory GithubTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubTreeItemFromJson(json);
|
||||
String? name;
|
||||
String? path;
|
||||
int? size;
|
||||
String? type;
|
||||
String? downloadUrl;
|
||||
String? content;
|
||||
GithubTreeItem();
|
||||
factory GithubTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubTreeItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubPagesItem {
|
||||
String? pageName;
|
||||
String? title;
|
||||
String? action;
|
||||
GithubPagesItem();
|
||||
factory GithubPagesItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubPagesItemFromJson(json);
|
||||
String? pageName;
|
||||
String? title;
|
||||
String? action;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubSecurityItem {
|
||||
String? summary;
|
||||
String? description;
|
||||
String? severity;
|
||||
GithubSecurityItem();
|
||||
factory GithubSecurityItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubSecurityItemFromJson(json);
|
||||
String? summary;
|
||||
String? description;
|
||||
String? severity;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubAlertItem {
|
||||
String? affectedPackageName;
|
||||
String? affectedRange;
|
||||
GithubAlertItem();
|
||||
factory GithubAlertItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubAlertItemFromJson(json);
|
||||
String? affectedPackageName;
|
||||
String? affectedRange;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubProjectItem {
|
||||
GithubProjectItem();
|
||||
factory GithubProjectItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubProjectItemFromJson(json);
|
||||
String? name;
|
||||
String? state;
|
||||
String? body;
|
||||
String? htmlUrl;
|
||||
GithubProjectItem();
|
||||
factory GithubProjectItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubProjectItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubProjectColumnItem {
|
||||
String? htmlUrl;
|
||||
String? columnsUrl;
|
||||
String? name;
|
||||
GithubProjectColumnItem();
|
||||
factory GithubProjectColumnItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubProjectColumnItemFromJson(json);
|
||||
String? htmlUrl;
|
||||
String? columnsUrl;
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubInstallationRepositoriesItem {
|
||||
List<GithubNotificationItemRepo>? repositoriesAdded, repositoriesRemoved;
|
||||
String? repositoriesSelection;
|
||||
int? id;
|
||||
GithubInstallationRepositoriesItem();
|
||||
factory GithubInstallationRepositoriesItem.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GithubInstallationRepositoriesItemFromJson(json);
|
||||
List<GithubNotificationItemRepo>? repositoriesAdded, repositoriesRemoved;
|
||||
String? repositoriesSelection;
|
||||
int? id;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubCheckrunItem {
|
||||
String? status;
|
||||
String? name;
|
||||
int? id;
|
||||
GithubCheckrunItem();
|
||||
factory GithubCheckrunItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubCheckrunItemFromJson(json);
|
||||
String? status;
|
||||
String? name;
|
||||
int? id;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubCheckSuiteItem {
|
||||
String? status;
|
||||
String? conclusion;
|
||||
GithubCheckSuiteItem();
|
||||
factory GithubCheckSuiteItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubCheckSuiteItemFromJson(json);
|
||||
String? status;
|
||||
String? conclusion;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubContentReferenceItem {
|
||||
int? id;
|
||||
String? reference;
|
||||
GithubContentReferenceItem();
|
||||
factory GithubContentReferenceItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubContentReferenceItemFromJson(json);
|
||||
int? id;
|
||||
String? reference;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubContributorItem {
|
||||
GithubContributorItem();
|
||||
factory GithubContributorItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubContributorItemFromJson(json);
|
||||
int? id;
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
String? htmlUrl;
|
||||
int? contributions;
|
||||
GithubContributorItem();
|
||||
factory GithubContributorItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubContributorItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubUserOrganizationItem {
|
||||
GithubUserOrganizationItem();
|
||||
factory GithubUserOrganizationItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubUserOrganizationItemFromJson(json);
|
||||
int? id;
|
||||
String? login;
|
||||
String? avatarUrl;
|
||||
String? description;
|
||||
String? url;
|
||||
GithubUserOrganizationItem();
|
||||
factory GithubUserOrganizationItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubUserOrganizationItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
|
@ -339,6 +319,9 @@ class GistFiles {
|
|||
this.truncated,
|
||||
this.content,
|
||||
});
|
||||
|
||||
factory GistFiles.fromJson(Map<String, dynamic> json) =>
|
||||
_$GistFilesFromJson(json);
|
||||
String? filename;
|
||||
int? size;
|
||||
String? rawUrl;
|
||||
|
@ -346,21 +329,21 @@ class GistFiles {
|
|||
String? language;
|
||||
bool? truncated;
|
||||
String? content;
|
||||
|
||||
factory GistFiles.fromJson(Map<String, dynamic> json) =>
|
||||
_$GistFilesFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubGistsItem {
|
||||
GithubGistsItem();
|
||||
factory GithubGistsItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubGistsItemFromJson(json);
|
||||
String? id;
|
||||
String? description;
|
||||
bool? public;
|
||||
Map<String, GistFiles>? files;
|
||||
GithubEventUser? owner;
|
||||
List<GistFiles> get fileNames {
|
||||
List<GistFiles> filenames = [];
|
||||
files!.forEach((String key, GistFiles value) {
|
||||
final filenames = <GistFiles>[];
|
||||
files!.forEach((key, value) {
|
||||
filenames.add(value);
|
||||
});
|
||||
return filenames;
|
||||
|
@ -368,32 +351,28 @@ class GithubGistsItem {
|
|||
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
|
||||
GithubGistsItem();
|
||||
factory GithubGistsItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubGistsItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubFilesItem {
|
||||
GithubFilesItem();
|
||||
factory GithubFilesItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubFilesItemFromJson(json);
|
||||
String? filename;
|
||||
String? status;
|
||||
int? additions;
|
||||
int? deletions;
|
||||
int? changes;
|
||||
String? patch;
|
||||
GithubFilesItem();
|
||||
factory GithubFilesItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubFilesItemFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GithubComparisonItem {
|
||||
GithubComparisonItem();
|
||||
factory GithubComparisonItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubComparisonItemFromJson(json);
|
||||
List<GithubFilesItem>? files;
|
||||
String? status;
|
||||
int? aheadBy;
|
||||
int? behindBy;
|
||||
GithubComparisonItem();
|
||||
factory GithubComparisonItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GithubComparisonItemFromJson(json);
|
||||
}
|
||||
|
|
|
@ -6,22 +6,20 @@ part of 'github.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GithubEvent _$GithubEventFromJson(Map<String, dynamic> json) {
|
||||
return GithubEvent()
|
||||
..actor = json['actor'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['actor'] as Map<String, dynamic>)
|
||||
..type = json['type'] as String?
|
||||
..repo = json['repo'] == null
|
||||
? null
|
||||
: GithubEventRepo.fromJson(json['repo'] as Map<String, dynamic>)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..payload = json['payload'] == null
|
||||
? null
|
||||
: GithubEventPayload.fromJson(json['payload'] as Map<String, dynamic>);
|
||||
}
|
||||
GithubEvent _$GithubEventFromJson(Map<String, dynamic> json) => GithubEvent()
|
||||
..actor = json['actor'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['actor'] as Map<String, dynamic>)
|
||||
..type = json['type'] as String?
|
||||
..repo = json['repo'] == null
|
||||
? null
|
||||
: GithubEventRepo.fromJson(json['repo'] as Map<String, dynamic>)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..payload = json['payload'] == null
|
||||
? null
|
||||
: GithubEventPayload.fromJson(json['payload'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GithubEventToJson(GithubEvent instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -32,11 +30,10 @@ Map<String, dynamic> _$GithubEventToJson(GithubEvent instance) =>
|
|||
'payload': instance.payload,
|
||||
};
|
||||
|
||||
GithubEventUser _$GithubEventUserFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?;
|
||||
}
|
||||
GithubEventUser _$GithubEventUserFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventUser()
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubEventUserToJson(GithubEventUser instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -44,72 +41,71 @@ Map<String, dynamic> _$GithubEventUserToJson(GithubEventUser instance) =>
|
|||
'avatar_url': instance.avatarUrl,
|
||||
};
|
||||
|
||||
GithubEventRepo _$GithubEventRepoFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventRepo()..name = json['name'] as String?;
|
||||
}
|
||||
GithubEventRepo _$GithubEventRepoFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventRepo()..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubEventRepoToJson(GithubEventRepo instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
GithubEventPayload _$GithubEventPayloadFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventPayload()
|
||||
..issue = json['issue'] == null
|
||||
? null
|
||||
: GithubEventIssue.fromJson(json['issue'] as Map<String, dynamic>)
|
||||
..pullRequest = json['pull_request'] == null
|
||||
? null
|
||||
: GithubEventIssue.fromJson(
|
||||
json['pull_request'] as Map<String, dynamic>)
|
||||
..comment = json['comment'] == null
|
||||
? null
|
||||
: GithubEventComment.fromJson(json['comment'] as Map<String, dynamic>)
|
||||
..release = json['release'] == null
|
||||
? null
|
||||
: GithubEventRelease.fromJson(json['release'] as Map<String, dynamic>)
|
||||
..action = json['action'] as String?
|
||||
..ref = json['ref'] as String?
|
||||
..refType = json['ref_type'] as String?
|
||||
..before = json['before'] as String?
|
||||
..head = json['head'] as String?
|
||||
..commits = (json['commits'] as List<dynamic>?)
|
||||
?.map((e) => GithubEventCommit.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..forkee = json['forkee'] as Map<String, dynamic>?
|
||||
..pages = (json['pages'] as List<dynamic>?)
|
||||
?.map((e) => GithubPagesItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..securityAdvisory = json['security_advisory'] == null
|
||||
? null
|
||||
: GithubSecurityItem.fromJson(
|
||||
json['security_advisory'] as Map<String, dynamic>)
|
||||
..alert = json['alert'] == null
|
||||
? null
|
||||
: GithubAlertItem.fromJson(json['alert'] as Map<String, dynamic>)
|
||||
..project = json['project'] == null
|
||||
? null
|
||||
: GithubProjectItem.fromJson(json['project'] as Map<String, dynamic>)
|
||||
..projectColumn = json['project_column'] == null
|
||||
? null
|
||||
: GithubProjectColumnItem.fromJson(
|
||||
json['project_column'] as Map<String, dynamic>)
|
||||
..installation = json['installation'] == null
|
||||
? null
|
||||
: GithubInstallationRepositoriesItem.fromJson(
|
||||
json['installation'] as Map<String, dynamic>)
|
||||
..checkRun = json['check_run'] == null
|
||||
? null
|
||||
: GithubCheckrunItem.fromJson(json['check_run'] as Map<String, dynamic>)
|
||||
..checkSuite = json['check_suite'] == null
|
||||
? null
|
||||
: GithubCheckSuiteItem.fromJson(
|
||||
json['check_suite'] as Map<String, dynamic>)
|
||||
..contentReference = json['content_reference'] == null
|
||||
? null
|
||||
: GithubContentReferenceItem.fromJson(
|
||||
json['content_reference'] as Map<String, dynamic>);
|
||||
}
|
||||
GithubEventPayload _$GithubEventPayloadFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventPayload()
|
||||
..issue = json['issue'] == null
|
||||
? null
|
||||
: GithubEventIssue.fromJson(json['issue'] as Map<String, dynamic>)
|
||||
..pullRequest = json['pull_request'] == null
|
||||
? null
|
||||
: GithubEventIssue.fromJson(
|
||||
json['pull_request'] as Map<String, dynamic>)
|
||||
..comment = json['comment'] == null
|
||||
? null
|
||||
: GithubEventComment.fromJson(json['comment'] as Map<String, dynamic>)
|
||||
..release = json['release'] == null
|
||||
? null
|
||||
: GithubEventRelease.fromJson(json['release'] as Map<String, dynamic>)
|
||||
..action = json['action'] as String?
|
||||
..ref = json['ref'] as String?
|
||||
..refType = json['ref_type'] as String?
|
||||
..before = json['before'] as String?
|
||||
..head = json['head'] as String?
|
||||
..commits = (json['commits'] as List<dynamic>?)
|
||||
?.map((e) => GithubEventCommit.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..forkee = json['forkee'] as Map<String, dynamic>?
|
||||
..pages = (json['pages'] as List<dynamic>?)
|
||||
?.map((e) => GithubPagesItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..securityAdvisory = json['security_advisory'] == null
|
||||
? null
|
||||
: GithubSecurityItem.fromJson(
|
||||
json['security_advisory'] as Map<String, dynamic>)
|
||||
..alert = json['alert'] == null
|
||||
? null
|
||||
: GithubAlertItem.fromJson(json['alert'] as Map<String, dynamic>)
|
||||
..project = json['project'] == null
|
||||
? null
|
||||
: GithubProjectItem.fromJson(json['project'] as Map<String, dynamic>)
|
||||
..projectColumn = json['project_column'] == null
|
||||
? null
|
||||
: GithubProjectColumnItem.fromJson(
|
||||
json['project_column'] as Map<String, dynamic>)
|
||||
..installation = json['installation'] == null
|
||||
? null
|
||||
: GithubInstallationRepositoriesItem.fromJson(
|
||||
json['installation'] as Map<String, dynamic>)
|
||||
..checkRun = json['check_run'] == null
|
||||
? null
|
||||
: GithubCheckrunItem.fromJson(
|
||||
json['check_run'] as Map<String, dynamic>)
|
||||
..checkSuite = json['check_suite'] == null
|
||||
? null
|
||||
: GithubCheckSuiteItem.fromJson(
|
||||
json['check_suite'] as Map<String, dynamic>)
|
||||
..contentReference = json['content_reference'] == null
|
||||
? null
|
||||
: GithubContentReferenceItem.fromJson(
|
||||
json['content_reference'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GithubEventPayloadToJson(GithubEventPayload instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -135,22 +131,21 @@ Map<String, dynamic> _$GithubEventPayloadToJson(GithubEventPayload instance) =>
|
|||
'content_reference': instance.contentReference,
|
||||
};
|
||||
|
||||
GithubEventIssue _$GithubEventIssueFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventIssue()
|
||||
..title = json['title'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..number = json['number'] as int?
|
||||
..body = json['body'] as String?
|
||||
..pullRequest = json['pull_request']
|
||||
..state = json['state'] as String?
|
||||
..comments = json['comments'] as int?
|
||||
..merged = json['merged'] as bool?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
}
|
||||
GithubEventIssue _$GithubEventIssueFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventIssue()
|
||||
..title = json['title'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..number = json['number'] as int?
|
||||
..body = json['body'] as String?
|
||||
..pullRequest = json['pull_request']
|
||||
..state = json['state'] as String?
|
||||
..comments = json['comments'] as int?
|
||||
..merged = json['merged'] as bool?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
|
||||
Map<String, dynamic> _$GithubEventIssueToJson(GithubEventIssue instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -165,15 +160,14 @@ Map<String, dynamic> _$GithubEventIssueToJson(GithubEventIssue instance) =>
|
|||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
GithubEventComment _$GithubEventCommentFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventComment()
|
||||
..body = json['body'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..commitId = json['commit_id'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
}
|
||||
GithubEventComment _$GithubEventCommentFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventComment()
|
||||
..body = json['body'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..commitId = json['commit_id'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubEventCommentToJson(GithubEventComment instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -183,11 +177,10 @@ Map<String, dynamic> _$GithubEventCommentToJson(GithubEventComment instance) =>
|
|||
'html_url': instance.htmlUrl,
|
||||
};
|
||||
|
||||
GithubEventCommit _$GithubEventCommitFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventCommit()
|
||||
..sha = json['sha'] as String?
|
||||
..message = json['message'] as String?;
|
||||
}
|
||||
GithubEventCommit _$GithubEventCommitFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventCommit()
|
||||
..sha = json['sha'] as String?
|
||||
..message = json['message'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubEventCommitToJson(GithubEventCommit instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -195,11 +188,10 @@ Map<String, dynamic> _$GithubEventCommitToJson(GithubEventCommit instance) =>
|
|||
'message': instance.message,
|
||||
};
|
||||
|
||||
GithubEventRelease _$GithubEventReleaseFromJson(Map<String, dynamic> json) {
|
||||
return GithubEventRelease()
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..tagName = json['tag_name'] as String?;
|
||||
}
|
||||
GithubEventRelease _$GithubEventReleaseFromJson(Map<String, dynamic> json) =>
|
||||
GithubEventRelease()
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..tagName = json['tag_name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubEventReleaseToJson(GithubEventRelease instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -208,22 +200,21 @@ Map<String, dynamic> _$GithubEventReleaseToJson(GithubEventRelease instance) =>
|
|||
};
|
||||
|
||||
GithubNotificationItem _$GithubNotificationItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubNotificationItem()
|
||||
..id = json['id'] as String?
|
||||
..subject = json['subject'] == null
|
||||
? null
|
||||
: GithubNotificationItemSubject.fromJson(
|
||||
json['subject'] as Map<String, dynamic>)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GithubNotificationItemRepo.fromJson(
|
||||
json['repository'] as Map<String, dynamic>)
|
||||
..unread = json['unread'] as bool?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubNotificationItem()
|
||||
..id = json['id'] as String?
|
||||
..subject = json['subject'] == null
|
||||
? null
|
||||
: GithubNotificationItemSubject.fromJson(
|
||||
json['subject'] as Map<String, dynamic>)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..repository = json['repository'] == null
|
||||
? null
|
||||
: GithubNotificationItemRepo.fromJson(
|
||||
json['repository'] as Map<String, dynamic>)
|
||||
..unread = json['unread'] as bool?;
|
||||
|
||||
Map<String, dynamic> _$GithubNotificationItemToJson(
|
||||
GithubNotificationItem instance) =>
|
||||
|
@ -236,12 +227,11 @@ Map<String, dynamic> _$GithubNotificationItemToJson(
|
|||
};
|
||||
|
||||
GithubNotificationItemSubject _$GithubNotificationItemSubjectFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubNotificationItemSubject()
|
||||
..title = json['title'] as String?
|
||||
..type = json['type'] as String?
|
||||
..url = json['url'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubNotificationItemSubject()
|
||||
..title = json['title'] as String?
|
||||
..type = json['type'] as String?
|
||||
..url = json['url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubNotificationItemSubjectToJson(
|
||||
GithubNotificationItemSubject instance) =>
|
||||
|
@ -252,9 +242,8 @@ Map<String, dynamic> _$GithubNotificationItemSubjectToJson(
|
|||
};
|
||||
|
||||
GithubNotificationItemRepo _$GithubNotificationItemRepoFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubNotificationItemRepo()..fullName = json['full_name'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubNotificationItemRepo()..fullName = json['full_name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubNotificationItemRepoToJson(
|
||||
GithubNotificationItemRepo instance) =>
|
||||
|
@ -262,15 +251,14 @@ Map<String, dynamic> _$GithubNotificationItemRepoToJson(
|
|||
'full_name': instance.fullName,
|
||||
};
|
||||
|
||||
GithubTreeItem _$GithubTreeItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubTreeItem()
|
||||
..name = json['name'] as String?
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..type = json['type'] as String?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
}
|
||||
GithubTreeItem _$GithubTreeItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubTreeItem()
|
||||
..name = json['name'] as String?
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..type = json['type'] as String?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubTreeItemToJson(GithubTreeItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -282,12 +270,11 @@ Map<String, dynamic> _$GithubTreeItemToJson(GithubTreeItem instance) =>
|
|||
'content': instance.content,
|
||||
};
|
||||
|
||||
GithubPagesItem _$GithubPagesItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubPagesItem()
|
||||
..pageName = json['page_name'] as String?
|
||||
..title = json['title'] as String?
|
||||
..action = json['action'] as String?;
|
||||
}
|
||||
GithubPagesItem _$GithubPagesItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubPagesItem()
|
||||
..pageName = json['page_name'] as String?
|
||||
..title = json['title'] as String?
|
||||
..action = json['action'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubPagesItemToJson(GithubPagesItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -296,12 +283,11 @@ Map<String, dynamic> _$GithubPagesItemToJson(GithubPagesItem instance) =>
|
|||
'action': instance.action,
|
||||
};
|
||||
|
||||
GithubSecurityItem _$GithubSecurityItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubSecurityItem()
|
||||
..summary = json['summary'] as String?
|
||||
..description = json['description'] as String?
|
||||
..severity = json['severity'] as String?;
|
||||
}
|
||||
GithubSecurityItem _$GithubSecurityItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubSecurityItem()
|
||||
..summary = json['summary'] as String?
|
||||
..description = json['description'] as String?
|
||||
..severity = json['severity'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubSecurityItemToJson(GithubSecurityItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -310,11 +296,10 @@ Map<String, dynamic> _$GithubSecurityItemToJson(GithubSecurityItem instance) =>
|
|||
'severity': instance.severity,
|
||||
};
|
||||
|
||||
GithubAlertItem _$GithubAlertItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubAlertItem()
|
||||
..affectedPackageName = json['affected_package_name'] as String?
|
||||
..affectedRange = json['affected_range'] as String?;
|
||||
}
|
||||
GithubAlertItem _$GithubAlertItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubAlertItem()
|
||||
..affectedPackageName = json['affected_package_name'] as String?
|
||||
..affectedRange = json['affected_range'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubAlertItemToJson(GithubAlertItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -322,13 +307,12 @@ Map<String, dynamic> _$GithubAlertItemToJson(GithubAlertItem instance) =>
|
|||
'affected_range': instance.affectedRange,
|
||||
};
|
||||
|
||||
GithubProjectItem _$GithubProjectItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubProjectItem()
|
||||
..name = json['name'] as String?
|
||||
..state = json['state'] as String?
|
||||
..body = json['body'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
}
|
||||
GithubProjectItem _$GithubProjectItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubProjectItem()
|
||||
..name = json['name'] as String?
|
||||
..state = json['state'] as String?
|
||||
..body = json['body'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubProjectItemToJson(GithubProjectItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -339,12 +323,11 @@ Map<String, dynamic> _$GithubProjectItemToJson(GithubProjectItem instance) =>
|
|||
};
|
||||
|
||||
GithubProjectColumnItem _$GithubProjectColumnItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubProjectColumnItem()
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..columnsUrl = json['columns_url'] as String?
|
||||
..name = json['name'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubProjectColumnItem()
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..columnsUrl = json['columns_url'] as String?
|
||||
..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubProjectColumnItemToJson(
|
||||
GithubProjectColumnItem instance) =>
|
||||
|
@ -355,19 +338,18 @@ Map<String, dynamic> _$GithubProjectColumnItemToJson(
|
|||
};
|
||||
|
||||
GithubInstallationRepositoriesItem _$GithubInstallationRepositoriesItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubInstallationRepositoriesItem()
|
||||
..repositoriesAdded = (json['repositories_added'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
GithubNotificationItemRepo.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..repositoriesRemoved = (json['repositories_removed'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
GithubNotificationItemRepo.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..repositoriesSelection = json['repositories_selection'] as String?
|
||||
..id = json['id'] as int?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubInstallationRepositoriesItem()
|
||||
..repositoriesAdded = (json['repositories_added'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
GithubNotificationItemRepo.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..repositoriesRemoved = (json['repositories_removed'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
GithubNotificationItemRepo.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..repositoriesSelection = json['repositories_selection'] as String?
|
||||
..id = json['id'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GithubInstallationRepositoriesItemToJson(
|
||||
GithubInstallationRepositoriesItem instance) =>
|
||||
|
@ -378,12 +360,11 @@ Map<String, dynamic> _$GithubInstallationRepositoriesItemToJson(
|
|||
'id': instance.id,
|
||||
};
|
||||
|
||||
GithubCheckrunItem _$GithubCheckrunItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubCheckrunItem()
|
||||
..status = json['status'] as String?
|
||||
..name = json['name'] as String?
|
||||
..id = json['id'] as int?;
|
||||
}
|
||||
GithubCheckrunItem _$GithubCheckrunItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubCheckrunItem()
|
||||
..status = json['status'] as String?
|
||||
..name = json['name'] as String?
|
||||
..id = json['id'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GithubCheckrunItemToJson(GithubCheckrunItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -392,11 +373,11 @@ Map<String, dynamic> _$GithubCheckrunItemToJson(GithubCheckrunItem instance) =>
|
|||
'id': instance.id,
|
||||
};
|
||||
|
||||
GithubCheckSuiteItem _$GithubCheckSuiteItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubCheckSuiteItem()
|
||||
..status = json['status'] as String?
|
||||
..conclusion = json['conclusion'] as String?;
|
||||
}
|
||||
GithubCheckSuiteItem _$GithubCheckSuiteItemFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
GithubCheckSuiteItem()
|
||||
..status = json['status'] as String?
|
||||
..conclusion = json['conclusion'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubCheckSuiteItemToJson(
|
||||
GithubCheckSuiteItem instance) =>
|
||||
|
@ -406,11 +387,10 @@ Map<String, dynamic> _$GithubCheckSuiteItemToJson(
|
|||
};
|
||||
|
||||
GithubContentReferenceItem _$GithubContentReferenceItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubContentReferenceItem()
|
||||
..id = json['id'] as int?
|
||||
..reference = json['reference'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubContentReferenceItem()
|
||||
..id = json['id'] as int?
|
||||
..reference = json['reference'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubContentReferenceItemToJson(
|
||||
GithubContentReferenceItem instance) =>
|
||||
|
@ -420,14 +400,13 @@ Map<String, dynamic> _$GithubContentReferenceItemToJson(
|
|||
};
|
||||
|
||||
GithubContributorItem _$GithubContributorItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubContributorItem()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..contributions = json['contributions'] as int?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubContributorItem()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..contributions = json['contributions'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GithubContributorItemToJson(
|
||||
GithubContributorItem instance) =>
|
||||
|
@ -440,14 +419,13 @@ Map<String, dynamic> _$GithubContributorItemToJson(
|
|||
};
|
||||
|
||||
GithubUserOrganizationItem _$GithubUserOrganizationItemFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GithubUserOrganizationItem()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..url = json['url'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GithubUserOrganizationItem()
|
||||
..id = json['id'] as int?
|
||||
..login = json['login'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..url = json['url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubUserOrganizationItemToJson(
|
||||
GithubUserOrganizationItem instance) =>
|
||||
|
@ -459,17 +437,15 @@ Map<String, dynamic> _$GithubUserOrganizationItemToJson(
|
|||
'url': instance.url,
|
||||
};
|
||||
|
||||
GistFiles _$GistFilesFromJson(Map<String, dynamic> json) {
|
||||
return GistFiles(
|
||||
filename: json['filename'] as String?,
|
||||
size: json['size'] as int?,
|
||||
rawUrl: json['raw_url'] as String?,
|
||||
type: json['type'] as String?,
|
||||
language: json['language'] as String?,
|
||||
truncated: json['truncated'] as bool?,
|
||||
content: json['content'] as String?,
|
||||
);
|
||||
}
|
||||
GistFiles _$GistFilesFromJson(Map<String, dynamic> json) => GistFiles(
|
||||
filename: json['filename'] as String?,
|
||||
size: json['size'] as int?,
|
||||
rawUrl: json['raw_url'] as String?,
|
||||
type: json['type'] as String?,
|
||||
language: json['language'] as String?,
|
||||
truncated: json['truncated'] as bool?,
|
||||
content: json['content'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GistFilesToJson(GistFiles instance) => <String, dynamic>{
|
||||
'filename': instance.filename,
|
||||
|
@ -481,24 +457,23 @@ Map<String, dynamic> _$GistFilesToJson(GistFiles instance) => <String, dynamic>{
|
|||
'content': instance.content,
|
||||
};
|
||||
|
||||
GithubGistsItem _$GithubGistsItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubGistsItem()
|
||||
..id = json['id'] as String?
|
||||
..description = json['description'] as String?
|
||||
..public = json['public'] as bool?
|
||||
..files = (json['files'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, GistFiles.fromJson(e as Map<String, dynamic>)),
|
||||
)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String);
|
||||
}
|
||||
GithubGistsItem _$GithubGistsItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubGistsItem()
|
||||
..id = json['id'] as String?
|
||||
..description = json['description'] as String?
|
||||
..public = json['public'] as bool?
|
||||
..files = (json['files'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, GistFiles.fromJson(e as Map<String, dynamic>)),
|
||||
)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GithubEventUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String);
|
||||
|
||||
Map<String, dynamic> _$GithubGistsItemToJson(GithubGistsItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -511,15 +486,14 @@ Map<String, dynamic> _$GithubGistsItemToJson(GithubGistsItem instance) =>
|
|||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
GithubFilesItem _$GithubFilesItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubFilesItem()
|
||||
..filename = json['filename'] as String?
|
||||
..status = json['status'] as String?
|
||||
..additions = json['additions'] as int?
|
||||
..deletions = json['deletions'] as int?
|
||||
..changes = json['changes'] as int?
|
||||
..patch = json['patch'] as String?;
|
||||
}
|
||||
GithubFilesItem _$GithubFilesItemFromJson(Map<String, dynamic> json) =>
|
||||
GithubFilesItem()
|
||||
..filename = json['filename'] as String?
|
||||
..status = json['status'] as String?
|
||||
..additions = json['additions'] as int?
|
||||
..deletions = json['deletions'] as int?
|
||||
..changes = json['changes'] as int?
|
||||
..patch = json['patch'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GithubFilesItemToJson(GithubFilesItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -531,15 +505,15 @@ Map<String, dynamic> _$GithubFilesItemToJson(GithubFilesItem instance) =>
|
|||
'patch': instance.patch,
|
||||
};
|
||||
|
||||
GithubComparisonItem _$GithubComparisonItemFromJson(Map<String, dynamic> json) {
|
||||
return GithubComparisonItem()
|
||||
..files = (json['files'] as List<dynamic>?)
|
||||
?.map((e) => GithubFilesItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..status = json['status'] as String?
|
||||
..aheadBy = json['ahead_by'] as int?
|
||||
..behindBy = json['behind_by'] as int?;
|
||||
}
|
||||
GithubComparisonItem _$GithubComparisonItemFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
GithubComparisonItem()
|
||||
..files = (json['files'] as List<dynamic>?)
|
||||
?.map((e) => GithubFilesItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..status = json['status'] as String?
|
||||
..aheadBy = json['ahead_by'] as int?
|
||||
..behindBy = json['behind_by'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GithubComparisonItemToJson(
|
||||
GithubComparisonItem instance) =>
|
||||
|
|
|
@ -4,6 +4,9 @@ part 'gitlab.g.dart';
|
|||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabUser {
|
||||
GitlabUser();
|
||||
factory GitlabUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabUserFromJson(json);
|
||||
int? id;
|
||||
String? username;
|
||||
String? name;
|
||||
|
@ -11,70 +14,70 @@ class GitlabUser {
|
|||
String? bio;
|
||||
DateTime? createdAt;
|
||||
int? accessLevel;
|
||||
GitlabUser();
|
||||
factory GitlabUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabGroup {
|
||||
GitlabGroup();
|
||||
factory GitlabGroup.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabGroupFromJson(json);
|
||||
int? id;
|
||||
String? path;
|
||||
String? name;
|
||||
String? avatarUrl;
|
||||
String? description;
|
||||
List<GitlabProject>? projects;
|
||||
GitlabGroup();
|
||||
factory GitlabGroup.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabGroupFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabTodoProject {
|
||||
String? pathWithNamespace;
|
||||
GitlabTodoProject();
|
||||
factory GitlabTodoProject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTodoProjectFromJson(json);
|
||||
String? pathWithNamespace;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabTodo {
|
||||
GitlabTodo();
|
||||
factory GitlabTodo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTodoFromJson(json);
|
||||
GitlabUser? author;
|
||||
GitlabTodoProject? project;
|
||||
String? actionName;
|
||||
String? targetType;
|
||||
GitlabTodoTarget? target;
|
||||
GitlabTodo();
|
||||
factory GitlabTodo.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTodoFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabTodoTarget {
|
||||
GitlabTodoTarget();
|
||||
factory GitlabTodoTarget.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTodoTargetFromJson(json);
|
||||
int? iid;
|
||||
int? projectId;
|
||||
String? title;
|
||||
GitlabUser? author;
|
||||
String? description;
|
||||
DateTime? createdAt;
|
||||
GitlabTodoTarget();
|
||||
factory GitlabTodoTarget.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTodoTargetFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabIssueNote {
|
||||
GitlabIssueNote();
|
||||
factory GitlabIssueNote.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabIssueNoteFromJson(json);
|
||||
GitlabUser? author;
|
||||
String? body;
|
||||
bool? system;
|
||||
DateTime? createdAt;
|
||||
GitlabIssueNote();
|
||||
factory GitlabIssueNote.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabIssueNoteFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabProject {
|
||||
GitlabProject();
|
||||
factory GitlabProject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectFromJson(json);
|
||||
int? id;
|
||||
String? name;
|
||||
String? avatarUrl;
|
||||
|
@ -93,103 +96,103 @@ class GitlabProject {
|
|||
DateTime? lastActivityAt;
|
||||
DateTime? createdAt;
|
||||
String? defaultBranch;
|
||||
GitlabProject();
|
||||
factory GitlabProject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabProjectBadge {
|
||||
String? renderedImageUrl;
|
||||
GitlabProjectBadge();
|
||||
factory GitlabProjectBadge.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectBadgeFromJson(json);
|
||||
String? renderedImageUrl;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabProjectStatistics {
|
||||
int? commitCount;
|
||||
int? repositorySize;
|
||||
GitlabProjectStatistics();
|
||||
factory GitlabProjectStatistics.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectStatisticsFromJson(json);
|
||||
int? commitCount;
|
||||
int? repositorySize;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabProjectNamespace {
|
||||
GitlabProjectNamespace();
|
||||
factory GitlabProjectNamespace.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectNamespaceFromJson(json);
|
||||
int? id;
|
||||
String? name;
|
||||
String? path;
|
||||
String? kind;
|
||||
GitlabProjectNamespace();
|
||||
factory GitlabProjectNamespace.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabProjectNamespaceFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabTreeItem {
|
||||
String type;
|
||||
String path;
|
||||
String name;
|
||||
GitlabTreeItem({required this.type, required this.path, required this.name});
|
||||
factory GitlabTreeItem.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabTreeItemFromJson(json);
|
||||
String type;
|
||||
String path;
|
||||
String name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabBlob {
|
||||
String? content;
|
||||
GitlabBlob();
|
||||
factory GitlabBlob.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabBlobFromJson(json);
|
||||
String? content;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabEvent {
|
||||
GitlabEvent();
|
||||
factory GitlabEvent.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabEventFromJson(json);
|
||||
GitlabUser? author;
|
||||
String? actionName;
|
||||
String? targetType;
|
||||
GitlabEventNote? note;
|
||||
GitlabEvent();
|
||||
factory GitlabEvent.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabEventFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabEventNote {
|
||||
String? body;
|
||||
String? noteableType;
|
||||
int? noteableIid;
|
||||
GitlabEventNote();
|
||||
factory GitlabEventNote.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabEventNoteFromJson(json);
|
||||
String? body;
|
||||
String? noteableType;
|
||||
int? noteableIid;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabCommit {
|
||||
GitlabCommit();
|
||||
factory GitlabCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabCommitFromJson(json);
|
||||
String? id;
|
||||
String? shortId;
|
||||
String? title;
|
||||
DateTime? createdAt;
|
||||
String? authorName;
|
||||
String? message;
|
||||
GitlabCommit();
|
||||
factory GitlabCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabCommitFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabDiff {
|
||||
String? diff;
|
||||
String? newPath;
|
||||
String? oldPath;
|
||||
GitlabDiff();
|
||||
factory GitlabDiff.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabDiffFromJson(json);
|
||||
String? diff;
|
||||
String? newPath;
|
||||
String? oldPath;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabIssue {
|
||||
GitlabIssue();
|
||||
factory GitlabIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabIssueFromJson(json);
|
||||
String? title;
|
||||
int? iid;
|
||||
int? projectId;
|
||||
|
@ -197,25 +200,22 @@ class GitlabIssue {
|
|||
int? userNotesCount;
|
||||
DateTime? updatedAt;
|
||||
List<String>? labels;
|
||||
GitlabIssue();
|
||||
factory GitlabIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabIssueFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabStarrer {
|
||||
DateTime? starredSince;
|
||||
GitlabUser? user;
|
||||
GitlabStarrer();
|
||||
factory GitlabStarrer.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabStarrerFromJson(json);
|
||||
DateTime? starredSince;
|
||||
GitlabUser? user;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GitlabBranch {
|
||||
String? name;
|
||||
bool? merged;
|
||||
GitlabBranch();
|
||||
factory GitlabBranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GitlabBranchFromJson(json);
|
||||
String? name;
|
||||
bool? merged;
|
||||
}
|
||||
|
|
|
@ -6,18 +6,16 @@ part of 'gitlab.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GitlabUser _$GitlabUserFromJson(Map<String, dynamic> json) {
|
||||
return GitlabUser()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..bio = json['bio'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..accessLevel = json['access_level'] as int?;
|
||||
}
|
||||
GitlabUser _$GitlabUserFromJson(Map<String, dynamic> json) => GitlabUser()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..bio = json['bio'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..accessLevel = json['access_level'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GitlabUserToJson(GitlabUser instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -30,17 +28,15 @@ Map<String, dynamic> _$GitlabUserToJson(GitlabUser instance) =>
|
|||
'access_level': instance.accessLevel,
|
||||
};
|
||||
|
||||
GitlabGroup _$GitlabGroupFromJson(Map<String, dynamic> json) {
|
||||
return GitlabGroup()
|
||||
..id = json['id'] as int?
|
||||
..path = json['path'] as String?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..projects = (json['projects'] as List<dynamic>?)
|
||||
?.map((e) => GitlabProject.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
GitlabGroup _$GitlabGroupFromJson(Map<String, dynamic> json) => GitlabGroup()
|
||||
..id = json['id'] as int?
|
||||
..path = json['path'] as String?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..projects = (json['projects'] as List<dynamic>?)
|
||||
?.map((e) => GitlabProject.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
Map<String, dynamic> _$GitlabGroupToJson(GitlabGroup instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -52,30 +48,27 @@ Map<String, dynamic> _$GitlabGroupToJson(GitlabGroup instance) =>
|
|||
'projects': instance.projects,
|
||||
};
|
||||
|
||||
GitlabTodoProject _$GitlabTodoProjectFromJson(Map<String, dynamic> json) {
|
||||
return GitlabTodoProject()
|
||||
..pathWithNamespace = json['path_with_namespace'] as String?;
|
||||
}
|
||||
GitlabTodoProject _$GitlabTodoProjectFromJson(Map<String, dynamic> json) =>
|
||||
GitlabTodoProject()
|
||||
..pathWithNamespace = json['path_with_namespace'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabTodoProjectToJson(GitlabTodoProject instance) =>
|
||||
<String, dynamic>{
|
||||
'path_with_namespace': instance.pathWithNamespace,
|
||||
};
|
||||
|
||||
GitlabTodo _$GitlabTodoFromJson(Map<String, dynamic> json) {
|
||||
return GitlabTodo()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..project = json['project'] == null
|
||||
? null
|
||||
: GitlabTodoProject.fromJson(json['project'] as Map<String, dynamic>)
|
||||
..actionName = json['action_name'] as String?
|
||||
..targetType = json['target_type'] as String?
|
||||
..target = json['target'] == null
|
||||
? null
|
||||
: GitlabTodoTarget.fromJson(json['target'] as Map<String, dynamic>);
|
||||
}
|
||||
GitlabTodo _$GitlabTodoFromJson(Map<String, dynamic> json) => GitlabTodo()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..project = json['project'] == null
|
||||
? null
|
||||
: GitlabTodoProject.fromJson(json['project'] as Map<String, dynamic>)
|
||||
..actionName = json['action_name'] as String?
|
||||
..targetType = json['target_type'] as String?
|
||||
..target = json['target'] == null
|
||||
? null
|
||||
: GitlabTodoTarget.fromJson(json['target'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GitlabTodoToJson(GitlabTodo instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -86,19 +79,18 @@ Map<String, dynamic> _$GitlabTodoToJson(GitlabTodo instance) =>
|
|||
'target': instance.target,
|
||||
};
|
||||
|
||||
GitlabTodoTarget _$GitlabTodoTargetFromJson(Map<String, dynamic> json) {
|
||||
return GitlabTodoTarget()
|
||||
..iid = json['iid'] as int?
|
||||
..projectId = json['project_id'] as int?
|
||||
..title = json['title'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..description = json['description'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
}
|
||||
GitlabTodoTarget _$GitlabTodoTargetFromJson(Map<String, dynamic> json) =>
|
||||
GitlabTodoTarget()
|
||||
..iid = json['iid'] as int?
|
||||
..projectId = json['project_id'] as int?
|
||||
..title = json['title'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..description = json['description'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
|
||||
Map<String, dynamic> _$GitlabTodoTargetToJson(GitlabTodoTarget instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -110,17 +102,16 @@ Map<String, dynamic> _$GitlabTodoTargetToJson(GitlabTodoTarget instance) =>
|
|||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
GitlabIssueNote _$GitlabIssueNoteFromJson(Map<String, dynamic> json) {
|
||||
return GitlabIssueNote()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..body = json['body'] as String?
|
||||
..system = json['system'] as bool?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
}
|
||||
GitlabIssueNote _$GitlabIssueNoteFromJson(Map<String, dynamic> json) =>
|
||||
GitlabIssueNote()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..body = json['body'] as String?
|
||||
..system = json['system'] as bool?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String);
|
||||
|
||||
Map<String, dynamic> _$GitlabIssueNoteToJson(GitlabIssueNote instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -130,39 +121,38 @@ Map<String, dynamic> _$GitlabIssueNoteToJson(GitlabIssueNote instance) =>
|
|||
'created_at': instance.createdAt?.toIso8601String(),
|
||||
};
|
||||
|
||||
GitlabProject _$GitlabProjectFromJson(Map<String, dynamic> json) {
|
||||
return GitlabProject()
|
||||
..id = json['id'] as int?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..starCount = json['star_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..visibility = json['visibility'] as String?
|
||||
..readmeUrl = json['readme_url'] as String?
|
||||
..webUrl = json['web_url'] as String?
|
||||
..namespace = json['namespace'] == null
|
||||
? null
|
||||
: GitlabProjectNamespace.fromJson(
|
||||
json['namespace'] as Map<String, dynamic>)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..issuesEnabled = json['issues_enabled'] as bool?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..mergeRequestsEnabled = json['merge_requests_enabled'] as bool?
|
||||
..statistics = json['statistics'] == null
|
||||
? null
|
||||
: GitlabProjectStatistics.fromJson(
|
||||
json['statistics'] as Map<String, dynamic>)
|
||||
..lastActivityAt = json['last_activity_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_activity_at'] as String)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..defaultBranch = json['default_branch'] as String?;
|
||||
}
|
||||
GitlabProject _$GitlabProjectFromJson(Map<String, dynamic> json) =>
|
||||
GitlabProject()
|
||||
..id = json['id'] as int?
|
||||
..name = json['name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..starCount = json['star_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..visibility = json['visibility'] as String?
|
||||
..readmeUrl = json['readme_url'] as String?
|
||||
..webUrl = json['web_url'] as String?
|
||||
..namespace = json['namespace'] == null
|
||||
? null
|
||||
: GitlabProjectNamespace.fromJson(
|
||||
json['namespace'] as Map<String, dynamic>)
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..issuesEnabled = json['issues_enabled'] as bool?
|
||||
..openIssuesCount = json['open_issues_count'] as int?
|
||||
..mergeRequestsEnabled = json['merge_requests_enabled'] as bool?
|
||||
..statistics = json['statistics'] == null
|
||||
? null
|
||||
: GitlabProjectStatistics.fromJson(
|
||||
json['statistics'] as Map<String, dynamic>)
|
||||
..lastActivityAt = json['last_activity_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['last_activity_at'] as String)
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..defaultBranch = json['default_branch'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabProjectToJson(GitlabProject instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -186,10 +176,9 @@ Map<String, dynamic> _$GitlabProjectToJson(GitlabProject instance) =>
|
|||
'default_branch': instance.defaultBranch,
|
||||
};
|
||||
|
||||
GitlabProjectBadge _$GitlabProjectBadgeFromJson(Map<String, dynamic> json) {
|
||||
return GitlabProjectBadge()
|
||||
..renderedImageUrl = json['rendered_image_url'] as String?;
|
||||
}
|
||||
GitlabProjectBadge _$GitlabProjectBadgeFromJson(Map<String, dynamic> json) =>
|
||||
GitlabProjectBadge()
|
||||
..renderedImageUrl = json['rendered_image_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabProjectBadgeToJson(GitlabProjectBadge instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -197,11 +186,10 @@ Map<String, dynamic> _$GitlabProjectBadgeToJson(GitlabProjectBadge instance) =>
|
|||
};
|
||||
|
||||
GitlabProjectStatistics _$GitlabProjectStatisticsFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GitlabProjectStatistics()
|
||||
..commitCount = json['commit_count'] as int?
|
||||
..repositorySize = json['repository_size'] as int?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GitlabProjectStatistics()
|
||||
..commitCount = json['commit_count'] as int?
|
||||
..repositorySize = json['repository_size'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GitlabProjectStatisticsToJson(
|
||||
GitlabProjectStatistics instance) =>
|
||||
|
@ -211,13 +199,12 @@ Map<String, dynamic> _$GitlabProjectStatisticsToJson(
|
|||
};
|
||||
|
||||
GitlabProjectNamespace _$GitlabProjectNamespaceFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return GitlabProjectNamespace()
|
||||
..id = json['id'] as int?
|
||||
..name = json['name'] as String?
|
||||
..path = json['path'] as String?
|
||||
..kind = json['kind'] as String?;
|
||||
}
|
||||
Map<String, dynamic> json) =>
|
||||
GitlabProjectNamespace()
|
||||
..id = json['id'] as int?
|
||||
..name = json['name'] as String?
|
||||
..path = json['path'] as String?
|
||||
..kind = json['kind'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabProjectNamespaceToJson(
|
||||
GitlabProjectNamespace instance) =>
|
||||
|
@ -228,13 +215,12 @@ Map<String, dynamic> _$GitlabProjectNamespaceToJson(
|
|||
'kind': instance.kind,
|
||||
};
|
||||
|
||||
GitlabTreeItem _$GitlabTreeItemFromJson(Map<String, dynamic> json) {
|
||||
return GitlabTreeItem(
|
||||
type: json['type'] as String,
|
||||
path: json['path'] as String,
|
||||
name: json['name'] as String,
|
||||
);
|
||||
}
|
||||
GitlabTreeItem _$GitlabTreeItemFromJson(Map<String, dynamic> json) =>
|
||||
GitlabTreeItem(
|
||||
type: json['type'] as String,
|
||||
path: json['path'] as String,
|
||||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GitlabTreeItemToJson(GitlabTreeItem instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -243,26 +229,23 @@ Map<String, dynamic> _$GitlabTreeItemToJson(GitlabTreeItem instance) =>
|
|||
'name': instance.name,
|
||||
};
|
||||
|
||||
GitlabBlob _$GitlabBlobFromJson(Map<String, dynamic> json) {
|
||||
return GitlabBlob()..content = json['content'] as String?;
|
||||
}
|
||||
GitlabBlob _$GitlabBlobFromJson(Map<String, dynamic> json) =>
|
||||
GitlabBlob()..content = json['content'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabBlobToJson(GitlabBlob instance) =>
|
||||
<String, dynamic>{
|
||||
'content': instance.content,
|
||||
};
|
||||
|
||||
GitlabEvent _$GitlabEventFromJson(Map<String, dynamic> json) {
|
||||
return GitlabEvent()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..actionName = json['action_name'] as String?
|
||||
..targetType = json['target_type'] as String?
|
||||
..note = json['note'] == null
|
||||
? null
|
||||
: GitlabEventNote.fromJson(json['note'] as Map<String, dynamic>);
|
||||
}
|
||||
GitlabEvent _$GitlabEventFromJson(Map<String, dynamic> json) => GitlabEvent()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..actionName = json['action_name'] as String?
|
||||
..targetType = json['target_type'] as String?
|
||||
..note = json['note'] == null
|
||||
? null
|
||||
: GitlabEventNote.fromJson(json['note'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GitlabEventToJson(GitlabEvent instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -272,12 +255,11 @@ Map<String, dynamic> _$GitlabEventToJson(GitlabEvent instance) =>
|
|||
'note': instance.note,
|
||||
};
|
||||
|
||||
GitlabEventNote _$GitlabEventNoteFromJson(Map<String, dynamic> json) {
|
||||
return GitlabEventNote()
|
||||
..body = json['body'] as String?
|
||||
..noteableType = json['noteable_type'] as String?
|
||||
..noteableIid = json['noteable_iid'] as int?;
|
||||
}
|
||||
GitlabEventNote _$GitlabEventNoteFromJson(Map<String, dynamic> json) =>
|
||||
GitlabEventNote()
|
||||
..body = json['body'] as String?
|
||||
..noteableType = json['noteable_type'] as String?
|
||||
..noteableIid = json['noteable_iid'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GitlabEventNoteToJson(GitlabEventNote instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -286,17 +268,15 @@ Map<String, dynamic> _$GitlabEventNoteToJson(GitlabEventNote instance) =>
|
|||
'noteable_iid': instance.noteableIid,
|
||||
};
|
||||
|
||||
GitlabCommit _$GitlabCommitFromJson(Map<String, dynamic> json) {
|
||||
return GitlabCommit()
|
||||
..id = json['id'] as String?
|
||||
..shortId = json['short_id'] as String?
|
||||
..title = json['title'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..authorName = json['author_name'] as String?
|
||||
..message = json['message'] as String?;
|
||||
}
|
||||
GitlabCommit _$GitlabCommitFromJson(Map<String, dynamic> json) => GitlabCommit()
|
||||
..id = json['id'] as String?
|
||||
..shortId = json['short_id'] as String?
|
||||
..title = json['title'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..authorName = json['author_name'] as String?
|
||||
..message = json['message'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabCommitToJson(GitlabCommit instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -308,12 +288,10 @@ Map<String, dynamic> _$GitlabCommitToJson(GitlabCommit instance) =>
|
|||
'message': instance.message,
|
||||
};
|
||||
|
||||
GitlabDiff _$GitlabDiffFromJson(Map<String, dynamic> json) {
|
||||
return GitlabDiff()
|
||||
..diff = json['diff'] as String?
|
||||
..newPath = json['new_path'] as String?
|
||||
..oldPath = json['old_path'] as String?;
|
||||
}
|
||||
GitlabDiff _$GitlabDiffFromJson(Map<String, dynamic> json) => GitlabDiff()
|
||||
..diff = json['diff'] as String?
|
||||
..newPath = json['new_path'] as String?
|
||||
..oldPath = json['old_path'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GitlabDiffToJson(GitlabDiff instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -322,21 +300,19 @@ Map<String, dynamic> _$GitlabDiffToJson(GitlabDiff instance) =>
|
|||
'old_path': instance.oldPath,
|
||||
};
|
||||
|
||||
GitlabIssue _$GitlabIssueFromJson(Map<String, dynamic> json) {
|
||||
return GitlabIssue()
|
||||
..title = json['title'] as String?
|
||||
..iid = json['iid'] as int?
|
||||
..projectId = json['project_id'] as int?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..userNotesCount = json['user_notes_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..labels =
|
||||
(json['labels'] as List<dynamic>?)?.map((e) => e as String).toList();
|
||||
}
|
||||
GitlabIssue _$GitlabIssueFromJson(Map<String, dynamic> json) => GitlabIssue()
|
||||
..title = json['title'] as String?
|
||||
..iid = json['iid'] as int?
|
||||
..projectId = json['project_id'] as int?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..userNotesCount = json['user_notes_count'] as int?
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..labels =
|
||||
(json['labels'] as List<dynamic>?)?.map((e) => e as String).toList();
|
||||
|
||||
Map<String, dynamic> _$GitlabIssueToJson(GitlabIssue instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -349,15 +325,14 @@ Map<String, dynamic> _$GitlabIssueToJson(GitlabIssue instance) =>
|
|||
'labels': instance.labels,
|
||||
};
|
||||
|
||||
GitlabStarrer _$GitlabStarrerFromJson(Map<String, dynamic> json) {
|
||||
return GitlabStarrer()
|
||||
..starredSince = json['starred_since'] == null
|
||||
? null
|
||||
: DateTime.parse(json['starred_since'] as String)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['user'] as Map<String, dynamic>);
|
||||
}
|
||||
GitlabStarrer _$GitlabStarrerFromJson(Map<String, dynamic> json) =>
|
||||
GitlabStarrer()
|
||||
..starredSince = json['starred_since'] == null
|
||||
? null
|
||||
: DateTime.parse(json['starred_since'] as String)
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GitlabUser.fromJson(json['user'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GitlabStarrerToJson(GitlabStarrer instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -365,11 +340,9 @@ Map<String, dynamic> _$GitlabStarrerToJson(GitlabStarrer instance) =>
|
|||
'user': instance.user,
|
||||
};
|
||||
|
||||
GitlabBranch _$GitlabBranchFromJson(Map<String, dynamic> json) {
|
||||
return GitlabBranch()
|
||||
..name = json['name'] as String?
|
||||
..merged = json['merged'] as bool?;
|
||||
}
|
||||
GitlabBranch _$GitlabBranchFromJson(Map<String, dynamic> json) => GitlabBranch()
|
||||
..name = json['name'] as String?
|
||||
..merged = json['merged'] as bool?;
|
||||
|
||||
Map<String, dynamic> _$GitlabBranchToJson(GitlabBranch instance) =>
|
||||
<String, dynamic>{
|
||||
|
|
|
@ -4,18 +4,21 @@ part 'gogs.g.dart';
|
|||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsUser {
|
||||
GogsUser();
|
||||
factory GogsUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsUserFromJson(json);
|
||||
int? id;
|
||||
String? username;
|
||||
String? fullName;
|
||||
String? avatarUrl;
|
||||
String? email;
|
||||
GogsUser();
|
||||
factory GogsUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsUserFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsRepository {
|
||||
GogsRepository();
|
||||
factory GogsRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsRepositoryFromJson(json);
|
||||
int? id;
|
||||
String? fullName;
|
||||
bool? private;
|
||||
|
@ -29,13 +32,13 @@ class GogsRepository {
|
|||
int? forksCount;
|
||||
String? website;
|
||||
int? watchersCount;
|
||||
GogsRepository();
|
||||
factory GogsRepository.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsRepositoryFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsOrg {
|
||||
GogsOrg();
|
||||
factory GogsOrg.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsOrgFromJson(json);
|
||||
int? id;
|
||||
String? username;
|
||||
String? fullName;
|
||||
|
@ -43,73 +46,72 @@ class GogsOrg {
|
|||
String? description;
|
||||
String? location;
|
||||
String? website;
|
||||
GogsOrg();
|
||||
factory GogsOrg.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsOrgFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsTree {
|
||||
GogsTree({required this.type, required this.name});
|
||||
factory GogsTree.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsTreeFromJson(json);
|
||||
String type;
|
||||
String name;
|
||||
String? path;
|
||||
int? size;
|
||||
String? downloadUrl;
|
||||
GogsTree({required this.type, required this.name});
|
||||
factory GogsTree.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsTreeFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsBlob extends GogsTree {
|
||||
String? content;
|
||||
GogsBlob({required String type, required String name})
|
||||
: super(name: name, type: type);
|
||||
GogsBlob({required super.type, required super.name});
|
||||
factory GogsBlob.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsBlobFromJson(json);
|
||||
String? content;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsBranch {
|
||||
String? name;
|
||||
GogsBranch();
|
||||
factory GogsBranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsBranchFromJson(json);
|
||||
String? name;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsCommit {
|
||||
GogsCommit();
|
||||
factory GogsCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsCommitFromJson(json);
|
||||
GogsUser? author;
|
||||
GogsCommitDetail? commit;
|
||||
String? sha;
|
||||
String? htmlUrl;
|
||||
GogsCommit();
|
||||
factory GogsCommit.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsCommitFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsCommitDetail {
|
||||
String? message;
|
||||
GogsCommitAuthor? author;
|
||||
GogsCommitAuthor? committer;
|
||||
GogsCommitDetail();
|
||||
factory GogsCommitDetail.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsCommitDetailFromJson(json);
|
||||
String? message;
|
||||
GogsCommitAuthor? author;
|
||||
GogsCommitAuthor? committer;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsCommitAuthor {
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
GogsCommitAuthor();
|
||||
factory GogsCommitAuthor.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsCommitAuthorFromJson(json);
|
||||
String? name;
|
||||
String? email;
|
||||
DateTime? date;
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsIssue {
|
||||
GogsIssue();
|
||||
factory GogsIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsIssueFromJson(json);
|
||||
int? number;
|
||||
String? state;
|
||||
String? title;
|
||||
|
@ -119,16 +121,13 @@ class GogsIssue {
|
|||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
int? comments;
|
||||
GogsIssue();
|
||||
factory GogsIssue.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsIssueFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class GogsLabel {
|
||||
String? name;
|
||||
String? color;
|
||||
GogsLabel();
|
||||
factory GogsLabel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GogsLabelFromJson(json);
|
||||
String? name;
|
||||
String? color;
|
||||
}
|
||||
|
|
|
@ -6,14 +6,12 @@ part of 'gogs.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GogsUser _$GogsUserFromJson(Map<String, dynamic> json) {
|
||||
return GogsUser()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..email = json['email'] as String?;
|
||||
}
|
||||
GogsUser _$GogsUserFromJson(Map<String, dynamic> json) => GogsUser()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..email = json['email'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsUserToJson(GogsUser instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
|
@ -23,28 +21,27 @@ Map<String, dynamic> _$GogsUserToJson(GogsUser instance) => <String, dynamic>{
|
|||
'email': instance.email,
|
||||
};
|
||||
|
||||
GogsRepository _$GogsRepositoryFromJson(Map<String, dynamic> json) {
|
||||
return GogsRepository()
|
||||
..id = json['id'] as int?
|
||||
..fullName = json['full_name'] as String?
|
||||
..private = json['private'] as bool?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..defaultBranch = json['default_branch'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..starsCount = json['stars_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..website = json['website'] as String?
|
||||
..watchersCount = json['watchers_count'] as int?;
|
||||
}
|
||||
GogsRepository _$GogsRepositoryFromJson(Map<String, dynamic> json) =>
|
||||
GogsRepository()
|
||||
..id = json['id'] as int?
|
||||
..fullName = json['full_name'] as String?
|
||||
..private = json['private'] as bool?
|
||||
..owner = json['owner'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['owner'] as Map<String, dynamic>)
|
||||
..htmlUrl = json['html_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..defaultBranch = json['default_branch'] as String?
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..starsCount = json['stars_count'] as int?
|
||||
..forksCount = json['forks_count'] as int?
|
||||
..website = json['website'] as String?
|
||||
..watchersCount = json['watchers_count'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GogsRepositoryToJson(GogsRepository instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -63,16 +60,14 @@ Map<String, dynamic> _$GogsRepositoryToJson(GogsRepository instance) =>
|
|||
'watchers_count': instance.watchersCount,
|
||||
};
|
||||
|
||||
GogsOrg _$GogsOrgFromJson(Map<String, dynamic> json) {
|
||||
return GogsOrg()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..location = json['location'] as String?
|
||||
..website = json['website'] as String?;
|
||||
}
|
||||
GogsOrg _$GogsOrgFromJson(Map<String, dynamic> json) => GogsOrg()
|
||||
..id = json['id'] as int?
|
||||
..username = json['username'] as String?
|
||||
..fullName = json['full_name'] as String?
|
||||
..avatarUrl = json['avatar_url'] as String?
|
||||
..description = json['description'] as String?
|
||||
..location = json['location'] as String?
|
||||
..website = json['website'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsOrgToJson(GogsOrg instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
|
@ -84,15 +79,13 @@ Map<String, dynamic> _$GogsOrgToJson(GogsOrg instance) => <String, dynamic>{
|
|||
'website': instance.website,
|
||||
};
|
||||
|
||||
GogsTree _$GogsTreeFromJson(Map<String, dynamic> json) {
|
||||
return GogsTree(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?;
|
||||
}
|
||||
GogsTree _$GogsTreeFromJson(Map<String, dynamic> json) => GogsTree(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsTreeToJson(GogsTree instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
|
@ -102,16 +95,14 @@ Map<String, dynamic> _$GogsTreeToJson(GogsTree instance) => <String, dynamic>{
|
|||
'download_url': instance.downloadUrl,
|
||||
};
|
||||
|
||||
GogsBlob _$GogsBlobFromJson(Map<String, dynamic> json) {
|
||||
return GogsBlob(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
}
|
||||
GogsBlob _$GogsBlobFromJson(Map<String, dynamic> json) => GogsBlob(
|
||||
type: json['type'] as String,
|
||||
name: json['name'] as String,
|
||||
)
|
||||
..path = json['path'] as String?
|
||||
..size = json['size'] as int?
|
||||
..downloadUrl = json['download_url'] as String?
|
||||
..content = json['content'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsBlobToJson(GogsBlob instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
|
@ -122,26 +113,23 @@ Map<String, dynamic> _$GogsBlobToJson(GogsBlob instance) => <String, dynamic>{
|
|||
'content': instance.content,
|
||||
};
|
||||
|
||||
GogsBranch _$GogsBranchFromJson(Map<String, dynamic> json) {
|
||||
return GogsBranch()..name = json['name'] as String?;
|
||||
}
|
||||
GogsBranch _$GogsBranchFromJson(Map<String, dynamic> json) =>
|
||||
GogsBranch()..name = json['name'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsBranchToJson(GogsBranch instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
GogsCommit _$GogsCommitFromJson(Map<String, dynamic> json) {
|
||||
return GogsCommit()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GogsCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
}
|
||||
GogsCommit _$GogsCommitFromJson(Map<String, dynamic> json) => GogsCommit()
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..commit = json['commit'] == null
|
||||
? null
|
||||
: GogsCommitDetail.fromJson(json['commit'] as Map<String, dynamic>)
|
||||
..sha = json['sha'] as String?
|
||||
..htmlUrl = json['html_url'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsCommitToJson(GogsCommit instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -151,16 +139,16 @@ Map<String, dynamic> _$GogsCommitToJson(GogsCommit instance) =>
|
|||
'html_url': instance.htmlUrl,
|
||||
};
|
||||
|
||||
GogsCommitDetail _$GogsCommitDetailFromJson(Map<String, dynamic> json) {
|
||||
return GogsCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GogsCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GogsCommitAuthor.fromJson(json['committer'] as Map<String, dynamic>);
|
||||
}
|
||||
GogsCommitDetail _$GogsCommitDetailFromJson(Map<String, dynamic> json) =>
|
||||
GogsCommitDetail()
|
||||
..message = json['message'] as String?
|
||||
..author = json['author'] == null
|
||||
? null
|
||||
: GogsCommitAuthor.fromJson(json['author'] as Map<String, dynamic>)
|
||||
..committer = json['committer'] == null
|
||||
? null
|
||||
: GogsCommitAuthor.fromJson(
|
||||
json['committer'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$GogsCommitDetailToJson(GogsCommitDetail instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -169,13 +157,12 @@ Map<String, dynamic> _$GogsCommitDetailToJson(GogsCommitDetail instance) =>
|
|||
'committer': instance.committer,
|
||||
};
|
||||
|
||||
GogsCommitAuthor _$GogsCommitAuthorFromJson(Map<String, dynamic> json) {
|
||||
return GogsCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
}
|
||||
GogsCommitAuthor _$GogsCommitAuthorFromJson(Map<String, dynamic> json) =>
|
||||
GogsCommitAuthor()
|
||||
..name = json['name'] as String?
|
||||
..email = json['email'] as String?
|
||||
..date =
|
||||
json['date'] == null ? null : DateTime.parse(json['date'] as String);
|
||||
|
||||
Map<String, dynamic> _$GogsCommitAuthorToJson(GogsCommitAuthor instance) =>
|
||||
<String, dynamic>{
|
||||
|
@ -184,26 +171,24 @@ Map<String, dynamic> _$GogsCommitAuthorToJson(GogsCommitAuthor instance) =>
|
|||
'date': instance.date?.toIso8601String(),
|
||||
};
|
||||
|
||||
GogsIssue _$GogsIssueFromJson(Map<String, dynamic> json) {
|
||||
return GogsIssue()
|
||||
..number = json['number'] as int?
|
||||
..state = json['state'] as String?
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GogsLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..comments = json['comments'] as int?;
|
||||
}
|
||||
GogsIssue _$GogsIssueFromJson(Map<String, dynamic> json) => GogsIssue()
|
||||
..number = json['number'] as int?
|
||||
..state = json['state'] as String?
|
||||
..title = json['title'] as String?
|
||||
..body = json['body'] as String?
|
||||
..user = json['user'] == null
|
||||
? null
|
||||
: GogsUser.fromJson(json['user'] as Map<String, dynamic>)
|
||||
..labels = (json['labels'] as List<dynamic>?)
|
||||
?.map((e) => GogsLabel.fromJson(e as Map<String, dynamic>))
|
||||
.toList()
|
||||
..createdAt = json['created_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['created_at'] as String)
|
||||
..updatedAt = json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String)
|
||||
..comments = json['comments'] as int?;
|
||||
|
||||
Map<String, dynamic> _$GogsIssueToJson(GogsIssue instance) => <String, dynamic>{
|
||||
'number': instance.number,
|
||||
|
@ -217,11 +202,9 @@ Map<String, dynamic> _$GogsIssueToJson(GogsIssue instance) => <String, dynamic>{
|
|||
'comments': instance.comments,
|
||||
};
|
||||
|
||||
GogsLabel _$GogsLabelFromJson(Map<String, dynamic> json) {
|
||||
return GogsLabel()
|
||||
..name = json['name'] as String?
|
||||
..color = json['color'] as String?;
|
||||
}
|
||||
GogsLabel _$GogsLabelFromJson(Map<String, dynamic> json) => GogsLabel()
|
||||
..name = json['name'] as String?
|
||||
..color = json['color'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GogsLabelToJson(GogsLabel instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
|
|
|
@ -1,31 +1,25 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/models/github.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import '../utils/utils.dart';
|
||||
|
||||
class NotificationGroup {
|
||||
NotificationGroup(this.fullName);
|
||||
String? fullName;
|
||||
List<GithubNotificationItem> items = [];
|
||||
|
||||
Tuple2<String, String>? _repo;
|
||||
String get owner {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(fullName!);
|
||||
}
|
||||
_repo ??= parseRepositoryFullName(fullName!);
|
||||
return _repo!.item1;
|
||||
}
|
||||
|
||||
String get name {
|
||||
if (_repo == null) {
|
||||
_repo = parseRepositoryFullName(fullName!);
|
||||
}
|
||||
_repo ??= parseRepositoryFullName(fullName!);
|
||||
return _repo!.item2;
|
||||
}
|
||||
|
||||
String get key => '_$hashCode';
|
||||
|
||||
NotificationGroup(this.fullName);
|
||||
}
|
||||
|
||||
class NotificationModel with ChangeNotifier {
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
import 'package:universal_io/io.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:fimber/fimber.dart';
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class AppThemeType {
|
||||
static const material = 0;
|
||||
static const cupertino = 1;
|
||||
static const values = [AppThemeType.material, AppThemeType.cupertino];
|
||||
}
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_button.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
class AppBrightnessType {
|
||||
static const followSystem = 0;
|
||||
|
@ -35,77 +28,48 @@ class AppMarkdownType {
|
|||
}
|
||||
|
||||
class PickerItem<T> {
|
||||
PickerItem(this.value, {required this.text});
|
||||
final T value;
|
||||
final String? text;
|
||||
PickerItem(this.value, {required this.text});
|
||||
}
|
||||
|
||||
class PickerGroupItem<T> {
|
||||
final T value;
|
||||
final List<PickerItem<T>> items;
|
||||
final Function(T value)? onChange;
|
||||
final Function(T value)? onClose;
|
||||
|
||||
PickerGroupItem({
|
||||
required this.value,
|
||||
required this.items,
|
||||
this.onChange,
|
||||
this.onClose,
|
||||
});
|
||||
final T value;
|
||||
final List<PickerItem<T>> items;
|
||||
final Function(T value)? onChange;
|
||||
final Function(T value)? onClose;
|
||||
}
|
||||
|
||||
class SelectorItem<T> {
|
||||
SelectorItem({required this.value, required this.text});
|
||||
T value;
|
||||
String text;
|
||||
SelectorItem({required this.value, required this.text});
|
||||
}
|
||||
|
||||
// No animation. For replacing route
|
||||
// TODO: Go back
|
||||
class StaticRoute extends PageRouteBuilder {
|
||||
final WidgetBuilder? builder;
|
||||
StaticRoute({this.builder})
|
||||
: super(
|
||||
pageBuilder: (BuildContext context, Animation<double> animation,
|
||||
Animation<double> secondaryAnimation) {
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return builder!(context);
|
||||
},
|
||||
transitionsBuilder: (BuildContext context,
|
||||
Animation<double> animation,
|
||||
Animation<double> secondaryAnimation,
|
||||
Widget child) {
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||
return child;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class Palette {
|
||||
final Color primary;
|
||||
final Color text;
|
||||
final Color secondaryText;
|
||||
final Color tertiaryText;
|
||||
final Color background;
|
||||
final Color grayBackground;
|
||||
final Color border;
|
||||
|
||||
const Palette({
|
||||
required this.primary,
|
||||
required this.text,
|
||||
required this.secondaryText,
|
||||
required this.tertiaryText,
|
||||
required this.background,
|
||||
required this.grayBackground,
|
||||
required this.border,
|
||||
});
|
||||
final WidgetBuilder? builder;
|
||||
}
|
||||
|
||||
class ThemeModel with ChangeNotifier {
|
||||
String? markdownCss;
|
||||
|
||||
int? _theme;
|
||||
int? get theme => _theme;
|
||||
bool get ready => _theme != null;
|
||||
|
||||
Brightness systemBrightness = Brightness.light;
|
||||
void setSystemBrightness(Brightness v) {
|
||||
if (v != systemBrightness) {
|
||||
|
@ -177,51 +141,11 @@ class ThemeModel with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
|
||||
final router = FluroRouter();
|
||||
|
||||
final paletteLight = Palette(
|
||||
primary: PrimerColors.blue500,
|
||||
text: Colors.black,
|
||||
secondaryText: Colors.grey.shade800,
|
||||
tertiaryText: Colors.grey.shade600,
|
||||
background: Colors.white,
|
||||
grayBackground: Colors.grey.shade100,
|
||||
border: Colors.grey.shade300,
|
||||
);
|
||||
final paletteDark = Palette(
|
||||
primary: PrimerColors.blue500,
|
||||
text: Colors.grey.shade300,
|
||||
secondaryText: Colors.grey.shade400,
|
||||
tertiaryText: Colors.grey.shade500,
|
||||
background: Colors.black,
|
||||
grayBackground: Colors.grey.shade900,
|
||||
border: Colors.grey.shade700,
|
||||
);
|
||||
|
||||
Palette get palette {
|
||||
switch (brightness) {
|
||||
case Brightness.dark:
|
||||
return paletteDark;
|
||||
case Brightness.light:
|
||||
default:
|
||||
return paletteLight;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> init() async {
|
||||
markdownCss = await rootBundle.loadString('images/github-markdown.css');
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
final v = prefs.getInt(StorageKeys.iTheme);
|
||||
Fimber.d('read theme: $v');
|
||||
if (AppThemeType.values.contains(v)) {
|
||||
_theme = v;
|
||||
} else if (Platform.isIOS || Platform.isMacOS) {
|
||||
_theme = AppThemeType.cupertino;
|
||||
} else {
|
||||
_theme = AppThemeType.material;
|
||||
}
|
||||
final b = prefs.getInt(StorageKeys.iBrightness);
|
||||
Fimber.d('read brightness: $b');
|
||||
if (AppBrightnessType.values.contains(b)) {
|
||||
|
@ -239,49 +163,6 @@ class ThemeModel with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<void> setTheme(int v) async {
|
||||
_theme = v;
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(StorageKeys.iTheme, v);
|
||||
Fimber.d('write theme: $v');
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
push(BuildContext context, String url, {bool replace = false}) {
|
||||
// Fimber.d(url);
|
||||
if (url.startsWith('/')) {
|
||||
return router.navigateTo(
|
||||
context,
|
||||
url,
|
||||
transition: theme == AppThemeType.cupertino
|
||||
? TransitionType.cupertino
|
||||
: TransitionType.material,
|
||||
replace: replace,
|
||||
);
|
||||
} else {
|
||||
launchUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> showWarning(BuildContext context, String message) async {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text(message),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool?> showConfirm(BuildContext context, Widget content) {
|
||||
return showCupertinoDialog(
|
||||
context: context,
|
||||
|
@ -290,11 +171,11 @@ class ThemeModel with ChangeNotifier {
|
|||
title: content,
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text('cancel'),
|
||||
isDefaultAction: true,
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
},
|
||||
child: const Text('cancel'),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text('OK'),
|
||||
|
@ -306,37 +187,15 @@ class ThemeModel with ChangeNotifier {
|
|||
);
|
||||
},
|
||||
);
|
||||
// default:
|
||||
// return showDialog(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return AlertDialog(
|
||||
// content: content,
|
||||
// actions: <Widget>[
|
||||
// FlatButton(
|
||||
// child: const Text('CANCEL'),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context, false);
|
||||
// },
|
||||
// ),
|
||||
// FlatButton(
|
||||
// child: const Text('OK'),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context, true);
|
||||
// },
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
}
|
||||
|
||||
static Timer? _debounce;
|
||||
String? _selectedItem;
|
||||
|
||||
showPicker(BuildContext context, PickerGroupItem<String?> groupItem) async {
|
||||
await showCupertinoModalPopup(
|
||||
await AntPopup.show(
|
||||
context: context,
|
||||
closeOnMaskClick: true,
|
||||
builder: (context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
|
@ -344,10 +203,10 @@ class ThemeModel with ChangeNotifier {
|
|||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
decoration: BoxDecoration(
|
||||
color: palette.background,
|
||||
color: AntTheme.of(context).colorBackground,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: palette.grayBackground,
|
||||
color: AntTheme.of(context).colorBox,
|
||||
width: 0.0,
|
||||
),
|
||||
),
|
||||
|
@ -356,7 +215,6 @@ class ThemeModel with ChangeNotifier {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
CupertinoButton(
|
||||
child: Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
_selectedItem = groupItem.value;
|
||||
|
@ -365,9 +223,9 @@ class ThemeModel with ChangeNotifier {
|
|||
horizontal: 16.0,
|
||||
vertical: 5.0,
|
||||
),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
CupertinoButton(
|
||||
child: Text('Confirm'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
groupItem.onClose!(_selectedItem);
|
||||
|
@ -376,18 +234,15 @@ class ThemeModel with ChangeNotifier {
|
|||
horizontal: 16.0,
|
||||
vertical: 5.0,
|
||||
),
|
||||
child: const Text('Confirm'),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 216,
|
||||
child: CupertinoPicker(
|
||||
backgroundColor: palette.background,
|
||||
children: <Widget>[
|
||||
for (var v in groupItem.items)
|
||||
Text(v.text!, style: TextStyle(color: palette.text)),
|
||||
],
|
||||
backgroundColor: AntTheme.of(context).colorBackground,
|
||||
itemExtent: 40,
|
||||
scrollController: FixedExtentScrollController(
|
||||
initialItem: groupItem.items
|
||||
|
@ -406,6 +261,12 @@ class ThemeModel with ChangeNotifier {
|
|||
});
|
||||
}
|
||||
},
|
||||
children: <Widget>[
|
||||
for (var v in groupItem.items)
|
||||
Text(v.text!,
|
||||
style:
|
||||
TextStyle(color: AntTheme.of(context).colorText)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -415,33 +276,23 @@ class ThemeModel with ChangeNotifier {
|
|||
}
|
||||
|
||||
showActions(BuildContext context, List<ActionItem> actionItems) async {
|
||||
final value = await showCupertinoModalPopup<int>(
|
||||
await AntActionSheet.show(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CupertinoActionSheet(
|
||||
title: Text('Actions'),
|
||||
actions: actionItems.asMap().entries.map((entry) {
|
||||
return CupertinoActionSheetAction(
|
||||
child: Text(entry.value.text!),
|
||||
isDestructiveAction: entry.value.isDestructiveAction,
|
||||
onPressed: () {
|
||||
Navigator.pop(context, entry.key);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
child: const Text('Cancel'),
|
||||
isDefaultAction: true,
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
extra: const Text('Actions'),
|
||||
actions: [
|
||||
for (final item in actionItems)
|
||||
AntActionSheetAction(
|
||||
text: Text(
|
||||
item.text!,
|
||||
style: TextStyle(
|
||||
color: item.danger ? AntTheme.of(context).colorDanger : null),
|
||||
),
|
||||
onClick: () {
|
||||
item.onTap?.call(context);
|
||||
},
|
||||
key: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
if (value != null) {
|
||||
actionItems[value].onTap!(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
1499
lib/router.dart
1499
lib/router.dart
File diff suppressed because it is too large
Load Diff
|
@ -1,20 +1,16 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CommonScaffold extends StatelessWidget {
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
final PreferredSizeWidget? bottom;
|
||||
|
||||
CommonScaffold({
|
||||
const CommonScaffold({
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action,
|
||||
this.bottom,
|
||||
});
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -22,26 +18,12 @@ class CommonScaffold extends StatelessWidget {
|
|||
// FIXME: A hack to get brightness before MaterialApp been built
|
||||
theme.setSystemBrightness(MediaQuery.of(context).platformBrightness);
|
||||
|
||||
switch (theme.theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: title,
|
||||
trailing: action,
|
||||
),
|
||||
child: SafeArea(child: body),
|
||||
);
|
||||
default:
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: title,
|
||||
actions: [
|
||||
if (action != null) action!,
|
||||
],
|
||||
bottom: bottom,
|
||||
),
|
||||
body: body,
|
||||
);
|
||||
}
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: title,
|
||||
trailing: action,
|
||||
),
|
||||
child: SafeArea(child: body),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/widgets/empty.dart';
|
||||
import 'package:git_touch/widgets/error_reload.dart';
|
||||
import 'package:git_touch/widgets/loading.dart';
|
||||
import 'package:git_touch/widgets/empty.dart';
|
||||
|
||||
export 'package:git_touch/utils/utils.dart';
|
||||
|
||||
// This is a scaffold for infinite scroll screens
|
||||
class ListStatefulScaffold<T, K> extends StatefulWidget {
|
||||
final Widget title;
|
||||
final Widget Function()? actionBuilder;
|
||||
final Widget Function(T payload) itemBuilder;
|
||||
final Future<ListPayload<T, K>> Function(K? cursor) fetch;
|
||||
|
||||
ListStatefulScaffold({
|
||||
const ListStatefulScaffold({
|
||||
required this.title,
|
||||
required this.fetch,
|
||||
required this.itemBuilder,
|
||||
this.actionBuilder,
|
||||
});
|
||||
final Widget title;
|
||||
final Widget Function()? actionBuilder;
|
||||
final Widget Function(T payload) itemBuilder;
|
||||
final Future<ListPayload<T, K>> Function(K? cursor) fetch;
|
||||
|
||||
@override
|
||||
_ListStatefulScaffoldState<T, K> createState() =>
|
||||
State<ListStatefulScaffold<T, K>> createState() =>
|
||||
_ListStatefulScaffoldState();
|
||||
}
|
||||
|
||||
|
@ -39,7 +36,7 @@ class _ListStatefulScaffoldState<T, K>
|
|||
K? cursor;
|
||||
bool? hasMore;
|
||||
|
||||
ScrollController _controller = ScrollController();
|
||||
final ScrollController _controller = ScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -69,13 +66,13 @@ class _ListStatefulScaffoldState<T, K>
|
|||
loading = true;
|
||||
});
|
||||
try {
|
||||
final ListPayload<T, K> p = await widget.fetch(null);
|
||||
final p = await widget.fetch(null);
|
||||
items = p.items.toList();
|
||||
cursor = p.cursor;
|
||||
hasMore = p.hasMore;
|
||||
} catch (err) {
|
||||
error = err.toString();
|
||||
throw err;
|
||||
rethrow;
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -91,13 +88,13 @@ class _ListStatefulScaffoldState<T, K>
|
|||
loadingMore = true;
|
||||
});
|
||||
try {
|
||||
ListPayload<T, K> p = await widget.fetch(cursor);
|
||||
final p = await widget.fetch(cursor);
|
||||
items.addAll(p.items);
|
||||
cursor = p.cursor;
|
||||
hasMore = p.hasMore;
|
||||
} catch (err) {
|
||||
error = err.toString();
|
||||
throw err;
|
||||
rethrow;
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -107,82 +104,45 @@ class _ListStatefulScaffoldState<T, K>
|
|||
}
|
||||
}
|
||||
|
||||
Widget _buildItem(BuildContext context, int index) {
|
||||
if (index == 2 * items.length) {
|
||||
if (hasMore != false) {
|
||||
return Loading(more: true);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
} else if (index % 2 == 1) {
|
||||
return CommonStyle.border;
|
||||
} else {
|
||||
return widget.itemBuilder(items[index ~/ 2]);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildCupertinoSliver() {
|
||||
if (error.isNotEmpty) {
|
||||
return SliverToBoxAdapter(
|
||||
child: ErrorReload(text: error, onTap: _refresh),
|
||||
);
|
||||
} else if (loading && items.isEmpty) {
|
||||
return SliverToBoxAdapter(child: Loading(more: false));
|
||||
return const SliverToBoxAdapter(child: Loading(more: false));
|
||||
} else if (items.isEmpty) {
|
||||
return SliverToBoxAdapter(child: EmptyWidget());
|
||||
} else {
|
||||
return SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
_buildItem,
|
||||
childCount: 2 * items.length + 1,
|
||||
),
|
||||
return AntSliverList(
|
||||
count: items.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == items.length) {
|
||||
if (hasMore != false) {
|
||||
return const Loading(more: true);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
return widget.itemBuilder(items[index]);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildMaterial() {
|
||||
if (error.isNotEmpty) {
|
||||
return ErrorReload(text: error, onTap: _refresh);
|
||||
} else if (loading && items.isEmpty) {
|
||||
return Loading(more: false);
|
||||
} else if (items.isEmpty) {
|
||||
return EmptyWidget();
|
||||
} else {
|
||||
return Scrollbar(
|
||||
child: ListView.builder(
|
||||
controller: _controller,
|
||||
itemCount: 2 * items.length + 1,
|
||||
itemBuilder: _buildItem,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoScrollbar(
|
||||
child: CustomScrollView(
|
||||
controller: _controller,
|
||||
slivers: [
|
||||
CupertinoSliverRefreshControl(onRefresh: _refresh),
|
||||
_buildCupertinoSliver(),
|
||||
],
|
||||
),
|
||||
);
|
||||
default:
|
||||
return RefreshIndicator(
|
||||
onRefresh: _refresh,
|
||||
child: _buildMaterial(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CommonScaffold(
|
||||
title: widget.title,
|
||||
body: _buildBody(),
|
||||
body: CupertinoScrollbar(
|
||||
child: CustomScrollView(
|
||||
controller: _controller,
|
||||
slivers: [
|
||||
CupertinoSliverRefreshControl(onRefresh: _refresh),
|
||||
_buildCupertinoSliver(),
|
||||
],
|
||||
),
|
||||
),
|
||||
action: widget.actionBuilder?.call(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,20 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../widgets/loading.dart';
|
||||
import '../widgets/link.dart';
|
||||
import '../widgets/error_reload.dart';
|
||||
import 'package:git_touch/widgets/error_reload.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:git_touch/widgets/loading.dart';
|
||||
|
||||
class LongListPayload<T, K> {
|
||||
T header;
|
||||
int totalCount;
|
||||
String? cursor;
|
||||
List<K> leadingItems;
|
||||
List<K>? trailingItems;
|
||||
|
||||
LongListPayload({
|
||||
required this.header,
|
||||
required this.totalCount,
|
||||
|
@ -22,6 +13,11 @@ class LongListPayload<T, K> {
|
|||
required this.leadingItems,
|
||||
this.trailingItems,
|
||||
});
|
||||
T header;
|
||||
int totalCount;
|
||||
String? cursor;
|
||||
List<K> leadingItems;
|
||||
List<K>? trailingItems;
|
||||
}
|
||||
|
||||
// This is a scaffold for issue and pull request
|
||||
|
@ -29,14 +25,7 @@ class LongListPayload<T, K> {
|
|||
// We should load leading and trailing items at first fetching, and do load more in the middle
|
||||
// e.g. https://github.com/reactjs/rfcs/pull/68
|
||||
class LongListStatefulScaffold<T, K> extends StatefulWidget {
|
||||
final Widget title;
|
||||
final Widget Function(T t)? trailingBuilder;
|
||||
final Widget Function(T t) headerBuilder;
|
||||
final Widget Function(K k) itemBuilder;
|
||||
final Future<LongListPayload<T, K>> Function() onRefresh;
|
||||
final Future<LongListPayload<T, K>> Function(String? cursor) onLoadMore;
|
||||
|
||||
LongListStatefulScaffold({
|
||||
const LongListStatefulScaffold({
|
||||
required this.title,
|
||||
this.trailingBuilder,
|
||||
required this.headerBuilder,
|
||||
|
@ -44,9 +33,15 @@ class LongListStatefulScaffold<T, K> extends StatefulWidget {
|
|||
required this.onRefresh,
|
||||
required this.onLoadMore,
|
||||
});
|
||||
final Widget title;
|
||||
final Widget Function(T t)? trailingBuilder;
|
||||
final Widget Function(T t) headerBuilder;
|
||||
final Widget Function(K k) itemBuilder;
|
||||
final Future<LongListPayload<T, K>> Function() onRefresh;
|
||||
final Future<LongListPayload<T, K>> Function(String? cursor) onLoadMore;
|
||||
|
||||
@override
|
||||
_LongListStatefulScaffoldState<T, K> createState() =>
|
||||
State<LongListStatefulScaffold<T, K>> createState() =>
|
||||
_LongListStatefulScaffoldState();
|
||||
}
|
||||
|
||||
|
@ -74,7 +69,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
payload = await widget.onRefresh();
|
||||
} catch (err) {
|
||||
error = err.toString();
|
||||
throw err;
|
||||
rethrow;
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -90,11 +85,10 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
loadingMore = true;
|
||||
});
|
||||
try {
|
||||
LongListPayload<T?, K> _payload =
|
||||
await widget.onLoadMore(payload!.cursor);
|
||||
payload!.totalCount = _payload.totalCount;
|
||||
payload!.cursor = _payload.cursor;
|
||||
payload!.leadingItems.addAll(_payload.leadingItems);
|
||||
final LongListPayload<T?, K> p = await widget.onLoadMore(payload!.cursor);
|
||||
payload!.totalCount = p.totalCount;
|
||||
payload!.cursor = p.cursor;
|
||||
payload!.leadingItems.addAll(p.leadingItems);
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -105,18 +99,16 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
}
|
||||
|
||||
Widget _buildItem(BuildContext context, int index) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
if (index % 2 == 1) {
|
||||
return CommonStyle.border;
|
||||
}
|
||||
|
||||
int realIndex = index ~/ 2;
|
||||
final realIndex = index ~/ 2;
|
||||
|
||||
if (realIndex < payload!.leadingItems.length) {
|
||||
return widget.itemBuilder(payload!.leadingItems[realIndex]);
|
||||
} else if (realIndex == payload!.leadingItems.length) {
|
||||
var count = payload!.totalCount -
|
||||
final count = payload!.totalCount -
|
||||
payload!.leadingItems.length +
|
||||
payload!.trailingItems!.length;
|
||||
return Container(
|
||||
|
@ -127,20 +119,21 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
child: Container(
|
||||
padding: CommonStyle.padding,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: theme.palette.text),
|
||||
border: Border.all(color: AntTheme.of(context).colorText),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text('$count hidden items',
|
||||
style:
|
||||
TextStyle(color: theme.palette.text, fontSize: 15)),
|
||||
Padding(padding: EdgeInsets.only(top: 4)),
|
||||
style: TextStyle(
|
||||
color: AntTheme.of(context).colorText, fontSize: 15)),
|
||||
const Padding(padding: EdgeInsets.only(top: 4)),
|
||||
loadingMore
|
||||
? CupertinoActivityIndicator()
|
||||
? const CupertinoActivityIndicator()
|
||||
: Text(
|
||||
'Load more...',
|
||||
style: TextStyle(
|
||||
color: theme.palette.primary, fontSize: 16),
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -155,7 +148,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
}
|
||||
|
||||
int get _itemCount {
|
||||
int count = payload!.leadingItems.length + payload!.trailingItems!.length;
|
||||
var count = payload!.leadingItems.length + payload!.trailingItems!.length;
|
||||
if (payload!.totalCount > count) {
|
||||
count++;
|
||||
}
|
||||
|
@ -168,7 +161,7 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
child: ErrorReload(text: error, onTap: _refresh));
|
||||
} else if (loading) {
|
||||
// TODO:
|
||||
return SliverToBoxAdapter(child: Loading(more: false));
|
||||
return const SliverToBoxAdapter(child: Loading(more: false));
|
||||
} else {
|
||||
return SliverList(
|
||||
delegate:
|
||||
|
@ -179,51 +172,27 @@ class _LongListStatefulScaffoldState<T, K>
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
List<Widget> slivers = [
|
||||
CupertinoSliverRefreshControl(onRefresh: _refresh)
|
||||
];
|
||||
if (payload != null) {
|
||||
slivers.add(
|
||||
SliverToBoxAdapter(child: widget.headerBuilder(payload!.header)),
|
||||
);
|
||||
}
|
||||
slivers.add(_buildSliver());
|
||||
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: widget.title,
|
||||
trailing: payload == null
|
||||
? null
|
||||
: widget.trailingBuilder!(payload!.header),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: CupertinoScrollbar(
|
||||
child: CustomScrollView(slivers: slivers),
|
||||
),
|
||||
),
|
||||
);
|
||||
default:
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: widget.title,
|
||||
actions: payload == null
|
||||
? null
|
||||
: [widget.trailingBuilder!(payload!.header)],
|
||||
),
|
||||
body: RefreshIndicator(
|
||||
onRefresh: _refresh,
|
||||
child: Scrollbar(
|
||||
child: CustomScrollView(slivers: [
|
||||
if (payload != null)
|
||||
SliverToBoxAdapter(
|
||||
child: widget.headerBuilder(payload!.header)),
|
||||
_buildSliver(),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
final slivers = <Widget>[
|
||||
CupertinoSliverRefreshControl(onRefresh: _refresh)
|
||||
];
|
||||
if (payload != null) {
|
||||
slivers.add(
|
||||
SliverToBoxAdapter(child: widget.headerBuilder(payload!.header)),
|
||||
);
|
||||
}
|
||||
slivers.add(_buildSliver());
|
||||
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: widget.title,
|
||||
trailing:
|
||||
payload == null ? null : widget.trailingBuilder!(payload!.header),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: CupertinoScrollbar(
|
||||
child: CustomScrollView(slivers: slivers),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/scaffolds/utils.dart';
|
||||
|
||||
class RefreshStatefulScaffold<T> extends StatefulWidget {
|
||||
final Widget title;
|
||||
final Widget? Function(T data, void Function(T newData) setData) bodyBuilder;
|
||||
final Future<T> Function() fetch;
|
||||
final Widget? Function(T data, void Function(T newData) setData)?
|
||||
actionBuilder;
|
||||
final Widget? action;
|
||||
final canRefresh;
|
||||
|
||||
RefreshStatefulScaffold({
|
||||
const RefreshStatefulScaffold({
|
||||
required this.title,
|
||||
required this.bodyBuilder,
|
||||
required this.fetch,
|
||||
|
@ -20,9 +12,16 @@ class RefreshStatefulScaffold<T> extends StatefulWidget {
|
|||
this.action,
|
||||
this.canRefresh = true,
|
||||
}) : assert(actionBuilder == null || action == null);
|
||||
final Widget title;
|
||||
final Widget? Function(T data, void Function(T newData) setData) bodyBuilder;
|
||||
final Future<T> Function() fetch;
|
||||
final Widget? Function(T data, void Function(T newData) setData)?
|
||||
actionBuilder;
|
||||
final Widget? action;
|
||||
final bool canRefresh;
|
||||
|
||||
@override
|
||||
_RefreshStatefulScaffoldState<T> createState() =>
|
||||
State<RefreshStatefulScaffold<T>> createState() =>
|
||||
_RefreshStatefulScaffoldState();
|
||||
}
|
||||
|
||||
|
@ -48,7 +47,7 @@ class _RefreshStatefulScaffoldState<T>
|
|||
_data = await widget.fetch();
|
||||
} catch (err) {
|
||||
_error = err.toString();
|
||||
throw err;
|
||||
rethrow;
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -61,7 +60,7 @@ class _RefreshStatefulScaffoldState<T>
|
|||
Widget? get _action {
|
||||
if (widget.action != null) return widget.action;
|
||||
if (widget.actionBuilder == null || _data == null) return null;
|
||||
return widget.actionBuilder!(_data!, (v) {
|
||||
return widget.actionBuilder!(_data as T, (v) {
|
||||
setState(() {
|
||||
_data = v;
|
||||
});
|
||||
|
@ -71,7 +70,7 @@ class _RefreshStatefulScaffoldState<T>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget child = ErrorLoadingWrapper(
|
||||
bodyBuilder: () => widget.bodyBuilder(_data!, (v) {
|
||||
bodyBuilder: () => widget.bodyBuilder(_data as T, (v) {
|
||||
setState(() {
|
||||
_data = v;
|
||||
});
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
|
||||
class SingleScaffold extends StatelessWidget {
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
|
||||
SingleScaffold({
|
||||
const SingleScaffold({
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action,
|
||||
});
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CommonScaffold(
|
||||
title: title,
|
||||
body: Scrollbar(child: SingleChildScrollView(child: body)),
|
||||
body: CupertinoScrollbar(child: SingleChildScrollView(child: body)),
|
||||
action: action,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/scaffolds/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class TabScaffold extends StatelessWidget {
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
final void Function() onRefresh;
|
||||
final List<String> tabs;
|
||||
final int activeTab;
|
||||
final Function(int index) onTabSwitch;
|
||||
|
||||
TabScaffold({
|
||||
const TabScaffold({
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action,
|
||||
|
@ -23,57 +12,41 @@ class TabScaffold extends StatelessWidget {
|
|||
required this.activeTab,
|
||||
required this.onTabSwitch,
|
||||
});
|
||||
|
||||
Widget _buildTitle(BuildContext context) {
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return DefaultTextStyle(
|
||||
style: DefaultTextStyle.of(context).style.copyWith(fontSize: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: CupertinoSlidingSegmentedControl<int>(
|
||||
groupValue: activeTab,
|
||||
onValueChanged: (v) {
|
||||
if (v == null) return;
|
||||
onTabSwitch(v);
|
||||
},
|
||||
children: tabs.asMap().map((key, text) => MapEntry(
|
||||
key,
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(text),
|
||||
))),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
default:
|
||||
return title;
|
||||
}
|
||||
}
|
||||
final Widget title;
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
final void Function() onRefresh;
|
||||
final List<String> tabs;
|
||||
final int activeTab;
|
||||
final Function(int index) onTabSwitch;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scaffold = CommonScaffold(
|
||||
title: _buildTitle(context),
|
||||
return CommonScaffold(
|
||||
title: DefaultTextStyle(
|
||||
style: DefaultTextStyle.of(context).style.copyWith(fontSize: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: CupertinoSlidingSegmentedControl<int>(
|
||||
groupValue: activeTab,
|
||||
onValueChanged: (v) {
|
||||
if (v == null) return;
|
||||
onTabSwitch(v);
|
||||
},
|
||||
children: tabs.asMap().map((key, text) => MapEntry(
|
||||
key,
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Text(text),
|
||||
))),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: RefreshWrapper(body: body, onRefresh: onRefresh),
|
||||
// action: action, // TODO:
|
||||
bottom: TabBar(
|
||||
onTap: onTabSwitch,
|
||||
tabs: tabs.map((text) => Tab(text: text.toUpperCase())).toList(),
|
||||
),
|
||||
);
|
||||
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return scaffold;
|
||||
default:
|
||||
return DefaultTabController(
|
||||
length: tabs.length,
|
||||
child: scaffold,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/scaffolds/tab.dart';
|
||||
import 'package:git_touch/scaffolds/utils.dart';
|
||||
|
||||
class TabStatefulScaffold<T> extends StatefulWidget {
|
||||
final Widget title;
|
||||
final Widget Function(T payload, int activeTab) bodyBuilder;
|
||||
final Future<T> Function(int activeTab) fetchData;
|
||||
final List<String> tabs;
|
||||
final Widget Function(T payload, void Function() refresh)? actionBuilder;
|
||||
|
||||
TabStatefulScaffold({
|
||||
const TabStatefulScaffold({
|
||||
required this.title,
|
||||
required this.bodyBuilder,
|
||||
required this.fetchData,
|
||||
required this.tabs,
|
||||
this.actionBuilder,
|
||||
});
|
||||
final Widget title;
|
||||
final Widget Function(T payload, int activeTab) bodyBuilder;
|
||||
final Future<T> Function(int activeTab) fetchData;
|
||||
final List<String> tabs;
|
||||
final Widget Function(T payload, void Function() refresh)? actionBuilder;
|
||||
|
||||
@override
|
||||
_TabStatefulScaffoldState<T> createState() => _TabStatefulScaffoldState();
|
||||
State<TabStatefulScaffold<T>> createState() => _TabStatefulScaffoldState();
|
||||
}
|
||||
|
||||
class _TabStatefulScaffoldState<T> extends State<TabStatefulScaffold<T>> {
|
||||
|
@ -74,7 +73,7 @@ class _TabStatefulScaffoldState<T> extends State<TabStatefulScaffold<T>> {
|
|||
_payload = await widget.fetchData(_activeTab);
|
||||
} catch (err) {
|
||||
_error = err.toString();
|
||||
throw err;
|
||||
rethrow;
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
|
@ -90,7 +89,7 @@ class _TabStatefulScaffoldState<T> extends State<TabStatefulScaffold<T>> {
|
|||
title: widget.title,
|
||||
action: widget.actionBuilder == null
|
||||
? null
|
||||
: widget.actionBuilder!(_payload!, _refresh),
|
||||
: widget.actionBuilder!(_payload as T, _refresh),
|
||||
tabs: widget.tabs,
|
||||
activeTab: _activeTab,
|
||||
onTabSwitch: (selected) async {
|
||||
|
@ -105,7 +104,7 @@ class _TabStatefulScaffoldState<T> extends State<TabStatefulScaffold<T>> {
|
|||
},
|
||||
onRefresh: _refresh,
|
||||
body: ErrorLoadingWrapper(
|
||||
bodyBuilder: () => widget.bodyBuilder(_payload!, _activeTab),
|
||||
bodyBuilder: () => widget.bodyBuilder(_payload as T, _activeTab),
|
||||
error: _error,
|
||||
loading: _payload == null,
|
||||
reload: _refresh,
|
||||
|
|
|
@ -1,55 +1,40 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/widgets/error_reload.dart';
|
||||
import 'package:git_touch/widgets/loading.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class RefreshWrapper extends StatelessWidget {
|
||||
final Widget body;
|
||||
final void Function() onRefresh;
|
||||
|
||||
RefreshWrapper({
|
||||
const RefreshWrapper({
|
||||
required this.onRefresh,
|
||||
required this.body,
|
||||
});
|
||||
final Widget body;
|
||||
final void Function() onRefresh;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoScrollbar(
|
||||
child: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CupertinoSliverRefreshControl(
|
||||
onRefresh: onRefresh as Future<void> Function()?),
|
||||
SliverToBoxAdapter(child: body),
|
||||
],
|
||||
),
|
||||
);
|
||||
default:
|
||||
return RefreshIndicator(
|
||||
onRefresh: onRefresh as Future<void> Function(),
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(child: body),
|
||||
),
|
||||
);
|
||||
}
|
||||
return CupertinoScrollbar(
|
||||
child: CustomScrollView(
|
||||
slivers: <Widget>[
|
||||
CupertinoSliverRefreshControl(
|
||||
onRefresh: onRefresh as Future<void> Function()?),
|
||||
SliverToBoxAdapter(child: body),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ErrorLoadingWrapper extends StatelessWidget {
|
||||
final String error;
|
||||
final bool loading;
|
||||
final void Function() reload;
|
||||
final Widget? Function() bodyBuilder;
|
||||
|
||||
ErrorLoadingWrapper({
|
||||
const ErrorLoadingWrapper({
|
||||
required this.error,
|
||||
required this.loading,
|
||||
required this.reload,
|
||||
required this.bodyBuilder,
|
||||
});
|
||||
final String error;
|
||||
final bool loading;
|
||||
final void Function() reload;
|
||||
final Widget? Function() bodyBuilder;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -58,7 +43,7 @@ class ErrorLoadingWrapper extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (loading) {
|
||||
return Loading();
|
||||
return const Loading();
|
||||
}
|
||||
|
||||
return bodyBuilder()!;
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
// import 'package:flutter/material.dart';
|
||||
// import 'package:git_touch/models/theme.dart';
|
||||
// import 'package:git_touch/scaffolds/single.dart';
|
||||
// import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
// import 'package:git_touch/widgets/table_view.dart';
|
||||
// import 'package:launch_review/launch_review.dart';
|
||||
// import 'package:package_info/package_info.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
|
||||
// /// Unused
|
||||
// class AboutScreen extends StatefulWidget {
|
||||
// @override
|
||||
// _AboutScreenState createState() => _AboutScreenState();
|
||||
// }
|
||||
|
||||
// class _AboutScreenState extends State<AboutScreen> {
|
||||
// var _version = '';
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// PackageInfo.fromPlatform().then((info) {
|
||||
// setState(() {
|
||||
// _version = info.version;
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final theme = Provider.of<ThemeModel>(context);
|
||||
// return SingleScaffold(
|
||||
// title: AppBarTitle('About'),
|
||||
// body: Column(
|
||||
// children: <Widget>[
|
||||
// SizedBox(height: 32),
|
||||
// ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(24),
|
||||
// child: Image.asset(
|
||||
// 'images/icon.png',
|
||||
// width: 96,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(height: 12),
|
||||
// Text(
|
||||
// 'GitTouch',
|
||||
// style: TextStyle(fontSize: 20, color: theme.palette.text),
|
||||
// ),
|
||||
// SizedBox(height: 48),
|
||||
// TableView(items: [
|
||||
// TableViewItem(text: Text('Version'), rightWidget: Text(_version)),
|
||||
// TableViewItem(text: Text('Source Code'), url: '/pd4d10/git-touch'),
|
||||
// TableViewItem(
|
||||
// text: Text('Feedback'), url: '/pd4d10/git-touch/issues/new'),
|
||||
// TableViewItem(
|
||||
// text: Text('Rate This App'),
|
||||
// onTap: () {
|
||||
// LaunchReview.launch(
|
||||
// androidAppId: 'io.github.pd4d10.gittouch',
|
||||
// iOSAppId: '1452042346',
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ]),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
|
@ -1,24 +1,22 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/commit_item.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbCommitsScreen extends StatelessWidget {
|
||||
const BbCommitsScreen(this.owner, this.name, this.ref);
|
||||
final String owner;
|
||||
final String name;
|
||||
final String ref;
|
||||
BbCommitsScreen(this.owner, this.name, this.ref);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
return ListStatefulScaffold<BbCommit, String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.commits),
|
||||
title: Text(AppLocalizations.of(context)!.commits),
|
||||
fetch: (nextUrl) async {
|
||||
final res = await context.read<AuthModel>().fetchBbWithPage(
|
||||
nextUrl ?? '/repositories/$owner/$name/commits/$ref');
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:git_touch/widgets/repo_item.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbExploreScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListStatefulScaffold<BbRepo, String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.explore),
|
||||
title: Text(AppLocalizations.of(context)!.explore),
|
||||
fetch: (nextUrl) async {
|
||||
final res = await context.read<AuthModel>().fetchBbWithPage(
|
||||
nextUrl ?? '/repositories?role=member&sort=-updated_on');
|
||||
|
@ -25,7 +23,7 @@ class BbExploreScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
return RepositoryItem.bb(payload: v);
|
||||
return RepoItem.bb(payload: v);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_entry.dart';
|
||||
import 'package:git_touch/widgets/avatar.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:git_touch/widgets/comment_item.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:primer/primer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
class BbIssueScreen extends StatelessWidget {
|
||||
const BbIssueScreen(this.owner, this.name, this.number, {this.isPr = false});
|
||||
final String owner;
|
||||
final String name;
|
||||
final String number;
|
||||
final bool isPr;
|
||||
|
||||
BbIssueScreen(this.owner, this.name, this.number, {this.isPr: false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshStatefulScaffold<Tuple2<BbIssues, Iterable<BbComment>>>(
|
||||
title: Text("Issue: #$number"),
|
||||
title: Text('Issue: #$number'),
|
||||
fetch: () async {
|
||||
final auth = context.read<AuthModel>();
|
||||
final res = await Future.wait([
|
||||
|
@ -45,7 +45,6 @@ class BbIssueScreen extends StatelessWidget {
|
|||
bodyBuilder: (data, _) {
|
||||
final issue = data.item1;
|
||||
final comments = data.item2;
|
||||
final theme = context.read<ThemeModel>();
|
||||
return Column(children: <Widget>[
|
||||
Container(
|
||||
padding: CommonStyle.padding,
|
||||
|
@ -60,43 +59,43 @@ class BbIssueScreen extends StatelessWidget {
|
|||
url: issue.reporter!.avatarUrl,
|
||||
size: AvatarSize.extraSmall,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'$owner / $name',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.secondaryText,
|
||||
color: AntTheme.of(context).colorTextSecondary,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'#$number',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: AntTheme.of(context).colorWeak,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
issue.title!,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
StateLabel(StateLabelStatus.issueOpened),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
CommonStyle.border,
|
||||
],
|
||||
)),
|
||||
Column(children: [
|
||||
for (var comment in comments) ...[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: CommentItem(
|
||||
avatar: Avatar(
|
||||
url: comment.user!.avatarUrl,
|
||||
|
@ -107,7 +106,7 @@ class BbIssueScreen extends StatelessWidget {
|
|||
login: comment.user!.displayName,
|
||||
prefix: 'bitbucket')),
|
||||
CommonStyle.border,
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
]),
|
||||
]);
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbIssueCommentScreen extends StatefulWidget {
|
||||
const BbIssueCommentScreen(this.owner, this.name, this.number);
|
||||
final String owner;
|
||||
final String name;
|
||||
final String number;
|
||||
BbIssueCommentScreen(this.owner, this.name, this.number);
|
||||
|
||||
@override
|
||||
_BbIssueCommentScreenState createState() => _BbIssueCommentScreenState();
|
||||
State<BbIssueCommentScreen> createState() => _BbIssueCommentScreenState();
|
||||
}
|
||||
|
||||
class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
|
||||
|
@ -22,16 +21,15 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
return CommonScaffold(
|
||||
title: Text('New Comment'),
|
||||
title: const Text('New Comment'),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: CommonStyle.padding,
|
||||
child: CupertinoTextField(
|
||||
style: TextStyle(color: theme.palette.text),
|
||||
style: TextStyle(color: AntTheme.of(context).colorText),
|
||||
placeholder: AppLocalizations.of(context)!.body,
|
||||
onChanged: (v) {
|
||||
setState(() {
|
||||
|
@ -41,9 +39,10 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
child: Text('Comment'),
|
||||
onPressed: () async {
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: const Text('Comment'),
|
||||
onClick: () async {
|
||||
await auth.fetchBb(
|
||||
'/repositories/${widget.owner}/${widget.name}/issues/${widget.number}/comments',
|
||||
isPost: true,
|
||||
|
@ -52,8 +51,7 @@ class _BbIssueCommentScreenState extends State<BbIssueCommentScreen> {
|
|||
},
|
||||
);
|
||||
Navigator.pop(context, true);
|
||||
await theme.push(
|
||||
context,
|
||||
await context.pushUrl(
|
||||
'/bitbucket/${widget.owner}/${widget.name}/issues/${widget.number}',
|
||||
replace: true,
|
||||
);
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/common.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbIssueFormScreen extends StatefulWidget {
|
||||
const BbIssueFormScreen(this.owner, this.name);
|
||||
final String owner;
|
||||
final String name;
|
||||
BbIssueFormScreen(this.owner, this.name);
|
||||
|
||||
@override
|
||||
_BbIssueFormScreenState createState() => _BbIssueFormScreenState();
|
||||
State<BbIssueFormScreen> createState() => _BbIssueFormScreenState();
|
||||
}
|
||||
|
||||
class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
||||
|
@ -23,7 +22,6 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
return CommonScaffold(
|
||||
title: Text(AppLocalizations.of(context)!.submitAnIssue),
|
||||
|
@ -32,7 +30,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
Padding(
|
||||
padding: CommonStyle.padding,
|
||||
child: CupertinoTextField(
|
||||
style: TextStyle(color: theme.palette.text),
|
||||
style: TextStyle(color: AntTheme.of(context).colorText),
|
||||
placeholder: AppLocalizations.of(context)!.title,
|
||||
onChanged: (v) {
|
||||
setState(() {
|
||||
|
@ -44,7 +42,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
Padding(
|
||||
padding: CommonStyle.padding,
|
||||
child: CupertinoTextField(
|
||||
style: TextStyle(color: theme.palette.text),
|
||||
style: TextStyle(color: AntTheme.of(context).colorText),
|
||||
placeholder: AppLocalizations.of(context)!.body,
|
||||
onChanged: (v) {
|
||||
setState(() {
|
||||
|
@ -54,9 +52,10 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
maxLines: 10,
|
||||
),
|
||||
),
|
||||
CupertinoButton.filled(
|
||||
AntButton(
|
||||
color: AntTheme.of(context).colorPrimary,
|
||||
child: Text(AppLocalizations.of(context)!.submit),
|
||||
onPressed: () async {
|
||||
onClick: () async {
|
||||
await auth.fetchBbJson(
|
||||
'/repositories/${widget.owner}/${widget.name}/issues',
|
||||
isPost: true,
|
||||
|
@ -65,8 +64,7 @@ class _BbIssueFormScreenState extends State<BbIssueFormScreen> {
|
|||
return BbIssues.fromJson(v);
|
||||
});
|
||||
Navigator.pop(context, true);
|
||||
await theme.push(
|
||||
context,
|
||||
await context.pushUrl(
|
||||
'/bitbucket/${widget.owner}/${widget.name}/issues',
|
||||
replace: true,
|
||||
);
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_entry.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/issue_item.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbIssuesScreen extends StatelessWidget {
|
||||
const BbIssuesScreen(this.owner, this.name);
|
||||
final String owner;
|
||||
final String name;
|
||||
BbIssuesScreen(this.owner, this.name);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListStatefulScaffold<BbIssues, String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.issues),
|
||||
title: Text(AppLocalizations.of(context)!.issues),
|
||||
actionBuilder: () {
|
||||
return ActionEntry(
|
||||
iconData: Octicons.plus, url: '/bitbucket/$owner/$name/issues/new');
|
||||
|
@ -35,13 +34,13 @@ class BbIssuesScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
int issueNumber =
|
||||
final issueNumber =
|
||||
int.parse(v.issueLink!.replaceFirst(RegExp(r'.*\/'), ''));
|
||||
return IssueItem(
|
||||
avatarUrl: v.reporter!.avatarUrl,
|
||||
author: v.reporter!.displayName,
|
||||
title: v.title,
|
||||
subtitle: '#' + issueNumber.toString(),
|
||||
subtitle: '#$issueNumber',
|
||||
commentCount: 0,
|
||||
updatedAt: v.createdOn,
|
||||
url: '/bitbucket/$owner/$name/issues/$issueNumber',
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
import 'dart:convert';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/widgets/action_entry.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/blob_view.dart';
|
||||
import 'package:git_touch/widgets/object_tree.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
class BbObjectScreen extends StatelessWidget {
|
||||
const BbObjectScreen(this.owner, this.name, this.ref, {this.path});
|
||||
final String owner;
|
||||
final String name;
|
||||
final String ref;
|
||||
final String? path;
|
||||
BbObjectScreen(this.owner, this.name, this.ref, {this.path});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
|
||||
return ListStatefulScaffold<dynamic, String?>(
|
||||
title: AppBarTitle(path ?? 'Files'),
|
||||
title: Text(path ?? 'Files'),
|
||||
fetch: (next) async {
|
||||
final res = await auth.fetchBb(
|
||||
next ?? '/repositories/$owner/$name/src/$ref/${path ?? ''}');
|
||||
|
@ -53,7 +53,7 @@ class BbObjectScreen extends StatelessWidget {
|
|||
if (pl is String) {
|
||||
return BlobView(path, text: pl);
|
||||
} else if (pl is BbTree) {
|
||||
return ObjectTreeItem(
|
||||
return createObjectTreeItem(
|
||||
name: p.basename(pl.path),
|
||||
type: pl.type,
|
||||
// size: v.type == 'commit_file' ? v.size : null,
|
||||
|
@ -66,7 +66,7 @@ class BbObjectScreen extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
actionBuilder: () {
|
||||
return ActionEntry(
|
||||
return const ActionEntry(
|
||||
iconData: Ionicons.cog,
|
||||
url: '/choose-code-theme',
|
||||
);
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/issue_item.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbPullsScreen extends StatelessWidget {
|
||||
const BbPullsScreen(this.owner, this.name);
|
||||
final String owner;
|
||||
final String name;
|
||||
BbPullsScreen(this.owner, this.name);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
return ListStatefulScaffold<BbPulls, String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.pullRequests),
|
||||
title: Text(AppLocalizations.of(context)!.pullRequests),
|
||||
fetch: (nextUrl) async {
|
||||
final res = await context.read<AuthModel>().fetchBbWithPage(
|
||||
nextUrl ?? '/repositories/$owner/$name/pullrequests');
|
||||
|
@ -30,13 +28,13 @@ class BbPullsScreen extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
itemBuilder: (v) {
|
||||
int pullNumber =
|
||||
final pullNumber =
|
||||
int.parse(v.pullRequestLink!.replaceFirst(RegExp(r'.*\/'), ''));
|
||||
return IssueItem(
|
||||
avatarUrl: v.author!.avatarUrl,
|
||||
author: v.author!.displayName,
|
||||
title: v.title,
|
||||
subtitle: '#' + pullNumber.toString(),
|
||||
subtitle: '#$pullNumber',
|
||||
commentCount: 0,
|
||||
updatedAt: v.createdOn,
|
||||
url:
|
||||
|
|
|
@ -1,30 +1,31 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/markdown_view.dart';
|
||||
import 'package:git_touch/widgets/repo_header.dart';
|
||||
import 'package:git_touch/widgets/table_view.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbRepoScreen extends StatelessWidget {
|
||||
const BbRepoScreen(this.owner, this.name, {this.branch});
|
||||
final String owner;
|
||||
final String name;
|
||||
final String? branch;
|
||||
BbRepoScreen(this.owner, this.name, {this.branch});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshStatefulScaffold<Tuple3<BbRepo, String?, List<BbBranch>>>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.repository),
|
||||
title: Text(AppLocalizations.of(context)!.repository),
|
||||
fetch: () async {
|
||||
final auth = context.read<AuthModel>();
|
||||
final r = await auth.fetchBbJson('/repositories/$owner/$name');
|
||||
|
@ -56,38 +57,44 @@ class BbRepoScreen extends StatelessWidget {
|
|||
homepageUrl: p.website,
|
||||
),
|
||||
CommonStyle.border,
|
||||
TableView(
|
||||
items: [
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.code,
|
||||
text: Text('Code'),
|
||||
rightWidget: Text(filesize(p.size)),
|
||||
url:
|
||||
'/bitbucket/$owner/$name/src/${branch ?? p.mainbranch!.name}',
|
||||
AntList(
|
||||
children: [
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.code),
|
||||
extra: Text(filesize(p.size)),
|
||||
onClick: () {
|
||||
context.push(
|
||||
'/bitbucket/$owner/$name/src/${branch ?? p.mainbranch!.name}');
|
||||
},
|
||||
child: const Text('Code'),
|
||||
),
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.issue_opened,
|
||||
text: Text('Issues'),
|
||||
url: '/bitbucket/$owner/$name/issues',
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.issue_opened),
|
||||
child: const Text('Issues'),
|
||||
onClick: () {
|
||||
context.push('/bitbucket/$owner/$name/issues');
|
||||
},
|
||||
),
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.git_pull_request,
|
||||
text: Text('Pull requests'),
|
||||
url: '/bitbucket/$owner/$name/pulls',
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.git_pull_request),
|
||||
child: const Text('Pull requests'),
|
||||
onClick: () {
|
||||
context.push('/bitbucket/$owner/$name/pulls');
|
||||
},
|
||||
),
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.history,
|
||||
text: Text('Commits'),
|
||||
url:
|
||||
'/bitbucket/$owner/$name/commits/${branch ?? p.mainbranch!.name}',
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.history),
|
||||
child: const Text('Commits'),
|
||||
onClick: () {
|
||||
context.push(
|
||||
'/bitbucket/$owner/$name/commits/${branch ?? p.mainbranch!.name}');
|
||||
},
|
||||
),
|
||||
TableViewItem(
|
||||
leftIconData: Octicons.git_branch,
|
||||
text: Text(AppLocalizations.of(context)!.branches),
|
||||
rightWidget: Text((branch ?? p.mainbranch!.name)! +
|
||||
' • ' +
|
||||
branches.length.toString()),
|
||||
onTap: () async {
|
||||
AntListItem(
|
||||
prefix: const Icon(Octicons.git_branch),
|
||||
extra: Text(
|
||||
'${(branch ?? p.mainbranch!.name)!} • ${branches.length}'),
|
||||
onClick: () async {
|
||||
if (branches.length < 2) return;
|
||||
|
||||
await theme.showPicker(
|
||||
|
@ -99,14 +106,15 @@ class BbRepoScreen extends StatelessWidget {
|
|||
.toList(),
|
||||
onClose: (ref) {
|
||||
if (ref != branch) {
|
||||
theme.push(
|
||||
context, '/bitbucket/$owner/$name?branch=$ref',
|
||||
context.pushUrl(
|
||||
'/bitbucket/$owner/$name?branch=$ref',
|
||||
replace: true);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.branches),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/user_item.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class BbTeamsScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListStatefulScaffold<BbUser, String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.teams),
|
||||
title: Text(AppLocalizations.of(context)!.teams),
|
||||
fetch: (nextUrl) async {
|
||||
final res = await context
|
||||
.read<AuthModel>()
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/bitbucket.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_entry.dart';
|
||||
import 'package:git_touch/widgets/repository_item.dart';
|
||||
import 'package:git_touch/widgets/repo_item.dart';
|
||||
import 'package:git_touch/widgets/user_header.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
|
||||
class BbUserScreen extends StatelessWidget {
|
||||
const BbUserScreen(this.login, {this.isTeam = false});
|
||||
final String? login;
|
||||
final bool isTeam;
|
||||
BbUserScreen(this.login, {this.isTeam = false});
|
||||
bool get isViewer => login == null;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final auth = Provider.of<AuthModel>(context);
|
||||
final _accountId = auth.activeAccount!.accountId;
|
||||
final _login = login ?? auth.activeAccount!.login;
|
||||
final accountId = auth.activeAccount!.accountId;
|
||||
final finalLogin = login ?? auth.activeAccount!.login;
|
||||
return RefreshStatefulScaffold<Tuple2<BbUser, Iterable<BbRepo>>>(
|
||||
title: Text(isViewer
|
||||
? 'Me'
|
||||
|
@ -30,16 +30,16 @@ class BbUserScreen extends StatelessWidget {
|
|||
fetch: () async {
|
||||
final res = await Future.wait([
|
||||
auth
|
||||
.fetchBbJson('/${isTeam ? 'teams' : 'users'}/$_accountId')
|
||||
.fetchBbJson('/${isTeam ? 'teams' : 'users'}/$accountId')
|
||||
.then((value) => BbUser.fromJson(value)),
|
||||
auth
|
||||
.fetchBbWithPage('/repositories/$_login')
|
||||
.fetchBbWithPage('/repositories/$finalLogin')
|
||||
.then((value) => [for (var v in value.items) BbRepo.fromJson(v)]),
|
||||
]);
|
||||
return Tuple2(res[0] as BbUser, res[1] as Iterable<BbRepo>);
|
||||
},
|
||||
action: isViewer
|
||||
? ActionEntry(
|
||||
? const ActionEntry(
|
||||
iconData: Ionicons.cog,
|
||||
url: '/settings',
|
||||
)
|
||||
|
@ -50,7 +50,7 @@ class BbUserScreen extends StatelessWidget {
|
|||
return Column(
|
||||
children: <Widget>[
|
||||
UserHeader(
|
||||
login: _login,
|
||||
login: finalLogin,
|
||||
avatarUrl: user.avatarUrl,
|
||||
name: user.displayName,
|
||||
createdAt: user.createdOn,
|
||||
|
@ -59,9 +59,7 @@ class BbUserScreen extends StatelessWidget {
|
|||
),
|
||||
CommonStyle.border,
|
||||
Column(
|
||||
children: <Widget>[
|
||||
for (var v in repos) RepositoryItem.bb(payload: v)
|
||||
],
|
||||
children: <Widget>[for (var v in repos) RepoItem.bb(payload: v)],
|
||||
)
|
||||
],
|
||||
);
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:flutter_highlight/flutter_highlight.dart';
|
||||
import 'package:flutter_highlight/theme_map.dart';
|
||||
import 'package:git_touch/models/code.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/scaffolds/single.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/table_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class CodeThemeScreen extends StatelessWidget {
|
||||
String _getCode(bool isDark) => '''// ${isDark ? 'Dark' : 'Light'} Mode
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
|
@ -35,23 +34,22 @@ class MyApp extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var codeProvider = Provider.of<CodeModel>(context);
|
||||
var theme = Provider.of<ThemeModel>(context);
|
||||
final codeProvider = Provider.of<CodeModel>(context);
|
||||
final theme = Provider.of<ThemeModel>(context);
|
||||
|
||||
return SingleScaffold(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.codeTheme),
|
||||
title: Text(AppLocalizations.of(context)!.codeTheme),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
CommonStyle.verticalGap,
|
||||
TableView(
|
||||
headerText: AppLocalizations.of(context)!.fontStyle,
|
||||
hasIcon: false,
|
||||
items: [
|
||||
TableViewItem(
|
||||
text: Text(AppLocalizations.of(context)!.fontSize),
|
||||
rightWidget: Text(codeProvider.fontSize.toString()),
|
||||
onTap: () {
|
||||
AntList(
|
||||
mode: AntListMode.card,
|
||||
header: Text(AppLocalizations.of(context)!.fontStyle),
|
||||
children: [
|
||||
AntListItem(
|
||||
extra: Text(codeProvider.fontSize.toString()),
|
||||
onClick: () {
|
||||
theme.showPicker(
|
||||
context,
|
||||
PickerGroupItem(
|
||||
|
@ -66,11 +64,11 @@ class MyApp extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.fontSize),
|
||||
),
|
||||
TableViewItem(
|
||||
text: Text(AppLocalizations.of(context)!.fontFamily),
|
||||
rightWidget: Text(codeProvider.fontFamily),
|
||||
onTap: () {
|
||||
AntListItem(
|
||||
extra: Text(codeProvider.fontFamily),
|
||||
onClick: () {
|
||||
theme.showPicker(
|
||||
context,
|
||||
PickerGroupItem(
|
||||
|
@ -78,23 +76,24 @@ class MyApp extends StatelessWidget {
|
|||
items: CodeModel.fontFamilies
|
||||
.map((v) => PickerItem(v, text: v))
|
||||
.toList(),
|
||||
onChange: (String? value) {
|
||||
onChange: (value) {
|
||||
codeProvider.setFontFamily(value!);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.fontFamily),
|
||||
),
|
||||
],
|
||||
),
|
||||
CommonStyle.verticalGap,
|
||||
TableView(
|
||||
headerText: AppLocalizations.of(context)!.syntaxHighlighting,
|
||||
items: [
|
||||
TableViewItem(
|
||||
text: Text(AppLocalizations.of(context)!.light),
|
||||
rightWidget: Text(codeProvider.theme),
|
||||
onTap: () {
|
||||
AntList(
|
||||
mode: AntListMode.card,
|
||||
header: Text(AppLocalizations.of(context)!.syntaxHighlighting),
|
||||
children: [
|
||||
AntListItem(
|
||||
extra: Text(codeProvider.theme),
|
||||
onClick: () {
|
||||
theme.showPicker(
|
||||
context,
|
||||
PickerGroupItem(
|
||||
|
@ -108,11 +107,20 @@ class MyApp extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.light),
|
||||
),
|
||||
TableViewItem(
|
||||
text: Text(AppLocalizations.of(context)!.dark),
|
||||
rightWidget: Text(codeProvider.themeDark),
|
||||
onTap: () {
|
||||
AntListItem(
|
||||
child: HighlightView(
|
||||
_getCode(false),
|
||||
language: 'dart',
|
||||
theme: themeMap[codeProvider.theme]!,
|
||||
textStyle: codeProvider.fontStyle,
|
||||
padding: CommonStyle.padding,
|
||||
),
|
||||
),
|
||||
AntListItem(
|
||||
extra: Text(codeProvider.themeDark),
|
||||
onClick: () {
|
||||
theme.showPicker(
|
||||
context,
|
||||
PickerGroupItem(
|
||||
|
@ -126,29 +134,19 @@ class MyApp extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.dark),
|
||||
),
|
||||
AntListItem(
|
||||
child: HighlightView(
|
||||
_getCode(true),
|
||||
language: 'dart',
|
||||
theme: themeMap[codeProvider.themeDark]!,
|
||||
textStyle: codeProvider.fontStyle,
|
||||
padding: CommonStyle.padding,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
HighlightView(
|
||||
_getCode(false),
|
||||
language: 'dart',
|
||||
theme: themeMap[codeProvider.theme]!,
|
||||
textStyle: TextStyle(
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
fontFamily: codeProvider.fontFamilyUsed,
|
||||
),
|
||||
padding: CommonStyle.padding,
|
||||
),
|
||||
HighlightView(
|
||||
_getCode(true),
|
||||
language: 'dart',
|
||||
theme: themeMap[codeProvider.themeDark]!,
|
||||
textStyle: TextStyle(
|
||||
fontSize: codeProvider.fontSize.toDouble(),
|
||||
fontFamily: codeProvider.fontFamilyUsed,
|
||||
),
|
||||
padding: CommonStyle.padding,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/gitee.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:git_touch/widgets/action_entry.dart';
|
||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||
import 'package:git_touch/widgets/blob_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/S.dart';
|
||||
|
||||
class GeBlobScreen extends StatelessWidget {
|
||||
const GeBlobScreen(this.owner, this.name, this.sha, this.path);
|
||||
final String owner;
|
||||
final String name;
|
||||
final String sha;
|
||||
final String path;
|
||||
GeBlobScreen(this.owner, this.name, this.sha, this.path);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshStatefulScaffold<String?>(
|
||||
title: AppBarTitle(AppLocalizations.of(context)!.file),
|
||||
title: Text(AppLocalizations.of(context)!.file),
|
||||
fetch: () async {
|
||||
final auth = context.read<AuthModel>();
|
||||
final res = await auth.fetchGitee('/repos/$owner/$name/git/blobs/$sha');
|
||||
return GiteeBlob.fromJson(res).content;
|
||||
},
|
||||
action: ActionEntry(iconData: Ionicons.cog, url: '/choose-code-theme'),
|
||||
action:
|
||||
const ActionEntry(iconData: Ionicons.cog, url: '/choose-code-theme'),
|
||||
bodyBuilder: (content, _) {
|
||||
return BlobView(path, base64Text: content);
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/gitee.dart';
|
||||
import 'package:git_touch/scaffolds/refresh_stateful.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
|
@ -7,20 +9,17 @@ import 'package:git_touch/widgets/avatar.dart';
|
|||
import 'package:git_touch/widgets/files_item.dart';
|
||||
import 'package:git_touch/widgets/link.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:git_touch/models/auth.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
|
||||
class GeCommitScreen extends StatelessWidget {
|
||||
const GeCommitScreen(this.owner, this.name, this.sha);
|
||||
final String owner;
|
||||
final String name;
|
||||
final String sha;
|
||||
GeCommitScreen(this.owner, this.name, this.sha);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = context.watch<ThemeModel>();
|
||||
return RefreshStatefulScaffold<GiteeCommit>(
|
||||
title: Text("Commit: ${sha.substring(0, 7)}"),
|
||||
title: Text('Commit: ${sha.substring(0, 7)}'),
|
||||
fetch: () async {
|
||||
final auth = context.read<AuthModel>();
|
||||
final items = await auth.fetchGitee('/repos/$owner/$name/commits/$sha');
|
||||
|
@ -43,29 +42,29 @@ class GeCommitScreen extends StatelessWidget {
|
|||
url: data.author!.avatarUrl,
|
||||
size: AvatarSize.extraSmall,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'$owner / $name',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.secondaryText,
|
||||
color: AntTheme.of(context).colorTextSecondary,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'${sha.substring(0, 7)}',
|
||||
sha.substring(0, 7),
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: theme.palette.tertiaryText,
|
||||
color: AntTheme.of(context).colorWeak,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
data.commit!.message!,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue