Compare commits
4 Commits
develop
...
a4700e9ec5
| Author | SHA1 | Date | |
|---|---|---|---|
| a4700e9ec5 | |||
| 4cbbad6c1a | |||
| 6bbc75fa94 | |||
| b0bbad7f97 |
@@ -57,6 +57,9 @@ android {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
|
||||
@@ -1,45 +1,73 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
>
|
||||
|
||||
<!--
|
||||
Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility?hl=en and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin.
|
||||
-->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT" />
|
||||
|
||||
<data android:mimeType="text/plain" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:label="Marianum Fulda"
|
||||
tools:replace="android:label"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="Marianum Fulda">
|
||||
<receiver
|
||||
android:name=".TimetableWidget"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/timetable_widget_info" />
|
||||
</receiver>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
|
||||
<!--
|
||||
Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
to determine the Window background behind the Flutter UI.
|
||||
-->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
android:resource="@style/NormalTheme" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<!--
|
||||
Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
|
||||
-->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility?hl=en and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,39 @@
|
||||
package eu.mhsl.marianum.mobile.client
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.appwidget.AppWidgetProvider
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.widget.RemoteViews
|
||||
|
||||
import es.antonborri.home_widget.HomeWidgetPlugin
|
||||
import android.util.Base64
|
||||
|
||||
/**
|
||||
* Implementation of App Widget functionality.
|
||||
*/
|
||||
class TimetableWidget : AppWidgetProvider() {
|
||||
override fun onUpdate(
|
||||
context: Context,
|
||||
appWidgetManager: AppWidgetManager,
|
||||
appWidgetIds: IntArray,
|
||||
) {
|
||||
for (appWidgetId in appWidgetIds) {
|
||||
val widgetData = HomeWidgetPlugin.getData(context)
|
||||
val views = RemoteViews(context.packageName, R.layout.timetable_widget).apply {
|
||||
val imageBase64 = widgetData.getString("screen", null) ?: return@apply
|
||||
val imageBytes = Base64.decode(imageBase64, Base64.DEFAULT);
|
||||
val imageBitmap: Bitmap = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.size)
|
||||
setImageViewBitmap(R.id.widget_image, imageBitmap)
|
||||
}
|
||||
|
||||
val launchIntent = context.packageManager.getLaunchIntentForPackage(context.packageName)
|
||||
val pendingIntent = PendingIntent.getActivity(context, 0, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
|
||||
views.setOnClickPendingIntent(R.id.background, pendingIntent)
|
||||
|
||||
appWidgetManager.updateAppWidget(appWidgetId, views)
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Background for widgets to make the rounded corners based on the
|
||||
appWidgetRadius attribute value
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="?attr/appWidgetRadius" />
|
||||
<solid android:color="?android:attr/colorBackground" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Background for views inside widgets to make the rounded corners based on the
|
||||
appWidgetInnerRadius attribute value
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="?attr/appWidgetInnerRadius" />
|
||||
<solid android:color="?android:attr/colorAccent" />
|
||||
</shape>
|
||||
26
android/app/src/main/res/layout/timetable_widget.xml
Normal file
26
android/app/src/main/res/layout/timetable_widget.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/background"
|
||||
style="@style/Widget.Android.AppWidget.Container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:padding="0dp"
|
||||
android:theme="@style/Theme.Android.AppWidgetContainer">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/widget_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:layout_weight="1"
|
||||
android:adjustViewBounds="false"
|
||||
android:background="@android:color/transparent"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/timetable_widget_default"
|
||||
android:visibility="visible"
|
||||
tools:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
10
android/app/src/main/res/values-night-v31/themes.xml
Normal file
10
android/app/src/main/res/values-night-v31/themes.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--
|
||||
Having themes.xml for night-v31 because of the priority order of the resource qualifiers.
|
||||
-->
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||
</style>
|
||||
</resources>
|
||||
14
android/app/src/main/res/values-v21/styles.xml
Normal file
14
android/app/src/main/res/values-v21/styles.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:id">@android:id/background</item>
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_background</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_inner_view_background</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -18,4 +18,18 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:id">@android:id/background</item>
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_background</item>
|
||||
<item name="android:clipToOutline">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_inner_view_background</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
<item name="android:clipToOutline">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
11
android/app/src/main/res/values-v31/themes.xml
Normal file
11
android/app/src/main/res/values-v31/themes.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--
|
||||
Having themes.xml for v31 variant because @android:dimen/system_app_widget_background_radius
|
||||
and @android:dimen/system_app_widget_internal_padding requires API level 31
|
||||
-->
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||
</style>
|
||||
</resources>
|
||||
7
android/app/src/main/res/values/attrs.xml
Normal file
7
android/app/src/main/res/values/attrs.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<resources>
|
||||
<declare-styleable name="AppWidgetAttrs">
|
||||
<attr name="appWidgetPadding" format="dimension" />
|
||||
<attr name="appWidgetInnerRadius" format="dimension" />
|
||||
<attr name="appWidgetRadius" format="dimension" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
6
android/app/src/main/res/values/colors.xml
Normal file
6
android/app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<resources>
|
||||
<color name="light_blue_50">#FFE1F5FE</color>
|
||||
<color name="light_blue_200">#FF81D4FA</color>
|
||||
<color name="light_blue_600">#FF039BE5</color>
|
||||
<color name="light_blue_900">#FF01579B</color>
|
||||
</resources>
|
||||
10
android/app/src/main/res/values/dimens.xml
Normal file
10
android/app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Refer to App Widget Documentation for margin information
|
||||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
||||
-->
|
||||
<dimen name="widget_margin">0dp</dimen>
|
||||
|
||||
</resources>
|
||||
6
android/app/src/main/res/values/strings.xml
Normal file
6
android/app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="appwidget_text">Marianum Vertretungsplan</string>
|
||||
<string name="add_widget">Hinzufügen</string>
|
||||
<string name="app_widget_description">Übersicht zum Vertretungsplan</string>
|
||||
</resources>
|
||||
@@ -19,4 +19,14 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:id">@android:id/background</item>
|
||||
<item name="android:background">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:background">?android:attr/colorBackground</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
17
android/app/src/main/res/values/themes.xml
Normal file
17
android/app/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault">
|
||||
<!-- Radius of the outer bound of widgets to make the rounded corners -->
|
||||
<item name="appWidgetRadius">16dp</item>
|
||||
<!--
|
||||
Radius of the inner view's bound of widgets to make the rounded corners.
|
||||
It needs to be 8dp or less than the value of appWidgetRadius
|
||||
-->
|
||||
<item name="appWidgetInnerRadius">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Android.AppWidgetContainer" parent="Theme.Android.AppWidgetContainerParent">
|
||||
<!-- Apply padding to avoid the content of the widget colliding with the rounded corners -->
|
||||
<item name="appWidgetPadding">16dp</item>
|
||||
</style>
|
||||
</resources>
|
||||
16
android/app/src/main/res/xml/timetable_widget_info.xml
Normal file
16
android/app/src/main/res/xml/timetable_widget_info.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:description="@string/app_widget_description"
|
||||
android:initialKeyguardLayout="@layout/timetable_widget"
|
||||
android:initialLayout="@layout/timetable_widget"
|
||||
android:minWidth="220dp"
|
||||
android:minHeight="294dp"
|
||||
android:minResizeWidth="110dp"
|
||||
android:minResizeHeight="147dp"
|
||||
android:previewImage="@drawable/timetable_widget_preview"
|
||||
android:previewLayout="@layout/timetable_widget"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:targetCellWidth="3"
|
||||
android:targetCellHeight="4"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen" />
|
||||
@@ -2,6 +2,21 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
|
||||
// [required] background_fetch
|
||||
maven {
|
||||
url "${project(':background_fetch').projectDir}/libs"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -19,8 +19,7 @@ pluginManagement {
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.9.1" apply false
|
||||
id "com.android.library" version "8.9.1" apply false
|
||||
id "com.android.application" version '8.7.3' apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFBTCCAu2gAwIBAgIQWgDyEtjUtIDzkkFX6imDBTANBgkqhkiG9w0BAQsFADBP
|
||||
MQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFy
|
||||
Y2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMTAeFw0yNDAzMTMwMDAwMDBa
|
||||
Fw0yNzAzMTIyMzU5NTlaMDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBF
|
||||
bmNyeXB0MQwwCgYDVQQDEwNSMTMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
|
||||
AoIBAQClZ3CN0FaBZBUXYc25BtStGZCMJlA3mBZjklTb2cyEBZPs0+wIG6BgUUNI
|
||||
fSvHSJaetC3ancgnO1ehn6vw1g7UDjDKb5ux0daknTI+WE41b0VYaHEX/D7YXYKg
|
||||
L7JRbLAaXbhZzjVlyIuhrxA3/+OcXcJJFzT/jCuLjfC8cSyTDB0FxLrHzarJXnzR
|
||||
yQH3nAP2/Apd9Np75tt2QnDr9E0i2gB3b9bJXxf92nUupVcM9upctuBzpWjPoXTi
|
||||
dYJ+EJ/B9aLrAek4sQpEzNPCifVJNYIKNLMc6YjCR06CDgo28EdPivEpBHXazeGa
|
||||
XP9enZiVuppD0EqiFwUBBDDTMrOPAgMBAAGjgfgwgfUwDgYDVR0PAQH/BAQDAgGG
|
||||
MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATASBgNVHRMBAf8ECDAGAQH/
|
||||
AgEAMB0GA1UdDgQWBBTnq58PLDOgU9NeT3jIsoQOO9aSMzAfBgNVHSMEGDAWgBR5
|
||||
tFnme7bl5AFzgAiIyBpY9umbbjAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAKG
|
||||
Fmh0dHA6Ly94MS5pLmxlbmNyLm9yZy8wEwYDVR0gBAwwCjAIBgZngQwBAgEwJwYD
|
||||
VR0fBCAwHjAcoBqgGIYWaHR0cDovL3gxLmMubGVuY3Iub3JnLzANBgkqhkiG9w0B
|
||||
AQsFAAOCAgEAUTdYUqEimzW7TbrOypLqCfL7VOwYf/Q79OH5cHLCZeggfQhDconl
|
||||
k7Kgh8b0vi+/XuWu7CN8n/UPeg1vo3G+taXirrytthQinAHGwc/UdbOygJa9zuBc
|
||||
VyqoH3CXTXDInT+8a+c3aEVMJ2St+pSn4ed+WkDp8ijsijvEyFwE47hulW0Ltzjg
|
||||
9fOV5Pmrg/zxWbRuL+k0DBDHEJennCsAen7c35Pmx7jpmJ/HtgRhcnz0yjSBvyIw
|
||||
6L1QIupkCv2SBODT/xDD3gfQQyKv6roV4G2EhfEyAsWpmojxjCUCGiyg97FvDtm/
|
||||
NK2LSc9lybKxB73I2+P2G3CaWpvvpAiHCVu30jW8GCxKdfhsXtnIy2imskQqVZ2m
|
||||
0Pmxobb28Tucr7xBK7CtwvPrb79os7u2XP3O5f9b/H66GNyRrglRXlrYjI1oGYL/
|
||||
f4I1n/Sgusda6WvA6C190kxjU15Y12mHU4+BxyR9cx2hhGS9fAjMZKJss28qxvz6
|
||||
Axu4CaDmRNZpK/pQrXF17yXCXkmEWgvSOEZy6Z9pcbLIVEGckV/iVeq0AOo2pkg9
|
||||
p4QRIy0tK2diRENLSF2KysFwbY6B26BFeFs3v1sYVRhFW9nLkOrQVporCS0KyZmf
|
||||
wVD89qSTlnctLcZnIavjKsKUu1nA1iU0yYMdYepKR7lWbnwhdx3ewok=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,4 +1 @@
|
||||
extensions:
|
||||
- hive_ce: true
|
||||
- shared_preferences: true
|
||||
- provider: true
|
||||
@@ -1,9 +0,0 @@
|
||||
flutter_launcher_icons:
|
||||
android: true
|
||||
ios: true
|
||||
remove_alpha_ios: true
|
||||
image_path_android: "assets/logo/icon/ic_launcher.png"
|
||||
image_path_ios: "assets/logo/icon/1024.png"
|
||||
adaptive_icon_background: "assets/logo/icon/ic_launcher_adaptive_back.png" # only available for Android 8.0 devices and above
|
||||
adaptive_icon_foreground: "assets/logo/icon/ic_launcher_adaptive_fore.png" # only available for Android 8.0 devices and above
|
||||
min_sdk_android: 16 # android min sdk min:16, default 21
|
||||
BIN
ios/.DS_Store
vendored
Normal file
BIN
ios/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -21,6 +21,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>13.0</string>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
platform :ios, '15.0'
|
||||
platform :ios, '11.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
@@ -31,8 +31,6 @@ target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
pod 'PhoneNumberKit', '~> 3.7.6'
|
||||
|
||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||
# target 'RunnerTests' do
|
||||
# inherit! :search_paths
|
||||
|
||||
318
ios/Podfile.lock
318
ios/Podfile.lock
@@ -1,190 +1,185 @@
|
||||
PODS:
|
||||
- connectivity_plus (0.0.1):
|
||||
- better_open_file (0.0.1):
|
||||
- Flutter
|
||||
- device_info_plus (0.0.1):
|
||||
- Flutter
|
||||
- DKImagePickerController/Core (4.3.9):
|
||||
- DKImagePickerController/Core (4.3.4):
|
||||
- DKImagePickerController/ImageDataManager
|
||||
- DKImagePickerController/Resource
|
||||
- DKImagePickerController/ImageDataManager (4.3.9)
|
||||
- DKImagePickerController/PhotoGallery (4.3.9):
|
||||
- DKImagePickerController/ImageDataManager (4.3.4)
|
||||
- DKImagePickerController/PhotoGallery (4.3.4):
|
||||
- DKImagePickerController/Core
|
||||
- DKPhotoGallery
|
||||
- DKImagePickerController/Resource (4.3.9)
|
||||
- DKPhotoGallery (0.0.19):
|
||||
- DKPhotoGallery/Core (= 0.0.19)
|
||||
- DKPhotoGallery/Model (= 0.0.19)
|
||||
- DKPhotoGallery/Preview (= 0.0.19)
|
||||
- DKPhotoGallery/Resource (= 0.0.19)
|
||||
- DKImagePickerController/Resource (4.3.4)
|
||||
- DKPhotoGallery (0.0.17):
|
||||
- DKPhotoGallery/Core (= 0.0.17)
|
||||
- DKPhotoGallery/Model (= 0.0.17)
|
||||
- DKPhotoGallery/Preview (= 0.0.17)
|
||||
- DKPhotoGallery/Resource (= 0.0.17)
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Core (0.0.19):
|
||||
- DKPhotoGallery/Core (0.0.17):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Preview
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Model (0.0.19):
|
||||
- DKPhotoGallery/Model (0.0.17):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Preview (0.0.19):
|
||||
- DKPhotoGallery/Preview (0.0.17):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Resource
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Resource (0.0.19):
|
||||
- DKPhotoGallery/Resource (0.0.17):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- emoji_picker_flutter (0.0.1):
|
||||
- Flutter
|
||||
- fast_rsa (0.7.0):
|
||||
- fast_rsa (0.6.0):
|
||||
- Flutter
|
||||
- file_picker (0.0.1):
|
||||
- DKImagePickerController/PhotoGallery
|
||||
- Flutter
|
||||
- Firebase/CoreOnly (12.4.0):
|
||||
- FirebaseCore (~> 12.4.0)
|
||||
- Firebase/InAppMessaging (12.4.0):
|
||||
- Firebase/CoreOnly (10.12.0):
|
||||
- FirebaseCore (= 10.12.0)
|
||||
- Firebase/InAppMessaging (10.12.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseInAppMessaging (~> 12.4.0-beta)
|
||||
- Firebase/Messaging (12.4.0):
|
||||
- FirebaseInAppMessaging (~> 10.12.0-beta)
|
||||
- Firebase/Messaging (10.12.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 12.4.0)
|
||||
- firebase_core (4.2.1):
|
||||
- Firebase/CoreOnly (= 12.4.0)
|
||||
- FirebaseMessaging (~> 10.12.0)
|
||||
- firebase_core (2.15.1):
|
||||
- Firebase/CoreOnly (= 10.12.0)
|
||||
- Flutter
|
||||
- firebase_in_app_messaging (0.9.0-4):
|
||||
- Firebase/InAppMessaging (= 12.4.0)
|
||||
- firebase_in_app_messaging (0.7.3-5):
|
||||
- Firebase/InAppMessaging (= 10.12.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_messaging (16.0.4):
|
||||
- Firebase/Messaging (= 12.4.0)
|
||||
- firebase_messaging (14.6.6):
|
||||
- Firebase/Messaging (= 10.12.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- FirebaseABTesting (12.4.0):
|
||||
- FirebaseCore (~> 12.4.0)
|
||||
- FirebaseCore (12.4.0):
|
||||
- FirebaseCoreInternal (~> 12.4.0)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/Logger (~> 8.1)
|
||||
- FirebaseCoreInternal (12.4.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
||||
- FirebaseInAppMessaging (12.4.0-beta):
|
||||
- FirebaseABTesting (~> 12.4.0)
|
||||
- FirebaseCore (~> 12.4.0)
|
||||
- FirebaseInstallations (~> 12.4.0)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/UserDefaults (~> 8.1)
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseInstallations (12.4.0):
|
||||
- FirebaseCore (~> 12.4.0)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/UserDefaults (~> 8.1)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- FirebaseMessaging (12.4.0):
|
||||
- FirebaseCore (~> 12.4.0)
|
||||
- FirebaseInstallations (~> 12.4.0)
|
||||
- GoogleDataTransport (~> 10.1)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
||||
- GoogleUtilities/Environment (~> 8.1)
|
||||
- GoogleUtilities/Reachability (~> 8.1)
|
||||
- GoogleUtilities/UserDefaults (~> 8.1)
|
||||
- nanopb (~> 3.30910.0)
|
||||
- FirebaseABTesting (10.13.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- FirebaseCore (10.12.0):
|
||||
- FirebaseCoreInternal (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/Logger (~> 7.8)
|
||||
- FirebaseCoreInternal (10.13.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||
- FirebaseInAppMessaging (10.12.0-beta):
|
||||
- FirebaseABTesting (~> 10.0)
|
||||
- FirebaseCore (~> 10.0)
|
||||
- FirebaseInstallations (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- FirebaseInstallations (10.13.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||
- PromisesObjC (~> 2.1)
|
||||
- FirebaseMessaging (10.12.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- FirebaseInstallations (~> 10.0)
|
||||
- GoogleDataTransport (~> 9.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/Reachability (~> 7.8)
|
||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_app_badge (2.0.0):
|
||||
- flutter_app_badger (1.3.0):
|
||||
- Flutter
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- flutter_native_splash (2.4.3):
|
||||
- flutter_native_splash (0.0.1):
|
||||
- Flutter
|
||||
- GoogleDataTransport (10.1.0):
|
||||
- nanopb (~> 3.30910.0)
|
||||
- PromisesObjC (~> 2.4)
|
||||
- GoogleUtilities/AppDelegateSwizzler (8.1.0):
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- GoogleDataTransport (9.2.5):
|
||||
- GoogleUtilities/Environment (~> 7.7)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (7.11.5):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Environment (8.1.0):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Logger (8.1.0):
|
||||
- GoogleUtilities/Environment (7.11.5):
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/Logger (7.11.5):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Network (8.1.0):
|
||||
- GoogleUtilities/Network (7.11.5):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (8.1.0)":
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Privacy (8.1.0)
|
||||
- GoogleUtilities/Reachability (8.1.0):
|
||||
- "GoogleUtilities/NSData+zlib (7.11.5)"
|
||||
- GoogleUtilities/Reachability (7.11.5):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/UserDefaults (8.1.0):
|
||||
- GoogleUtilities/UserDefaults (7.11.5):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- image_picker_ios (0.0.1):
|
||||
- Flutter
|
||||
- in_app_review (2.0.0):
|
||||
- libphonenumber_plugin (0.0.1):
|
||||
- Flutter
|
||||
- nanopb (3.30910.0):
|
||||
- nanopb/decode (= 3.30910.0)
|
||||
- nanopb/encode (= 3.30910.0)
|
||||
- nanopb/decode (3.30910.0)
|
||||
- nanopb/encode (3.30910.0)
|
||||
- open_filex (0.0.2):
|
||||
- Flutter
|
||||
- package_info_plus (0.4.5):
|
||||
- PhoneNumberKit
|
||||
- nanopb (2.30909.0):
|
||||
- nanopb/decode (= 2.30909.0)
|
||||
- nanopb/encode (= 2.30909.0)
|
||||
- nanopb/decode (2.30909.0)
|
||||
- nanopb/encode (2.30909.0)
|
||||
- package_info (0.0.1):
|
||||
- Flutter
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- PhoneNumberKit (3.7.11):
|
||||
- PhoneNumberKit/PhoneNumberKitCore (= 3.7.11)
|
||||
- PhoneNumberKit/UIKit (= 3.7.11)
|
||||
- PhoneNumberKit/PhoneNumberKitCore (3.7.11)
|
||||
- PhoneNumberKit/UIKit (3.7.11):
|
||||
- PhoneNumberKit (3.6.7):
|
||||
- PhoneNumberKit/PhoneNumberKitCore (= 3.6.7)
|
||||
- PhoneNumberKit/UIKit (= 3.6.7)
|
||||
- PhoneNumberKit/PhoneNumberKitCore (3.6.7)
|
||||
- PhoneNumberKit/UIKit (3.6.7):
|
||||
- PhoneNumberKit/PhoneNumberKitCore
|
||||
- PromisesObjC (2.4.0)
|
||||
- SDWebImage (5.21.2):
|
||||
- SDWebImage/Core (= 5.21.2)
|
||||
- SDWebImage/Core (5.21.2)
|
||||
- PromisesObjC (2.3.1)
|
||||
- SDWebImage (5.17.0):
|
||||
- SDWebImage/Core (= 5.17.0)
|
||||
- SDWebImage/Core (5.17.0)
|
||||
- share_plus (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqflite_darwin (0.0.4):
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- SwiftyGif (5.4.5)
|
||||
- FMDB (>= 2.7.5)
|
||||
- SwiftyGif (5.4.4)
|
||||
- syncfusion_flutter_pdfviewer (0.0.1):
|
||||
- Flutter
|
||||
- Toast (4.0.0)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||
- better_open_file (from `.symlinks/plugins/better_open_file/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`)
|
||||
- fast_rsa (from `.symlinks/plugins/fast_rsa/ios`)
|
||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||
- firebase_in_app_messaging (from `.symlinks/plugins/firebase_in_app_messaging/ios`)
|
||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_app_badge (from `.symlinks/plugins/flutter_app_badge/ios`)
|
||||
- flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
|
||||
- open_filex (from `.symlinks/plugins/open_filex/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- libphonenumber_plugin (from `.symlinks/plugins/libphonenumber_plugin/ios`)
|
||||
- package_info (from `.symlinks/plugins/package_info/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- PhoneNumberKit (~> 3.7.6)
|
||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- syncfusion_flutter_pdfviewer (from `.symlinks/plugins/syncfusion_flutter_pdfviewer/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
|
||||
@@ -199,6 +194,7 @@ SPEC REPOS:
|
||||
- FirebaseInAppMessaging
|
||||
- FirebaseInstallations
|
||||
- FirebaseMessaging
|
||||
- FMDB
|
||||
- GoogleDataTransport
|
||||
- GoogleUtilities
|
||||
- nanopb
|
||||
@@ -206,14 +202,13 @@ SPEC REPOS:
|
||||
- PromisesObjC
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
connectivity_plus:
|
||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||
better_open_file:
|
||||
:path: ".symlinks/plugins/better_open_file/ios"
|
||||
device_info_plus:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
emoji_picker_flutter:
|
||||
:path: ".symlinks/plugins/emoji_picker_flutter/ios"
|
||||
fast_rsa:
|
||||
:path: ".symlinks/plugins/fast_rsa/ios"
|
||||
file_picker:
|
||||
@@ -226,73 +221,74 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_app_badge:
|
||||
:path: ".symlinks/plugins/flutter_app_badge/ios"
|
||||
flutter_app_badger:
|
||||
:path: ".symlinks/plugins/flutter_app_badger/ios"
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
flutter_native_splash:
|
||||
:path: ".symlinks/plugins/flutter_native_splash/ios"
|
||||
fluttertoast:
|
||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
in_app_review:
|
||||
:path: ".symlinks/plugins/in_app_review/ios"
|
||||
open_filex:
|
||||
:path: ".symlinks/plugins/open_filex/ios"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
libphonenumber_plugin:
|
||||
:path: ".symlinks/plugins/libphonenumber_plugin/ios"
|
||||
package_info:
|
||||
:path: ".symlinks/plugins/package_info/ios"
|
||||
path_provider_foundation:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||
share_plus:
|
||||
:path: ".symlinks/plugins/share_plus/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||
sqflite_darwin:
|
||||
:path: ".symlinks/plugins/sqflite_darwin/darwin"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
syncfusion_flutter_pdfviewer:
|
||||
:path: ".symlinks/plugins/syncfusion_flutter_pdfviewer/ios"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
|
||||
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
|
||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||
emoji_picker_flutter: ece213fc274bdddefb77d502d33080dc54e616cc
|
||||
fast_rsa: fb70897d51040b094c780d5f1d7358614738b879
|
||||
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
|
||||
Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e
|
||||
firebase_core: f1aafb21c14f497e5498f7ffc4dc63cbb52b2594
|
||||
firebase_in_app_messaging: 04dfc07ab81578ef83bf0c0229be258ddf287c4f
|
||||
firebase_messaging: c17a29984eafce4b2997fe078bb0a9e0b06f5dde
|
||||
FirebaseABTesting: c05b5ec9f1d9f21a65909525de301d375032d9a4
|
||||
FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3
|
||||
FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6
|
||||
FirebaseInAppMessaging: 606dd4d4d5590a3d8229f363fdebb485235985b2
|
||||
FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2
|
||||
FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5
|
||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||
flutter_app_badge: ca742dd659a157c1090ef7cd881cb78f48f3bcdf
|
||||
flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
|
||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
|
||||
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
|
||||
in_app_review: 7dd1ea365263f834b8464673f9df72c80c17c937
|
||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||
open_filex: 432f3cd11432da3e39f47fcc0df2b1603854eff1
|
||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||
PhoneNumberKit: ced55861269312a5e3bc2ef82a58d6255b1c976a
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a
|
||||
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
|
||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
|
||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||
syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14
|
||||
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
||||
better_open_file: 03cf320415d4d3f46b6e00adc4a567d76c1a399d
|
||||
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
|
||||
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
|
||||
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||
fast_rsa: f696740d492d562e76f17b0a81dfc8ec3e635374
|
||||
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
|
||||
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
|
||||
firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f
|
||||
firebase_in_app_messaging: aebdbc10109a0ce44a3294f4ea57ed89ebe1d8bd
|
||||
firebase_messaging: 13b378c8449cae7ec96c79570170943dd73d4738
|
||||
FirebaseABTesting: 86ac5a4fc749088bb4d55a1cbfb2c4cb42c6d5de
|
||||
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
|
||||
FirebaseCoreInternal: b342e37cd4f5b4454ec34308f073420e7920858e
|
||||
FirebaseInAppMessaging: dc24f50aebaf81a377f0b8abf360778f94208931
|
||||
FirebaseInstallations: b28af1b9f997f1a799efe818c94695a3728c352f
|
||||
FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_app_badger: b87fc231847b03b92ce1412aa351842e7e97932f
|
||||
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
|
||||
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
||||
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
|
||||
GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
|
||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||
libphonenumber_plugin: e8a7d64a6624a7c25f2c4ab0b7ead2a8e341e35e
|
||||
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
|
||||
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
PhoneNumberKit: 43b5169526cc417398c8f13f77c97552c1c6ed76
|
||||
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
|
||||
SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9
|
||||
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
|
||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
|
||||
syncfusion_flutter_pdfviewer: bb9998884b864cfedf72628df3503bdf57e397c0
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||
|
||||
PODFILE CHECKSUM: e21c9d4c7b9623c73c6784ddc132fd50a603ad93
|
||||
PODFILE CHECKSUM: 3d89a90682e2cd438911ad748b8ba5992f8b6a0e
|
||||
|
||||
COCOAPODS: 1.16.2
|
||||
COCOAPODS: 1.12.1
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
33FDB0982EE9ABDC000B2391 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
6483E4432A911EA00063B51E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6483E4422A911EA00063B51E /* GoogleService-Info.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 */; };
|
||||
@@ -33,10 +33,10 @@
|
||||
/* Begin PBXFileReference section */
|
||||
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>"; };
|
||||
33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
4509EC31CB08BA9BF367AF6C /* 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>"; };
|
||||
64801C012A9112D500E8B558 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
|
||||
6483E4422A911EA00063B51E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.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>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
@@ -115,12 +115,12 @@
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */,
|
||||
64801C012A9112D500E8B558 /* Runner.entitlements */,
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||
97C147021CF9000F007C117D /* Info.plist */,
|
||||
6483E4422A911EA00063B51E /* GoogleService-Info.plist */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
@@ -144,7 +144,6 @@
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
174B54D80220E5F588BD9737 /* [CP] Embed Pods Frameworks */,
|
||||
859FAB4E05FAC31B7B1A62D7 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -162,7 +161,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1510;
|
||||
LastUpgradeCheck = 1430;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
@@ -196,7 +195,7 @@
|
||||
files = (
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||
33FDB0982EE9ABDC000B2391 /* GoogleService-Info.plist in Resources */,
|
||||
6483E4432A911EA00063B51E /* GoogleService-Info.plist in Resources */,
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||
);
|
||||
@@ -213,14 +212,10 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
@@ -242,27 +237,6 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
859FAB4E05FAC31B7B1A62D7 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@@ -375,7 +349,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
@@ -460,7 +434,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -509,7 +483,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1510"
|
||||
LastUpgradeVersion = "1430"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,7 +26,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@@ -44,13 +43,11 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@main
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
|
||||
@@ -9,26 +9,23 @@ part of 'getHolidaysResponse.dart';
|
||||
GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetHolidaysResponse(
|
||||
(json['data'] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) =>
|
||||
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetHolidaysResponseToJson(
|
||||
GetHolidaysResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetHolidaysResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'data': instance.data.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetHolidaysResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetHolidaysResponseObject(
|
||||
start: json['start'] as String,
|
||||
end: json['end'] as String,
|
||||
year: (json['year'] as num).toInt(),
|
||||
@@ -38,8 +35,8 @@ GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
|
||||
GetHolidaysResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetHolidaysResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'start': instance.start,
|
||||
'end': instance.end,
|
||||
'year': instance.year,
|
||||
|
||||
@@ -7,22 +7,23 @@ part of 'autocompleteResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
AutocompleteResponse _$AutocompleteResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => AutocompleteResponse(
|
||||
Map<String, dynamic> json) =>
|
||||
AutocompleteResponse(
|
||||
(json['data'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => AutocompleteResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) =>
|
||||
AutocompleteResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AutocompleteResponseToJson(
|
||||
AutocompleteResponse instance,
|
||||
) => <String, dynamic>{'data': instance.data.map((e) => e.toJson()).toList()};
|
||||
AutocompleteResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'data': instance.data.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
AutocompleteResponseObject _$AutocompleteResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => AutocompleteResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
AutocompleteResponseObject(
|
||||
json['id'] as String,
|
||||
json['label'] as String,
|
||||
json['icon'] as String?,
|
||||
@@ -33,8 +34,8 @@ AutocompleteResponseObject _$AutocompleteResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AutocompleteResponseObjectToJson(
|
||||
AutocompleteResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
AutocompleteResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'label': instance.label,
|
||||
'icon': instance.icon,
|
||||
|
||||
@@ -7,8 +7,8 @@ part of 'fileSharingApiParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
FileSharingApiParams _$FileSharingApiParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => FileSharingApiParams(
|
||||
Map<String, dynamic> json) =>
|
||||
FileSharingApiParams(
|
||||
shareType: (json['shareType'] as num).toInt(),
|
||||
shareWith: json['shareWith'] as String,
|
||||
path: json['path'] as String,
|
||||
@@ -17,8 +17,8 @@ FileSharingApiParams _$FileSharingApiParamsFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$FileSharingApiParamsToJson(
|
||||
FileSharingApiParams instance,
|
||||
) => <String, dynamic>{
|
||||
FileSharingApiParams instance) =>
|
||||
<String, dynamic>{
|
||||
'shareType': instance.shareType,
|
||||
'shareWith': instance.shareWith,
|
||||
'path': instance.path,
|
||||
|
||||
@@ -8,34 +8,33 @@ part of 'getChatParams.dart';
|
||||
|
||||
GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) =>
|
||||
GetChatParams(
|
||||
lookIntoFuture: $enumDecode(
|
||||
_$GetChatParamsSwitchEnumMap,
|
||||
json['lookIntoFuture'],
|
||||
),
|
||||
lookIntoFuture:
|
||||
$enumDecode(_$GetChatParamsSwitchEnumMap, json['lookIntoFuture']),
|
||||
limit: (json['limit'] as num?)?.toInt(),
|
||||
lastKnownMessageId: (json['lastKnownMessageId'] as num?)?.toInt(),
|
||||
lastCommonReadId: (json['lastCommonReadId'] as num?)?.toInt(),
|
||||
timeout: (json['timeout'] as num?)?.toInt(),
|
||||
setReadMarker: $enumDecodeNullable(
|
||||
_$GetChatParamsSwitchEnumMap,
|
||||
json['setReadMarker'],
|
||||
),
|
||||
_$GetChatParamsSwitchEnumMap, json['setReadMarker']),
|
||||
includeLastKnown: $enumDecodeNullable(
|
||||
_$GetChatParamsSwitchEnumMap,
|
||||
json['includeLastKnown'],
|
||||
),
|
||||
_$GetChatParamsSwitchEnumMap, json['includeLastKnown']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetChatParamsToJson(
|
||||
GetChatParams instance,
|
||||
) => <String, dynamic>{
|
||||
Map<String, dynamic> _$GetChatParamsToJson(GetChatParams instance) =>
|
||||
<String, dynamic>{
|
||||
'lookIntoFuture': _$GetChatParamsSwitchEnumMap[instance.lookIntoFuture]!,
|
||||
'limit': ?instance.limit,
|
||||
'lastKnownMessageId': ?instance.lastKnownMessageId,
|
||||
'lastCommonReadId': ?instance.lastCommonReadId,
|
||||
'timeout': ?instance.timeout,
|
||||
'setReadMarker': ?_$GetChatParamsSwitchEnumMap[instance.setReadMarker],
|
||||
'includeLastKnown': ?_$GetChatParamsSwitchEnumMap[instance.includeLastKnown],
|
||||
if (instance.limit case final value?) 'limit': value,
|
||||
if (instance.lastKnownMessageId case final value?)
|
||||
'lastKnownMessageId': value,
|
||||
if (instance.lastCommonReadId case final value?)
|
||||
'lastCommonReadId': value,
|
||||
if (instance.timeout case final value?) 'timeout': value,
|
||||
if (_$GetChatParamsSwitchEnumMap[instance.setReadMarker]
|
||||
case final value?)
|
||||
'setReadMarker': value,
|
||||
if (_$GetChatParamsSwitchEnumMap[instance.includeLastKnown]
|
||||
case final value?)
|
||||
'includeLastKnown': value,
|
||||
};
|
||||
|
||||
const _$GetChatParamsSwitchEnumMap = {
|
||||
|
||||
@@ -120,5 +120,4 @@ enum RichObjectStringObjectType {
|
||||
@JsonValue('guest') guest,
|
||||
@JsonValue('highlight') highlight,
|
||||
@JsonValue('talk-poll') talkPoll,
|
||||
@JsonValue('geo-location') geoLocation,
|
||||
}
|
||||
|
||||
@@ -9,35 +9,31 @@ part of 'getChatResponse.dart';
|
||||
GetChatResponse _$GetChatResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetChatResponse(
|
||||
(json['data'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetChatResponseToJson(GetChatResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'data': instance.data.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetChatResponseObject _$GetChatResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetChatResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetChatResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['token'] as String,
|
||||
$enumDecode(
|
||||
_$GetRoomResponseObjectMessageActorTypeEnumMap,
|
||||
json['actorType'],
|
||||
),
|
||||
_$GetRoomResponseObjectMessageActorTypeEnumMap, json['actorType']),
|
||||
json['actorId'] as String,
|
||||
json['actorDisplayName'] as String,
|
||||
(json['timestamp'] as num).toInt(),
|
||||
json['systemMessage'] as String,
|
||||
$enumDecode(_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
|
||||
$enumDecode(
|
||||
_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
|
||||
json['isReplyable'] as bool,
|
||||
json['referenceId'] as String,
|
||||
json['message'] as String,
|
||||
@@ -45,15 +41,18 @@ GetChatResponseObject _$GetChatResponseObjectFromJson(
|
||||
(json['reactions'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, (e as num).toInt()),
|
||||
),
|
||||
(json['reactionsSelf'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
(json['reactionsSelf'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
json['parent'] == null
|
||||
? null
|
||||
: GetChatResponseObject.fromJson(json['parent'] as Map<String, dynamic>),
|
||||
: GetChatResponseObject.fromJson(
|
||||
json['parent'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetChatResponseObjectToJson(
|
||||
GetChatResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetChatResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'token': instance.token,
|
||||
'actorType':
|
||||
@@ -69,9 +68,8 @@ Map<String, dynamic> _$GetChatResponseObjectToJson(
|
||||
'message': instance.message,
|
||||
'reactions': instance.reactions,
|
||||
'reactionsSelf': instance.reactionsSelf,
|
||||
'messageParameters': instance.messageParameters?.map(
|
||||
(k, e) => MapEntry(k, e.toJson()),
|
||||
),
|
||||
'messageParameters':
|
||||
instance.messageParameters?.map((k, e) => MapEntry(k, e.toJson())),
|
||||
'parent': instance.parent?.toJson(),
|
||||
};
|
||||
|
||||
@@ -85,7 +83,6 @@ const _$GetRoomResponseObjectMessageActorTypeEnumMap = {
|
||||
|
||||
const _$GetRoomResponseObjectMessageTypeEnumMap = {
|
||||
GetRoomResponseObjectMessageType.comment: 'comment',
|
||||
GetRoomResponseObjectMessageType.voiceMessage: 'voice-message',
|
||||
GetRoomResponseObjectMessageType.deletedComment: 'comment_deleted',
|
||||
GetRoomResponseObjectMessageType.system: 'system',
|
||||
GetRoomResponseObjectMessageType.command: 'command',
|
||||
@@ -116,5 +113,4 @@ const _$RichObjectStringObjectTypeEnumMap = {
|
||||
RichObjectStringObjectType.guest: 'guest',
|
||||
RichObjectStringObjectType.highlight: 'highlight',
|
||||
RichObjectStringObjectType.talkPoll: 'talk-poll',
|
||||
RichObjectStringObjectType.geoLocation: 'geo-location',
|
||||
};
|
||||
|
||||
@@ -7,9 +7,13 @@ part of 'deleteReactMessageParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
DeleteReactMessageParams _$DeleteReactMessageParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => DeleteReactMessageParams(json['reaction'] as String);
|
||||
Map<String, dynamic> json) =>
|
||||
DeleteReactMessageParams(
|
||||
json['reaction'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeleteReactMessageParamsToJson(
|
||||
DeleteReactMessageParams instance,
|
||||
) => <String, dynamic>{'reaction': instance.reaction};
|
||||
DeleteReactMessageParams instance) =>
|
||||
<String, dynamic>{
|
||||
'reaction': instance.reaction,
|
||||
};
|
||||
|
||||
@@ -7,44 +7,35 @@ part of 'getParticipantsResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
GetParticipantsResponse _$GetParticipantsResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
Map<String, dynamic> json) =>
|
||||
GetParticipantsResponse(
|
||||
(json['data'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetParticipantsResponseObject.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.map((e) =>
|
||||
GetParticipantsResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetParticipantsResponseToJson(
|
||||
GetParticipantsResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetParticipantsResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'data': instance.data.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetParticipantsResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetParticipantsResponseObject(
|
||||
(json['attendeeId'] as num).toInt(),
|
||||
json['actorType'] as String,
|
||||
json['actorId'] as String,
|
||||
json['displayName'] as String,
|
||||
$enumDecode(
|
||||
_$GetParticipantsResponseObjectParticipantTypeEnumMap,
|
||||
json['participantType'],
|
||||
),
|
||||
$enumDecode(_$GetParticipantsResponseObjectParticipantTypeEnumMap,
|
||||
json['participantType']),
|
||||
(json['lastPing'] as num).toInt(),
|
||||
$enumDecode(
|
||||
_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
|
||||
json['inCall'],
|
||||
),
|
||||
$enumDecode(_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
|
||||
json['inCall']),
|
||||
(json['permissions'] as num).toInt(),
|
||||
(json['attendeePermissions'] as num).toInt(),
|
||||
json['sessionId'] as String?,
|
||||
@@ -56,19 +47,17 @@ GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetParticipantsResponseObjectToJson(
|
||||
GetParticipantsResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetParticipantsResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'attendeeId': instance.attendeeId,
|
||||
'actorType': instance.actorType,
|
||||
'actorId': instance.actorId,
|
||||
'displayName': instance.displayName,
|
||||
'participantType':
|
||||
_$GetParticipantsResponseObjectParticipantTypeEnumMap[instance
|
||||
.participantType]!,
|
||||
'participantType': _$GetParticipantsResponseObjectParticipantTypeEnumMap[
|
||||
instance.participantType]!,
|
||||
'lastPing': instance.lastPing,
|
||||
'inCall':
|
||||
_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[instance
|
||||
.inCall]!,
|
||||
'inCall': _$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[
|
||||
instance.inCall]!,
|
||||
'permissions': instance.permissions,
|
||||
'attendeePermissions': instance.attendeePermissions,
|
||||
'sessionId': instance.sessionId,
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../talkApi.dart';
|
||||
import 'getPollStateResponse.dart';
|
||||
|
||||
class GetPollState extends TalkApi<GetPollStateResponse> {
|
||||
String token;
|
||||
int pollId;
|
||||
GetPollState({required this.token, required this.pollId}) : super('v1/poll/$token/$pollId', null);
|
||||
|
||||
@override
|
||||
GetPollStateResponse assemble(String raw) => GetPollStateResponse.fromJson(jsonDecode(raw)['ocs']);
|
||||
|
||||
@override
|
||||
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) => http.get(uri, headers: headers);
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../../../apiResponse.dart';
|
||||
|
||||
part 'getPollStateResponse.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetPollStateResponse extends ApiResponse {
|
||||
GetPollStateResponseObject data;
|
||||
|
||||
GetPollStateResponse(this.data);
|
||||
|
||||
factory GetPollStateResponse.fromJson(Map<String, dynamic> json) => _$GetPollStateResponseFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetPollStateResponseToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetPollStateResponseObject {
|
||||
int id;
|
||||
String question;
|
||||
List<String> options;
|
||||
dynamic votes;
|
||||
String actorType;
|
||||
String actorId;
|
||||
String actorDisplayName;
|
||||
int status;
|
||||
int resultMode;
|
||||
int maxVotes;
|
||||
List<int> votedSelf;
|
||||
int? numVoters;
|
||||
List<dynamic>? details;
|
||||
|
||||
GetPollStateResponseObject(
|
||||
this.id,
|
||||
this.question,
|
||||
this.options,
|
||||
this.votes,
|
||||
this.actorType,
|
||||
this.actorId,
|
||||
this.actorDisplayName,
|
||||
this.status,
|
||||
this.resultMode,
|
||||
this.maxVotes,
|
||||
this.votedSelf,
|
||||
this.numVoters,
|
||||
this.details);
|
||||
|
||||
factory GetPollStateResponseObject.fromJson(Map<String, dynamic> json) => _$GetPollStateResponseObjectFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetPollStateResponseObjectToJson(this);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'getPollStateResponse.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GetPollStateResponse _$GetPollStateResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
GetPollStateResponse(
|
||||
GetPollStateResponseObject.fromJson(
|
||||
json['data'] as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetPollStateResponseToJson(
|
||||
GetPollStateResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
'data': instance.data.toJson(),
|
||||
};
|
||||
|
||||
GetPollStateResponseObject _$GetPollStateResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetPollStateResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['question'] as String,
|
||||
(json['options'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
json['votes'],
|
||||
json['actorType'] as String,
|
||||
json['actorId'] as String,
|
||||
json['actorDisplayName'] as String,
|
||||
(json['status'] as num).toInt(),
|
||||
(json['resultMode'] as num).toInt(),
|
||||
(json['maxVotes'] as num).toInt(),
|
||||
(json['votedSelf'] as List<dynamic>).map((e) => (e as num).toInt()).toList(),
|
||||
(json['numVoters'] as num?)?.toInt(),
|
||||
json['details'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetPollStateResponseObjectToJson(
|
||||
GetPollStateResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'question': instance.question,
|
||||
'options': instance.options,
|
||||
'votes': instance.votes,
|
||||
'actorType': instance.actorType,
|
||||
'actorId': instance.actorId,
|
||||
'actorDisplayName': instance.actorDisplayName,
|
||||
'status': instance.status,
|
||||
'resultMode': instance.resultMode,
|
||||
'maxVotes': instance.maxVotes,
|
||||
'votedSelf': instance.votedSelf,
|
||||
'numVoters': instance.numVoters,
|
||||
'details': instance.details,
|
||||
};
|
||||
@@ -7,47 +7,41 @@ part of 'getReactionsResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
GetReactionsResponse _$GetReactionsResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
Map<String, dynamic> json) =>
|
||||
GetReactionsResponse(
|
||||
(json['data'] as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
k,
|
||||
(e as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetReactionsResponseObject.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
.map((e) => GetReactionsResponseObject.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList()),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetReactionsResponseToJson(
|
||||
GetReactionsResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
'data': instance.data.map(
|
||||
(k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()),
|
||||
),
|
||||
GetReactionsResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'data': instance.data
|
||||
.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList())),
|
||||
};
|
||||
|
||||
GetReactionsResponseObject _$GetReactionsResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetReactionsResponseObject(
|
||||
$enumDecode(_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
|
||||
Map<String, dynamic> json) =>
|
||||
GetReactionsResponseObject(
|
||||
$enumDecode(
|
||||
_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
|
||||
json['actorId'] as String,
|
||||
json['actorDisplayName'] as String,
|
||||
(json['timestamp'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetReactionsResponseObjectToJson(
|
||||
GetReactionsResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetReactionsResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'actorType':
|
||||
_$GetReactionsResponseObjectActorTypeEnumMap[instance.actorType]!,
|
||||
'actorId': instance.actorId,
|
||||
|
||||
@@ -7,7 +7,11 @@ part of 'reactMessageParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
ReactMessageParams _$ReactMessageParamsFromJson(Map<String, dynamic> json) =>
|
||||
ReactMessageParams(json['reaction'] as String);
|
||||
ReactMessageParams(
|
||||
json['reaction'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReactMessageParamsToJson(ReactMessageParams instance) =>
|
||||
<String, dynamic>{'reaction': instance.reaction};
|
||||
<String, dynamic>{
|
||||
'reaction': instance.reaction,
|
||||
};
|
||||
|
||||
@@ -9,17 +9,15 @@ part of 'getRoomParams.dart';
|
||||
GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) =>
|
||||
GetRoomParams(
|
||||
noStatusUpdate: $enumDecodeNullable(
|
||||
_$GetRoomParamsStatusUpdateEnumMap,
|
||||
json['noStatusUpdate'],
|
||||
),
|
||||
_$GetRoomParamsStatusUpdateEnumMap, json['noStatusUpdate']),
|
||||
includeStatus: json['includeStatus'] as bool?,
|
||||
modifiedSince: (json['modifiedSince'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetRoomParamsToJson(
|
||||
GetRoomParams instance,
|
||||
) => <String, dynamic>{
|
||||
'noStatusUpdate': _$GetRoomParamsStatusUpdateEnumMap[instance.noStatusUpdate],
|
||||
Map<String, dynamic> _$GetRoomParamsToJson(GetRoomParams instance) =>
|
||||
<String, dynamic>{
|
||||
'noStatusUpdate':
|
||||
_$GetRoomParamsStatusUpdateEnumMap[instance.noStatusUpdate],
|
||||
'includeStatus': GetRoomParams._format(instance.includeStatus),
|
||||
'modifiedSince': instance.modifiedSince,
|
||||
};
|
||||
|
||||
@@ -162,7 +162,6 @@ enum GetRoomResponseObjectMessageActorType {
|
||||
|
||||
enum GetRoomResponseObjectMessageType {
|
||||
@JsonValue('comment') comment,
|
||||
@JsonValue('voice-message') voiceMessage,
|
||||
@JsonValue('comment_deleted') deletedComment,
|
||||
@JsonValue('system') system,
|
||||
@JsonValue('command') command,
|
||||
|
||||
@@ -9,24 +9,21 @@ part of 'getRoomResponse.dart';
|
||||
GetRoomResponse _$GetRoomResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetRoomResponse(
|
||||
(json['data'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetRoomResponseToJson(GetRoomResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'data': instance.data.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetRoomResponseObject _$GetRoomResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetRoomResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetRoomResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['token'] as String,
|
||||
$enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']),
|
||||
@@ -47,24 +44,23 @@ GetRoomResponseObject _$GetRoomResponseObjectFromJson(
|
||||
json['canLeaveConversation'] as bool,
|
||||
(json['lastActivity'] as num).toInt(),
|
||||
json['isFavorite'] as bool,
|
||||
$enumDecode(
|
||||
_$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
|
||||
json['notificationLevel'],
|
||||
),
|
||||
$enumDecode(_$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
|
||||
json['notificationLevel']),
|
||||
(json['unreadMessages'] as num).toInt(),
|
||||
json['unreadMention'] as bool,
|
||||
json['unreadMentionDirect'] as bool,
|
||||
(json['lastReadMessage'] as num).toInt(),
|
||||
(json['lastCommonReadMessage'] as num).toInt(),
|
||||
GetChatResponseObject.fromJson(json['lastMessage'] as Map<String, dynamic>),
|
||||
GetChatResponseObject.fromJson(
|
||||
json['lastMessage'] as Map<String, dynamic>),
|
||||
json['status'] as String?,
|
||||
json['statusIcon'] as String?,
|
||||
json['statusMessage'] as String?,
|
||||
)..sort = json['sort'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GetRoomResponseObjectToJson(
|
||||
GetRoomResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetRoomResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'token': instance.token,
|
||||
'type': _$GetRoomResponseObjectConversationTypeEnumMap[instance.type]!,
|
||||
@@ -86,8 +82,8 @@ Map<String, dynamic> _$GetRoomResponseObjectToJson(
|
||||
'lastActivity': instance.lastActivity,
|
||||
'isFavorite': instance.isFavorite,
|
||||
'notificationLevel':
|
||||
_$GetRoomResponseObjectParticipantNotificationLevelEnumMap[instance
|
||||
.notificationLevel]!,
|
||||
_$GetRoomResponseObjectParticipantNotificationLevelEnumMap[
|
||||
instance.notificationLevel]!,
|
||||
'unreadMessages': instance.unreadMessages,
|
||||
'unreadMention': instance.unreadMention,
|
||||
'unreadMentionDirect': instance.unreadMentionDirect,
|
||||
|
||||
@@ -15,5 +15,5 @@ SendMessageParams _$SendMessageParamsFromJson(Map<String, dynamic> json) =>
|
||||
Map<String, dynamic> _$SendMessageParamsToJson(SendMessageParams instance) =>
|
||||
<String, dynamic>{
|
||||
'message': instance.message,
|
||||
'replyTo': ?instance.replyTo,
|
||||
if (instance.replyTo case final value?) 'replyTo': value,
|
||||
};
|
||||
|
||||
@@ -12,5 +12,7 @@ SetReadMarkerParams _$SetReadMarkerParamsFromJson(Map<String, dynamic> json) =>
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SetReadMarkerParamsToJson(
|
||||
SetReadMarkerParams instance,
|
||||
) => <String, dynamic>{'lastReadMessage': instance.lastReadMessage};
|
||||
SetReadMarkerParams instance) =>
|
||||
<String, dynamic>{
|
||||
'lastReadMessage': instance.lastReadMessage,
|
||||
};
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/http.dart';
|
||||
|
||||
import '../getPoll/getPollStateResponse.dart';
|
||||
import '../talkApi.dart';
|
||||
import 'votePollParams.dart';
|
||||
|
||||
@Deprecated('VotePoll is broken')
|
||||
class VotePoll extends TalkApi {
|
||||
String token;
|
||||
int pollId;
|
||||
VotePoll({required this.token, required this.pollId, required VotePollParams params}) : super('v1/poll/$token/$pollId', params);
|
||||
|
||||
@override
|
||||
GetPollStateResponse assemble(String raw) => GetPollStateResponse.fromJson(jsonDecode(raw)['ocs']);
|
||||
|
||||
@override
|
||||
Future<Response>? request(Uri uri, Object? body, Map<String, String>? headers) {
|
||||
if(body is VotePollParams) {
|
||||
return http.post(uri, headers: headers, body: body.toJson().toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../../../apiParams.dart';
|
||||
|
||||
part 'votePollParams.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
@Deprecated('VotePoll is broken')
|
||||
class VotePollParams extends ApiParams {
|
||||
List<int> optionIds;
|
||||
|
||||
VotePollParams({required this.optionIds});
|
||||
factory VotePollParams.fromJson(Map<String, dynamic> json) => _$VotePollParamsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$VotePollParamsToJson(this);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'votePollParams.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
VotePollParams _$VotePollParamsFromJson(Map<String, dynamic> json) =>
|
||||
VotePollParams(
|
||||
optionIds: (json['optionIds'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VotePollParamsToJson(VotePollParams instance) =>
|
||||
<String, dynamic>{'optionIds': instance.optionIds};
|
||||
@@ -7,9 +7,13 @@ part of 'downloadFileResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
DownloadFileResponse _$DownloadFileResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => DownloadFileResponse(json['path'] as String);
|
||||
Map<String, dynamic> json) =>
|
||||
DownloadFileResponse(
|
||||
json['path'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DownloadFileResponseToJson(
|
||||
DownloadFileResponse instance,
|
||||
) => <String, dynamic>{'path': instance.path};
|
||||
DownloadFileResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'path': instance.path,
|
||||
};
|
||||
|
||||
@@ -7,7 +7,11 @@ part of 'listFilesParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
ListFilesParams _$ListFilesParamsFromJson(Map<String, dynamic> json) =>
|
||||
ListFilesParams(json['path'] as String);
|
||||
ListFilesParams(
|
||||
json['path'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ListFilesParamsToJson(ListFilesParams instance) =>
|
||||
<String, dynamic>{'path': instance.path};
|
||||
<String, dynamic>{
|
||||
'path': instance.path,
|
||||
};
|
||||
|
||||
@@ -11,13 +11,12 @@ ListFilesResponse _$ListFilesResponseFromJson(Map<String, dynamic> json) =>
|
||||
(json['files'] as List<dynamic>)
|
||||
.map((e) => CacheableFile.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ListFilesResponseToJson(ListFilesResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'files': instance.files.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
@@ -8,31 +8,26 @@ part of 'getBreakersResponse.dart';
|
||||
|
||||
GetBreakersResponse _$GetBreakersResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetBreakersResponse(
|
||||
GetBreakersReponseObject.fromJson(
|
||||
json['global'] as Map<String, dynamic>,
|
||||
),
|
||||
GetBreakersReponseObject.fromJson(json['global'] as Map<String, dynamic>),
|
||||
(json['regional'] as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
k,
|
||||
GetBreakersReponseObject.fromJson(e as Map<String, dynamic>),
|
||||
k, GetBreakersReponseObject.fromJson(e as Map<String, dynamic>)),
|
||||
),
|
||||
),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetBreakersResponseToJson(
|
||||
GetBreakersResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetBreakersResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'global': instance.global.toJson(),
|
||||
'regional': instance.regional.map((k, e) => MapEntry(k, e.toJson())),
|
||||
};
|
||||
|
||||
GetBreakersReponseObject _$GetBreakersReponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetBreakersReponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetBreakersReponseObject(
|
||||
(json['areas'] as List<dynamic>)
|
||||
.map((e) => $enumDecode(_$BreakerAreaEnumMap, e))
|
||||
.toList(),
|
||||
@@ -40,8 +35,8 @@ GetBreakersReponseObject _$GetBreakersReponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetBreakersReponseObjectToJson(
|
||||
GetBreakersReponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetBreakersReponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'areas': instance.areas.map((e) => _$BreakerAreaEnumMap[e]!).toList(),
|
||||
'message': instance.message,
|
||||
};
|
||||
|
||||
@@ -7,12 +7,15 @@ part of 'addCustomTimetableEventParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
AddCustomTimetableEventParams _$AddCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => AddCustomTimetableEventParams(
|
||||
Map<String, dynamic> json) =>
|
||||
AddCustomTimetableEventParams(
|
||||
json['user'] as String,
|
||||
CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddCustomTimetableEventParamsToJson(
|
||||
AddCustomTimetableEventParams instance,
|
||||
) => <String, dynamic>{'user': instance.user, 'event': instance.event.toJson()};
|
||||
AddCustomTimetableEventParams instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'event': instance.event.toJson(),
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ part of 'customTimetableEvent.dart';
|
||||
// **************************************************************************
|
||||
|
||||
CustomTimetableEvent _$CustomTimetableEventFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => CustomTimetableEvent(
|
||||
Map<String, dynamic> json) =>
|
||||
CustomTimetableEvent(
|
||||
id: json['id'] as String,
|
||||
title: json['title'] as String,
|
||||
description: json['description'] as String,
|
||||
@@ -21,8 +21,8 @@ CustomTimetableEvent _$CustomTimetableEventFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CustomTimetableEventToJson(
|
||||
CustomTimetableEvent instance,
|
||||
) => <String, dynamic>{
|
||||
CustomTimetableEvent instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'title': instance.title,
|
||||
'description': instance.description,
|
||||
|
||||
@@ -7,9 +7,13 @@ part of 'getCustomTimetableEventParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
GetCustomTimetableEventParams _$GetCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetCustomTimetableEventParams(json['user'] as String);
|
||||
Map<String, dynamic> json) =>
|
||||
GetCustomTimetableEventParams(
|
||||
json['user'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetCustomTimetableEventParamsToJson(
|
||||
GetCustomTimetableEventParams instance,
|
||||
) => <String, dynamic>{'user': instance.user};
|
||||
GetCustomTimetableEventParams instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
@@ -7,19 +7,18 @@ part of 'getCustomTimetableEventResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
GetCustomTimetableEventResponse _$GetCustomTimetableEventResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
Map<String, dynamic> json) =>
|
||||
GetCustomTimetableEventResponse(
|
||||
(json['events'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetCustomTimetableEventResponseToJson(
|
||||
GetCustomTimetableEventResponse instance,
|
||||
) => <String, dynamic>{'headers': ?instance.headers, 'events': instance.events};
|
||||
GetCustomTimetableEventResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'events': instance.events,
|
||||
};
|
||||
|
||||
@@ -7,9 +7,13 @@ part of 'removeCustomTimetableEventParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
RemoveCustomTimetableEventParams _$RemoveCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => RemoveCustomTimetableEventParams(json['id'] as String);
|
||||
Map<String, dynamic> json) =>
|
||||
RemoveCustomTimetableEventParams(
|
||||
json['id'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RemoveCustomTimetableEventParamsToJson(
|
||||
RemoveCustomTimetableEventParams instance,
|
||||
) => <String, dynamic>{'id': instance.id};
|
||||
RemoveCustomTimetableEventParams instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
};
|
||||
|
||||
@@ -7,12 +7,15 @@ part of 'updateCustomTimetableEventParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
UpdateCustomTimetableEventParams _$UpdateCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => UpdateCustomTimetableEventParams(
|
||||
Map<String, dynamic> json) =>
|
||||
UpdateCustomTimetableEventParams(
|
||||
json['id'] as String,
|
||||
CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UpdateCustomTimetableEventParamsToJson(
|
||||
UpdateCustomTimetableEventParams instance,
|
||||
) => <String, dynamic>{'id': instance.id, 'event': instance.event.toJson()};
|
||||
UpdateCustomTimetableEventParams instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'event': instance.event.toJson(),
|
||||
};
|
||||
|
||||
@@ -7,16 +7,16 @@ part of 'notifyRegisterParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
NotifyRegisterParams _$NotifyRegisterParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => NotifyRegisterParams(
|
||||
Map<String, dynamic> json) =>
|
||||
NotifyRegisterParams(
|
||||
username: json['username'] as String,
|
||||
password: json['password'] as String,
|
||||
fcmToken: json['fcmToken'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$NotifyRegisterParamsToJson(
|
||||
NotifyRegisterParams instance,
|
||||
) => <String, dynamic>{
|
||||
NotifyRegisterParams instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'password': instance.password,
|
||||
'fcmToken': instance.fcmToken,
|
||||
|
||||
@@ -7,8 +7,8 @@ part of 'updateUserIndexParams.dart';
|
||||
// **************************************************************************
|
||||
|
||||
UpdateUserIndexParams _$UpdateUserIndexParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => UpdateUserIndexParams(
|
||||
Map<String, dynamic> json) =>
|
||||
UpdateUserIndexParams(
|
||||
user: json['user'] as String,
|
||||
username: json['username'] as String,
|
||||
device: json['device'] as String,
|
||||
@@ -17,8 +17,8 @@ UpdateUserIndexParams _$UpdateUserIndexParamsFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UpdateUserIndexParamsToJson(
|
||||
UpdateUserIndexParams instance,
|
||||
) => <String, dynamic>{
|
||||
UpdateUserIndexParams instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'username': instance.username,
|
||||
'device': instance.device,
|
||||
|
||||
@@ -13,4 +13,7 @@ AuthenticateParams _$AuthenticateParamsFromJson(Map<String, dynamic> json) =>
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AuthenticateParamsToJson(AuthenticateParams instance) =>
|
||||
<String, dynamic>{'user': instance.user, 'password': instance.password};
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'password': instance.password,
|
||||
};
|
||||
|
||||
@@ -7,22 +7,20 @@ part of 'authenticateResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
AuthenticateResponse _$AuthenticateResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
Map<String, dynamic> json) =>
|
||||
AuthenticateResponse(
|
||||
json['sessionId'] as String,
|
||||
(json['personType'] as num).toInt(),
|
||||
(json['personId'] as num).toInt(),
|
||||
(json['klasseId'] as num).toInt(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AuthenticateResponseToJson(
|
||||
AuthenticateResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
AuthenticateResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'sessionId': instance.sessionId,
|
||||
'personType': instance.personType,
|
||||
'personId': instance.personId,
|
||||
|
||||
@@ -9,26 +9,23 @@ part of 'getHolidaysResponse.dart';
|
||||
GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetHolidaysResponse(
|
||||
(json['result'] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) =>
|
||||
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetHolidaysResponseToJson(
|
||||
GetHolidaysResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetHolidaysResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'result': instance.result.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetHolidaysResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetHolidaysResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longName'] as String,
|
||||
@@ -37,8 +34,8 @@ GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
|
||||
GetHolidaysResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetHolidaysResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longName': instance.longName,
|
||||
|
||||
@@ -10,23 +10,21 @@ GetRoomsResponse _$GetRoomsResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetRoomsResponse(
|
||||
(json['result'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetRoomsResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
(e) => GetRoomsResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) =>
|
||||
<String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'result': instance.result.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetRoomsResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetRoomsResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longName'] as String,
|
||||
@@ -35,8 +33,8 @@ GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetRoomsResponseObjectToJson(
|
||||
GetRoomsResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetRoomsResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longName': instance.longName,
|
||||
|
||||
@@ -9,26 +9,23 @@ part of 'getSubjectsResponse.dart';
|
||||
GetSubjectsResponse _$GetSubjectsResponseFromJson(Map<String, dynamic> json) =>
|
||||
GetSubjectsResponse(
|
||||
(json['result'] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) =>
|
||||
GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetSubjectsResponseToJson(
|
||||
GetSubjectsResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetSubjectsResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'result': instance.result.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetSubjectsResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetSubjectsResponseObject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longName'] as String,
|
||||
@@ -37,8 +34,8 @@ GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetSubjectsResponseObjectToJson(
|
||||
GetSubjectsResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetSubjectsResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longName': instance.longName,
|
||||
|
||||
@@ -9,19 +9,19 @@ part of 'getTimetableParams.dart';
|
||||
GetTimetableParams _$GetTimetableParamsFromJson(Map<String, dynamic> json) =>
|
||||
GetTimetableParams(
|
||||
options: GetTimetableParamsOptions.fromJson(
|
||||
json['options'] as Map<String, dynamic>,
|
||||
),
|
||||
json['options'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableParamsToJson(GetTimetableParams instance) =>
|
||||
<String, dynamic>{'options': instance.options.toJson()};
|
||||
<String, dynamic>{
|
||||
'options': instance.options.toJson(),
|
||||
};
|
||||
|
||||
GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableParamsOptions(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableParamsOptions(
|
||||
element: GetTimetableParamsOptionsElement.fromJson(
|
||||
json['element'] as Map<String, dynamic>,
|
||||
),
|
||||
json['element'] as Map<String, dynamic>),
|
||||
startDate: (json['startDate'] as num?)?.toInt(),
|
||||
endDate: (json['endDate'] as num?)?.toInt(),
|
||||
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
|
||||
@@ -46,30 +46,40 @@ GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableParamsOptionsToJson(
|
||||
GetTimetableParamsOptions instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableParamsOptions instance) =>
|
||||
<String, dynamic>{
|
||||
'element': instance.element.toJson(),
|
||||
'startDate': ?instance.startDate,
|
||||
'endDate': ?instance.endDate,
|
||||
'onlyBaseTimetable': ?instance.onlyBaseTimetable,
|
||||
'showBooking': ?instance.showBooking,
|
||||
'showInfo': ?instance.showInfo,
|
||||
'showSubstText': ?instance.showSubstText,
|
||||
'showLsText': ?instance.showLsText,
|
||||
'showLsNumber': ?instance.showLsNumber,
|
||||
'showStudentgroup': ?instance.showStudentgroup,
|
||||
'klasseFields': ?instance.klasseFields
|
||||
if (instance.startDate case final value?) 'startDate': value,
|
||||
if (instance.endDate case final value?) 'endDate': value,
|
||||
if (instance.onlyBaseTimetable case final value?)
|
||||
'onlyBaseTimetable': value,
|
||||
if (instance.showBooking case final value?) 'showBooking': value,
|
||||
if (instance.showInfo case final value?) 'showInfo': value,
|
||||
if (instance.showSubstText case final value?) 'showSubstText': value,
|
||||
if (instance.showLsText case final value?) 'showLsText': value,
|
||||
if (instance.showLsNumber case final value?) 'showLsNumber': value,
|
||||
if (instance.showStudentgroup case final value?)
|
||||
'showStudentgroup': value,
|
||||
if (instance.klasseFields
|
||||
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
|
||||
.toList(),
|
||||
'roomFields': ?instance.roomFields
|
||||
.toList()
|
||||
case final value?)
|
||||
'klasseFields': value,
|
||||
if (instance.roomFields
|
||||
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
|
||||
.toList(),
|
||||
'subjectFields': ?instance.subjectFields
|
||||
.toList()
|
||||
case final value?)
|
||||
'roomFields': value,
|
||||
if (instance.subjectFields
|
||||
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
|
||||
.toList(),
|
||||
'teacherFields': ?instance.teacherFields
|
||||
.toList()
|
||||
case final value?)
|
||||
'subjectFields': value,
|
||||
if (instance.teacherFields
|
||||
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
|
||||
.toList(),
|
||||
.toList()
|
||||
case final value?)
|
||||
'teacherFields': value,
|
||||
};
|
||||
|
||||
const _$GetTimetableParamsOptionsFieldsEnumMap = {
|
||||
@@ -80,23 +90,22 @@ const _$GetTimetableParamsOptionsFieldsEnumMap = {
|
||||
};
|
||||
|
||||
GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableParamsOptionsElement(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableParamsOptionsElement(
|
||||
id: (json['id'] as num).toInt(),
|
||||
type: (json['type'] as num).toInt(),
|
||||
keyType: $enumDecodeNullable(
|
||||
_$GetTimetableParamsOptionsElementKeyTypeEnumMap,
|
||||
json['keyType'],
|
||||
),
|
||||
_$GetTimetableParamsOptionsElementKeyTypeEnumMap, json['keyType']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson(
|
||||
GetTimetableParamsOptionsElement instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableParamsOptionsElement instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'type': instance.type,
|
||||
'keyType':
|
||||
?_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType],
|
||||
if (_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType]
|
||||
case final value?)
|
||||
'keyType': value,
|
||||
};
|
||||
|
||||
const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = {
|
||||
|
||||
@@ -7,31 +7,26 @@ part of 'getTimetableResponse.dart';
|
||||
// **************************************************************************
|
||||
|
||||
GetTimetableResponse _$GetTimetableResponseFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) =>
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponse(
|
||||
(json['result'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetTimetableResponseObject.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.map((e) =>
|
||||
GetTimetableResponseObject.fromJson(e as Map<String, dynamic>))
|
||||
.toSet(),
|
||||
)
|
||||
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
)..headers = (json['headers'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseToJson(
|
||||
GetTimetableResponse instance,
|
||||
) => <String, dynamic>{
|
||||
'headers': ?instance.headers,
|
||||
GetTimetableResponse instance) =>
|
||||
<String, dynamic>{
|
||||
if (instance.headers case final value?) 'headers': value,
|
||||
'result': instance.result.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObject(
|
||||
id: (json['id'] as num).toInt(),
|
||||
date: (json['date'] as num).toInt(),
|
||||
startTime: (json['startTime'] as num).toInt(),
|
||||
@@ -47,36 +42,26 @@ GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
|
||||
sg: json['sg'] as String?,
|
||||
bkRemark: json['bkRemark'] as String?,
|
||||
kl: (json['kl'] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
GetTimetableResponseObjectClass.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) => GetTimetableResponseObjectClass.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
te: (json['te'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetTimetableResponseObjectTeacher.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.map((e) => GetTimetableResponseObjectTeacher.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
su: (json['su'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetTimetableResponseObjectSubject.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.map((e) => GetTimetableResponseObjectSubject.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
ro: (json['ro'] as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
GetTimetableResponseObjectRoom.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.map((e) => GetTimetableResponseObjectRoom.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)..bkText = json['bkText'] as String?;
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectToJson(
|
||||
GetTimetableResponseObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'date': instance.date,
|
||||
'startTime': instance.startTime,
|
||||
@@ -99,23 +84,23 @@ Map<String, dynamic> _$GetTimetableResponseObjectToJson(
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectFields _$GetTimetableResponseObjectFieldsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObjectFields(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectFields(
|
||||
(json['te'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => GetTimetableResponseObjectFieldsObject.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
?.map((e) => GetTimetableResponseObjectFieldsObject.fromJson(
|
||||
e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson(
|
||||
GetTimetableResponseObjectFields instance,
|
||||
) => <String, dynamic>{'te': instance.te?.map((e) => e.toJson()).toList()};
|
||||
GetTimetableResponseObjectFields instance) =>
|
||||
<String, dynamic>{
|
||||
'te': instance.te?.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectFieldsObject
|
||||
_$GetTimetableResponseObjectFieldsObjectFromJson(Map<String, dynamic> json) =>
|
||||
_$GetTimetableResponseObjectFieldsObjectFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectFieldsObject(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
@@ -124,8 +109,8 @@ _$GetTimetableResponseObjectFieldsObjectFromJson(Map<String, dynamic> json) =>
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson(
|
||||
GetTimetableResponseObjectFieldsObject instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObjectFieldsObject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longname': instance.longname,
|
||||
@@ -133,8 +118,8 @@ Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson(
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObjectClass(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectClass(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longname'] as String,
|
||||
@@ -142,8 +127,8 @@ GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectClassToJson(
|
||||
GetTimetableResponseObjectClass instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObjectClass instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longname': instance.longname,
|
||||
@@ -151,8 +136,8 @@ Map<String, dynamic> _$GetTimetableResponseObjectClassToJson(
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObjectTeacher(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectTeacher(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longname'] as String,
|
||||
@@ -162,8 +147,8 @@ GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson(
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectTeacherToJson(
|
||||
GetTimetableResponseObjectTeacher instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObjectTeacher instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longname': instance.longname,
|
||||
@@ -173,32 +158,32 @@ Map<String, dynamic> _$GetTimetableResponseObjectTeacherToJson(
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectSubject _$GetTimetableResponseObjectSubjectFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObjectSubject(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectSubject(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longname'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectSubjectToJson(
|
||||
GetTimetableResponseObjectSubject instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObjectSubject instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longname': instance.longname,
|
||||
};
|
||||
|
||||
GetTimetableResponseObjectRoom _$GetTimetableResponseObjectRoomFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => GetTimetableResponseObjectRoom(
|
||||
Map<String, dynamic> json) =>
|
||||
GetTimetableResponseObjectRoom(
|
||||
(json['id'] as num).toInt(),
|
||||
json['name'] as String,
|
||||
json['longname'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetTimetableResponseObjectRoomToJson(
|
||||
GetTimetableResponseObjectRoom instance,
|
||||
) => <String, dynamic>{
|
||||
GetTimetableResponseObjectRoom instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'longname': instance.longname,
|
||||
|
||||
@@ -19,7 +19,7 @@ abstract class WebuntisApi extends ApiRequest {
|
||||
WebuntisApi(this.method, this.genericParam, {this.authenticatedResponse = true});
|
||||
|
||||
|
||||
Future<String> query(WebuntisApi untis, {bool retry = false}) async {
|
||||
Future<String> query(WebuntisApi untis) async {
|
||||
var query = '{"id":"ID","method":"$method","params":${untis._body()},"jsonrpc":"2.0"}';
|
||||
|
||||
var sessionId = '0';
|
||||
@@ -32,9 +32,8 @@ abstract class WebuntisApi extends ApiRequest {
|
||||
dynamic jsonData = jsonDecode(data.body);
|
||||
if(jsonData['error'] != null) {
|
||||
if(jsonData['error']['code'] == -8520) {
|
||||
if(retry) throw WebuntisError('Authentication was tried (probably session timeout), but was not successful!', 1);
|
||||
await Authenticate.createSession();
|
||||
return await this.query(untis, retry: true);
|
||||
this.query(untis);
|
||||
} else {
|
||||
throw WebuntisError(jsonData['error']['message'], jsonData['error']['code']);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import 'storage/base/settingsProvider.dart';
|
||||
import 'view/pages/overhang.dart';
|
||||
|
||||
class App extends StatefulWidget {
|
||||
static GlobalKey appContext = GlobalKey();
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
@@ -31,7 +32,6 @@ class App extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with WidgetsBindingObserver {
|
||||
|
||||
late Timer refetchChats;
|
||||
late Timer updateTimings;
|
||||
|
||||
|
||||
64
lib/background_tasks/scheduledTask.dart
Normal file
64
lib/background_tasks/scheduledTask.dart
Normal file
@@ -0,0 +1,64 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:background_fetch/background_fetch.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../app.dart';
|
||||
import '../homescreen_widgets/timetable/timetableHomeWidget.dart';
|
||||
|
||||
class ScheduledTask {
|
||||
static final String fetchApiLastRunTimestampKey = 'fetchApiLastRunTimestamp';
|
||||
|
||||
static Future<void> configure() async {
|
||||
var status = await BackgroundFetch.configure(BackgroundFetchConfig(
|
||||
minimumFetchInterval: 15,
|
||||
stopOnTerminate: false,
|
||||
enableHeadless: true,
|
||||
requiresBatteryNotLow: false,
|
||||
requiresCharging: false,
|
||||
requiresStorageNotLow: false,
|
||||
requiresDeviceIdle: false,
|
||||
requiredNetworkType: NetworkType.ANY,
|
||||
startOnBoot: true,
|
||||
), (String taskId) async {
|
||||
log('Background fetch started with id $taskId');
|
||||
await ScheduledTask.backgroundFetch();
|
||||
BackgroundFetch.finish(taskId);
|
||||
}, (String taskId) async {
|
||||
log('Background fetch stopped because of an timeout with id $taskId');
|
||||
BackgroundFetch.finish(taskId);
|
||||
});
|
||||
|
||||
log('Background Fetch-API status: $status');
|
||||
}
|
||||
|
||||
// called periodically, iOS and Android
|
||||
static Future<void> backgroundFetch() async {
|
||||
var sp = await SharedPreferences.getInstance();
|
||||
var history = sp.getStringList(fetchApiLastRunTimestampKey) ?? List.empty(growable: true);
|
||||
history.add(DateTime.now().toIso8601String());
|
||||
try {
|
||||
TimetableHomeWidget.update(App.appContext.currentContext!);
|
||||
} on Exception catch(e) {
|
||||
history.add('Got Error:');
|
||||
history.add(e.toString());
|
||||
history.add('--- EXCEPTION END ---');
|
||||
}
|
||||
sp.setStringList(fetchApiLastRunTimestampKey, history.take(100).toList());
|
||||
}
|
||||
|
||||
// only Android, starts when app is terminated
|
||||
@pragma('vm:entry-point')
|
||||
static Future<void> headless(HeadlessTask task) async {
|
||||
var taskId = task.taskId;
|
||||
var isTimeout = task.timeout;
|
||||
if (isTimeout) {
|
||||
log('Background fetch headless task timed-out: $taskId');
|
||||
BackgroundFetch.finish(taskId);
|
||||
return;
|
||||
}
|
||||
log('Background fetch headless event received.');
|
||||
await backgroundFetch();
|
||||
BackgroundFetch.finish(taskId);
|
||||
}
|
||||
}
|
||||
88
lib/homescreen_widgets/timetable/timetableHomeWidget.dart
Normal file
88
lib/homescreen_widgets/timetable/timetableHomeWidget.dart
Normal file
@@ -0,0 +1,88 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:home_widget/home_widget.dart';
|
||||
import 'package:screenshot/screenshot.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
import '../../model/accountData.dart';
|
||||
import '../../model/timetable/timetableProps.dart';
|
||||
import '../../storage/base/settingsProvider.dart';
|
||||
import '../../theming/darkAppTheme.dart';
|
||||
import '../../theming/lightAppTheme.dart';
|
||||
import '../../view/pages/timetable/calendar.dart';
|
||||
|
||||
class TimetableHomeWidget {
|
||||
static Future<void> update(BuildContext context) async {
|
||||
await AccountData().waitForPopulation();
|
||||
var data = TimetableProps();
|
||||
var settings = SettingsProvider();
|
||||
settings.waitForPopulation();
|
||||
var completer = Completer();
|
||||
|
||||
data.addListener(() async {
|
||||
if(completer.isCompleted) return;
|
||||
if(data.primaryLoading()) return;
|
||||
await _generate(data, settings);
|
||||
if(completer.isCompleted) return;
|
||||
completer.complete();
|
||||
});
|
||||
|
||||
data.run();
|
||||
await completer.future;
|
||||
}
|
||||
|
||||
static Future<void> _generate(TimetableProps data, SettingsProvider settings) async {
|
||||
log('Generating widget screen...');
|
||||
log('data: ${data.getTimetableResponse.toJson().toString().substring(0, 400)}...');
|
||||
var screenshotController = ScreenshotController();
|
||||
var calendarController = CalendarController();
|
||||
calendarController.displayDate = DateTime.now().copyWith(hour: 07, minute: 00);
|
||||
|
||||
var imageData = await screenshotController.captureFromWidget(
|
||||
SizedBox(
|
||||
height: 700,
|
||||
width: 300,
|
||||
child: Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: MediaQuery(
|
||||
data: MediaQueryData(),
|
||||
child: MaterialApp(
|
||||
localizationsDelegates: const [
|
||||
...GlobalMaterialLocalizations.delegates,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: const [
|
||||
Locale('de'),
|
||||
Locale('en'),
|
||||
],
|
||||
locale: const Locale('de'),
|
||||
darkTheme: DarkAppTheme.theme,
|
||||
theme: LightAppTheme.theme,
|
||||
themeMode: settings.val().appTheme,
|
||||
home: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Scaffold(
|
||||
body: Calendar(
|
||||
controller: calendarController,
|
||||
timetableProps: data,
|
||||
settings: settings,
|
||||
isHomeWidget: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
delay: Duration(seconds: 5),
|
||||
);
|
||||
|
||||
HomeWidget.saveWidgetData<String>('screen', base64.encode(imageData));
|
||||
HomeWidget.updateWidget(name: 'TimetableWidget');
|
||||
log('Widget screen successfully updated! (${imageData.length})');
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:background_fetch/background_fetch.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -17,6 +18,7 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
|
||||
import 'app.dart';
|
||||
import 'background_tasks/scheduledTask.dart';
|
||||
import 'firebase_options.dart';
|
||||
import 'model/accountData.dart';
|
||||
import 'model/accountModel.dart';
|
||||
@@ -46,7 +48,6 @@ Future<void> main() async {
|
||||
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r13.pem').then(addCertificateAsTrusted),
|
||||
|
||||
Future(() async {
|
||||
await HydratedStorage.build(
|
||||
@@ -85,6 +86,8 @@ Future<void> main() async {
|
||||
child: const Main(),
|
||||
)
|
||||
);
|
||||
|
||||
BackgroundFetch.registerHeadlessTask(ScheduledTask.headless);
|
||||
}
|
||||
|
||||
class Main extends StatefulWidget {
|
||||
@@ -112,6 +115,7 @@ class _MainState extends State<Main> {
|
||||
Provider.of<BreakerProps>(context, listen: false).run();
|
||||
});
|
||||
|
||||
ScheduledTask.configure();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@@ -126,7 +130,6 @@ class _MainState extends State<Main> {
|
||||
checkerboardOffscreenLayers: devToolsSettings.checkerboardOffscreenLayers,
|
||||
checkerboardRasterCacheImages: devToolsSettings.checkerboardRasterCacheImages,
|
||||
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: const [
|
||||
...GlobalMaterialLocalizations.delegates,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
@@ -148,7 +151,7 @@ class _MainState extends State<Main> {
|
||||
child: Consumer<AccountModel>(
|
||||
builder: (context, accountModel, child) {
|
||||
switch(accountModel.state) {
|
||||
case AccountModelState.loggedIn: return const App();
|
||||
case AccountModelState.loggedIn: return App(key: App.appContext);
|
||||
case AccountModelState.loggedOut: return const Login();
|
||||
case AccountModelState.undefined: return const PlaceholderView(icon: Icons.timer, text: 'Daten werden geladen');
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class EndpointData {
|
||||
|
||||
Endpoint webuntis() => EndpointOptions(
|
||||
live: Endpoint(
|
||||
domain: 'marianum-fulda.webuntis.com',
|
||||
domain: 'peleus.webuntis.com',
|
||||
),
|
||||
staged: Endpoint(
|
||||
domain: 'mhsl.eu',
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'loadable_state_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LoadableStateState with _$LoadableStateState {
|
||||
class LoadableStateState with _$LoadableStateState {
|
||||
const factory LoadableStateState({
|
||||
required List<ConnectivityResult>? connections,
|
||||
}) = _LoadableStateState;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,208 +9,103 @@ part of 'loadable_state_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadableStateState {
|
||||
List<ConnectivityResult>? get connections =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
List<ConnectivityResult>? get connections;
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableStateStateCopyWith<LoadableStateState> get copyWith => _$LoadableStateStateCopyWithImpl<LoadableStateState>(this as LoadableStateState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableStateState&&const DeepCollectionEquality().equals(other.connections, connections));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(connections));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableStateState(connections: $connections)';
|
||||
}
|
||||
|
||||
|
||||
$LoadableStateStateCopyWith<LoadableStateState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LoadableStateStateCopyWith<$Res> {
|
||||
factory $LoadableStateStateCopyWith(LoadableStateState value, $Res Function(LoadableStateState) _then) = _$LoadableStateStateCopyWithImpl;
|
||||
abstract class $LoadableStateStateCopyWith<$Res> {
|
||||
factory $LoadableStateStateCopyWith(
|
||||
LoadableStateState value, $Res Function(LoadableStateState) then) =
|
||||
_$LoadableStateStateCopyWithImpl<$Res, LoadableStateState>;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<ConnectivityResult>? connections
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$Res call({List<ConnectivityResult>? connections});
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadableStateStateCopyWithImpl<$Res>
|
||||
implements $LoadableStateStateCopyWith<$Res> {
|
||||
_$LoadableStateStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LoadableStateState _self;
|
||||
final $Res Function(LoadableStateState) _then;
|
||||
/// @nodoc
|
||||
class _$LoadableStateStateCopyWithImpl<$Res, $Val extends LoadableStateState>
|
||||
implements $LoadableStateStateCopyWith<$Res> {
|
||||
_$LoadableStateStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? connections = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
connections: freezed == connections ? _self.connections : connections // ignore: cast_nullable_to_non_nullable
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? connections = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
connections: freezed == connections
|
||||
? _value.connections
|
||||
: connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableStateStateImplCopyWith<$Res>
|
||||
implements $LoadableStateStateCopyWith<$Res> {
|
||||
factory _$$LoadableStateStateImplCopyWith(_$LoadableStateStateImpl value,
|
||||
$Res Function(_$LoadableStateStateImpl) then) =
|
||||
__$$LoadableStateStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<ConnectivityResult>? connections});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableStateStateImplCopyWithImpl<$Res>
|
||||
extends _$LoadableStateStateCopyWithImpl<$Res, _$LoadableStateStateImpl>
|
||||
implements _$$LoadableStateStateImplCopyWith<$Res> {
|
||||
__$$LoadableStateStateImplCopyWithImpl(_$LoadableStateStateImpl _value,
|
||||
$Res Function(_$LoadableStateStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? connections = freezed,
|
||||
}) {
|
||||
return _then(_$LoadableStateStateImpl(
|
||||
connections: freezed == connections
|
||||
? _value._connections
|
||||
: connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LoadableStateState].
|
||||
extension LoadableStateStatePatterns on LoadableStateState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableStateState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableStateState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableStateState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ConnectivityResult>? connections)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that.connections);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ConnectivityResult>? connections) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState():
|
||||
return $default(_that.connections);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ConnectivityResult>? connections)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableStateState() when $default != null:
|
||||
return $default(_that.connections);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _LoadableStateState implements LoadableStateState {
|
||||
const _LoadableStateState({required final List<ConnectivityResult>? connections}): _connections = connections;
|
||||
|
||||
class _$LoadableStateStateImpl implements _LoadableStateState {
|
||||
const _$LoadableStateStateImpl(
|
||||
{required final List<ConnectivityResult>? connections})
|
||||
: _connections = connections;
|
||||
|
||||
final List<ConnectivityResult>? _connections;
|
||||
@override List<ConnectivityResult>? get connections {
|
||||
@override
|
||||
List<ConnectivityResult>? get connections {
|
||||
final value = _connections;
|
||||
if (value == null) return null;
|
||||
if (_connections is EqualUnmodifiableListView) return _connections;
|
||||
@@ -218,62 +113,46 @@ class _LoadableStateState implements LoadableStateState {
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableStateStateCopyWith<_LoadableStateState> get copyWith => __$LoadableStateStateCopyWithImpl<_LoadableStateState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableStateState&&const DeepCollectionEquality().equals(other._connections, _connections));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_connections));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableStateState(connections: $connections)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableStateStateImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._connections, _connections));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableStateStateCopyWith<$Res> implements $LoadableStateStateCopyWith<$Res> {
|
||||
factory _$LoadableStateStateCopyWith(_LoadableStateState value, $Res Function(_LoadableStateState) _then) = __$LoadableStateStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<ConnectivityResult>? connections
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableStateStateCopyWithImpl<$Res>
|
||||
implements _$LoadableStateStateCopyWith<$Res> {
|
||||
__$LoadableStateStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableStateState _self;
|
||||
final $Res Function(_LoadableStateState) _then;
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, const DeepCollectionEquality().hash(_connections));
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? connections = freezed,}) {
|
||||
return _then(_LoadableStateState(
|
||||
connections: freezed == connections ? _self._connections : connections // ignore: cast_nullable_to_non_nullable
|
||||
as List<ConnectivityResult>?,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
|
||||
__$$LoadableStateStateImplCopyWithImpl<_$LoadableStateStateImpl>(
|
||||
this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _LoadableStateState implements LoadableStateState {
|
||||
const factory _LoadableStateState(
|
||||
{required final List<ConnectivityResult>? connections}) =
|
||||
_$LoadableStateStateImpl;
|
||||
|
||||
@override
|
||||
List<ConnectivityResult>? get connections;
|
||||
|
||||
/// Create a copy of LoadableStateState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'loading_error.dart';
|
||||
part 'loadable_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LoadableState<TState> with _$LoadableState<TState> {
|
||||
class LoadableState<TState> with _$LoadableState {
|
||||
const LoadableState._();
|
||||
|
||||
const factory LoadableState({
|
||||
@@ -14,7 +14,7 @@ abstract class LoadableState<TState> with _$LoadableState<TState> {
|
||||
required int? lastFetch,
|
||||
required void Function()? reFetch,
|
||||
required LoadingError? error,
|
||||
}) = _LoadableState<TState>;
|
||||
}) = _LoadableState;
|
||||
|
||||
bool _hasError() => error != null;
|
||||
bool _hasData() => data != null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,299 +9,246 @@ part of 'loadable_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadableState<TState> {
|
||||
bool get isLoading => throw _privateConstructorUsedError;
|
||||
TState? get data => throw _privateConstructorUsedError;
|
||||
int? get lastFetch => throw _privateConstructorUsedError;
|
||||
void Function()? get reFetch => throw _privateConstructorUsedError;
|
||||
LoadingError? get error => throw _privateConstructorUsedError;
|
||||
|
||||
bool get isLoading; TState? get data; int? get lastFetch; void Function()? get reFetch; LoadingError? get error;
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith => _$LoadableStateCopyWithImpl<TState, LoadableState<TState>>(this as LoadableState<TState>, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LoadableStateCopyWith<TState,$Res> {
|
||||
factory $LoadableStateCopyWith(LoadableState<TState> value, $Res Function(LoadableState<TState>) _then) = _$LoadableStateCopyWithImpl;
|
||||
abstract class $LoadableStateCopyWith<TState, $Res> {
|
||||
factory $LoadableStateCopyWith(LoadableState<TState> value,
|
||||
$Res Function(LoadableState<TState>) then) =
|
||||
_$LoadableStateCopyWithImpl<TState, $Res, LoadableState<TState>>;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
|
||||
});
|
||||
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
TState? data,
|
||||
int? lastFetch,
|
||||
void Function()? reFetch,
|
||||
LoadingError? error});
|
||||
|
||||
$LoadingErrorCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadableStateCopyWithImpl<TState,$Res>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
_$LoadableStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LoadableState<TState> _self;
|
||||
final $Res Function(LoadableState<TState>) _then;
|
||||
/// @nodoc
|
||||
class _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
$Val extends LoadableState<TState>>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
_$LoadableStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
Object? lastFetch = freezed,
|
||||
Object? reFetch = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
lastFetch: freezed == lastFetch
|
||||
? _value.lastFetch
|
||||
: lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
reFetch: freezed == reFetch
|
||||
? _value.reFetch
|
||||
: reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
if (_value.error == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) {
|
||||
return _then(_self.copyWith(error: value));
|
||||
return $LoadingErrorCopyWith<$Res>(_value.error!, (value) {
|
||||
return _then(_value.copyWith(error: value) as $Val);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableStateImplCopyWith<TState, $Res>
|
||||
implements $LoadableStateCopyWith<TState, $Res> {
|
||||
factory _$$LoadableStateImplCopyWith(_$LoadableStateImpl<TState> value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) then) =
|
||||
__$$LoadableStateImplCopyWithImpl<TState, $Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool isLoading,
|
||||
TState? data,
|
||||
int? lastFetch,
|
||||
void Function()? reFetch,
|
||||
LoadingError? error});
|
||||
|
||||
/// Adds pattern-matching-related methods to [LoadableState].
|
||||
extension LoadableStatePatterns<TState> on LoadableState<TState> {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableState<TState> value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableState<TState> value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableState<TState> value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState():
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableState() when $default != null:
|
||||
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@override
|
||||
$LoadingErrorCopyWith<$Res>? get error;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableStateImplCopyWithImpl<TState, $Res>
|
||||
extends _$LoadableStateCopyWithImpl<TState, $Res,
|
||||
_$LoadableStateImpl<TState>>
|
||||
implements _$$LoadableStateImplCopyWith<TState, $Res> {
|
||||
__$$LoadableStateImplCopyWithImpl(_$LoadableStateImpl<TState> _value,
|
||||
$Res Function(_$LoadableStateImpl<TState>) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? isLoading = null,
|
||||
Object? data = freezed,
|
||||
Object? lastFetch = freezed,
|
||||
Object? reFetch = freezed,
|
||||
Object? error = freezed,
|
||||
}) {
|
||||
return _then(_$LoadableStateImpl<TState>(
|
||||
isLoading: null == isLoading
|
||||
? _value.isLoading
|
||||
: isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
data: freezed == data
|
||||
? _value.data
|
||||
: data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,
|
||||
lastFetch: freezed == lastFetch
|
||||
? _value.lastFetch
|
||||
: lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
reFetch: freezed == reFetch
|
||||
? _value.reFetch
|
||||
: reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,
|
||||
error: freezed == error
|
||||
? _value.error
|
||||
: error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _LoadableState<TState> extends LoadableState<TState> {
|
||||
const _LoadableState({required this.isLoading, required this.data, required this.lastFetch, required this.reFetch, required this.error}): super._();
|
||||
|
||||
|
||||
@override final bool isLoading;
|
||||
@override final TState? data;
|
||||
@override final int? lastFetch;
|
||||
@override final void Function()? reFetch;
|
||||
@override final LoadingError? error;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableStateCopyWith<TState, _LoadableState<TState>> get copyWith => __$LoadableStateCopyWithImpl<TState, _LoadableState<TState>>(this, _$identity);
|
||||
|
||||
|
||||
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
|
||||
const _$LoadableStateImpl(
|
||||
{required this.isLoading,
|
||||
required this.data,
|
||||
required this.lastFetch,
|
||||
required this.reFetch,
|
||||
required this.error})
|
||||
: super._();
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
|
||||
final bool isLoading;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
|
||||
final TState? data;
|
||||
@override
|
||||
final int? lastFetch;
|
||||
@override
|
||||
final void Function()? reFetch;
|
||||
@override
|
||||
final LoadingError? error;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableStateImpl<TState> &&
|
||||
(identical(other.isLoading, isLoading) ||
|
||||
other.isLoading == isLoading) &&
|
||||
const DeepCollectionEquality().equals(other.data, data) &&
|
||||
(identical(other.lastFetch, lastFetch) ||
|
||||
other.lastFetch == lastFetch) &&
|
||||
(identical(other.reFetch, reFetch) || other.reFetch == reFetch) &&
|
||||
(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableStateCopyWith<TState,$Res> implements $LoadableStateCopyWith<TState, $Res> {
|
||||
factory _$LoadableStateCopyWith(_LoadableState<TState> value, $Res Function(_LoadableState<TState>) _then) = __$LoadableStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
|
||||
});
|
||||
|
||||
|
||||
@override $LoadingErrorCopyWith<$Res>? get error;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableStateCopyWithImpl<TState,$Res>
|
||||
implements _$LoadableStateCopyWith<TState, $Res> {
|
||||
__$LoadableStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableState<TState> _self;
|
||||
final $Res Function(_LoadableState<TState>) _then;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, isLoading,
|
||||
const DeepCollectionEquality().hash(data), lastFetch, reFetch, error);
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
|
||||
return _then(_LoadableState<TState>(
|
||||
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
|
||||
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
|
||||
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
|
||||
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as LoadingError?,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => __$$LoadableStateImplCopyWithImpl<TState,
|
||||
_$LoadableStateImpl<TState>>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _LoadableState<TState> extends LoadableState<TState> {
|
||||
const factory _LoadableState(
|
||||
{required final bool isLoading,
|
||||
required final TState? data,
|
||||
required final int? lastFetch,
|
||||
required final void Function()? reFetch,
|
||||
required final LoadingError? error}) = _$LoadableStateImpl<TState>;
|
||||
const _LoadableState._() : super._();
|
||||
|
||||
@override
|
||||
bool get isLoading;
|
||||
@override
|
||||
TState? get data;
|
||||
@override
|
||||
int? get lastFetch;
|
||||
@override
|
||||
void Function()? get reFetch;
|
||||
@override
|
||||
LoadingError? get error;
|
||||
|
||||
/// Create a copy of LoadableState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<$Res>? get error {
|
||||
if (_self.error == null) {
|
||||
return null;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) {
|
||||
return _then(_self.copyWith(error: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'loading_error.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LoadingError with _$LoadingError {
|
||||
class LoadingError with _$LoadingError {
|
||||
const factory LoadingError({
|
||||
required String message,
|
||||
@Default(false) bool allowRetry,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,266 +9,155 @@ part of 'loading_error.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadingError {
|
||||
String get message => throw _privateConstructorUsedError;
|
||||
bool get allowRetry => throw _privateConstructorUsedError;
|
||||
|
||||
String get message; bool get allowRetry;
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadingErrorCopyWith<LoadingError> get copyWith => _$LoadingErrorCopyWithImpl<LoadingError>(this as LoadingError, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,message,allowRetry);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
|
||||
}
|
||||
|
||||
|
||||
$LoadingErrorCopyWith<LoadingError> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LoadingErrorCopyWith<$Res> {
|
||||
factory $LoadingErrorCopyWith(LoadingError value, $Res Function(LoadingError) _then) = _$LoadingErrorCopyWithImpl;
|
||||
abstract class $LoadingErrorCopyWith<$Res> {
|
||||
factory $LoadingErrorCopyWith(
|
||||
LoadingError value, $Res Function(LoadingError) then) =
|
||||
_$LoadingErrorCopyWithImpl<$Res, LoadingError>;
|
||||
@useResult
|
||||
$Res call({
|
||||
String message, bool allowRetry
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$Res call({String message, bool allowRetry});
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadingErrorCopyWithImpl<$Res>
|
||||
implements $LoadingErrorCopyWith<$Res> {
|
||||
_$LoadingErrorCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LoadingError _self;
|
||||
final $Res Function(LoadingError) _then;
|
||||
/// @nodoc
|
||||
class _$LoadingErrorCopyWithImpl<$Res, $Val extends LoadingError>
|
||||
implements $LoadingErrorCopyWith<$Res> {
|
||||
_$LoadingErrorCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? message = null,Object? allowRetry = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
Object? allowRetry = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
allowRetry: null == allowRetry
|
||||
? _value.allowRetry
|
||||
: allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadingErrorImplCopyWith<$Res>
|
||||
implements $LoadingErrorCopyWith<$Res> {
|
||||
factory _$$LoadingErrorImplCopyWith(
|
||||
_$LoadingErrorImpl value, $Res Function(_$LoadingErrorImpl) then) =
|
||||
__$$LoadingErrorImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String message, bool allowRetry});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadingErrorImplCopyWithImpl<$Res>
|
||||
extends _$LoadingErrorCopyWithImpl<$Res, _$LoadingErrorImpl>
|
||||
implements _$$LoadingErrorImplCopyWith<$Res> {
|
||||
__$$LoadingErrorImplCopyWithImpl(
|
||||
_$LoadingErrorImpl _value, $Res Function(_$LoadingErrorImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? message = null,
|
||||
Object? allowRetry = null,
|
||||
}) {
|
||||
return _then(_$LoadingErrorImpl(
|
||||
message: null == message
|
||||
? _value.message
|
||||
: message // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
allowRetry: null == allowRetry
|
||||
? _value.allowRetry
|
||||
: allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LoadingError].
|
||||
extension LoadingErrorPatterns on LoadingError {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadingError value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadingError value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadingError value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String message, bool allowRetry)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that.message,_that.allowRetry);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String message, bool allowRetry) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError():
|
||||
return $default(_that.message,_that.allowRetry);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String message, bool allowRetry)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadingError() when $default != null:
|
||||
return $default(_that.message,_that.allowRetry);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _LoadingError implements LoadingError {
|
||||
const _LoadingError({required this.message, this.allowRetry = false});
|
||||
|
||||
|
||||
@override final String message;
|
||||
@override@JsonKey() final bool allowRetry;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadingErrorCopyWith<_LoadingError> get copyWith => __$LoadingErrorCopyWithImpl<_LoadingError>(this, _$identity);
|
||||
|
||||
|
||||
class _$LoadingErrorImpl implements _LoadingError {
|
||||
const _$LoadingErrorImpl({required this.message, this.allowRetry = false});
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
|
||||
}
|
||||
|
||||
|
||||
final String message;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,message,allowRetry);
|
||||
@JsonKey()
|
||||
final bool allowRetry;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadingErrorImpl &&
|
||||
(identical(other.message, message) || other.message == message) &&
|
||||
(identical(other.allowRetry, allowRetry) ||
|
||||
other.allowRetry == allowRetry));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadingErrorCopyWith<$Res> implements $LoadingErrorCopyWith<$Res> {
|
||||
factory _$LoadingErrorCopyWith(_LoadingError value, $Res Function(_LoadingError) _then) = __$LoadingErrorCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String message, bool allowRetry
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadingErrorCopyWithImpl<$Res>
|
||||
implements _$LoadingErrorCopyWith<$Res> {
|
||||
__$LoadingErrorCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadingError _self;
|
||||
final $Res Function(_LoadingError) _then;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, message, allowRetry);
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? message = null,Object? allowRetry = null,}) {
|
||||
return _then(_LoadingError(
|
||||
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
|
||||
__$$LoadingErrorImplCopyWithImpl<_$LoadingErrorImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _LoadingError implements LoadingError {
|
||||
const factory _LoadingError(
|
||||
{required final String message,
|
||||
final bool allowRetry}) = _$LoadingErrorImpl;
|
||||
|
||||
@override
|
||||
String get message;
|
||||
@override
|
||||
bool get allowRetry;
|
||||
|
||||
/// Create a copy of LoadingError
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -26,7 +26,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
|
||||
var loadableState = context.watch<TController>().state;
|
||||
|
||||
if(!loadableState.isLoading && onLoad != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data!));
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data));
|
||||
}
|
||||
|
||||
var childWidget = ConditionalWrapper(
|
||||
@@ -48,7 +48,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: loadableState.showContent()
|
||||
? child(loadableState.data!, loadableState.isLoading)
|
||||
? child(loadableState.data, loadableState.isLoading)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -103,7 +103,7 @@ abstract class LoadableHydratedBloc<
|
||||
Map<String, dynamic>? toJson(LoadableState<TState> state) {
|
||||
Map<String, dynamic>? data;
|
||||
try {
|
||||
data = state.data == null ? null : toStorage(state.data!);
|
||||
data = state.data == null ? null : toStorage(state.data);
|
||||
} catch(e) {
|
||||
log('Failed to save state ${TState.toString()}: ${e.toString()}');
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'loadable_save_context.freezed.dart';
|
||||
part 'loadable_save_context.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LoadableSaveContext with _$LoadableSaveContext {
|
||||
class LoadableSaveContext with _$LoadableSaveContext {
|
||||
const LoadableSaveContext._();
|
||||
const factory LoadableSaveContext({
|
||||
required int timestamp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,269 +9,160 @@ part of 'loadable_save_context.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) {
|
||||
return _LoadableSaveContext.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoadableSaveContext {
|
||||
|
||||
int get timestamp;
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith => _$LoadableSaveContextCopyWithImpl<LoadableSaveContext>(this as LoadableSaveContext, _$identity);
|
||||
int get timestamp => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this LoadableSaveContext to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,timestamp);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableSaveContext(timestamp: $timestamp)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LoadableSaveContextCopyWith<$Res> {
|
||||
factory $LoadableSaveContextCopyWith(LoadableSaveContext value, $Res Function(LoadableSaveContext) _then) = _$LoadableSaveContextCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int timestamp
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoadableSaveContextCopyWithImpl<$Res>
|
||||
implements $LoadableSaveContextCopyWith<$Res> {
|
||||
_$LoadableSaveContextCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LoadableSaveContext _self;
|
||||
final $Res Function(LoadableSaveContext) _then;
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? timestamp = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LoadableSaveContextCopyWith<$Res> {
|
||||
factory $LoadableSaveContextCopyWith(
|
||||
LoadableSaveContext value, $Res Function(LoadableSaveContext) then) =
|
||||
_$LoadableSaveContextCopyWithImpl<$Res, LoadableSaveContext>;
|
||||
@useResult
|
||||
$Res call({int timestamp});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LoadableSaveContextCopyWithImpl<$Res, $Val extends LoadableSaveContext>
|
||||
implements $LoadableSaveContextCopyWith<$Res> {
|
||||
_$LoadableSaveContextCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? timestamp = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
timestamp: null == timestamp
|
||||
? _value.timestamp
|
||||
: timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LoadableSaveContextImplCopyWith<$Res>
|
||||
implements $LoadableSaveContextCopyWith<$Res> {
|
||||
factory _$$LoadableSaveContextImplCopyWith(_$LoadableSaveContextImpl value,
|
||||
$Res Function(_$LoadableSaveContextImpl) then) =
|
||||
__$$LoadableSaveContextImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int timestamp});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LoadableSaveContextImplCopyWithImpl<$Res>
|
||||
extends _$LoadableSaveContextCopyWithImpl<$Res, _$LoadableSaveContextImpl>
|
||||
implements _$$LoadableSaveContextImplCopyWith<$Res> {
|
||||
__$$LoadableSaveContextImplCopyWithImpl(_$LoadableSaveContextImpl _value,
|
||||
$Res Function(_$LoadableSaveContextImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? timestamp = null,
|
||||
}) {
|
||||
return _then(_$LoadableSaveContextImpl(
|
||||
timestamp: null == timestamp
|
||||
? _value.timestamp
|
||||
: timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LoadableSaveContext].
|
||||
extension LoadableSaveContextPatterns on LoadableSaveContext {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableSaveContext value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableSaveContext value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableSaveContext value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int timestamp)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that.timestamp);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int timestamp) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext():
|
||||
return $default(_that.timestamp);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int timestamp)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoadableSaveContext() when $default != null:
|
||||
return $default(_that.timestamp);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$LoadableSaveContextImpl extends _LoadableSaveContext {
|
||||
const _$LoadableSaveContextImpl({required this.timestamp}) : super._();
|
||||
|
||||
class _LoadableSaveContext extends LoadableSaveContext {
|
||||
const _LoadableSaveContext({required this.timestamp}): super._();
|
||||
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) => _$LoadableSaveContextFromJson(json);
|
||||
|
||||
@override final int timestamp;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoadableSaveContextCopyWith<_LoadableSaveContext> get copyWith => __$LoadableSaveContextCopyWithImpl<_LoadableSaveContext>(this, _$identity);
|
||||
factory _$LoadableSaveContextImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LoadableSaveContextImplFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$LoadableSaveContextToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,timestamp);
|
||||
final int timestamp;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoadableSaveContext(timestamp: $timestamp)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LoadableSaveContextImpl &&
|
||||
(identical(other.timestamp, timestamp) ||
|
||||
other.timestamp == timestamp));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoadableSaveContextCopyWith<$Res> implements $LoadableSaveContextCopyWith<$Res> {
|
||||
factory _$LoadableSaveContextCopyWith(_LoadableSaveContext value, $Res Function(_LoadableSaveContext) _then) = __$LoadableSaveContextCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int timestamp
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoadableSaveContextCopyWithImpl<$Res>
|
||||
implements _$LoadableSaveContextCopyWith<$Res> {
|
||||
__$LoadableSaveContextCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoadableSaveContext _self;
|
||||
final $Res Function(_LoadableSaveContext) _then;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, timestamp);
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? timestamp = null,}) {
|
||||
return _then(_LoadableSaveContext(
|
||||
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
|
||||
__$$LoadableSaveContextImplCopyWithImpl<_$LoadableSaveContextImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$LoadableSaveContextImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _LoadableSaveContext extends LoadableSaveContext {
|
||||
const factory _LoadableSaveContext({required final int timestamp}) =
|
||||
_$LoadableSaveContextImpl;
|
||||
const _LoadableSaveContext._() : super._();
|
||||
|
||||
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) =
|
||||
_$LoadableSaveContextImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get timestamp;
|
||||
|
||||
/// Create a copy of LoadableSaveContext
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -6,9 +6,14 @@ part of 'loadable_save_context.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) =>
|
||||
_LoadableSaveContext(timestamp: (json['timestamp'] as num).toInt());
|
||||
_$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$LoadableSaveContextImpl(
|
||||
timestamp: (json['timestamp'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LoadableSaveContextToJson(
|
||||
_LoadableSaveContext instance,
|
||||
) => <String, dynamic>{'timestamp': instance.timestamp};
|
||||
Map<String, dynamic> _$$LoadableSaveContextImplToJson(
|
||||
_$LoadableSaveContextImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'timestamp': instance.timestamp,
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'grade_averages_state.freezed.dart';
|
||||
part 'grade_averages_state.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GradeAveragesState with _$GradeAveragesState {
|
||||
class GradeAveragesState with _$GradeAveragesState {
|
||||
const factory GradeAveragesState({
|
||||
required GradeAveragesGradingSystem gradingSystem,
|
||||
required List<int> grades,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,278 +9,185 @@ part of 'grade_averages_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) {
|
||||
return _GradeAveragesState.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GradeAveragesState {
|
||||
|
||||
GradeAveragesGradingSystem get gradingSystem; List<int> get grades;
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith => _$GradeAveragesStateCopyWithImpl<GradeAveragesState>(this as GradeAveragesState, _$identity);
|
||||
GradeAveragesGradingSystem get gradingSystem =>
|
||||
throw _privateConstructorUsedError;
|
||||
List<int> get grades => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this GradeAveragesState to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other.grades, grades));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(grades));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GradeAveragesStateCopyWith<$Res> {
|
||||
factory $GradeAveragesStateCopyWith(GradeAveragesState value, $Res Function(GradeAveragesState) _then) = _$GradeAveragesStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
GradeAveragesGradingSystem gradingSystem, List<int> grades
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GradeAveragesStateCopyWithImpl<$Res>
|
||||
implements $GradeAveragesStateCopyWith<$Res> {
|
||||
_$GradeAveragesStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GradeAveragesState _self;
|
||||
final $Res Function(GradeAveragesState) _then;
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? gradingSystem = null,Object? grades = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,grades: null == grades ? _self.grades : grades // ignore: cast_nullable_to_non_nullable
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $GradeAveragesStateCopyWith<$Res> {
|
||||
factory $GradeAveragesStateCopyWith(
|
||||
GradeAveragesState value, $Res Function(GradeAveragesState) then) =
|
||||
_$GradeAveragesStateCopyWithImpl<$Res, GradeAveragesState>;
|
||||
@useResult
|
||||
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$GradeAveragesStateCopyWithImpl<$Res, $Val extends GradeAveragesState>
|
||||
implements $GradeAveragesStateCopyWith<$Res> {
|
||||
_$GradeAveragesStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? gradingSystem = null,
|
||||
Object? grades = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
gradingSystem: null == gradingSystem
|
||||
? _value.gradingSystem
|
||||
: gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,
|
||||
grades: null == grades
|
||||
? _value.grades
|
||||
: grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$GradeAveragesStateImplCopyWith<$Res>
|
||||
implements $GradeAveragesStateCopyWith<$Res> {
|
||||
factory _$$GradeAveragesStateImplCopyWith(_$GradeAveragesStateImpl value,
|
||||
$Res Function(_$GradeAveragesStateImpl) then) =
|
||||
__$$GradeAveragesStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$GradeAveragesStateImplCopyWithImpl<$Res>
|
||||
extends _$GradeAveragesStateCopyWithImpl<$Res, _$GradeAveragesStateImpl>
|
||||
implements _$$GradeAveragesStateImplCopyWith<$Res> {
|
||||
__$$GradeAveragesStateImplCopyWithImpl(_$GradeAveragesStateImpl _value,
|
||||
$Res Function(_$GradeAveragesStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? gradingSystem = null,
|
||||
Object? grades = null,
|
||||
}) {
|
||||
return _then(_$GradeAveragesStateImpl(
|
||||
gradingSystem: null == gradingSystem
|
||||
? _value.gradingSystem
|
||||
: gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,
|
||||
grades: null == grades
|
||||
? _value._grades
|
||||
: grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GradeAveragesState].
|
||||
extension GradeAveragesStatePatterns on GradeAveragesState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GradeAveragesState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GradeAveragesState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GradeAveragesState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that.gradingSystem,_that.grades);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( GradeAveragesGradingSystem gradingSystem, List<int> grades) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState():
|
||||
return $default(_that.gradingSystem,_that.grades);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GradeAveragesState() when $default != null:
|
||||
return $default(_that.gradingSystem,_that.grades);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$GradeAveragesStateImpl implements _GradeAveragesState {
|
||||
const _$GradeAveragesStateImpl(
|
||||
{required this.gradingSystem, required final List<int> grades})
|
||||
: _grades = grades;
|
||||
|
||||
class _GradeAveragesState implements GradeAveragesState {
|
||||
const _GradeAveragesState({required this.gradingSystem, required final List<int> grades}): _grades = grades;
|
||||
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) => _$GradeAveragesStateFromJson(json);
|
||||
factory _$GradeAveragesStateImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$GradeAveragesStateImplFromJson(json);
|
||||
|
||||
@override final GradeAveragesGradingSystem gradingSystem;
|
||||
@override
|
||||
final GradeAveragesGradingSystem gradingSystem;
|
||||
final List<int> _grades;
|
||||
@override List<int> get grades {
|
||||
@override
|
||||
List<int> get grades {
|
||||
if (_grades is EqualUnmodifiableListView) return _grades;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_grades);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GradeAveragesStateCopyWith<_GradeAveragesState> get copyWith => __$GradeAveragesStateCopyWithImpl<_GradeAveragesState>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GradeAveragesStateToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other._grades, _grades));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(_grades));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$GradeAveragesStateImpl &&
|
||||
(identical(other.gradingSystem, gradingSystem) ||
|
||||
other.gradingSystem == gradingSystem) &&
|
||||
const DeepCollectionEquality().equals(other._grades, _grades));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GradeAveragesStateCopyWith<$Res> implements $GradeAveragesStateCopyWith<$Res> {
|
||||
factory _$GradeAveragesStateCopyWith(_GradeAveragesState value, $Res Function(_GradeAveragesState) _then) = __$GradeAveragesStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
GradeAveragesGradingSystem gradingSystem, List<int> grades
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GradeAveragesStateCopyWithImpl<$Res>
|
||||
implements _$GradeAveragesStateCopyWith<$Res> {
|
||||
__$GradeAveragesStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GradeAveragesState _self;
|
||||
final $Res Function(_GradeAveragesState) _then;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, gradingSystem, const DeepCollectionEquality().hash(_grades));
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? gradingSystem = null,Object? grades = null,}) {
|
||||
return _then(_GradeAveragesState(
|
||||
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
|
||||
as GradeAveragesGradingSystem,grades: null == grades ? _self._grades : grades // ignore: cast_nullable_to_non_nullable
|
||||
as List<int>,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
|
||||
__$$GradeAveragesStateImplCopyWithImpl<_$GradeAveragesStateImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$GradeAveragesStateImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _GradeAveragesState implements GradeAveragesState {
|
||||
const factory _GradeAveragesState(
|
||||
{required final GradeAveragesGradingSystem gradingSystem,
|
||||
required final List<int> grades}) = _$GradeAveragesStateImpl;
|
||||
|
||||
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) =
|
||||
_$GradeAveragesStateImpl.fromJson;
|
||||
|
||||
@override
|
||||
GradeAveragesGradingSystem get gradingSystem;
|
||||
@override
|
||||
List<int> get grades;
|
||||
|
||||
/// Create a copy of GradeAveragesState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -6,21 +6,21 @@ part of 'grade_averages_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) =>
|
||||
_GradeAveragesState(
|
||||
_$GradeAveragesStateImpl _$$GradeAveragesStateImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$GradeAveragesStateImpl(
|
||||
gradingSystem: $enumDecode(
|
||||
_$GradeAveragesGradingSystemEnumMap,
|
||||
json['gradingSystem'],
|
||||
),
|
||||
_$GradeAveragesGradingSystemEnumMap, json['gradingSystem']),
|
||||
grades: (json['grades'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GradeAveragesStateToJson(
|
||||
_GradeAveragesState instance,
|
||||
) => <String, dynamic>{
|
||||
'gradingSystem': _$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
|
||||
Map<String, dynamic> _$$GradeAveragesStateImplToJson(
|
||||
_$GradeAveragesStateImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'gradingSystem':
|
||||
_$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
|
||||
'grades': instance.grades,
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class GradeAveragesView extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(isMiddleSchool ? 'Realschule' : 'Oberstufe'),
|
||||
Text(isMiddleSchool ? 'Notensystem' : 'Punktesystem'),
|
||||
],
|
||||
),
|
||||
)).toList(),
|
||||
@@ -80,19 +80,11 @@ class GradeAveragesView extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 30),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('Ø', style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
|
||||
SizedBox(width: 5),
|
||||
Text(bloc.average().toStringAsFixed(2), style: const TextStyle(fontSize: 30, fontWeight: FontWeight.bold))
|
||||
],
|
||||
),
|
||||
Text(bloc.average().toStringAsFixed(2), style: const TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 10),
|
||||
const Divider(),
|
||||
const SizedBox(height: 10),
|
||||
Text(bloc.isMiddleSchool() ? 'Wähle die Anzahl deiner jeweiligen Noten aus' : 'Wähle die Anzahl deiner jeweiligen Punkte aus'),
|
||||
Text(bloc.isMiddleSchool() ? 'Wähle unten die Anzahl deiner jeweiligen Noten aus' : 'Wähle unten die Anzahl deiner jeweiligen Punkte aus'),
|
||||
const SizedBox(height: 10),
|
||||
const Expanded(
|
||||
child: GradeAveragesListView()
|
||||
|
||||
@@ -5,7 +5,7 @@ part 'holidays_state.freezed.dart';
|
||||
part 'holidays_state.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class HolidaysState with _$HolidaysState {
|
||||
class HolidaysState with _$HolidaysState {
|
||||
const factory HolidaysState({
|
||||
required bool showPastHolidays,
|
||||
required bool showDisclaimer,
|
||||
@@ -16,7 +16,7 @@ abstract class HolidaysState with _$HolidaysState {
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Holiday with _$Holiday {
|
||||
class Holiday with _$Holiday {
|
||||
const factory Holiday({
|
||||
required String start,
|
||||
required String end,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
@@ -9,583 +9,481 @@ part of 'holidays_state.dart';
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$HolidaysState implements DiagnosticableTreeMixin {
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
bool get showPastHolidays; bool get showDisclaimer; List<Holiday> get holidays;
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$HolidaysStateCopyWith<HolidaysState> get copyWith => _$HolidaysStateCopyWithImpl<HolidaysState>(this as HolidaysState, _$identity);
|
||||
HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) {
|
||||
return _HolidaysState.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$HolidaysState {
|
||||
bool get showPastHolidays => throw _privateConstructorUsedError;
|
||||
bool get showDisclaimer => throw _privateConstructorUsedError;
|
||||
List<Holiday> get holidays => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this HolidaysState to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'HolidaysState'))
|
||||
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))..add(DiagnosticsProperty('holidays', holidays));
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is HolidaysState&&(identical(other.showPastHolidays, showPastHolidays) || other.showPastHolidays == showPastHolidays)&&(identical(other.showDisclaimer, showDisclaimer) || other.showDisclaimer == showDisclaimer)&&const DeepCollectionEquality().equals(other.holidays, holidays));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,showPastHolidays,showDisclaimer,const DeepCollectionEquality().hash(holidays));
|
||||
|
||||
@override
|
||||
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
|
||||
return 'HolidaysState(showPastHolidays: $showPastHolidays, showDisclaimer: $showDisclaimer, holidays: $holidays)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $HolidaysStateCopyWith<$Res> {
|
||||
factory $HolidaysStateCopyWith(HolidaysState value, $Res Function(HolidaysState) _then) = _$HolidaysStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$HolidaysStateCopyWithImpl<$Res>
|
||||
implements $HolidaysStateCopyWith<$Res> {
|
||||
_$HolidaysStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final HolidaysState _self;
|
||||
final $Res Function(HolidaysState) _then;
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? showPastHolidays = null,Object? showDisclaimer = null,Object? holidays = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
showPastHolidays: null == showPastHolidays ? _self.showPastHolidays : showPastHolidays // ignore: cast_nullable_to_non_nullable
|
||||
as bool,showDisclaimer: null == showDisclaimer ? _self.showDisclaimer : showDisclaimer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,holidays: null == holidays ? _self.holidays : holidays // ignore: cast_nullable_to_non_nullable
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$HolidaysStateCopyWith<HolidaysState> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $HolidaysStateCopyWith<$Res> {
|
||||
factory $HolidaysStateCopyWith(
|
||||
HolidaysState value, $Res Function(HolidaysState) then) =
|
||||
_$HolidaysStateCopyWithImpl<$Res, HolidaysState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$HolidaysStateCopyWithImpl<$Res, $Val extends HolidaysState>
|
||||
implements $HolidaysStateCopyWith<$Res> {
|
||||
_$HolidaysStateCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? showPastHolidays = null,
|
||||
Object? showDisclaimer = null,
|
||||
Object? holidays = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
showPastHolidays: null == showPastHolidays
|
||||
? _value.showPastHolidays
|
||||
: showPastHolidays // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
showDisclaimer: null == showDisclaimer
|
||||
? _value.showDisclaimer
|
||||
: showDisclaimer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
holidays: null == holidays
|
||||
? _value.holidays
|
||||
: holidays // ignore: cast_nullable_to_non_nullable
|
||||
as List<Holiday>,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$HolidaysStateImplCopyWith<$Res>
|
||||
implements $HolidaysStateCopyWith<$Res> {
|
||||
factory _$$HolidaysStateImplCopyWith(
|
||||
_$HolidaysStateImpl value, $Res Function(_$HolidaysStateImpl) then) =
|
||||
__$$HolidaysStateImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$HolidaysStateImplCopyWithImpl<$Res>
|
||||
extends _$HolidaysStateCopyWithImpl<$Res, _$HolidaysStateImpl>
|
||||
implements _$$HolidaysStateImplCopyWith<$Res> {
|
||||
__$$HolidaysStateImplCopyWithImpl(
|
||||
_$HolidaysStateImpl _value, $Res Function(_$HolidaysStateImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? showPastHolidays = null,
|
||||
Object? showDisclaimer = null,
|
||||
Object? holidays = null,
|
||||
}) {
|
||||
return _then(_$HolidaysStateImpl(
|
||||
showPastHolidays: null == showPastHolidays
|
||||
? _value.showPastHolidays
|
||||
: showPastHolidays // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
showDisclaimer: null == showDisclaimer
|
||||
? _value.showDisclaimer
|
||||
: showDisclaimer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
holidays: null == holidays
|
||||
? _value._holidays
|
||||
: holidays // ignore: cast_nullable_to_non_nullable
|
||||
as List<Holiday>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [HolidaysState].
|
||||
extension HolidaysStatePatterns on HolidaysState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _HolidaysState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _HolidaysState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _HolidaysState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState() when $default != null:
|
||||
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState():
|
||||
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HolidaysState() when $default != null:
|
||||
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$HolidaysStateImpl
|
||||
with DiagnosticableTreeMixin
|
||||
implements _HolidaysState {
|
||||
const _$HolidaysStateImpl(
|
||||
{required this.showPastHolidays,
|
||||
required this.showDisclaimer,
|
||||
required final List<Holiday> holidays})
|
||||
: _holidays = holidays;
|
||||
|
||||
class _HolidaysState with DiagnosticableTreeMixin implements HolidaysState {
|
||||
const _HolidaysState({required this.showPastHolidays, required this.showDisclaimer, required final List<Holiday> holidays}): _holidays = holidays;
|
||||
factory _HolidaysState.fromJson(Map<String, dynamic> json) => _$HolidaysStateFromJson(json);
|
||||
factory _$HolidaysStateImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$HolidaysStateImplFromJson(json);
|
||||
|
||||
@override final bool showPastHolidays;
|
||||
@override final bool showDisclaimer;
|
||||
@override
|
||||
final bool showPastHolidays;
|
||||
@override
|
||||
final bool showDisclaimer;
|
||||
final List<Holiday> _holidays;
|
||||
@override List<Holiday> get holidays {
|
||||
@override
|
||||
List<Holiday> get holidays {
|
||||
if (_holidays is EqualUnmodifiableListView) return _holidays;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_holidays);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$HolidaysStateCopyWith<_HolidaysState> get copyWith => __$HolidaysStateCopyWithImpl<_HolidaysState>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$HolidaysStateToJson(this, );
|
||||
}
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'HolidaysState'))
|
||||
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))..add(DiagnosticsProperty('holidays', holidays));
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HolidaysState&&(identical(other.showPastHolidays, showPastHolidays) || other.showPastHolidays == showPastHolidays)&&(identical(other.showDisclaimer, showDisclaimer) || other.showDisclaimer == showDisclaimer)&&const DeepCollectionEquality().equals(other._holidays, _holidays));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,showPastHolidays,showDisclaimer,const DeepCollectionEquality().hash(_holidays));
|
||||
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'HolidaysState(showPastHolidays: $showPastHolidays, showDisclaimer: $showDisclaimer, holidays: $holidays)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$HolidaysStateCopyWith<$Res> implements $HolidaysStateCopyWith<$Res> {
|
||||
factory _$HolidaysStateCopyWith(_HolidaysState value, $Res Function(_HolidaysState) _then) = __$HolidaysStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$HolidaysStateCopyWithImpl<$Res>
|
||||
implements _$HolidaysStateCopyWith<$Res> {
|
||||
__$HolidaysStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _HolidaysState _self;
|
||||
final $Res Function(_HolidaysState) _then;
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? showPastHolidays = null,Object? showDisclaimer = null,Object? holidays = null,}) {
|
||||
return _then(_HolidaysState(
|
||||
showPastHolidays: null == showPastHolidays ? _self.showPastHolidays : showPastHolidays // ignore: cast_nullable_to_non_nullable
|
||||
as bool,showDisclaimer: null == showDisclaimer ? _self.showDisclaimer : showDisclaimer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,holidays: null == holidays ? _self._holidays : holidays // ignore: cast_nullable_to_non_nullable
|
||||
as List<Holiday>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Holiday implements DiagnosticableTreeMixin {
|
||||
|
||||
String get start; String get end; int get year; String get stateCode; String get name; String get slug;
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$HolidayCopyWith<Holiday> get copyWith => _$HolidayCopyWithImpl<Holiday>(this as Holiday, _$identity);
|
||||
|
||||
/// Serializes this Holiday to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'Holiday'))
|
||||
..add(DiagnosticsProperty('start', start))..add(DiagnosticsProperty('end', end))..add(DiagnosticsProperty('year', year))..add(DiagnosticsProperty('stateCode', stateCode))..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('slug', slug));
|
||||
..add(DiagnosticsProperty('type', 'HolidaysState'))
|
||||
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))
|
||||
..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))
|
||||
..add(DiagnosticsProperty('holidays', holidays));
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is Holiday&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)&&(identical(other.year, year) || other.year == year)&&(identical(other.stateCode, stateCode) || other.stateCode == stateCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.slug, slug) || other.slug == slug));
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$HolidaysStateImpl &&
|
||||
(identical(other.showPastHolidays, showPastHolidays) ||
|
||||
other.showPastHolidays == showPastHolidays) &&
|
||||
(identical(other.showDisclaimer, showDisclaimer) ||
|
||||
other.showDisclaimer == showDisclaimer) &&
|
||||
const DeepCollectionEquality().equals(other._holidays, _holidays));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,start,end,year,stateCode,name,slug);
|
||||
int get hashCode => Object.hash(runtimeType, showPastHolidays, showDisclaimer,
|
||||
const DeepCollectionEquality().hash(_holidays));
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$HolidaysStateImplCopyWith<_$HolidaysStateImpl> get copyWith =>
|
||||
__$$HolidaysStateImplCopyWithImpl<_$HolidaysStateImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
|
||||
return 'Holiday(start: $start, end: $end, year: $year, stateCode: $stateCode, name: $name, slug: $slug)';
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$HolidaysStateImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _HolidaysState implements HolidaysState {
|
||||
const factory _HolidaysState(
|
||||
{required final bool showPastHolidays,
|
||||
required final bool showDisclaimer,
|
||||
required final List<Holiday> holidays}) = _$HolidaysStateImpl;
|
||||
|
||||
factory _HolidaysState.fromJson(Map<String, dynamic> json) =
|
||||
_$HolidaysStateImpl.fromJson;
|
||||
|
||||
@override
|
||||
bool get showPastHolidays;
|
||||
@override
|
||||
bool get showDisclaimer;
|
||||
@override
|
||||
List<Holiday> get holidays;
|
||||
|
||||
/// Create a copy of HolidaysState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$HolidaysStateImplCopyWith<_$HolidaysStateImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
Holiday _$HolidayFromJson(Map<String, dynamic> json) {
|
||||
return _Holiday.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $HolidayCopyWith<$Res> {
|
||||
factory $HolidayCopyWith(Holiday value, $Res Function(Holiday) _then) = _$HolidayCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String start, String end, int year, String stateCode, String name, String slug
|
||||
});
|
||||
mixin _$Holiday {
|
||||
String get start => throw _privateConstructorUsedError;
|
||||
String get end => throw _privateConstructorUsedError;
|
||||
int get year => throw _privateConstructorUsedError;
|
||||
String get stateCode => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get slug => throw _privateConstructorUsedError;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$HolidayCopyWithImpl<$Res>
|
||||
implements $HolidayCopyWith<$Res> {
|
||||
_$HolidayCopyWithImpl(this._self, this._then);
|
||||
|
||||
final Holiday _self;
|
||||
final $Res Function(Holiday) _then;
|
||||
/// Serializes this Holiday to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? start = null,Object? end = null,Object? year = null,Object? stateCode = null,Object? name = null,Object? slug = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
start: null == start ? _self.start : start // ignore: cast_nullable_to_non_nullable
|
||||
as String,end: null == end ? _self.end : end // ignore: cast_nullable_to_non_nullable
|
||||
as String,year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable
|
||||
as int,stateCode: null == stateCode ? _self.stateCode : stateCode // ignore: cast_nullable_to_non_nullable
|
||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$HolidayCopyWith<Holiday> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $HolidayCopyWith<$Res> {
|
||||
factory $HolidayCopyWith(Holiday value, $Res Function(Holiday) then) =
|
||||
_$HolidayCopyWithImpl<$Res, Holiday>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String start,
|
||||
String end,
|
||||
int year,
|
||||
String stateCode,
|
||||
String name,
|
||||
String slug});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$HolidayCopyWithImpl<$Res, $Val extends Holiday>
|
||||
implements $HolidayCopyWith<$Res> {
|
||||
_$HolidayCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? start = null,
|
||||
Object? end = null,
|
||||
Object? year = null,
|
||||
Object? stateCode = null,
|
||||
Object? name = null,
|
||||
Object? slug = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
start: null == start
|
||||
? _value.start
|
||||
: start // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
end: null == end
|
||||
? _value.end
|
||||
: end // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
year: null == year
|
||||
? _value.year
|
||||
: year // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
stateCode: null == stateCode
|
||||
? _value.stateCode
|
||||
: stateCode // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$HolidayImplCopyWith<$Res> implements $HolidayCopyWith<$Res> {
|
||||
factory _$$HolidayImplCopyWith(
|
||||
_$HolidayImpl value, $Res Function(_$HolidayImpl) then) =
|
||||
__$$HolidayImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String start,
|
||||
String end,
|
||||
int year,
|
||||
String stateCode,
|
||||
String name,
|
||||
String slug});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$HolidayImplCopyWithImpl<$Res>
|
||||
extends _$HolidayCopyWithImpl<$Res, _$HolidayImpl>
|
||||
implements _$$HolidayImplCopyWith<$Res> {
|
||||
__$$HolidayImplCopyWithImpl(
|
||||
_$HolidayImpl _value, $Res Function(_$HolidayImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? start = null,
|
||||
Object? end = null,
|
||||
Object? year = null,
|
||||
Object? stateCode = null,
|
||||
Object? name = null,
|
||||
Object? slug = null,
|
||||
}) {
|
||||
return _then(_$HolidayImpl(
|
||||
start: null == start
|
||||
? _value.start
|
||||
: start // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
end: null == end
|
||||
? _value.end
|
||||
: end // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
year: null == year
|
||||
? _value.year
|
||||
: year // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
stateCode: null == stateCode
|
||||
? _value.stateCode
|
||||
: stateCode // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
slug: null == slug
|
||||
? _value.slug
|
||||
: slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [Holiday].
|
||||
extension HolidayPatterns on Holiday {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _Holiday value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _Holiday value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _Holiday value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String start, String end, int year, String stateCode, String name, String slug)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday() when $default != null:
|
||||
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String start, String end, int year, String stateCode, String name, String slug) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday():
|
||||
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String start, String end, int year, String stateCode, String name, String slug)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Holiday() when $default != null:
|
||||
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$HolidayImpl with DiagnosticableTreeMixin implements _Holiday {
|
||||
const _$HolidayImpl(
|
||||
{required this.start,
|
||||
required this.end,
|
||||
required this.year,
|
||||
required this.stateCode,
|
||||
required this.name,
|
||||
required this.slug});
|
||||
|
||||
class _Holiday with DiagnosticableTreeMixin implements Holiday {
|
||||
const _Holiday({required this.start, required this.end, required this.year, required this.stateCode, required this.name, required this.slug});
|
||||
factory _Holiday.fromJson(Map<String, dynamic> json) => _$HolidayFromJson(json);
|
||||
|
||||
@override final String start;
|
||||
@override final String end;
|
||||
@override final int year;
|
||||
@override final String stateCode;
|
||||
@override final String name;
|
||||
@override final String slug;
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$HolidayCopyWith<_Holiday> get copyWith => __$HolidayCopyWithImpl<_Holiday>(this, _$identity);
|
||||
factory _$HolidayImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$HolidayImplFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$HolidayToJson(this, );
|
||||
}
|
||||
final String start;
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'Holiday'))
|
||||
..add(DiagnosticsProperty('start', start))..add(DiagnosticsProperty('end', end))..add(DiagnosticsProperty('year', year))..add(DiagnosticsProperty('stateCode', stateCode))..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('slug', slug));
|
||||
}
|
||||
|
||||
final String end;
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Holiday&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)&&(identical(other.year, year) || other.year == year)&&(identical(other.stateCode, stateCode) || other.stateCode == stateCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.slug, slug) || other.slug == slug));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
final int year;
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,start,end,year,stateCode,name,slug);
|
||||
final String stateCode;
|
||||
@override
|
||||
final String name;
|
||||
@override
|
||||
final String slug;
|
||||
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'Holiday(start: $start, end: $end, year: $year, stateCode: $stateCode, name: $name, slug: $slug)';
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'Holiday'))
|
||||
..add(DiagnosticsProperty('start', start))
|
||||
..add(DiagnosticsProperty('end', end))
|
||||
..add(DiagnosticsProperty('year', year))
|
||||
..add(DiagnosticsProperty('stateCode', stateCode))
|
||||
..add(DiagnosticsProperty('name', name))
|
||||
..add(DiagnosticsProperty('slug', slug));
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$HolidayCopyWith<$Res> implements $HolidayCopyWith<$Res> {
|
||||
factory _$HolidayCopyWith(_Holiday value, $Res Function(_Holiday) _then) = __$HolidayCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String start, String end, int year, String stateCode, String name, String slug
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$HolidayImpl &&
|
||||
(identical(other.start, start) || other.start == start) &&
|
||||
(identical(other.end, end) || other.end == end) &&
|
||||
(identical(other.year, year) || other.year == year) &&
|
||||
(identical(other.stateCode, stateCode) ||
|
||||
other.stateCode == stateCode) &&
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.slug, slug) || other.slug == slug));
|
||||
}
|
||||
/// @nodoc
|
||||
class __$HolidayCopyWithImpl<$Res>
|
||||
implements _$HolidayCopyWith<$Res> {
|
||||
__$HolidayCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Holiday _self;
|
||||
final $Res Function(_Holiday) _then;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, start, end, year, stateCode, name, slug);
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? start = null,Object? end = null,Object? year = null,Object? stateCode = null,Object? name = null,Object? slug = null,}) {
|
||||
return _then(_Holiday(
|
||||
start: null == start ? _self.start : start // ignore: cast_nullable_to_non_nullable
|
||||
as String,end: null == end ? _self.end : end // ignore: cast_nullable_to_non_nullable
|
||||
as String,year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable
|
||||
as int,stateCode: null == stateCode ? _self.stateCode : stateCode // ignore: cast_nullable_to_non_nullable
|
||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$HolidayImplCopyWith<_$HolidayImpl> get copyWith =>
|
||||
__$$HolidayImplCopyWithImpl<_$HolidayImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$HolidayImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _Holiday implements Holiday {
|
||||
const factory _Holiday(
|
||||
{required final String start,
|
||||
required final String end,
|
||||
required final int year,
|
||||
required final String stateCode,
|
||||
required final String name,
|
||||
required final String slug}) = _$HolidayImpl;
|
||||
|
||||
factory _Holiday.fromJson(Map<String, dynamic> json) = _$HolidayImpl.fromJson;
|
||||
|
||||
@override
|
||||
String get start;
|
||||
@override
|
||||
String get end;
|
||||
@override
|
||||
int get year;
|
||||
@override
|
||||
String get stateCode;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
String get slug;
|
||||
|
||||
/// Create a copy of Holiday
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$HolidayImplCopyWith<_$HolidayImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -6,8 +6,8 @@ part of 'holidays_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) =>
|
||||
_HolidaysState(
|
||||
_$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) =>
|
||||
_$HolidaysStateImpl(
|
||||
showPastHolidays: json['showPastHolidays'] as bool,
|
||||
showDisclaimer: json['showDisclaimer'] as bool,
|
||||
holidays: (json['holidays'] as List<dynamic>)
|
||||
@@ -15,14 +15,15 @@ _HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) =>
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HolidaysStateToJson(_HolidaysState instance) =>
|
||||
Map<String, dynamic> _$$HolidaysStateImplToJson(_$HolidaysStateImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'showPastHolidays': instance.showPastHolidays,
|
||||
'showDisclaimer': instance.showDisclaimer,
|
||||
'holidays': instance.holidays,
|
||||
};
|
||||
|
||||
_Holiday _$HolidayFromJson(Map<String, dynamic> json) => _Holiday(
|
||||
_$HolidayImpl _$$HolidayImplFromJson(Map<String, dynamic> json) =>
|
||||
_$HolidayImpl(
|
||||
start: json['start'] as String,
|
||||
end: json['end'] as String,
|
||||
year: (json['year'] as num).toInt(),
|
||||
@@ -31,7 +32,8 @@ _Holiday _$HolidayFromJson(Map<String, dynamic> json) => _Holiday(
|
||||
slug: json['slug'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HolidayToJson(_Holiday instance) => <String, dynamic>{
|
||||
Map<String, dynamic> _$$HolidayImplToJson(_$HolidayImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'start': instance.start,
|
||||
'end': instance.end,
|
||||
'year': instance.year,
|
||||
|
||||
@@ -5,7 +5,7 @@ part 'marianum_message_state.g.dart';
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class MarianumMessageState with _$MarianumMessageState {
|
||||
class MarianumMessageState with _$MarianumMessageState {
|
||||
const factory MarianumMessageState({
|
||||
required MarianumMessageList messageList,
|
||||
}) = _MarianumMessageState;
|
||||
@@ -14,7 +14,7 @@ abstract class MarianumMessageState with _$MarianumMessageState {
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class MarianumMessageList with _$MarianumMessageList {
|
||||
class MarianumMessageList with _$MarianumMessageList {
|
||||
const factory MarianumMessageList({
|
||||
required String base,
|
||||
required List<MarianumMessage> messages,
|
||||
@@ -24,7 +24,7 @@ abstract class MarianumMessageList with _$MarianumMessageList {
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class MarianumMessage with _$MarianumMessage {
|
||||
class MarianumMessage with _$MarianumMessage {
|
||||
const factory MarianumMessage({
|
||||
required String name,
|
||||
required String date,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,38 +6,45 @@ part of 'marianum_message_state.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_MarianumMessageState _$MarianumMessageStateFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _MarianumMessageState(
|
||||
_$MarianumMessageStateImpl _$$MarianumMessageStateImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageStateImpl(
|
||||
messageList: MarianumMessageList.fromJson(
|
||||
json['messageList'] as Map<String, dynamic>,
|
||||
),
|
||||
json['messageList'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$MarianumMessageStateToJson(
|
||||
_MarianumMessageState instance,
|
||||
) => <String, dynamic>{'messageList': instance.messageList};
|
||||
Map<String, dynamic> _$$MarianumMessageStateImplToJson(
|
||||
_$MarianumMessageStateImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'messageList': instance.messageList,
|
||||
};
|
||||
|
||||
_MarianumMessageList _$MarianumMessageListFromJson(Map<String, dynamic> json) =>
|
||||
_MarianumMessageList(
|
||||
_$MarianumMessageListImpl _$$MarianumMessageListImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageListImpl(
|
||||
base: json['base'] as String,
|
||||
messages: (json['messages'] as List<dynamic>)
|
||||
.map((e) => MarianumMessage.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$MarianumMessageListToJson(
|
||||
_MarianumMessageList instance,
|
||||
) => <String, dynamic>{'base': instance.base, 'messages': instance.messages};
|
||||
Map<String, dynamic> _$$MarianumMessageListImplToJson(
|
||||
_$MarianumMessageListImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'base': instance.base,
|
||||
'messages': instance.messages,
|
||||
};
|
||||
|
||||
_MarianumMessage _$MarianumMessageFromJson(Map<String, dynamic> json) =>
|
||||
_MarianumMessage(
|
||||
_$MarianumMessageImpl _$$MarianumMessageImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MarianumMessageImpl(
|
||||
name: json['name'] as String,
|
||||
date: json['date'] as String,
|
||||
url: json['url'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$MarianumMessageToJson(_MarianumMessage instance) =>
|
||||
Map<String, dynamic> _$$MarianumMessageImplToJson(
|
||||
_$MarianumMessageImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'date': instance.date,
|
||||
|
||||
@@ -10,29 +10,21 @@ Settings _$SettingsFromJson(Map<String, dynamic> json) => Settings(
|
||||
appTheme: Settings._themeFromJson(json['appTheme'] as String),
|
||||
devToolsEnabled: json['devToolsEnabled'] as bool,
|
||||
modulesSettings: ModulesSettings.fromJson(
|
||||
json['modulesSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['modulesSettings'] as Map<String, dynamic>),
|
||||
timetableSettings: TimetableSettings.fromJson(
|
||||
json['timetableSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
talkSettings: TalkSettings.fromJson(
|
||||
json['talkSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
fileSettings: FileSettings.fromJson(
|
||||
json['fileSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['timetableSettings'] as Map<String, dynamic>),
|
||||
talkSettings:
|
||||
TalkSettings.fromJson(json['talkSettings'] as Map<String, dynamic>),
|
||||
fileSettings:
|
||||
FileSettings.fromJson(json['fileSettings'] as Map<String, dynamic>),
|
||||
holidaysSettings: HolidaysSettings.fromJson(
|
||||
json['holidaysSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['holidaysSettings'] as Map<String, dynamic>),
|
||||
fileViewSettings: FileViewSettings.fromJson(
|
||||
json['fileViewSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['fileViewSettings'] as Map<String, dynamic>),
|
||||
notificationSettings: NotificationSettings.fromJson(
|
||||
json['notificationSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['notificationSettings'] as Map<String, dynamic>),
|
||||
devToolsSettings: DevToolsSettings.fromJson(
|
||||
json['devToolsSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
json['devToolsSettings'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user