mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-20 16:10:44 +01:00
Merge remote-tracking branch 'origin/main' into server-list
This commit is contained in:
commit
fe5e9170f5
@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdkVersion 31
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
|
@ -2714,5 +2714,20 @@
|
|||||||
"whatIsGoingOn": "Co se děje?",
|
"whatIsGoingOn": "Co se děje?",
|
||||||
"@whatIsGoingOn": {},
|
"@whatIsGoingOn": {},
|
||||||
"addDescription": "Přidat popis",
|
"addDescription": "Přidat popis",
|
||||||
"@addDescription": {}
|
"@addDescription": {},
|
||||||
|
"iUnderstand": "Rozumím",
|
||||||
|
"@iUnderstand": {},
|
||||||
|
"markAsRead": "Označit jako přečtené",
|
||||||
|
"@markAsRead": {},
|
||||||
|
"bubbleSize": "Velikost bubliny",
|
||||||
|
"@bubbleSize": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"reportUser": "Nahlásit uživatele",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Otevřete chat",
|
||||||
|
"@openChat": {},
|
||||||
|
"storyPrivacyWarning": "Upozorňujeme, že lidé se ve vašem příběhu mohou navzájem vidět a kontaktovat. Vaše příběhy budou viditelné po dobu 24 hodin, ale není zaručeno, že budou smazány ze všech zařízení a serverů.",
|
||||||
|
"@storyPrivacyWarning": {}
|
||||||
}
|
}
|
||||||
|
@ -2719,5 +2719,9 @@
|
|||||||
"dismiss": "Desbotar",
|
"dismiss": "Desbotar",
|
||||||
"@dismiss": {},
|
"@dismiss": {},
|
||||||
"markAsRead": "Marcar como lido",
|
"markAsRead": "Marcar como lido",
|
||||||
"@markAsRead": {}
|
"@markAsRead": {},
|
||||||
|
"reportUser": "Denunciar usuaria",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Abrir Chat",
|
||||||
|
"@openChat": {}
|
||||||
}
|
}
|
||||||
|
@ -2721,5 +2721,9 @@
|
|||||||
"dismiss": "Abaikan",
|
"dismiss": "Abaikan",
|
||||||
"@dismiss": {},
|
"@dismiss": {},
|
||||||
"markAsRead": "Tandai sebagai dibaca",
|
"markAsRead": "Tandai sebagai dibaca",
|
||||||
"@markAsRead": {}
|
"@markAsRead": {},
|
||||||
|
"reportUser": "Laporkan pengguna",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Buka Chat",
|
||||||
|
"@openChat": {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"@@last_modified": "2021-08-14 12:41:09.835634",
|
"@@last_modified": "2021-08-14 12:41:09.835634",
|
||||||
"about": "Om Fluffychat",
|
"about": "Om",
|
||||||
"@about": {
|
"@about": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -259,7 +259,7 @@
|
|||||||
"username": {}
|
"username": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"changedTheJoinRulesTo": "{username} ändrade anslutningsreglerna till",
|
"changedTheJoinRulesTo": "{username} ändrade anslutningsreglerna till {joinRules}",
|
||||||
"@changedTheJoinRulesTo": {
|
"@changedTheJoinRulesTo": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -489,7 +489,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"dateAndTimeOfDay": "{timeOfDay}, {date}",
|
"dateAndTimeOfDay": "{date}, {timeOfDay}",
|
||||||
"@dateAndTimeOfDay": {
|
"@dateAndTimeOfDay": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -505,7 +505,7 @@
|
|||||||
"day": {}
|
"day": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dateWithYear": "{day}-{month}-{year}",
|
"dateWithYear": "{year}-{month}-{day}",
|
||||||
"@dateWithYear": {
|
"@dateWithYear": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -524,7 +524,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"delete": "Ta bort",
|
"delete": "Radera",
|
||||||
"@delete": {
|
"@delete": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -891,7 +891,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"inviteContactToGroup": "Bjud in kontakt till",
|
"inviteContactToGroup": "Bjud in kontakt till {groupName}",
|
||||||
"@inviteContactToGroup": {
|
"@inviteContactToGroup": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -1193,7 +1193,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"notifications": "Notifikationer",
|
"notifications": "Aviseringar",
|
||||||
"@notifications": {
|
"@notifications": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -1232,7 +1232,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"ok": "ok",
|
"ok": "OK",
|
||||||
"@ok": {
|
"@ok": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -1445,7 +1445,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"unbanFromChat": "Ta bort exil",
|
"unbanFromChat": "Ta bort chatt-blockering",
|
||||||
"@unbanFromChat": {
|
"@unbanFromChat": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -1675,7 +1675,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"sharedTheLocation": "{username} delade positionen",
|
"sharedTheLocation": "{username} delade sin position",
|
||||||
"@sharedTheLocation": {
|
"@sharedTheLocation": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -1709,7 +1709,7 @@
|
|||||||
"senderName": {}
|
"senderName": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"startYourFirstChat": "Starta din första chatt nu! 🙂\n- tryck på \"meddelande knappen\"\n- Ange din kompis användarnamn\n- Ha så kul med chattandet",
|
"startYourFirstChat": "Starta din första chatt nu! 🙂\n- tryck på \"ny chatt\"\n- Skanna en väns QR-kod\n- Ha så kul med chattandet",
|
||||||
"@startYourFirstChat": {
|
"@startYourFirstChat": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -1860,14 +1860,14 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"unreadChats": "{unreadCount, plural, other{{unreadCount} olästa chattar}}",
|
"unreadChats": "{unreadCount, plural, =1{en oläst chatt} other{{unreadCount} olästa chattar}}",
|
||||||
"@unreadChats": {
|
"@unreadChats": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"unreadCount": {}
|
"unreadCount": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unreadMessages": "{unreadEvents, plural, other{{unreadEvents} olästa meddelanden}}",
|
"unreadMessages": "{unreadEvents, plural, =1{ett oläst meddelande} other{{unreadEvents} olästa meddelanden}}",
|
||||||
"@unreadMessages": {
|
"@unreadMessages": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@ -2284,7 +2284,7 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"createNewSpace": "Skapa nytt utrymme",
|
"createNewSpace": "Nytt utrymme",
|
||||||
"@createNewSpace": {
|
"@createNewSpace": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
@ -2567,5 +2567,166 @@
|
|||||||
"placeholders": {
|
"placeholders": {
|
||||||
"count": {}
|
"count": {}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"commandHint_create": "Skapa en tom grupp-chatt\nAnvänd --no-encryption för att inaktivera kryptering",
|
||||||
|
"@commandHint_create": {
|
||||||
|
"type": "text",
|
||||||
|
"description": "Usage hint for the command /create"
|
||||||
|
},
|
||||||
|
"commandHint_discardsession": "Kasta bort sessionen",
|
||||||
|
"@commandHint_discardsession": {
|
||||||
|
"type": "text",
|
||||||
|
"description": "Usage hint for the command /discardsession"
|
||||||
|
},
|
||||||
|
"commandHint_dm": "Starta en direkt-chatt\nAnvänd --no-encryption för att inaktivera kryptering",
|
||||||
|
"@commandHint_dm": {
|
||||||
|
"type": "text",
|
||||||
|
"description": "Usage hint for the command /dm"
|
||||||
|
},
|
||||||
|
"homeserver": "Hemserver",
|
||||||
|
"@homeserver": {},
|
||||||
|
"oneClientLoggedOut": "En av dina klienter har loggats ut",
|
||||||
|
"@oneClientLoggedOut": {},
|
||||||
|
"addAccount": "Lägg till konto",
|
||||||
|
"@addAccount": {},
|
||||||
|
"editBundlesForAccount": "Lägg till paket för detta konto",
|
||||||
|
"@editBundlesForAccount": {},
|
||||||
|
"addToBundle": "Utöka paket",
|
||||||
|
"@addToBundle": {},
|
||||||
|
"bundleName": "Paketnamn",
|
||||||
|
"@bundleName": {},
|
||||||
|
"serverRequiresEmail": "Servern behöver validera din e-postadress för registrering.",
|
||||||
|
"@serverRequiresEmail": {},
|
||||||
|
"singlesignon": "Single Sign On",
|
||||||
|
"@singlesignon": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"unverified": "Ej verifierad",
|
||||||
|
"@unverified": {},
|
||||||
|
"messageInfo": "Meddelandeinformation",
|
||||||
|
"@messageInfo": {},
|
||||||
|
"messageType": "Meddelandetyp",
|
||||||
|
"@messageType": {},
|
||||||
|
"time": "Tid",
|
||||||
|
"@time": {},
|
||||||
|
"sender": "Avsändare",
|
||||||
|
"@sender": {},
|
||||||
|
"removeFromSpace": "Ta bort från utrymme",
|
||||||
|
"@removeFromSpace": {},
|
||||||
|
"addToSpaceDescription": "Välj ett utrymme som chatten skall läggas till i.",
|
||||||
|
"@addToSpaceDescription": {},
|
||||||
|
"start": "Starta",
|
||||||
|
"@start": {},
|
||||||
|
"pleaseEnterSecurityKeyDescription": "För att låsa upp din chatt-backup, vänligen ange säkerhetsnyckeln som skapats i en tidigare session. Säkerhetsnyckeln är INTE densamma som ditt lösenord.",
|
||||||
|
"@pleaseEnterSecurityKeyDescription": {},
|
||||||
|
"saveTheSecurityKeyNow": "Spara säkerhetsnyckeln nu",
|
||||||
|
"@saveTheSecurityKeyNow": {},
|
||||||
|
"iUnderstand": "Jag förstår",
|
||||||
|
"@iUnderstand": {},
|
||||||
|
"yourStory": "Din berättelse",
|
||||||
|
"@yourStory": {},
|
||||||
|
"openGallery": "Öppna galleri",
|
||||||
|
"@openGallery": {},
|
||||||
|
"storyFrom": "Berättelse från {date}: \n{body}",
|
||||||
|
"@storyFrom": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {
|
||||||
|
"date": {},
|
||||||
|
"body": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"passwordsDoNotMatch": "Lösenorden stämmer inte överens!",
|
||||||
|
"@passwordsDoNotMatch": {},
|
||||||
|
"repeatPassword": "Upprepa lösenord",
|
||||||
|
"@repeatPassword": {},
|
||||||
|
"pleaseChooseAtLeastChars": "Vänligen ange minst {min} tecken.",
|
||||||
|
"@pleaseChooseAtLeastChars": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {
|
||||||
|
"min": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"markAsRead": "Markera som läst",
|
||||||
|
"@markAsRead": {},
|
||||||
|
"setupChatBackup": "Konfigurera chatt-backup",
|
||||||
|
"@setupChatBackup": {},
|
||||||
|
"setupChatBackupDescription": "För att skydda dina meddelanden så det skapats en säkerhetsnyckel.\nFörvara nyckeln på ett säkert ställe, t ex med en lösenordshanterare.",
|
||||||
|
"@setupChatBackupDescription": {},
|
||||||
|
"commandHint_clearcache": "Rensa cache",
|
||||||
|
"@commandHint_clearcache": {
|
||||||
|
"type": "text",
|
||||||
|
"description": "Usage hint for the command /clearcache"
|
||||||
|
},
|
||||||
|
"newUsernameDescription": "Ditt användar-ID kommer att ha formatet @användarnamn:servernamn",
|
||||||
|
"@newUsernameDescription": {},
|
||||||
|
"openVideoCamera": "Aktivera kamera för video",
|
||||||
|
"@openVideoCamera": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"link": "Länk",
|
||||||
|
"@link": {},
|
||||||
|
"publish": "Publicera",
|
||||||
|
"@publish": {},
|
||||||
|
"unsubscribeStories": "Avprenumerera berättelser",
|
||||||
|
"@unsubscribeStories": {},
|
||||||
|
"replyHasBeenSent": "Svar har skickats",
|
||||||
|
"@replyHasBeenSent": {},
|
||||||
|
"videoWithSize": "Video ({size})",
|
||||||
|
"@videoWithSize": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {
|
||||||
|
"size": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"whatIsGoingOn": "Vad händer?",
|
||||||
|
"@whatIsGoingOn": {},
|
||||||
|
"addDescription": "Lägg till beskrivning",
|
||||||
|
"@addDescription": {},
|
||||||
|
"reportUser": "Rapportera användare",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Öppna Chatt",
|
||||||
|
"@openChat": {},
|
||||||
|
"yourUserId": "Ditt användar-ID:",
|
||||||
|
"@yourUserId": {},
|
||||||
|
"sendOnEnter": "Skicka med Enter",
|
||||||
|
"@sendOnEnter": {},
|
||||||
|
"iWroteDownTheKey": "Jag har antecknat nyckeln",
|
||||||
|
"@iWroteDownTheKey": {},
|
||||||
|
"addToStory": "Addera till berättelse",
|
||||||
|
"@addToStory": {},
|
||||||
|
"pleaseEnterValidEmail": "Vänligen ange en giltig e-postadress.",
|
||||||
|
"@pleaseEnterValidEmail": {},
|
||||||
|
"scanQrCode": "Skanna QR-kod",
|
||||||
|
"@scanQrCode": {},
|
||||||
|
"bubbleSize": "Storlek på bubbla",
|
||||||
|
"@bubbleSize": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"yourChatBackupHasBeenSetUp": "Din chatt-backup har konfigurerats.",
|
||||||
|
"@yourChatBackupHasBeenSetUp": {},
|
||||||
|
"loginWithOneClick": "Logga in med ett klick",
|
||||||
|
"@loginWithOneClick": {},
|
||||||
|
"typeInInviteLinkManually": "Skriv in länk med inbjudan manuellt...",
|
||||||
|
"@typeInInviteLinkManually": {},
|
||||||
|
"newPasswordDescription": "För att kunna återställa ditt lösenord så bör du vid tillfälle lägga till en e-postadress till ditt konto.",
|
||||||
|
"@newPasswordDescription": {},
|
||||||
|
"removeFromBundle": "Ta bort från paket",
|
||||||
|
"@removeFromBundle": {},
|
||||||
|
"enableMultiAccounts": "(BETA) Aktivera multi-konton på denna enhet",
|
||||||
|
"@enableMultiAccounts": {},
|
||||||
|
"removeFromSpaceDescription": "Detta raderar chatten från det nuvarande utrymmet. Chatten är fortfarande synlig under \"Alla chattar\".",
|
||||||
|
"@removeFromSpaceDescription": {},
|
||||||
|
"whoCanSeeMyStories": "Vem kan se mina berättelser?",
|
||||||
|
"@whoCanSeeMyStories": {},
|
||||||
|
"setupChatBackupNow": "Konfigurera din chatt-backup nu",
|
||||||
|
"@setupChatBackupNow": {},
|
||||||
|
"whoCanSeeMyStoriesDesc": "Notera att användare kan se och kontakta varandra i din berättelse.",
|
||||||
|
"@whoCanSeeMyStoriesDesc": {},
|
||||||
|
"thisUserHasNotPostedAnythingYet": "Den här användaren har inte lagt till något till deras berättelse än",
|
||||||
|
"@thisUserHasNotPostedAnythingYet": {},
|
||||||
|
"storyPrivacyWarning": "Notera att användare kan se och kontakta varandra i din berättelse. Din berättelse är synlig i 24 timmar, men det finns ingen garanti för att berättelser raderas från alla enheter och servrar.",
|
||||||
|
"@storyPrivacyWarning": {}
|
||||||
}
|
}
|
||||||
|
@ -2727,5 +2727,9 @@
|
|||||||
"dismiss": "Kapat",
|
"dismiss": "Kapat",
|
||||||
"@dismiss": {},
|
"@dismiss": {},
|
||||||
"markAsRead": "Okundu olarak işaretle",
|
"markAsRead": "Okundu olarak işaretle",
|
||||||
"@markAsRead": {}
|
"@markAsRead": {},
|
||||||
|
"reportUser": "Kullanıcıyı bildir",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Sohbeti Aç",
|
||||||
|
"@openChat": {}
|
||||||
}
|
}
|
||||||
|
@ -2722,5 +2722,9 @@
|
|||||||
"dismiss": "Відхилити",
|
"dismiss": "Відхилити",
|
||||||
"@dismiss": {},
|
"@dismiss": {},
|
||||||
"markAsRead": "Позначити прочитаним",
|
"markAsRead": "Позначити прочитаним",
|
||||||
"@markAsRead": {}
|
"@markAsRead": {},
|
||||||
|
"reportUser": "Поскаржився на користувача",
|
||||||
|
"@reportUser": {},
|
||||||
|
"openChat": "Відкрити бесіду",
|
||||||
|
"@openChat": {}
|
||||||
}
|
}
|
||||||
|
@ -2729,5 +2729,7 @@
|
|||||||
"markAsRead": "标为已读",
|
"markAsRead": "标为已读",
|
||||||
"@markAsRead": {},
|
"@markAsRead": {},
|
||||||
"reportUser": "举报用户",
|
"reportUser": "举报用户",
|
||||||
"@reportUser": {}
|
"@reportUser": {},
|
||||||
|
"openChat": "打开聊天",
|
||||||
|
"@openChat": {}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,6 @@ abstract class FluffyThemes {
|
|||||||
colorScheme: ThemeData.light().colorScheme.copyWith(
|
colorScheme: ThemeData.light().colorScheme.copyWith(
|
||||||
primary: AppConfig.chatColor,
|
primary: AppConfig.chatColor,
|
||||||
secondary: AppConfig.chatColor,
|
secondary: AppConfig.chatColor,
|
||||||
secondaryVariant: AppConfig.secondaryColor,
|
|
||||||
surface: FluffyThemes.lighten(AppConfig.chatColor, 0.535),
|
surface: FluffyThemes.lighten(AppConfig.chatColor, 0.535),
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
@ -133,7 +132,6 @@ abstract class FluffyThemes {
|
|||||||
colorScheme: ThemeData.dark().colorScheme.copyWith(
|
colorScheme: ThemeData.dark().colorScheme.copyWith(
|
||||||
primary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
|
primary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
|
||||||
secondary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
|
secondary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
|
||||||
secondaryVariant: AppConfig.secondaryColor,
|
|
||||||
surface: FluffyThemes.darken(AppConfig.chatColor, 0.35),
|
surface: FluffyThemes.darken(AppConfig.chatColor, 0.35),
|
||||||
),
|
),
|
||||||
secondaryHeaderColor: Colors.blueGrey.shade900,
|
secondaryHeaderColor: Colors.blueGrey.shade900,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -35,12 +36,25 @@ class AddStoryController extends State<AddStoryPage> {
|
|||||||
|
|
||||||
bool get hasMedia => image != null || video != null;
|
bool get hasMedia => image != null || video != null;
|
||||||
|
|
||||||
void updateColors() => hasMedia
|
bool hasText = false;
|
||||||
? null
|
|
||||||
: setState(() {
|
Timer? _updateColorsCooldown;
|
||||||
backgroundColor = controller.text.color;
|
|
||||||
backgroundColorDark = controller.text.darkColor;
|
void updateColors() {
|
||||||
});
|
if (hasText != controller.text.isNotEmpty) {
|
||||||
|
setState(() {
|
||||||
|
hasText = controller.text.isNotEmpty;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_updateColorsCooldown?.cancel();
|
||||||
|
_updateColorsCooldown = Timer(
|
||||||
|
const Duration(seconds: 3),
|
||||||
|
() => setState(() {
|
||||||
|
backgroundColor = controller.text.color;
|
||||||
|
backgroundColorDark = controller.text.darkColor;
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void importMedia() async {
|
void importMedia() async {
|
||||||
final picked = await FilePickerCross.importFromStorage(
|
final picked = await FilePickerCross.importFromStorage(
|
||||||
@ -88,6 +102,11 @@ class AddStoryController extends State<AddStoryPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset() => setState(() {
|
||||||
|
image = video = null;
|
||||||
|
controller.clear();
|
||||||
|
});
|
||||||
|
|
||||||
void postStory() async {
|
void postStory() async {
|
||||||
if (video == null && image == null && controller.text.isEmpty) return;
|
if (video == null && image == null && controller.text.isEmpty) return;
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
@ -150,7 +169,6 @@ class AddStoryController extends State<AddStoryPage> {
|
|||||||
backgroundColorDark = text.darkColor;
|
backgroundColorDark = text.darkColor;
|
||||||
|
|
||||||
final shareContent = Matrix.of(context).shareContent;
|
final shareContent = Matrix.of(context).shareContent;
|
||||||
// ignore: unnecessary_null_comparison
|
|
||||||
if (shareContent != null) {
|
if (shareContent != null) {
|
||||||
final shareFile = shareContent.tryGet<MatrixFile>('file')?.detectFileType;
|
final shareFile = shareContent.tryGet<MatrixFile>('file')?.detectFileType;
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:video_player/video_player.dart';
|
import 'package:video_player/video_player.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
|
||||||
import 'add_story.dart';
|
import 'add_story.dart';
|
||||||
|
|
||||||
class AddStoryView extends StatelessWidget {
|
class AddStoryView extends StatelessWidget {
|
||||||
@ -34,24 +33,13 @@ class AddStoryView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: controller.hasMedia
|
actions: [
|
||||||
? null
|
if (controller.hasMedia)
|
||||||
: [
|
IconButton(
|
||||||
IconButton(
|
icon: const Icon(Icons.delete_outlined),
|
||||||
icon: const Icon(Icons.photo_outlined),
|
onPressed: controller.reset,
|
||||||
onPressed: controller.importMedia,
|
),
|
||||||
),
|
],
|
||||||
if (PlatformInfos.isMobile)
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.camera_alt_outlined),
|
|
||||||
onPressed: controller.capturePhoto,
|
|
||||||
),
|
|
||||||
if (PlatformInfos.isMobile)
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.video_camera_back_outlined),
|
|
||||||
onPressed: controller.captureVideo,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: Stack(
|
body: Stack(
|
||||||
@ -104,7 +92,7 @@ class AddStoryView extends StatelessWidget {
|
|||||||
? null
|
? null
|
||||||
: Colors.black.withOpacity(0.5),
|
: Colors.black.withOpacity(0.5),
|
||||||
),
|
),
|
||||||
onEditingComplete: controller.updateColors,
|
onChanged: (_) => controller.updateColors(),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintText: controller.hasMedia
|
hintText: controller.hasMedia
|
||||||
@ -123,12 +111,42 @@ class AddStoryView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
floatingActionButton: Column(
|
||||||
onPressed: controller.postStory,
|
mainAxisSize: MainAxisSize.min,
|
||||||
label: Text(L10n.of(context)!.publish),
|
children: [
|
||||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
FloatingActionButton(
|
||||||
foregroundColor: Theme.of(context).colorScheme.onSurface,
|
onPressed: controller.captureVideo,
|
||||||
icon: const Icon(Icons.send_rounded),
|
backgroundColor: controller.backgroundColorDark,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
heroTag: null,
|
||||||
|
child: const Icon(Icons.video_camera_front_outlined),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
FloatingActionButton(
|
||||||
|
onPressed: controller.capturePhoto,
|
||||||
|
backgroundColor: controller.backgroundColorDark,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
heroTag: null,
|
||||||
|
child: const Icon(Icons.camera_alt_outlined),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
FloatingActionButton(
|
||||||
|
onPressed: controller.importMedia,
|
||||||
|
backgroundColor: controller.backgroundColorDark,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
heroTag: null,
|
||||||
|
child: const Icon(Icons.photo_outlined),
|
||||||
|
),
|
||||||
|
if (controller.hasMedia || controller.hasText) ...[
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
FloatingActionButton(
|
||||||
|
onPressed: controller.postStory,
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
|
foregroundColor: Theme.of(context).colorScheme.onSurface,
|
||||||
|
child: const Icon(Icons.send_rounded),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user