Compare commits
9 Commits
2.1.1+36
...
77e9994204
Author | SHA1 | Date | |
---|---|---|---|
|
77e9994204 | ||
|
3f6c186c13 | ||
|
9ac4a940dd | ||
|
ec050ab712 | ||
|
77e3ce8bcc | ||
|
f5dcf71e10 | ||
|
7fc18b40db | ||
|
8c8ab24c9e | ||
|
a319bd7f8c |
@@ -10,8 +10,9 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "androidx.glance:glance:1.1.1"
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation "androidx.glance:glance-appwidget:1.1.1"
|
implementation 'androidx.glance:glance:1.1.1'
|
||||||
|
implementation 'androidx.glance:glance-appwidget:1.1.1'
|
||||||
implementation 'androidx.compose.foundation:foundation-layout-android:1.7.6'
|
implementation 'androidx.compose.foundation:foundation-layout-android:1.7.6'
|
||||||
implementation 'com.google.code.gson:gson:2.10.1'
|
implementation 'com.google.code.gson:gson:2.10.1'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
@@ -19,6 +20,12 @@ dependencies {
|
|||||||
implementation 'io.coil-kt.coil3:coil-network-okhttp:3.0.4'
|
implementation 'io.coil-kt.coil3:coil-network-okhttp:3.0.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def keystoreProperties = new Properties()
|
||||||
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose true
|
compose true
|
||||||
@@ -49,6 +56,15 @@ android {
|
|||||||
versionName = flutter.versionName
|
versionName = flutter.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
keyAlias = keystoreProperties['keyAlias']
|
||||||
|
keyPassword = keystoreProperties['keyPassword']
|
||||||
|
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||||
|
storePassword = keystoreProperties['storePassword']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable true
|
||||||
@@ -56,9 +72,7 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig = signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
signingConfig = signingConfigs.debug
|
|
||||||
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 537 B |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="ic_launcher_background">#FFFFFFFF</color>
|
<color name="ic_launcher_background">#FFFFFFFF</color>
|
||||||
|
<color name="ic_notification_background">#00000000</color>
|
||||||
</resources>
|
</resources>
|
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<style name="LaunchTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
running.
|
running.
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -139,6 +139,8 @@
|
|||||||
"fieldPostTitle": "Title",
|
"fieldPostTitle": "Title",
|
||||||
"fieldPostDescription": "Description",
|
"fieldPostDescription": "Description",
|
||||||
"fieldPostTags": "Tags",
|
"fieldPostTags": "Tags",
|
||||||
|
"fieldPostAlias": "Alias",
|
||||||
|
"fieldPostAliasHint": "Optional, used to represent the post in URL, should follow URL-Safe.",
|
||||||
"postPublish": "Publish",
|
"postPublish": "Publish",
|
||||||
"postPosted": "Post has been posted.",
|
"postPosted": "Post has been posted.",
|
||||||
"postPublishedAt": "Published At",
|
"postPublishedAt": "Published At",
|
||||||
@@ -176,12 +178,18 @@
|
|||||||
"other": "{} comments"
|
"other": "{} comments"
|
||||||
},
|
},
|
||||||
"settingsAppearance": "Appearance",
|
"settingsAppearance": "Appearance",
|
||||||
|
"settingsAppBarTransparent": "Transparent App Bar",
|
||||||
|
"settingsAppBarTransparentDescription": "Enable transparent effect for the app bar.",
|
||||||
"settingsBackgroundImage": "Background Image",
|
"settingsBackgroundImage": "Background Image",
|
||||||
"settingsBackgroundImageDescription": "Set the background image that will be applied globally.",
|
"settingsBackgroundImageDescription": "Set the background image that will be applied globally.",
|
||||||
"settingsBackgroundImageClear": "Clear Existing Background Image",
|
"settingsBackgroundImageClear": "Clear Existing Background Image",
|
||||||
"settingsBackgroundImageClearDescription": "Reset the background image to blank.",
|
"settingsBackgroundImageClearDescription": "Reset the background image to blank.",
|
||||||
"settingsThemeMaterial3": "Use Material You Design",
|
"settingsThemeMaterial3": "Use Material You Design",
|
||||||
"settingsThemeMaterial3Description": "Set the application theme to Material 3 Design.",
|
"settingsThemeMaterial3Description": "Set the application theme to Material 3 Design.",
|
||||||
|
"settingsColorScheme": "Color Scheme",
|
||||||
|
"settingsColorSchemeDescription": "Set the application primary color.",
|
||||||
|
"settingsColorSeed": "Color Seed",
|
||||||
|
"settingsColorSeedDescription": "Select one of the present color schemes.",
|
||||||
"settingsNetwork": "Network",
|
"settingsNetwork": "Network",
|
||||||
"settingsNetworkServer": "HyperNet Server",
|
"settingsNetworkServer": "HyperNet Server",
|
||||||
"settingsNetworkServerDescription": "Set the HyperNet server address, choose ours or build your own.",
|
"settingsNetworkServerDescription": "Set the HyperNet server address, choose ours or build your own.",
|
||||||
@@ -448,7 +456,7 @@
|
|||||||
"publisherBlockHintDescription": "You are going to block this publisher's maintainer, this will also block publishers that run by the same user.",
|
"publisherBlockHintDescription": "You are going to block this publisher's maintainer, this will also block publishers that run by the same user.",
|
||||||
"userUnblocked": "{} has been unblocked.",
|
"userUnblocked": "{} has been unblocked.",
|
||||||
"userBlocked": "{} has been blocked.",
|
"userBlocked": "{} has been blocked.",
|
||||||
"postSharingViaPicture": "Capturing post as picture, please stand by...",
|
"postSharingViaPicture": "Capturing post as picture, please wait...",
|
||||||
"postImageShareReadMore": "Scan the QR code to read full post",
|
"postImageShareReadMore": "Scan the QR code to read full post",
|
||||||
"postImageShareAds": "Explore posts on the Solar Network",
|
"postImageShareAds": "Explore posts on the Solar Network",
|
||||||
"postShare": "Share",
|
"postShare": "Share",
|
||||||
@@ -459,5 +467,15 @@
|
|||||||
"shareIntentDescription": "What do you want to do with the content you are sharing?",
|
"shareIntentDescription": "What do you want to do with the content you are sharing?",
|
||||||
"shareIntentPostStory": "Post a Story",
|
"shareIntentPostStory": "Post a Story",
|
||||||
"updateAvailable": "Update Available",
|
"updateAvailable": "Update Available",
|
||||||
"updateOngoing": "正在更新,请稍后..."
|
"updateOngoing": "Updating, please wait...",
|
||||||
|
"custom": "Custom",
|
||||||
|
"colorSchemeIndigo": "Indigo",
|
||||||
|
"colorSchemeBlue": "Blue",
|
||||||
|
"colorSchemeGreen": "Green",
|
||||||
|
"colorSchemeYellow": "Yellow",
|
||||||
|
"colorSchemeOrange": "Orange",
|
||||||
|
"colorSchemeRed": "Red",
|
||||||
|
"colorSchemeWhite": "White",
|
||||||
|
"colorSchemeBlack": "Black",
|
||||||
|
"colorSchemeApplied": "Color scheme has been applied, may need restart the app to take effect."
|
||||||
}
|
}
|
||||||
|
@@ -123,6 +123,8 @@
|
|||||||
"fieldPostTitle": "标题",
|
"fieldPostTitle": "标题",
|
||||||
"fieldPostDescription": "描述",
|
"fieldPostDescription": "描述",
|
||||||
"fieldPostTags": "标签",
|
"fieldPostTags": "标签",
|
||||||
|
"fieldPostAlias": "别名",
|
||||||
|
"fieldPostAliasHint": "可选项,用于在 URL 中表示该帖子,应遵循 URL-Safe 的原则。",
|
||||||
"postPublish": "发布",
|
"postPublish": "发布",
|
||||||
"postPublishedAt": "发布于",
|
"postPublishedAt": "发布于",
|
||||||
"postPublishedUntil": "取消发布于",
|
"postPublishedUntil": "取消发布于",
|
||||||
@@ -180,6 +182,12 @@
|
|||||||
"settingsBackgroundImageClearDescription": "将应用背景图重置为空白。",
|
"settingsBackgroundImageClearDescription": "将应用背景图重置为空白。",
|
||||||
"settingsThemeMaterial3": "使用 Material You 设计范式",
|
"settingsThemeMaterial3": "使用 Material You 设计范式",
|
||||||
"settingsThemeMaterial3Description": "将应用主题设置为 Material 3 设计范式的主题。",
|
"settingsThemeMaterial3Description": "将应用主题设置为 Material 3 设计范式的主题。",
|
||||||
|
"settingsAppBarTransparent": "透明顶栏",
|
||||||
|
"settingsAppBarTransparentDescription": "为顶栏启用透明效果。",
|
||||||
|
"settingsColorScheme": "主题色",
|
||||||
|
"settingsColorSchemeDescription": "设置应用主题色。",
|
||||||
|
"settingsColorSeed": "预设色彩主题",
|
||||||
|
"settingsColorSeedDescription": "选择一个预设色彩主题。",
|
||||||
"settingsNetwork": "网络",
|
"settingsNetwork": "网络",
|
||||||
"settingsNetworkServer": "HyperNet 服务器",
|
"settingsNetworkServer": "HyperNet 服务器",
|
||||||
"settingsNetworkServerDescription": "设置 HyperNet 服务器地址,选择我们提供的,或者自己搭建。",
|
"settingsNetworkServerDescription": "设置 HyperNet 服务器地址,选择我们提供的,或者自己搭建。",
|
||||||
@@ -457,5 +465,15 @@
|
|||||||
"shareIntentDescription": "您想对您分享的内容做些什么?",
|
"shareIntentDescription": "您想对您分享的内容做些什么?",
|
||||||
"shareIntentPostStory": "发布动态",
|
"shareIntentPostStory": "发布动态",
|
||||||
"updateAvailable": "检测到更新可用",
|
"updateAvailable": "检测到更新可用",
|
||||||
"updateOngoing": "正在更新,请稍后……"
|
"updateOngoing": "正在更新,请稍后……",
|
||||||
|
"custom": "自定义",
|
||||||
|
"colorSchemeIndigo": "靛蓝",
|
||||||
|
"colorSchemeBlue": "蓝色",
|
||||||
|
"colorSchemeGreen": "绿色",
|
||||||
|
"colorSchemeYellow": "黄色",
|
||||||
|
"colorSchemeOrange": "橙色",
|
||||||
|
"colorSchemeRed": "红色",
|
||||||
|
"colorSchemeWhite": "白色",
|
||||||
|
"colorSchemeBlack": "黑色",
|
||||||
|
"colorSchemeApplied": "主题色已应用,可能需要重启来生效。"
|
||||||
}
|
}
|
||||||
|
@@ -123,6 +123,8 @@
|
|||||||
"fieldPostTitle": "標題",
|
"fieldPostTitle": "標題",
|
||||||
"fieldPostDescription": "描述",
|
"fieldPostDescription": "描述",
|
||||||
"fieldPostTags": "標籤",
|
"fieldPostTags": "標籤",
|
||||||
|
"fieldPostAlias": "別名",
|
||||||
|
"fieldPostAliasHint": "可選項,用於在 URL 中表示該帖子,應遵循 URL-Safe 的原則。",
|
||||||
"postPublish": "發佈",
|
"postPublish": "發佈",
|
||||||
"postPublishedAt": "發佈於",
|
"postPublishedAt": "發佈於",
|
||||||
"postPublishedUntil": "取消發佈於",
|
"postPublishedUntil": "取消發佈於",
|
||||||
@@ -180,6 +182,12 @@
|
|||||||
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
||||||
"settingsThemeMaterial3": "使用 Material You 設計範式",
|
"settingsThemeMaterial3": "使用 Material You 設計範式",
|
||||||
"settingsThemeMaterial3Description": "將應用主題設置為 Material 3 設計範式的主題。",
|
"settingsThemeMaterial3Description": "將應用主題設置為 Material 3 設計範式的主題。",
|
||||||
|
"settingsAppBarTransparent": "透明頂欄",
|
||||||
|
"settingsAppBarTransparentDescription": "為頂欄啓用透明效果。",
|
||||||
|
"settingsColorScheme": "主題色",
|
||||||
|
"settingsColorSchemeDescription": "設置應用主題色。",
|
||||||
|
"settingsColorSeed": "預設色彩主題",
|
||||||
|
"settingsColorSeedDescription": "選擇一個預設色彩主題。",
|
||||||
"settingsNetwork": "網絡",
|
"settingsNetwork": "網絡",
|
||||||
"settingsNetworkServer": "HyperNet 服務器",
|
"settingsNetworkServer": "HyperNet 服務器",
|
||||||
"settingsNetworkServerDescription": "設置 HyperNet 服務器地址,選擇我們提供的,或者自己搭建。",
|
"settingsNetworkServerDescription": "設置 HyperNet 服務器地址,選擇我們提供的,或者自己搭建。",
|
||||||
@@ -368,6 +376,8 @@
|
|||||||
"dailyCheckNegativeHint6": "出門",
|
"dailyCheckNegativeHint6": "出門",
|
||||||
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
||||||
"happyBirthday": "生日快樂,{}!",
|
"happyBirthday": "生日快樂,{}!",
|
||||||
|
"celebrateMerryXmas": "聖誕快樂,{}!",
|
||||||
|
"celebrateNewYear": "新年快樂,{}!",
|
||||||
"friendNew": "添加好友",
|
"friendNew": "添加好友",
|
||||||
"friendRequests": "好友請求",
|
"friendRequests": "好友請求",
|
||||||
"friendRequestsDescription": {
|
"friendRequestsDescription": {
|
||||||
@@ -453,5 +463,17 @@
|
|||||||
"poweredBy": "由 {} 提供支持",
|
"poweredBy": "由 {} 提供支持",
|
||||||
"shareIntent": "分享",
|
"shareIntent": "分享",
|
||||||
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
||||||
"shareIntentPostStory": "發佈動態"
|
"shareIntentPostStory": "發佈動態",
|
||||||
|
"updateAvailable": "檢測到更新可用",
|
||||||
|
"updateOngoing": "正在更新,請稍後……",
|
||||||
|
"custom": "自定義",
|
||||||
|
"colorSchemeIndigo": "靛藍",
|
||||||
|
"colorSchemeBlue": "藍色",
|
||||||
|
"colorSchemeGreen": "綠色",
|
||||||
|
"colorSchemeYellow": "黃色",
|
||||||
|
"colorSchemeOrange": "橙色",
|
||||||
|
"colorSchemeRed": "紅色",
|
||||||
|
"colorSchemeWhite": "白色",
|
||||||
|
"colorSchemeBlack": "黑色",
|
||||||
|
"colorSchemeApplied": "主題色已應用,可能需要重啓來生效。"
|
||||||
}
|
}
|
||||||
|
@@ -123,6 +123,8 @@
|
|||||||
"fieldPostTitle": "標題",
|
"fieldPostTitle": "標題",
|
||||||
"fieldPostDescription": "描述",
|
"fieldPostDescription": "描述",
|
||||||
"fieldPostTags": "標籤",
|
"fieldPostTags": "標籤",
|
||||||
|
"fieldPostAlias": "別名",
|
||||||
|
"fieldPostAliasHint": "可選項,用於在 URL 中表示該帖子,應遵循 URL-Safe 的原則。",
|
||||||
"postPublish": "釋出",
|
"postPublish": "釋出",
|
||||||
"postPublishedAt": "釋出於",
|
"postPublishedAt": "釋出於",
|
||||||
"postPublishedUntil": "取消釋出於",
|
"postPublishedUntil": "取消釋出於",
|
||||||
@@ -180,6 +182,12 @@
|
|||||||
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
"settingsBackgroundImageClearDescription": "將應用背景圖重置為空白。",
|
||||||
"settingsThemeMaterial3": "使用 Material You 設計正規化",
|
"settingsThemeMaterial3": "使用 Material You 設計正規化",
|
||||||
"settingsThemeMaterial3Description": "將應用主題設定為 Material 3 設計正規化的主題。",
|
"settingsThemeMaterial3Description": "將應用主題設定為 Material 3 設計正規化的主題。",
|
||||||
|
"settingsAppBarTransparent": "透明頂欄",
|
||||||
|
"settingsAppBarTransparentDescription": "為頂欄啟用透明效果。",
|
||||||
|
"settingsColorScheme": "主題色",
|
||||||
|
"settingsColorSchemeDescription": "設定應用主題色。",
|
||||||
|
"settingsColorSeed": "預設色彩主題",
|
||||||
|
"settingsColorSeedDescription": "選擇一個預設色彩主題。",
|
||||||
"settingsNetwork": "網路",
|
"settingsNetwork": "網路",
|
||||||
"settingsNetworkServer": "HyperNet 伺服器",
|
"settingsNetworkServer": "HyperNet 伺服器",
|
||||||
"settingsNetworkServerDescription": "設定 HyperNet 伺服器地址,選擇我們提供的,或者自己搭建。",
|
"settingsNetworkServerDescription": "設定 HyperNet 伺服器地址,選擇我們提供的,或者自己搭建。",
|
||||||
@@ -368,6 +376,8 @@
|
|||||||
"dailyCheckNegativeHint6": "出門",
|
"dailyCheckNegativeHint6": "出門",
|
||||||
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
"dailyCheckNegativeHint6Description": "忘帶傘遇上大雨",
|
||||||
"happyBirthday": "生日快樂,{}!",
|
"happyBirthday": "生日快樂,{}!",
|
||||||
|
"celebrateMerryXmas": "聖誕快樂,{}!",
|
||||||
|
"celebrateNewYear": "新年快樂,{}!",
|
||||||
"friendNew": "新增好友",
|
"friendNew": "新增好友",
|
||||||
"friendRequests": "好友請求",
|
"friendRequests": "好友請求",
|
||||||
"friendRequestsDescription": {
|
"friendRequestsDescription": {
|
||||||
@@ -453,5 +463,17 @@
|
|||||||
"poweredBy": "由 {} 提供支援",
|
"poweredBy": "由 {} 提供支援",
|
||||||
"shareIntent": "分享",
|
"shareIntent": "分享",
|
||||||
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
"shareIntentDescription": "您想對您分享的內容做些什麼?",
|
||||||
"shareIntentPostStory": "釋出動態"
|
"shareIntentPostStory": "釋出動態",
|
||||||
|
"updateAvailable": "檢測到更新可用",
|
||||||
|
"updateOngoing": "正在更新,請稍後……",
|
||||||
|
"custom": "自定義",
|
||||||
|
"colorSchemeIndigo": "靛藍",
|
||||||
|
"colorSchemeBlue": "藍色",
|
||||||
|
"colorSchemeGreen": "綠色",
|
||||||
|
"colorSchemeYellow": "黃色",
|
||||||
|
"colorSchemeOrange": "橙色",
|
||||||
|
"colorSchemeRed": "紅色",
|
||||||
|
"colorSchemeWhite": "白色",
|
||||||
|
"colorSchemeBlack": "黑色",
|
||||||
|
"colorSchemeApplied": "主題色已應用,可能需要重啟來生效。"
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -152,6 +153,7 @@ class PostWriteController extends ChangeNotifier {
|
|||||||
final TextEditingController contentController = TextEditingController();
|
final TextEditingController contentController = TextEditingController();
|
||||||
final TextEditingController titleController = TextEditingController();
|
final TextEditingController titleController = TextEditingController();
|
||||||
final TextEditingController descriptionController = TextEditingController();
|
final TextEditingController descriptionController = TextEditingController();
|
||||||
|
final TextEditingController aliasController = TextEditingController();
|
||||||
|
|
||||||
PostWriteController() {
|
PostWriteController() {
|
||||||
titleController.addListener(() => notifyListeners());
|
titleController.addListener(() => notifyListeners());
|
||||||
@@ -198,6 +200,7 @@ class PostWriteController extends ChangeNotifier {
|
|||||||
titleController.text = post.body['title'] ?? '';
|
titleController.text = post.body['title'] ?? '';
|
||||||
descriptionController.text = post.body['description'] ?? '';
|
descriptionController.text = post.body['description'] ?? '';
|
||||||
contentController.text = post.body['content'] ?? '';
|
contentController.text = post.body['content'] ?? '';
|
||||||
|
aliasController.text = post.alias ?? '';
|
||||||
publishedAt = post.publishedAt;
|
publishedAt = post.publishedAt;
|
||||||
publishedUntil = post.publishedUntil;
|
publishedUntil = post.publishedUntil;
|
||||||
visibleUsers = List.from(post.visibleUsersList ?? []);
|
visibleUsers = List.from(post.visibleUsersList ?? []);
|
||||||
@@ -269,7 +272,7 @@ class PostWriteController extends ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> post(BuildContext context) async {
|
Future<void> sendPost(BuildContext context) async {
|
||||||
if (isBusy || publisher == null) return;
|
if (isBusy || publisher == null) return;
|
||||||
|
|
||||||
final sn = context.read<SnNetworkProvider>();
|
final sn = context.read<SnNetworkProvider>();
|
||||||
@@ -305,12 +308,14 @@ class PostWriteController extends ChangeNotifier {
|
|||||||
place.$2,
|
place.$2,
|
||||||
onProgress: (progress) {
|
onProgress: (progress) {
|
||||||
// Calculate overall progress for attachments
|
// Calculate overall progress for attachments
|
||||||
progress = ((i + progress) / attachments.length) * kAttachmentProgressWeight;
|
progress = math.max(((i + progress) / attachments.length) * kAttachmentProgressWeight, progress);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
progress = (i + 1) / attachments.length * kAttachmentProgressWeight;
|
||||||
attachments[i] = PostWriteMedia(item);
|
attachments[i] = PostWriteMedia(item);
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
isBusy = false;
|
isBusy = false;
|
||||||
@@ -334,6 +339,7 @@ class PostWriteController extends ChangeNotifier {
|
|||||||
data: {
|
data: {
|
||||||
'publisher': publisher!.id,
|
'publisher': publisher!.id,
|
||||||
'content': contentController.text,
|
'content': contentController.text,
|
||||||
|
if (aliasController.text.isNotEmpty) 'alias': aliasController.text,
|
||||||
if (titleController.text.isNotEmpty) 'title': titleController.text,
|
if (titleController.text.isNotEmpty) 'title': titleController.text,
|
||||||
if (descriptionController.text.isNotEmpty) 'description': descriptionController.text,
|
if (descriptionController.text.isNotEmpty) 'description': descriptionController.text,
|
||||||
if (thumbnail != null && thumbnail!.attachment != null) 'thumbnail': thumbnail!.attachment!.rid,
|
if (thumbnail != null && thumbnail!.attachment != null) 'thumbnail': thumbnail!.attachment!.rid,
|
||||||
|
@@ -9,6 +9,10 @@ const kRtkStoreKey = 'nex_user_rtk';
|
|||||||
const kNetworkServerDefault = 'https://api.sn.solsynth.dev';
|
const kNetworkServerDefault = 'https://api.sn.solsynth.dev';
|
||||||
const kNetworkServerStoreKey = 'app_server_url';
|
const kNetworkServerStoreKey = 'app_server_url';
|
||||||
|
|
||||||
|
const kAppbarTransparentStoreKey = 'app_bar_transparent';
|
||||||
|
const kAppBackgroundStoreKey = 'app_has_background';
|
||||||
|
const kAppColorSchemeStoreKey = 'app_color_scheme';
|
||||||
|
|
||||||
const Map<String, FilterQuality> kImageQualityLevel = {
|
const Map<String, FilterQuality> kImageQualityLevel = {
|
||||||
'settingsImageQualityLowest': FilterQuality.none,
|
'settingsImageQualityLowest': FilterQuality.none,
|
||||||
'settingsImageQualityLow': FilterQuality.low,
|
'settingsImageQualityLow': FilterQuality.low,
|
||||||
|
@@ -41,8 +41,7 @@ class SnAttachmentProvider {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<SnAttachment?>> getMultiple(List<String> rids,
|
Future<List<SnAttachment?>> getMultiple(List<String> rids, {noCache = false}) async {
|
||||||
{noCache = false}) async {
|
|
||||||
final result = List<SnAttachment?>.filled(rids.length, null);
|
final result = List<SnAttachment?>.filled(rids.length, null);
|
||||||
final Map<String, int> randomMapping = {};
|
final Map<String, int> randomMapping = {};
|
||||||
for (int i = 0; i < rids.length; i++) {
|
for (int i = 0; i < rids.length; i++) {
|
||||||
@@ -63,9 +62,7 @@ class SnAttachmentProvider {
|
|||||||
'id': pendingFetch.join(','),
|
'id': pendingFetch.join(','),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
final out = resp.data['data']
|
final out = resp.data['data'].map((e) => e['id'] == 0 ? null : SnAttachment.fromJson(e)).toList();
|
||||||
.map((e) => e['id'] == 0 ? null : SnAttachment.fromJson(e))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
for (final item in out) {
|
for (final item in out) {
|
||||||
if (item == null) continue;
|
if (item == null) continue;
|
||||||
@@ -79,10 +76,7 @@ class SnAttachmentProvider {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, String> mimetypeOverrides = {
|
static Map<String, String> mimetypeOverrides = {'mov': 'video/quicktime', 'mp4': 'video/mp4'};
|
||||||
'mov': 'video/quicktime',
|
|
||||||
'mp4': 'video/mp4'
|
|
||||||
};
|
|
||||||
|
|
||||||
Future<SnAttachment> directUploadOne(
|
Future<SnAttachment> directUploadOne(
|
||||||
Uint8List data,
|
Uint8List data,
|
||||||
@@ -93,11 +87,8 @@ class SnAttachmentProvider {
|
|||||||
Function(double progress)? onProgress,
|
Function(double progress)? onProgress,
|
||||||
}) async {
|
}) async {
|
||||||
final filePayload = MultipartFile.fromBytes(data, filename: filename);
|
final filePayload = MultipartFile.fromBytes(data, filename: filename);
|
||||||
final fileAlt = filename.contains('.')
|
final fileAlt = filename.contains('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename;
|
||||||
? filename.substring(0, filename.lastIndexOf('.'))
|
final fileExt = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
|
||||||
: filename;
|
|
||||||
final fileExt =
|
|
||||||
filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
|
|
||||||
|
|
||||||
String? mimetypeOverride;
|
String? mimetypeOverride;
|
||||||
if (mimetype != null) {
|
if (mimetype != null) {
|
||||||
@@ -133,11 +124,8 @@ class SnAttachmentProvider {
|
|||||||
Map<String, dynamic>? metadata, {
|
Map<String, dynamic>? metadata, {
|
||||||
String? mimetype,
|
String? mimetype,
|
||||||
}) async {
|
}) async {
|
||||||
final fileAlt = filename.contains('.')
|
final fileAlt = filename.contains('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename;
|
||||||
? filename.substring(0, filename.lastIndexOf('.'))
|
final fileExt = filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
|
||||||
: filename;
|
|
||||||
final fileExt =
|
|
||||||
filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();
|
|
||||||
|
|
||||||
String? mimetypeOverride;
|
String? mimetypeOverride;
|
||||||
if (mimetype == null && mimetypeOverrides.keys.contains(fileExt)) {
|
if (mimetype == null && mimetypeOverrides.keys.contains(fileExt)) {
|
||||||
@@ -155,10 +143,7 @@ class SnAttachmentProvider {
|
|||||||
if (mimetypeOverride != null) 'mimetype': mimetypeOverride,
|
if (mimetypeOverride != null) 'mimetype': mimetypeOverride,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (SnAttachment.fromJson(resp.data['meta']), resp.data['chunk_size'] as int);
|
||||||
SnAttachment.fromJson(resp.data['meta']),
|
|
||||||
resp.data['chunk_size'] as int
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<SnAttachment> _chunkedUploadOnePart(
|
Future<SnAttachment> _chunkedUploadOnePart(
|
||||||
@@ -200,24 +185,17 @@ class SnAttachmentProvider {
|
|||||||
(entry.value + 1) * chunkSize,
|
(entry.value + 1) * chunkSize,
|
||||||
await file.length(),
|
await file.length(),
|
||||||
);
|
);
|
||||||
final data = Uint8List.fromList(await file
|
final data = Uint8List.fromList(await file.openRead(beginCursor, endCursor).expand((chunk) => chunk).toList());
|
||||||
.openRead(beginCursor, endCursor)
|
|
||||||
.expand((chunk) => chunk)
|
|
||||||
.toList());
|
|
||||||
|
|
||||||
place = await _chunkedUploadOnePart(
|
place = await _chunkedUploadOnePart(
|
||||||
data,
|
data,
|
||||||
place.rid,
|
place.rid,
|
||||||
entry.key,
|
entry.key,
|
||||||
onProgress: (chunkProgress) {
|
|
||||||
final overallProgress =
|
|
||||||
(currentTask + chunkProgress) / chunks.length;
|
|
||||||
if (onProgress != null) {
|
|
||||||
onProgress(overallProgress);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final overallProgress = currentTask / chunks.length;
|
||||||
|
onProgress?.call(overallProgress);
|
||||||
|
|
||||||
currentTask++;
|
currentTask++;
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:surface/theme.dart';
|
import 'package:surface/theme.dart';
|
||||||
|
|
||||||
@@ -11,8 +13,8 @@ class ThemeProvider extends ChangeNotifier {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void reloadTheme({bool? useMaterial3}) {
|
void reloadTheme({Color? seedColorOverride, bool? useMaterial3}) {
|
||||||
createAppThemeSet().then((value) {
|
createAppThemeSet(seedColorOverride: seedColorOverride, useMaterial3: useMaterial3).then((value) {
|
||||||
theme = value;
|
theme = value;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
});
|
});
|
||||||
|
@@ -17,14 +17,13 @@ import 'package:surface/providers/config.dart';
|
|||||||
import 'package:surface/providers/post.dart';
|
import 'package:surface/providers/post.dart';
|
||||||
import 'package:surface/providers/sn_network.dart';
|
import 'package:surface/providers/sn_network.dart';
|
||||||
import 'package:surface/providers/userinfo.dart';
|
import 'package:surface/providers/userinfo.dart';
|
||||||
|
import 'package:surface/providers/widget.dart';
|
||||||
import 'package:surface/types/check_in.dart';
|
import 'package:surface/types/check_in.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
import 'package:surface/widgets/app_bar_leading.dart';
|
import 'package:surface/widgets/app_bar_leading.dart';
|
||||||
import 'package:surface/widgets/dialog.dart';
|
import 'package:surface/widgets/dialog.dart';
|
||||||
import 'package:surface/widgets/post/post_item.dart';
|
import 'package:surface/widgets/post/post_item.dart';
|
||||||
|
|
||||||
import '../providers/widget.dart';
|
|
||||||
|
|
||||||
class HomeScreenDashEntry {
|
class HomeScreenDashEntry {
|
||||||
final String name;
|
final String name;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
@@ -133,7 +132,7 @@ class _HomeDashUpdateWidget extends StatelessWidget {
|
|||||||
final model = UpdateModel(
|
final model = UpdateModel(
|
||||||
'https://files.solsynth.dev/d/production01/solian/app-arm64-v8a-release.apk',
|
'https://files.solsynth.dev/d/production01/solian/app-arm64-v8a-release.apk',
|
||||||
'solian-app-release-${config.updatableVersion!}.apk',
|
'solian-app-release-${config.updatableVersion!}.apk',
|
||||||
'ic_notification',
|
'ic_launcher',
|
||||||
'https://apps.apple.com/us/app/solian/id6499032345',
|
'https://apps.apple.com/us/app/solian/id6499032345',
|
||||||
);
|
);
|
||||||
AzhonAppUpdate.update(model);
|
AzhonAppUpdate.update(model);
|
||||||
@@ -212,7 +211,7 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> {
|
|||||||
final home = context.read<HomeWidgetProvider>();
|
final home = context.read<HomeWidgetProvider>();
|
||||||
final resp = await sn.client.get('/cgi/id/check-in/today');
|
final resp = await sn.client.get('/cgi/id/check-in/today');
|
||||||
_todayRecord = SnCheckInRecord.fromJson(resp.data);
|
_todayRecord = SnCheckInRecord.fromJson(resp.data);
|
||||||
home.saveWidgetData('pas_check_in_record', _todayRecord!.toJson());
|
await home.saveWidgetData('pas_check_in_record', _todayRecord!.toJson());
|
||||||
} finally {
|
} finally {
|
||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
@@ -225,7 +224,7 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> {
|
|||||||
final home = context.read<HomeWidgetProvider>();
|
final home = context.read<HomeWidgetProvider>();
|
||||||
final resp = await sn.client.post('/cgi/id/check-in');
|
final resp = await sn.client.post('/cgi/id/check-in');
|
||||||
_todayRecord = SnCheckInRecord.fromJson(resp.data);
|
_todayRecord = SnCheckInRecord.fromJson(resp.data);
|
||||||
home.saveWidgetData('pas_check_in_record', _todayRecord!.toJson());
|
await home.saveWidgetData('pas_check_in_record', _todayRecord!.toJson());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
context.showErrorDialog(err);
|
context.showErrorDialog(err);
|
||||||
|
@@ -13,6 +13,7 @@ import 'package:material_symbols_icons/symbols.dart';
|
|||||||
import 'package:pasteboard/pasteboard.dart';
|
import 'package:pasteboard/pasteboard.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:surface/controllers/post_write_controller.dart';
|
import 'package:surface/controllers/post_write_controller.dart';
|
||||||
|
import 'package:surface/providers/config.dart';
|
||||||
import 'package:surface/providers/sn_network.dart';
|
import 'package:surface/providers/sn_network.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
import 'package:surface/widgets/account/account_image.dart';
|
import 'package:surface/widgets/account/account_image.dart';
|
||||||
@@ -71,11 +72,14 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final sn = context.read<SnNetworkProvider>();
|
final sn = context.read<SnNetworkProvider>();
|
||||||
|
final config = context.read<ConfigProvider>();
|
||||||
final resp = await sn.client.get('/cgi/co/publishers/me');
|
final resp = await sn.client.get('/cgi/co/publishers/me');
|
||||||
_publishers = List<SnPublisher>.from(
|
_publishers = List<SnPublisher>.from(
|
||||||
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
|
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
|
||||||
);
|
);
|
||||||
_writeController.setPublisher(_publishers?.firstOrNull);
|
final beforeId = config.prefs.getInt('int_last_publisher_id');
|
||||||
|
_writeController
|
||||||
|
.setPublisher(_publishers?.where((ele) => ele.id == beforeId).firstOrNull ?? _publishers?.firstOrNull);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
context.showErrorDialog(err);
|
context.showErrorDialog(err);
|
||||||
@@ -265,6 +269,8 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_writeController.setPublisher(value);
|
_writeController.setPublisher(value);
|
||||||
|
final config = context.read<ConfigProvider>();
|
||||||
|
config.prefs.setInt('int_last_publisher_id', value.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonStyleData: const ButtonStyleData(
|
buttonStyleData: const ButtonStyleData(
|
||||||
@@ -496,7 +502,7 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
|
|||||||
onPressed: (_writeController.isBusy || _writeController.publisher == null)
|
onPressed: (_writeController.isBusy || _writeController.publisher == null)
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
_writeController.post(context).then((_) {
|
_writeController.sendPost(context).then((_) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
Navigator.pop(context, true);
|
Navigator.pop(context, true);
|
||||||
});
|
});
|
||||||
|
@@ -5,6 +5,7 @@ import 'package:dropdown_button2/dropdown_button2.dart';
|
|||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
@@ -18,6 +19,17 @@ import 'package:surface/providers/theme.dart';
|
|||||||
import 'package:surface/theme.dart';
|
import 'package:surface/theme.dart';
|
||||||
import 'package:surface/widgets/dialog.dart';
|
import 'package:surface/widgets/dialog.dart';
|
||||||
|
|
||||||
|
const Map<String, Color> kColorSchemes = {
|
||||||
|
'colorSchemeIndigo': Colors.indigo,
|
||||||
|
'colorSchemeBlue': Colors.blue,
|
||||||
|
'colorSchemeGreen': Colors.green,
|
||||||
|
'colorSchemeYellow': Colors.yellow,
|
||||||
|
'colorSchemeOrange': Colors.orange,
|
||||||
|
'colorSchemeRed': Colors.red,
|
||||||
|
'colorSchemeWhite': Colors.white,
|
||||||
|
'colorSchemeBlack': Colors.black,
|
||||||
|
};
|
||||||
|
|
||||||
class SettingsScreen extends StatefulWidget {
|
class SettingsScreen extends StatefulWidget {
|
||||||
const SettingsScreen({super.key});
|
const SettingsScreen({super.key});
|
||||||
|
|
||||||
@@ -77,7 +89,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
if (image == null) return;
|
if (image == null) return;
|
||||||
|
|
||||||
await File(image.path).copy('$_docBasepath/app_background_image');
|
await File(image.path).copy('$_docBasepath/app_background_image');
|
||||||
_prefs.setBool('has_background_image', true);
|
_prefs.setBool(kAppBackgroundStoreKey, true);
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
@@ -98,7 +110,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
trailing: const Icon(Symbols.chevron_right),
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
File('$_docBasepath/app_background_image').deleteSync();
|
File('$_docBasepath/app_background_image').deleteSync();
|
||||||
_prefs.remove('has_background_image');
|
_prefs.remove(kAppBackgroundStoreKey);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -116,10 +128,118 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
value ?? false,
|
value ?? false,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
final th = context.watch<ThemeProvider>();
|
final th = context.read<ThemeProvider>();
|
||||||
th.reloadTheme(useMaterial3: value ?? false);
|
th.reloadTheme(useMaterial3: value ?? false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Symbols.format_paint),
|
||||||
|
title: Text('settingsColorScheme').tr(),
|
||||||
|
subtitle: Text('settingsColorSchemeDescription').tr(),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
|
onTap: () async {
|
||||||
|
Color pickerColor = Color(_prefs.getInt(kAppColorSchemeStoreKey) ?? Colors.indigo.value);
|
||||||
|
final color = await showDialog<Color?>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
content: SingleChildScrollView(
|
||||||
|
child: ColorPicker(
|
||||||
|
pickerColor: pickerColor,
|
||||||
|
onColorChanged: (color) => pickerColor = color,
|
||||||
|
enableAlpha: false,
|
||||||
|
hexInputBar: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
child: const Text('dialogDismiss').tr(),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: const Text('dialogConfirm').tr(),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop(pickerColor);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (color == null || !context.mounted) return;
|
||||||
|
|
||||||
|
_prefs.setInt(kAppColorSchemeStoreKey, color.value);
|
||||||
|
final th = context.read<ThemeProvider>();
|
||||||
|
th.reloadTheme(seedColorOverride: color);
|
||||||
|
setState(() {});
|
||||||
|
|
||||||
|
context.showSnackbar('colorSchemeApplied'.tr());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Symbols.palette),
|
||||||
|
title: Text('settingsColorSeed').tr(),
|
||||||
|
subtitle: Text('settingsColorSeedDescription').tr(),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 24, right: 17),
|
||||||
|
trailing: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton2<int?>(
|
||||||
|
isExpanded: true,
|
||||||
|
items: [
|
||||||
|
...kColorSchemes.entries.mapIndexed((idx, ele) {
|
||||||
|
return DropdownMenuItem<int>(
|
||||||
|
value: idx,
|
||||||
|
child: Text(ele.key).tr(),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
DropdownMenuItem<int>(
|
||||||
|
value: -1,
|
||||||
|
child: Text('custom').tr(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
value: _prefs.getInt(kAppColorSchemeStoreKey) == null
|
||||||
|
? 1
|
||||||
|
: kColorSchemes.values
|
||||||
|
.toList()
|
||||||
|
.indexWhere((ele) => ele.value == _prefs.getInt(kAppColorSchemeStoreKey)),
|
||||||
|
onChanged: (int? value) {
|
||||||
|
if (value != null && value != -1) {
|
||||||
|
_prefs.setInt(kAppColorSchemeStoreKey, kColorSchemes.values.elementAt(value).value);
|
||||||
|
final th = context.read<ThemeProvider>();
|
||||||
|
th.reloadTheme(seedColorOverride: kColorSchemes.values.elementAt(value));
|
||||||
|
setState(() {});
|
||||||
|
|
||||||
|
context.showSnackbar('colorSchemeApplied'.tr());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonStyleData: const ButtonStyleData(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 5,
|
||||||
|
),
|
||||||
|
height: 40,
|
||||||
|
width: 160,
|
||||||
|
),
|
||||||
|
menuItemStyleData: const MenuItemStyleData(
|
||||||
|
height: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CheckboxListTile(
|
||||||
|
secondary: const Icon(Symbols.blur_on),
|
||||||
|
title: Text('settingsAppBarTransparent').tr(),
|
||||||
|
subtitle: Text('settingsAppBarTransparentDescription').tr(),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 24, right: 17),
|
||||||
|
value: _prefs.getBool(kAppbarTransparentStoreKey) ?? false,
|
||||||
|
onChanged: (value) {
|
||||||
|
_prefs.setBool(kAppbarTransparentStoreKey, value ?? false);
|
||||||
|
final th = context.read<ThemeProvider>();
|
||||||
|
th.reloadTheme();
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
@@ -189,7 +309,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
horizontal: 16,
|
horizontal: 16,
|
||||||
vertical: 5,
|
vertical: 5,
|
||||||
),
|
),
|
||||||
height: 40,
|
height: 56,
|
||||||
width: 160,
|
width: 160,
|
||||||
),
|
),
|
||||||
menuItemStyleData: const MenuItemStyleData(
|
menuItemStyleData: const MenuItemStyleData(
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:surface/providers/config.dart';
|
||||||
|
|
||||||
const kMaterialYouToggleStoreKey = 'app_theme_material_you';
|
const kMaterialYouToggleStoreKey = 'app_theme_material_you';
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ class ThemeSet {
|
|||||||
ThemeSet({required this.light, required this.dark});
|
ThemeSet({required this.light, required this.dark});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ThemeSet> createAppThemeSet({bool? useMaterial3}) async {
|
Future<ThemeSet> createAppThemeSet({Color? seedColorOverride, bool? useMaterial3}) async {
|
||||||
return ThemeSet(
|
return ThemeSet(
|
||||||
light: await createAppTheme(Brightness.light, useMaterial3: useMaterial3),
|
light: await createAppTheme(Brightness.light, useMaterial3: useMaterial3),
|
||||||
dark: await createAppTheme(Brightness.dark, useMaterial3: useMaterial3),
|
dark: await createAppTheme(Brightness.dark, useMaterial3: useMaterial3),
|
||||||
@@ -19,16 +20,21 @@ Future<ThemeSet> createAppThemeSet({bool? useMaterial3}) async {
|
|||||||
|
|
||||||
Future<ThemeData> createAppTheme(
|
Future<ThemeData> createAppTheme(
|
||||||
Brightness brightness, {
|
Brightness brightness, {
|
||||||
|
Color? seedColorOverride,
|
||||||
bool? useMaterial3,
|
bool? useMaterial3,
|
||||||
}) async {
|
}) async {
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
final seedColorString = prefs.getInt(kAppColorSchemeStoreKey);
|
||||||
|
final seedColor = seedColorString != null ? Color(seedColorString) : Colors.indigo;
|
||||||
|
|
||||||
final colorScheme = ColorScheme.fromSeed(
|
final colorScheme = ColorScheme.fromSeed(
|
||||||
seedColor: Colors.indigo,
|
seedColor: seedColorOverride ?? seedColor,
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
);
|
);
|
||||||
|
|
||||||
final hasBackground = prefs.getBool('has_background_image') ?? false;
|
final hasBackground = prefs.getBool(kAppBackgroundStoreKey) ?? false;
|
||||||
|
final hasAppBarBlurry = prefs.getBool(kAppbarTransparentStoreKey) ?? false;
|
||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
useMaterial3: useMaterial3 ?? (prefs.getBool(kMaterialYouToggleStoreKey) ?? false),
|
useMaterial3: useMaterial3 ?? (prefs.getBool(kMaterialYouToggleStoreKey) ?? false),
|
||||||
@@ -42,8 +48,9 @@ Future<ThemeData> createAppTheme(
|
|||||||
),
|
),
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
backgroundColor: hasBackground ? colorScheme.primary.withOpacity(0.75) : colorScheme.primary,
|
elevation: hasAppBarBlurry ? 0 : null,
|
||||||
foregroundColor: colorScheme.onPrimary,
|
backgroundColor: hasAppBarBlurry ? colorScheme.surfaceContainer.withAlpha(200) : colorScheme.primary,
|
||||||
|
foregroundColor: hasAppBarBlurry ? colorScheme.onSurface : colorScheme.onPrimary,
|
||||||
),
|
),
|
||||||
scaffoldBackgroundColor: Colors.transparent,
|
scaffoldBackgroundColor: Colors.transparent,
|
||||||
);
|
);
|
||||||
|
@@ -17,6 +17,8 @@ import 'package:responsive_framework/responsive_framework.dart';
|
|||||||
import 'package:screenshot/screenshot.dart';
|
import 'package:screenshot/screenshot.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
import 'package:surface/providers/config.dart';
|
||||||
|
import 'package:surface/providers/link_preview.dart';
|
||||||
import 'package:surface/providers/sn_network.dart';
|
import 'package:surface/providers/sn_network.dart';
|
||||||
import 'package:surface/providers/userinfo.dart';
|
import 'package:surface/providers/userinfo.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
@@ -83,6 +85,8 @@ class PostItem extends StatelessWidget {
|
|||||||
child: MultiProvider(
|
child: MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
Provider<SnNetworkProvider>(create: (_) => context.read()),
|
Provider<SnNetworkProvider>(create: (_) => context.read()),
|
||||||
|
Provider<SnLinkPreviewProvider>(create: (_) => context.read()),
|
||||||
|
ChangeNotifierProvider<ConfigProvider>(create: (_) => context.read()),
|
||||||
],
|
],
|
||||||
child: ResponsiveBreakpoints.builder(
|
child: ResponsiveBreakpoints.builder(
|
||||||
breakpoints: ResponsiveBreakpoints.of(context).breakpoints,
|
breakpoints: ResponsiveBreakpoints.of(context).breakpoints,
|
||||||
@@ -410,7 +414,7 @@ class PostShareImageWidget extends StatelessWidget {
|
|||||||
size: Size(28, 28),
|
size: Size(28, 28),
|
||||||
),
|
),
|
||||||
eyeStyle: QrEyeStyle(
|
eyeStyle: QrEyeStyle(
|
||||||
eyeShape: QrEyeShape.square,
|
eyeShape: QrEyeShape.circle,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
dataModuleStyle: QrDataModuleStyle(
|
dataModuleStyle: QrDataModuleStyle(
|
||||||
|
@@ -189,16 +189,19 @@ class PostMediaPendingList extends StatelessWidget {
|
|||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
child: switch (thumbnail!.type) {
|
child: switch (thumbnail!.type) {
|
||||||
PostWriteMediaType.image => LayoutBuilder(builder: (context, constraints) {
|
PostWriteMediaType.image => Container(
|
||||||
return Image(
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
image: thumbnail!.getImageProvider(
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
context,
|
return Image(
|
||||||
width: (constraints.maxWidth * devicePixelRatio).round(),
|
image: thumbnail!.getImageProvider(
|
||||||
height: (constraints.maxHeight * devicePixelRatio).round(),
|
context,
|
||||||
)!,
|
width: (constraints.maxWidth * devicePixelRatio).round(),
|
||||||
fit: BoxFit.cover,
|
height: (constraints.maxHeight * devicePixelRatio).round(),
|
||||||
);
|
)!,
|
||||||
}),
|
fit: BoxFit.contain,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
_ => Container(
|
_ => Container(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: const Icon(Symbols.docs).center(),
|
child: const Icon(Symbols.docs).center(),
|
||||||
@@ -236,18 +239,21 @@ class PostMediaPendingList extends StatelessWidget {
|
|||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
child: switch (media.type) {
|
child: switch (media.type) {
|
||||||
PostWriteMediaType.image => LayoutBuilder(builder: (context, constraints) {
|
PostWriteMediaType.image => Container(
|
||||||
return Image(
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
image: media.getImageProvider(
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
context,
|
return Image(
|
||||||
width: (constraints.maxWidth * devicePixelRatio).round(),
|
image: media.getImageProvider(
|
||||||
height: (constraints.maxHeight * devicePixelRatio).round(),
|
context,
|
||||||
)!,
|
width: (constraints.maxWidth * devicePixelRatio).round(),
|
||||||
fit: BoxFit.cover,
|
height: (constraints.maxHeight * devicePixelRatio).round(),
|
||||||
);
|
)!,
|
||||||
}),
|
fit: BoxFit.contain,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
_ => Container(
|
_ => Container(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
child: const Icon(Symbols.docs).center(),
|
child: const Icon(Symbols.docs).center(),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@@ -114,6 +114,18 @@ class PostMetaEditor extends StatelessWidget {
|
|||||||
controller.setTags(value);
|
controller.setTags(value);
|
||||||
},
|
},
|
||||||
).padding(horizontal: 24),
|
).padding(horizontal: 24),
|
||||||
|
const Gap(4),
|
||||||
|
TextField(
|
||||||
|
controller: controller.aliasController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'fieldPostAlias'.tr(),
|
||||||
|
helperText: 'fieldPostAliasHint'.tr(),
|
||||||
|
helperMaxLines: 2,
|
||||||
|
border: UnderlineInputBorder(),
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
).padding(horizontal: 24),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
@@ -7,6 +7,7 @@ import 'package:material_symbols_icons/symbols.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:surface/controllers/post_write_controller.dart';
|
import 'package:surface/controllers/post_write_controller.dart';
|
||||||
|
import 'package:surface/providers/config.dart';
|
||||||
import 'package:surface/providers/sn_network.dart';
|
import 'package:surface/providers/sn_network.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
import 'package:surface/widgets/account/account_image.dart';
|
import 'package:surface/widgets/account/account_image.dart';
|
||||||
@@ -16,6 +17,7 @@ import 'package:surface/widgets/loading_indicator.dart';
|
|||||||
class PostMiniEditor extends StatefulWidget {
|
class PostMiniEditor extends StatefulWidget {
|
||||||
final int? postReplyId;
|
final int? postReplyId;
|
||||||
final Function? onPost;
|
final Function? onPost;
|
||||||
|
|
||||||
const PostMiniEditor({super.key, this.postReplyId, this.onPost});
|
const PostMiniEditor({super.key, this.postReplyId, this.onPost});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -26,6 +28,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
final PostWriteController _writeController = PostWriteController();
|
final PostWriteController _writeController = PostWriteController();
|
||||||
|
|
||||||
bool _isFetching = false;
|
bool _isFetching = false;
|
||||||
|
|
||||||
bool get _isLoading => _isFetching || _writeController.isLoading;
|
bool get _isLoading => _isFetching || _writeController.isLoading;
|
||||||
|
|
||||||
List<SnPublisher>? _publishers;
|
List<SnPublisher>? _publishers;
|
||||||
@@ -35,11 +38,14 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final sn = context.read<SnNetworkProvider>();
|
final sn = context.read<SnNetworkProvider>();
|
||||||
|
final config = context.read<ConfigProvider>();
|
||||||
final resp = await sn.client.get('/cgi/co/publishers/me');
|
final resp = await sn.client.get('/cgi/co/publishers/me');
|
||||||
_publishers = List<SnPublisher>.from(
|
_publishers = List<SnPublisher>.from(
|
||||||
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
|
resp.data?.map((e) => SnPublisher.fromJson(e)) ?? [],
|
||||||
);
|
);
|
||||||
_writeController.setPublisher(_publishers?.firstOrNull);
|
final beforeId = config.prefs.getInt('int_last_publisher_id');
|
||||||
|
_writeController
|
||||||
|
.setPublisher(_publishers?.where((ele) => ele.id == beforeId).firstOrNull ?? _publishers?.firstOrNull);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
context.showErrorDialog(err);
|
context.showErrorDialog(err);
|
||||||
@@ -93,17 +99,11 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Text(item.nick).textStyle(
|
Text(item.nick).textStyle(Theme.of(context).textTheme.bodyMedium!),
|
||||||
Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.bodyMedium!),
|
|
||||||
Text('@${item.name}')
|
Text('@${item.name}')
|
||||||
.textStyle(Theme.of(context)
|
.textStyle(Theme.of(context).textTheme.bodySmall!)
|
||||||
.textTheme
|
|
||||||
.bodySmall!)
|
|
||||||
.fontSize(12),
|
.fontSize(12),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -120,8 +120,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
radius: 16,
|
radius: 16,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
foregroundColor:
|
foregroundColor: Theme.of(context).colorScheme.onSurface,
|
||||||
Theme.of(context).colorScheme.onSurface,
|
|
||||||
child: const Icon(Symbols.add),
|
child: const Icon(Symbols.add),
|
||||||
),
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
@@ -130,8 +129,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('publishersNew').tr().textStyle(
|
Text('publishersNew').tr().textStyle(Theme.of(context).textTheme.bodyMedium!),
|
||||||
Theme.of(context).textTheme.bodyMedium!),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -142,9 +140,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
value: _writeController.publisher,
|
value: _writeController.publisher,
|
||||||
onChanged: (SnPublisher? value) {
|
onChanged: (SnPublisher? value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
GoRouter.of(context)
|
GoRouter.of(context).pushNamed('accountPublisherNew').then((value) {
|
||||||
.pushNamed('accountPublisherNew')
|
|
||||||
.then((value) {
|
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
_publishers = null;
|
_publishers = null;
|
||||||
_fetchPublishers();
|
_fetchPublishers();
|
||||||
@@ -152,6 +148,8 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_writeController.setPublisher(value);
|
_writeController.setPublisher(value);
|
||||||
|
final config = context.read<ConfigProvider>();
|
||||||
|
config.prefs.setInt('int_last_publisher_id', value.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonStyleData: const ButtonStyleData(
|
buttonStyleData: const ButtonStyleData(
|
||||||
@@ -178,8 +176,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
),
|
),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) =>
|
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
@@ -188,8 +185,7 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
TweenAnimationBuilder<double>(
|
TweenAnimationBuilder<double>(
|
||||||
tween: Tween(begin: 0, end: _writeController.progress),
|
tween: Tween(begin: 0, end: _writeController.progress),
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
builder: (context, value, _) =>
|
builder: (context, value, _) => LinearProgressIndicator(value: value, minHeight: 2),
|
||||||
LinearProgressIndicator(value: value, minHeight: 2),
|
|
||||||
)
|
)
|
||||||
else if (_writeController.isBusy)
|
else if (_writeController.isBusy)
|
||||||
const LinearProgressIndicator(value: null, minHeight: 2),
|
const LinearProgressIndicator(value: null, minHeight: 2),
|
||||||
@@ -206,18 +202,16 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
'postEditor',
|
'postEditor',
|
||||||
pathParameters: {'mode': 'stories'},
|
pathParameters: {'mode': 'stories'},
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
if (widget.postReplyId != null)
|
if (widget.postReplyId != null) 'replying': widget.postReplyId.toString(),
|
||||||
'replying': widget.postReplyId.toString(),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: (_writeController.isBusy ||
|
onPressed: (_writeController.isBusy || _writeController.publisher == null)
|
||||||
_writeController.publisher == null)
|
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
_writeController.post(context).then((_) {
|
_writeController.sendPost(context).then((_) {
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
if (widget.onPost != null) widget.onPost!();
|
if (widget.onPost != null) widget.onPost!();
|
||||||
context.showSnackbar('postPosted'.tr());
|
context.showSnackbar('postPosted'.tr());
|
||||||
|
@@ -643,6 +643,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.4.1"
|
version: "3.4.1"
|
||||||
|
flutter_colorpicker:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_colorpicker
|
||||||
|
sha256: "969de5f6f9e2a570ac660fb7b501551451ea2a1ab9e2097e89475f60e07816ea"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
flutter_context_menu:
|
flutter_context_menu:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 2.1.1+36
|
version: 2.1.1+37
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
@@ -111,6 +111,7 @@ dependencies:
|
|||||||
flutter_app_update: ^3.2.2
|
flutter_app_update: ^3.2.2
|
||||||
in_app_review: ^2.0.10
|
in_app_review: ^2.0.10
|
||||||
version: ^3.0.2
|
version: ^3.0.2
|
||||||
|
flutter_colorpicker: ^1.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|