Compare commits
59 Commits
3.3.0+148
...
9d03faf594
| Author | SHA1 | Date | |
|---|---|---|---|
|
9d03faf594
|
|||
|
fd79c11d18
|
|||
|
c4ac256896
|
|||
|
c1fc8ea3fe
|
|||
|
29574ada88
|
|||
|
7369f5d88c
|
|||
|
5b3c138ebe
|
|||
|
562bdf62e9
|
|||
|
a73672925e
|
|||
|
c585522c35
|
|||
|
6aba84e506
|
|||
|
c6f104afc7
|
|||
|
4181fd0090
|
|||
|
84bca9601a
|
|||
|
31b83b2d27
|
|||
|
dfcb089c69
|
|||
|
fe365e8c6d
|
|||
|
b5262137ad
|
|||
|
11e93314c7
|
|||
|
c8658bc0ca
|
|||
|
b2f689693b
|
|||
|
33ec0b1d9a
|
|||
|
f698385494
|
|||
|
6ecdf89d20
|
|||
|
683f686540
|
|||
|
6a115ab1cc
|
|||
|
d05283d3b1
|
|||
|
b9653e7264
|
|||
|
87d1c8b320
|
|||
|
22eb54b61f
|
|||
|
a90ad2debc
|
|||
|
2f00bf660d
|
|||
|
322a93324c
|
|||
|
c3a3be0807
|
|||
|
27c7c8f039
|
|||
|
a7960da362
|
|||
|
64ab30b0a9
|
|||
|
935e6d5833
|
|||
|
938b128b1e
|
|||
|
c9764daa20
|
|||
|
7bc44e8f06
|
|||
|
4a7ff96a8b
|
|||
|
e759d5f46c
|
|||
|
f5ca6a37bf
|
|||
|
5fc8859f3b
|
|||
|
e30e7adbe2
|
|||
|
68be4db160
|
|||
|
aa91e376ca
|
|||
|
caffb85588
|
|||
|
521b192205
|
|||
|
77ac0428ea
|
|||
|
88c8227c66
|
|||
|
b20d8350a8
|
|||
|
98b27bed0e
|
|||
|
3a7d8b1a0d
|
|||
|
b4801d6af6
|
|||
|
aab5b957af
|
|||
|
43d706a184
|
|||
|
98df275f88
|
File diff suppressed because it is too large
Load Diff
@@ -164,8 +164,6 @@
|
|||||||
"checkInResultLevel3": "Good Luck",
|
"checkInResultLevel3": "Good Luck",
|
||||||
"checkInResultLevel4": "Best Luck",
|
"checkInResultLevel4": "Best Luck",
|
||||||
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
||||||
"eventCalander": "Event Calander",
|
|
||||||
"eventCalanderEmpty": "No events on that day.",
|
|
||||||
"fortuneGraph": "Fortune Trend",
|
"fortuneGraph": "Fortune Trend",
|
||||||
"noFortuneData": "No fortune data available for this month.",
|
"noFortuneData": "No fortune data available for this month.",
|
||||||
"creatorHub": "Creator Hub",
|
"creatorHub": "Creator Hub",
|
||||||
@@ -752,21 +750,6 @@
|
|||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
"markAsSensitive": "Mark as Sensitive",
|
"markAsSensitive": "Mark as Sensitive",
|
||||||
"fileName": "File name",
|
"fileName": "File name",
|
||||||
"sensitiveCategories": {
|
|
||||||
"language": "Language",
|
|
||||||
"sexualContent": "Sexual Content",
|
|
||||||
"violence": "Violence",
|
|
||||||
"profanity": "Profanity",
|
|
||||||
"hateSpeech": "Hate Speech",
|
|
||||||
"racism": "Racism",
|
|
||||||
"adultContent": "Adult Content",
|
|
||||||
"drugAbuse": "Drug Abuse",
|
|
||||||
"alcoholAbuse": "Alcohol Abuse",
|
|
||||||
"gambling": "Gambling",
|
|
||||||
"selfHarm": "Self-harm",
|
|
||||||
"childAbuse": "Child Abuse",
|
|
||||||
"other": "Other"
|
|
||||||
},
|
|
||||||
"poll": "Poll",
|
"poll": "Poll",
|
||||||
"pollsRecent": "Recent Polls",
|
"pollsRecent": "Recent Polls",
|
||||||
"pollCreateNew": "Create New",
|
"pollCreateNew": "Create New",
|
||||||
@@ -1075,5 +1058,421 @@
|
|||||||
"deleteRecycledFiles": "Delete Recycled Files",
|
"deleteRecycledFiles": "Delete Recycled Files",
|
||||||
"recycledFilesDeleted": "Recycled files deleted successfully",
|
"recycledFilesDeleted": "Recycled files deleted successfully",
|
||||||
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
||||||
"upload": "Upload"
|
"upload": "Upload",
|
||||||
|
"deleteMessage": "Delete Message",
|
||||||
|
"deleteMessageConfirmation": "Are you sure you want to delete this message?",
|
||||||
|
"customReaction": "Custom Reaction",
|
||||||
|
"customReactions": "Custom Reactions",
|
||||||
|
"stickerPlaceholder": "Sticker Placeholder",
|
||||||
|
"reactionAttitude": "Reaction Attitude",
|
||||||
|
"addReaction": "Add Reaction",
|
||||||
|
"eventCalendar": "Event Calendar",
|
||||||
|
"eventCalendarEmpty": "No events on that day.",
|
||||||
|
"walletStats": "Wallet Statistics",
|
||||||
|
"totalTransactions": "Total Transactions",
|
||||||
|
"totalOrders": "Total Orders",
|
||||||
|
"totalIncome": "Total Income",
|
||||||
|
"totalOutgoing": "Total Outgoing",
|
||||||
|
"netBalance": "Net Balance",
|
||||||
|
"messageUpdateLinks": "Server generated links previews",
|
||||||
|
"messageUpdateEdited": "Edited a message",
|
||||||
|
"settingsCardBackgroundOpacity": "Card Background Opacity",
|
||||||
|
"settingsThemeMode": "Theme Mode",
|
||||||
|
"settingsThemeModeSystem": "System",
|
||||||
|
"settingsThemeModeLight": "Light",
|
||||||
|
"settingsThemeModeDark": "Dark",
|
||||||
|
"enterPin": "Enter your PIN code",
|
||||||
|
"chatReplyingTo": "Replying to {}",
|
||||||
|
"chatForwarding": "Forwarding message",
|
||||||
|
"chatEditing": "Editing message",
|
||||||
|
"chatNoContent": "No content",
|
||||||
|
"sensitiveCategories": {
|
||||||
|
"language": "Language",
|
||||||
|
"sexualContent": "Sexual Content",
|
||||||
|
"violence": "Violence",
|
||||||
|
"profanity": "Profanity",
|
||||||
|
"hateSpeech": "Hate Speech",
|
||||||
|
"racism": "Racism",
|
||||||
|
"adultContent": "Adult Content",
|
||||||
|
"drugAbuse": "Drug Abuse",
|
||||||
|
"alcoholAbuse": "Alcohol Abuse",
|
||||||
|
"gambling": "Gambling",
|
||||||
|
"selfHarm": "Self-harm",
|
||||||
|
"childAbuse": "Child Abuse",
|
||||||
|
"other": "Other"
|
||||||
|
},
|
||||||
|
"Searching...": "Searching...",
|
||||||
|
"searchError": "Search failed. Please try again.",
|
||||||
|
"tryDifferentKeywords": "Try different keywords or remove search filters",
|
||||||
|
"settingsWindowOpacity": "Window Opacity",
|
||||||
|
"messageContent": "Message Content",
|
||||||
|
"updateAvailable": "Update available",
|
||||||
|
"noChangelogProvided": "No changelog provided.",
|
||||||
|
"useSecondarySourceForDownload": "Use secondary source for download",
|
||||||
|
"installUpdate": "Install update",
|
||||||
|
"openReleasePage": "Open release page",
|
||||||
|
"postCompose": "Compose Post",
|
||||||
|
"postPublish": "Publish Post",
|
||||||
|
"restoreDraftTitle": "Restore Draft",
|
||||||
|
"restoreDraftMessage": "A draft was found. Do you want to restore it?",
|
||||||
|
"draft": "Draft",
|
||||||
|
"purchaseGift": "Purchase Gift",
|
||||||
|
"selectRecipient": "Select Recipient",
|
||||||
|
"changeRecipient": "Change Recipient",
|
||||||
|
"addMessage": "Add Message",
|
||||||
|
"skipRecipient": "Skip Recipient",
|
||||||
|
"giftSubscriptions": "Gift Subscriptions",
|
||||||
|
"purchaseAGift": "Purchase a Gift",
|
||||||
|
"redeemAGift": "Redeem a Gift",
|
||||||
|
"giftHistory": "Gift History",
|
||||||
|
"sentGifts": "Sent Gifts",
|
||||||
|
"receivedGifts": "Received Gifts",
|
||||||
|
"noSentGifts": "No sent gifts",
|
||||||
|
"noReceivedGifts": "No received gifts",
|
||||||
|
"stellarGift": "Stellar Gift",
|
||||||
|
"novaGift": "Nova Gift",
|
||||||
|
"supernovaGift": "Supernova Gift",
|
||||||
|
"sameAsMembership": "Same as membership",
|
||||||
|
"enterGiftCodeToRedeem": "Enter gift code to redeem",
|
||||||
|
"enterGiftCode": "Enter gift code",
|
||||||
|
"giftPurchased": "Gift Purchased!",
|
||||||
|
"shareCodeWithRecipient": "Share this code with the recipient to redeem the gift.",
|
||||||
|
"openGiftAnyoneCanRedeem": "This is an open gift that anyone can redeem.",
|
||||||
|
"ok": "OK",
|
||||||
|
"selectedRecipient": "Selected recipient",
|
||||||
|
"noRecipientSelected": "No recipient selected",
|
||||||
|
"thisWillBeAnOpenGift": "This will be an open gift",
|
||||||
|
"personalMessage": "Personal Message",
|
||||||
|
"addPersonalMessageForRecipient": "Add a personal message for the recipient",
|
||||||
|
"giftStatusCreated": "Created",
|
||||||
|
"giftStatusSent": "Sent",
|
||||||
|
"giftStatusRedeemed": "Redeemed",
|
||||||
|
"giftStatusCancelled": "Cancelled",
|
||||||
|
"giftStatusExpired": "Expired",
|
||||||
|
"giftStatusUnknown": "Unknown",
|
||||||
|
"giftCodeCopiedToClipboard": "Gift code copied to clipboard",
|
||||||
|
"codeLabel": "Code: ",
|
||||||
|
"subscriptionLabel": "Subscription: ",
|
||||||
|
"toLabel": "To: ",
|
||||||
|
"fromLabel": "From: ",
|
||||||
|
"messageLabel": "Message: ",
|
||||||
|
"giftRedeemed": "Gift Redeemed!",
|
||||||
|
"giftRedeemedSuccessfully": "You have successfully redeemed the gift. Your new subscription is now active.",
|
||||||
|
"cancelGift": "Cancel Gift",
|
||||||
|
"cancelGiftConfirm": "Are you sure you want to cancel this gift? This action cannot be undone.",
|
||||||
|
"giftCancelledSuccessfully": "Gift cancelled successfully",
|
||||||
|
"createFund": "Create Fund",
|
||||||
|
"fundAmount": "Fund Amount",
|
||||||
|
"enterAmount": "Enter Amount",
|
||||||
|
"selectCurrency": "Select Currency",
|
||||||
|
"splitType": "Split Type",
|
||||||
|
"evenSplit": "Even Split",
|
||||||
|
"equalAmountEach": "Equal amount for each recipient",
|
||||||
|
"randomSplit": "Random Split",
|
||||||
|
"randomAmountEach": "Random amount for each recipient",
|
||||||
|
"recipientCount": "Recipient Count",
|
||||||
|
"numberOfRecipients": "Number of Recipients",
|
||||||
|
"addPersonalMessageForRecipients": "Add a personal message for recipients",
|
||||||
|
"invalidAmount": "Invalid amount",
|
||||||
|
"invalidRecipientCount": "Invalid recipient count",
|
||||||
|
"fundOverview": "Fund Overview",
|
||||||
|
"totalFundsSent": "Total Funds Sent",
|
||||||
|
"totalFundsReceived": "Total Funds Received",
|
||||||
|
"transactions": "Transactions",
|
||||||
|
"myFunds": "My Funds",
|
||||||
|
"availableFunds": "Available Funds",
|
||||||
|
"fundStatusCreated": "Created",
|
||||||
|
"fundStatusPartial": "Partially Claimed",
|
||||||
|
"fundStatusCompleted": "Fully Claimed",
|
||||||
|
"fundStatusExpired": "Expired",
|
||||||
|
"fundStatusUnknown": "Unknown",
|
||||||
|
"recipients": "Recipients",
|
||||||
|
"fundClaimedSuccessfully": "Fund claimed successfully!",
|
||||||
|
"claim": "Claim",
|
||||||
|
"noFundsCreated": "No funds created yet",
|
||||||
|
"createYourFirstFund": "Create your first fund to get started",
|
||||||
|
"noAvailableFunds": "No available funds",
|
||||||
|
"fundsWillAppearHere": "Funds you can claim will appear here",
|
||||||
|
"fundCreatedSuccessfully": "Fund created successfully!",
|
||||||
|
"selectRecipients": "Select Recipients",
|
||||||
|
"noRecipientsSelected": "No recipients selected",
|
||||||
|
"selectRecipientsToSendFund": "Select recipients to send the fund to",
|
||||||
|
"addRecipient": "Add Recipient",
|
||||||
|
"addMoreRecipients": "Add More Recipients",
|
||||||
|
"transactionDetails": "Transaction Details",
|
||||||
|
"remarks": "Remarks",
|
||||||
|
"payer": "Payer",
|
||||||
|
"payee": "Payee",
|
||||||
|
"transactionType": "Transaction Type",
|
||||||
|
"transfer": "Transfer",
|
||||||
|
"payment": "Payment",
|
||||||
|
"systemWallet": "System Wallet",
|
||||||
|
"date": "Date",
|
||||||
|
"createTransfer": "Create Transfer",
|
||||||
|
"transferAmount": "Transfer Amount",
|
||||||
|
"selectPayee": "Select Payee",
|
||||||
|
"selectedPayee": "Selected Payee",
|
||||||
|
"noPayeeSelected": "No payee selected",
|
||||||
|
"selectPayeeToTransfer": "Select payee to transfer to",
|
||||||
|
"addRemark": "Add Remark",
|
||||||
|
"transferRemark": "Transfer Remark",
|
||||||
|
"addRemarkForTransfer": "Add remark for transfer",
|
||||||
|
"enterPinToConfirmTransfer": "Enter your 6-digit PIN to confirm transfer",
|
||||||
|
"transferCreatedSuccessfully": "Transfer created successfully!",
|
||||||
|
"postUpdate": "Update",
|
||||||
|
"fileMetadata": "File Metadata",
|
||||||
|
"resend": "Resend",
|
||||||
|
"fileInfoTitle": "File Information",
|
||||||
|
"download": "Download",
|
||||||
|
"info": "Info",
|
||||||
|
"noStickers": "No Stickers",
|
||||||
|
"noStickersInPack": "This pack does not contains stickers",
|
||||||
|
"noStickerPacks": "No Sticker Packs",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"spoiler": "Spoiler",
|
||||||
|
"activityHeatmap": "Activity Heatmap",
|
||||||
|
"custom": "Custom",
|
||||||
|
"usernameColor": "Username Color",
|
||||||
|
"colorType": "Color Type",
|
||||||
|
"plain": "Plain",
|
||||||
|
"gradient": "Gradient",
|
||||||
|
"colorValue": "Color Value",
|
||||||
|
"gradientDirection": "Gradient Direction",
|
||||||
|
"gradientDirectionToRight": "To Right",
|
||||||
|
"gradientDirectionToLeft": "To Left",
|
||||||
|
"gradientDirectionToBottom": "To Bottom",
|
||||||
|
"gradientDirectionToTop": "To Top",
|
||||||
|
"gradientDirectionToBottomRight": "To Bottom Right",
|
||||||
|
"gradientDirectionToBottomLeft": "To Bottom Left",
|
||||||
|
"gradientDirectionToTopRight": "To Top Right",
|
||||||
|
"gradientDirectionToTopLeft": "To Top Left",
|
||||||
|
"gradientColors": "Gradient Colors",
|
||||||
|
"color": "Color",
|
||||||
|
"addColor": "Add Color",
|
||||||
|
"availableWithYourPlan": "Available with your plan",
|
||||||
|
"upgradeRequired": "Upgrade required",
|
||||||
|
"settingsDisableAnimation": "Disable Animation",
|
||||||
|
"addTag": "Add Tag",
|
||||||
|
"accountConnectionProviderSpotify": "Spotify",
|
||||||
|
"accountConnectionProviderSteam": "Steam",
|
||||||
|
"timezoneNotFound": "Time zone not found",
|
||||||
|
"awardPoints": "Awarded {} points",
|
||||||
|
"postFeaturedOn": "Post featured on {}",
|
||||||
|
"messageSentAt": "Sent at {}",
|
||||||
|
"myTickets": "My Tickets",
|
||||||
|
"drawHistory": "Draw History",
|
||||||
|
"lottery": "Lottery",
|
||||||
|
"noLotteryTickets": "No lottery tickets yet",
|
||||||
|
"buyYourFirstTicket": "Buy your first lottery ticket to get started!",
|
||||||
|
"buyTicket": "Buy Ticket",
|
||||||
|
"ticketNumbers": "Numbers: {}, Special: {}",
|
||||||
|
"cost": "Cost",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"prizeWon": "Prize Won",
|
||||||
|
"pending": "Pending",
|
||||||
|
"drawn": "Drawn",
|
||||||
|
"won": "Won",
|
||||||
|
"lost": "Lost",
|
||||||
|
"noDrawHistory": "No draw history yet",
|
||||||
|
"buyLotteryTicket": "Buy Lottery Ticket",
|
||||||
|
"selectNumbers": "Select Numbers",
|
||||||
|
"select5UniqueNumbers": "Select 5 unique numbers",
|
||||||
|
"selectSpecialNumber": "Select Special Number",
|
||||||
|
"selectMultiplier": "Select Multiplier",
|
||||||
|
"baseCost": "Base Cost",
|
||||||
|
"totalCost": "Total Cost",
|
||||||
|
"prizeStructure": "Prize Structure",
|
||||||
|
"enterPinToConfirmPurchase": "Enter your PIN to confirm purchase",
|
||||||
|
"ticketPurchasedSuccessfully": "Ticket purchased successfully!",
|
||||||
|
"winningNumbers": "Winning Numbers",
|
||||||
|
"specialNumber": "Special Number",
|
||||||
|
"totalTickets": "Total Tickets",
|
||||||
|
"totalWinners": "Total Winners",
|
||||||
|
"prizePool": "Prize Pool",
|
||||||
|
"enterPinToConfirmPayment": "Enter your PIN code to confirm payment",
|
||||||
|
"purchase": "Purchase",
|
||||||
|
"multiplierLabel": "Multiplier",
|
||||||
|
"specialOnly": "Special Only",
|
||||||
|
"matches": "Matches",
|
||||||
|
"thoughtDefaultTopic": "Reflection",
|
||||||
|
"thoughtAiName": "SN-chan",
|
||||||
|
"thoughtUserName": "You",
|
||||||
|
"thoughtStreamingHint": "Sn-chan is thinking...",
|
||||||
|
"thoughtInputHint": "Ask sn-chan anything...",
|
||||||
|
"thoughtNewConversation": "Start New Conversation",
|
||||||
|
"thoughtParseError": "Failed to parse AI response",
|
||||||
|
"thoughtFunctionCall": "Use {}",
|
||||||
|
"aiThought": "AI Thought",
|
||||||
|
"aiThoughtTitle": "Let sn-chan think",
|
||||||
|
"postReferenceUnavailable": "Referenced post is unavailable",
|
||||||
|
"fabLocation": "FAB Location",
|
||||||
|
"activities": "Activities",
|
||||||
|
"presenceTypeGaming": "Playing",
|
||||||
|
"presenceTypeMusic": "Listening to Music",
|
||||||
|
"presenceTypeWorkout": "Working out",
|
||||||
|
"articleCompose": "Compose Article",
|
||||||
|
"backToHub": "Back to Hub",
|
||||||
|
"advancedFilters": "Advanced Filters",
|
||||||
|
"searchPosts": "Search Posts",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"fromDate": "From Date",
|
||||||
|
"toDate": "To Date",
|
||||||
|
"popularity": "Popularity",
|
||||||
|
"descendingOrder": "Descending Order",
|
||||||
|
"selectDate": "Select Date",
|
||||||
|
"pinnedPosts": "Pinned Posts",
|
||||||
|
"customReactionHint": "Custom Reaction allow you to use user uploaded stickers as the symbol of the reaction for the post. Exclusive for Stellar Program members.",
|
||||||
|
"publicationSites": "Publication Sites",
|
||||||
|
"uploadTasks": "Upload Tasks",
|
||||||
|
"thoughtFunctionCallBegin": "Calling tool {}",
|
||||||
|
"thoughtFunctionCallFinish": "{} responded",
|
||||||
|
"thoughtUnpaidHint": "Thinking unavaiable due to unpaid orders",
|
||||||
|
"more": "More",
|
||||||
|
"collapse": "Collapse",
|
||||||
|
"pollConfirmDiscard": "Are you sure you want to leave? All the poll data you're editing will not be saved.",
|
||||||
|
"discard": "Discard",
|
||||||
|
"fund": "Fund",
|
||||||
|
"fundsRecent": "Recent Funds",
|
||||||
|
"fundCreateNew": "Create New",
|
||||||
|
"fundCreateNewHint": "Create a new fund for your message. Select recipients and amount.",
|
||||||
|
"amountOfSplits": "Amount of Splits",
|
||||||
|
"enterNumberOfSplits": "Enter Splits Amount",
|
||||||
|
"orCreateWith": "Or\ncreate with",
|
||||||
|
"unindexedFiles": "Unindexed files",
|
||||||
|
"folder": "Folder",
|
||||||
|
"clearCompleted": "Clear Completed",
|
||||||
|
"uploadSuccess": "Upload successful!",
|
||||||
|
"wouldYouLikeToViewFile": "Would you like to view the file?",
|
||||||
|
"contentCantEmpty": "Content cannot be empty",
|
||||||
|
"features": "Features",
|
||||||
|
"unnamed": "Unnamed",
|
||||||
|
"fundEnvelopeLoadFailed": "Failed to load fund envelope",
|
||||||
|
"fundEnvelope": "Fund Envelope",
|
||||||
|
"fundEnvelopeRemaining": "Remaining: {} {}",
|
||||||
|
"fundEnvelopeSplit": "Split: {}",
|
||||||
|
"fundEnvelopeSplitEvenly": "Evenly",
|
||||||
|
"fundEnvelopeSplitRandomly": "Randomly",
|
||||||
|
"fundEnvelopeClaimSuccess": "Fund claimed successfully!",
|
||||||
|
"fundEnvelopeStatusCreated": "Created",
|
||||||
|
"fundEnvelopeStatusPartial": "Partially Claimed",
|
||||||
|
"fundEnvelopeStatusCompleted": "Fully Claimed",
|
||||||
|
"fundEnvelopeStatusExpired": "Expired",
|
||||||
|
"fundEnvelopeStatusUnknown": "Unknown",
|
||||||
|
"fundEnvelopeRecipients": "Recipients ({}/{} claimed)",
|
||||||
|
"fundEnvelopeExpiredDaysAgo": {
|
||||||
|
"one": "Expired {} day ago",
|
||||||
|
"other": "Expired {} days ago"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresSoon": "Expires soon",
|
||||||
|
"fundEnvelopeExpiresInHours": {
|
||||||
|
"one": "Expires in {} hour",
|
||||||
|
"other": "Expires in {} hours"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresInDays": {
|
||||||
|
"one": "Expires in {} day",
|
||||||
|
"other": "Expires in {} days"
|
||||||
|
},
|
||||||
|
"fundEnvelopeRemainingWithSplits": "{} {} / {} splits",
|
||||||
|
"fundEnvelopeUnknownUser": "Unknown User",
|
||||||
|
"deleteSite": "Delete Site",
|
||||||
|
"deleteSiteConfirm": "Are you sure you want to delete this site?",
|
||||||
|
"siteDeletedSuccess": "Site deleted successfully",
|
||||||
|
"siteSlug": "Slug",
|
||||||
|
"siteSlugHint": "my-site",
|
||||||
|
"siteSlugRequired": "Please enter a slug",
|
||||||
|
"siteSlugInvalid": "Slug can only contain lowercase letters, numbers, and dashes",
|
||||||
|
"siteName": "Site Name",
|
||||||
|
"siteNameHint": "My Publication Site",
|
||||||
|
"siteNameRequired": "Please enter a site name",
|
||||||
|
"siteMode": "Mode",
|
||||||
|
"siteModeFullyManaged": "Fully Managed",
|
||||||
|
"siteModeSelfManaged": "Self-Managed",
|
||||||
|
"editPublicationSite": "Edit Publication Site",
|
||||||
|
"deletePublicationSite": "Delete Publication Site",
|
||||||
|
"publicationSiteSavedSuccess": "Publication site saved successfully",
|
||||||
|
"publicationSiteDeleteConfirm": "Are you sure you want to delete this publication site? This action cannot be undone.",
|
||||||
|
"publicationSiteDeletedSuccess": "Publication site deleted successfully",
|
||||||
|
"newPublicationSite": "New Publication Site",
|
||||||
|
"siteDetails": "Site Details",
|
||||||
|
"siteInformation": "Site Information",
|
||||||
|
"siteDomain": "Domain",
|
||||||
|
"siteCreated": "Created",
|
||||||
|
"siteUpdated": "Updated",
|
||||||
|
"failedToLoadSite": "Failed to load site",
|
||||||
|
"sitePages": "Pages",
|
||||||
|
"noPagesYet": "No pages yet",
|
||||||
|
"createFirstPage": "Create your first page to get started",
|
||||||
|
"failedToLoadPages": "Failed to load pages",
|
||||||
|
"fileManagement": "File Management",
|
||||||
|
"siteFiles": "Files",
|
||||||
|
"siteFolder": "Folder",
|
||||||
|
"siteRoot": "Root",
|
||||||
|
"noFilesUploadedYet": "No files uploaded yet",
|
||||||
|
"uploadFirstFile": "Upload your first file to get started",
|
||||||
|
"failedToLoadFiles": "Failed to load files",
|
||||||
|
"noFilesFoundInFolder": "No files found in the selected folder",
|
||||||
|
"fileActions": "File Actions",
|
||||||
|
"purgeFiles": "Purge Files",
|
||||||
|
"purgeFilesDescription": "Remove all uploaded files from the site",
|
||||||
|
"deploySite": "Deploy Site",
|
||||||
|
"deploySiteDescription": "Upload and deploy a new version from ZIP archive",
|
||||||
|
"confirmPurge": "Confirm Purge",
|
||||||
|
"purgeFilesConfirm": "This will permanently delete all files uploaded to this site. This action cannot be undone. Are you sure you want to continue?",
|
||||||
|
"purgeAllFiles": "Purge All Files",
|
||||||
|
"allFilesPurgedSuccess": "All files purged successfully",
|
||||||
|
"failedToPurgeFiles": "Failed to purge files: {}",
|
||||||
|
"siteDeployedSuccess": "Site deployed successfully",
|
||||||
|
"failedToDeploySite": "Failed to deploy site: {}",
|
||||||
|
"createPage": "Create Page",
|
||||||
|
"editPage": "Edit Page",
|
||||||
|
"pageType": "Page Type",
|
||||||
|
"htmlPage": "HTML Page",
|
||||||
|
"redirectPage": "Redirect Page",
|
||||||
|
"pageTypeRequired": "Please select a page type",
|
||||||
|
"pagePath": "Page Path",
|
||||||
|
"pagePathHint": "/about, /contact, etc.",
|
||||||
|
"pagePathRequired": "Please enter a page path",
|
||||||
|
"pagePathInvalid": "Page path can only contain letters, numbers, hyphens, underscores, and slashes",
|
||||||
|
"pagePathMustStartWithSlash": "Page path must start with /",
|
||||||
|
"pagePathNoConsecutiveSlashes": "Page path cannot have consecutive slashes",
|
||||||
|
"pageTitle": "Page Title",
|
||||||
|
"pageTitleHint": "About Us, Contact, etc.",
|
||||||
|
"pageTitleRequired": "Please enter a page title",
|
||||||
|
"pageContentHtml": "Page Content (HTML)",
|
||||||
|
"pageContentHint": "<h1>Hello World</h1><p>This is my page content...</p>",
|
||||||
|
"pageContentRequired": "Please enter HTML content for the page",
|
||||||
|
"redirectTarget": "Redirect Target",
|
||||||
|
"redirectTargetHint": "/new-page, https://example.com, etc.",
|
||||||
|
"redirectTargetRequired": "Please enter a redirect target",
|
||||||
|
"redirectTargetInvalid": "Target must be a relative path (/) or absolute URL (http/https)",
|
||||||
|
"deletePage": "Delete Page",
|
||||||
|
"deletePageConfirm": "Are you sure you want to delete this page?",
|
||||||
|
"savePage": "Save Page",
|
||||||
|
"pageCreatedSuccess": "Page created successfully",
|
||||||
|
"pageUpdatedSuccess": "Page updated successfully",
|
||||||
|
"pageDeletedSuccess": "Page deleted successfully",
|
||||||
|
"uploadFiles": "Upload Files",
|
||||||
|
"uploadPath": "Upload Path",
|
||||||
|
"uploadPathHint": "/ (root) or /assets/images/",
|
||||||
|
"uploadPathRequired": "Please enter an upload path",
|
||||||
|
"uploadPathMustStartWithSlash": "Path must start with /",
|
||||||
|
"uploadPathNoSpaces": "Path cannot contain spaces",
|
||||||
|
"uploadPathNoConsecutiveSlashes": "Path cannot have consecutive slashes",
|
||||||
|
"percentCompleted": "{}% completed",
|
||||||
|
"filesToUpload": "{} files to upload",
|
||||||
|
"fileSizeKb": "Size: {} KB",
|
||||||
|
"uploadingEllipsis": "Uploading...",
|
||||||
|
"uploadFilesCount": {
|
||||||
|
"one": "Upload {} File",
|
||||||
|
"other": "Upload {} Files"
|
||||||
|
},
|
||||||
|
"allUploadsCompleted": "All uploads completed",
|
||||||
|
"someUploadsFailed": "Some uploads failed",
|
||||||
|
"uploadingInProgress": "Uploading in progress",
|
||||||
|
"readyToUpload": "Ready to upload",
|
||||||
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
@@ -164,8 +164,6 @@
|
|||||||
"checkInResultLevel3": "Good Luck",
|
"checkInResultLevel3": "Good Luck",
|
||||||
"checkInResultLevel4": "Best Luck",
|
"checkInResultLevel4": "Best Luck",
|
||||||
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
||||||
"eventCalander": "Event Calander",
|
|
||||||
"eventCalanderEmpty": "No events on that day.",
|
|
||||||
"fortuneGraph": "Fortune Trend",
|
"fortuneGraph": "Fortune Trend",
|
||||||
"noFortuneData": "No fortune data available for this month.",
|
"noFortuneData": "No fortune data available for this month.",
|
||||||
"creatorHub": "Creator Hub",
|
"creatorHub": "Creator Hub",
|
||||||
@@ -752,21 +750,6 @@
|
|||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
"markAsSensitive": "Mark as Sensitive",
|
"markAsSensitive": "Mark as Sensitive",
|
||||||
"fileName": "File name",
|
"fileName": "File name",
|
||||||
"sensitiveCategories": {
|
|
||||||
"language": "Language",
|
|
||||||
"sexualContent": "Sexual Content",
|
|
||||||
"violence": "Violence",
|
|
||||||
"profanity": "Profanity",
|
|
||||||
"hateSpeech": "Hate Speech",
|
|
||||||
"racism": "Racism",
|
|
||||||
"adultContent": "Adult Content",
|
|
||||||
"drugAbuse": "Drug Abuse",
|
|
||||||
"alcoholAbuse": "Alcohol Abuse",
|
|
||||||
"gambling": "Gambling",
|
|
||||||
"selfHarm": "Self-harm",
|
|
||||||
"childAbuse": "Child Abuse",
|
|
||||||
"other": "Other"
|
|
||||||
},
|
|
||||||
"poll": "Poll",
|
"poll": "Poll",
|
||||||
"pollsRecent": "Recent Polls",
|
"pollsRecent": "Recent Polls",
|
||||||
"pollCreateNew": "Create New",
|
"pollCreateNew": "Create New",
|
||||||
@@ -1075,5 +1058,421 @@
|
|||||||
"deleteRecycledFiles": "Delete Recycled Files",
|
"deleteRecycledFiles": "Delete Recycled Files",
|
||||||
"recycledFilesDeleted": "Recycled files deleted successfully",
|
"recycledFilesDeleted": "Recycled files deleted successfully",
|
||||||
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
||||||
"upload": "Upload"
|
"upload": "Upload",
|
||||||
|
"deleteMessage": "Delete Message",
|
||||||
|
"deleteMessageConfirmation": "Are you sure you want to delete this message?",
|
||||||
|
"customReaction": "Custom Reaction",
|
||||||
|
"customReactions": "Custom Reactions",
|
||||||
|
"stickerPlaceholder": "Sticker Placeholder",
|
||||||
|
"reactionAttitude": "Reaction Attitude",
|
||||||
|
"addReaction": "Add Reaction",
|
||||||
|
"eventCalendar": "Event Calendar",
|
||||||
|
"eventCalendarEmpty": "No events on that day.",
|
||||||
|
"walletStats": "Wallet Statistics",
|
||||||
|
"totalTransactions": "Total Transactions",
|
||||||
|
"totalOrders": "Total Orders",
|
||||||
|
"totalIncome": "Total Income",
|
||||||
|
"totalOutgoing": "Total Outgoing",
|
||||||
|
"netBalance": "Net Balance",
|
||||||
|
"messageUpdateLinks": "Server generated links previews",
|
||||||
|
"messageUpdateEdited": "Edited a message",
|
||||||
|
"settingsCardBackgroundOpacity": "Card Background Opacity",
|
||||||
|
"settingsThemeMode": "Theme Mode",
|
||||||
|
"settingsThemeModeSystem": "System",
|
||||||
|
"settingsThemeModeLight": "Light",
|
||||||
|
"settingsThemeModeDark": "Dark",
|
||||||
|
"enterPin": "Enter your PIN code",
|
||||||
|
"chatReplyingTo": "Replying to {}",
|
||||||
|
"chatForwarding": "Forwarding message",
|
||||||
|
"chatEditing": "Editing message",
|
||||||
|
"chatNoContent": "No content",
|
||||||
|
"sensitiveCategories": {
|
||||||
|
"language": "Language",
|
||||||
|
"sexualContent": "Sexual Content",
|
||||||
|
"violence": "Violence",
|
||||||
|
"profanity": "Profanity",
|
||||||
|
"hateSpeech": "Hate Speech",
|
||||||
|
"racism": "Racism",
|
||||||
|
"adultContent": "Adult Content",
|
||||||
|
"drugAbuse": "Drug Abuse",
|
||||||
|
"alcoholAbuse": "Alcohol Abuse",
|
||||||
|
"gambling": "Gambling",
|
||||||
|
"selfHarm": "Self-harm",
|
||||||
|
"childAbuse": "Child Abuse",
|
||||||
|
"other": "Other"
|
||||||
|
},
|
||||||
|
"Searching...": "Searching...",
|
||||||
|
"searchError": "Search failed. Please try again.",
|
||||||
|
"tryDifferentKeywords": "Try different keywords or remove search filters",
|
||||||
|
"settingsWindowOpacity": "Window Opacity",
|
||||||
|
"messageContent": "Message Content",
|
||||||
|
"updateAvailable": "Update available",
|
||||||
|
"noChangelogProvided": "No changelog provided.",
|
||||||
|
"useSecondarySourceForDownload": "Use secondary source for download",
|
||||||
|
"installUpdate": "Install update",
|
||||||
|
"openReleasePage": "Open release page",
|
||||||
|
"postCompose": "Compose Post",
|
||||||
|
"postPublish": "Publish Post",
|
||||||
|
"restoreDraftTitle": "Restore Draft",
|
||||||
|
"restoreDraftMessage": "A draft was found. Do you want to restore it?",
|
||||||
|
"draft": "Draft",
|
||||||
|
"purchaseGift": "Purchase Gift",
|
||||||
|
"selectRecipient": "Select Recipient",
|
||||||
|
"changeRecipient": "Change Recipient",
|
||||||
|
"addMessage": "Add Message",
|
||||||
|
"skipRecipient": "Skip Recipient",
|
||||||
|
"giftSubscriptions": "Gift Subscriptions",
|
||||||
|
"purchaseAGift": "Purchase a Gift",
|
||||||
|
"redeemAGift": "Redeem a Gift",
|
||||||
|
"giftHistory": "Gift History",
|
||||||
|
"sentGifts": "Sent Gifts",
|
||||||
|
"receivedGifts": "Received Gifts",
|
||||||
|
"noSentGifts": "No sent gifts",
|
||||||
|
"noReceivedGifts": "No received gifts",
|
||||||
|
"stellarGift": "Stellar Gift",
|
||||||
|
"novaGift": "Nova Gift",
|
||||||
|
"supernovaGift": "Supernova Gift",
|
||||||
|
"sameAsMembership": "Same as membership",
|
||||||
|
"enterGiftCodeToRedeem": "Enter gift code to redeem",
|
||||||
|
"enterGiftCode": "Enter gift code",
|
||||||
|
"giftPurchased": "Gift Purchased!",
|
||||||
|
"shareCodeWithRecipient": "Share this code with the recipient to redeem the gift.",
|
||||||
|
"openGiftAnyoneCanRedeem": "This is an open gift that anyone can redeem.",
|
||||||
|
"ok": "OK",
|
||||||
|
"selectedRecipient": "Selected recipient",
|
||||||
|
"noRecipientSelected": "No recipient selected",
|
||||||
|
"thisWillBeAnOpenGift": "This will be an open gift",
|
||||||
|
"personalMessage": "Personal Message",
|
||||||
|
"addPersonalMessageForRecipient": "Add a personal message for the recipient",
|
||||||
|
"giftStatusCreated": "Created",
|
||||||
|
"giftStatusSent": "Sent",
|
||||||
|
"giftStatusRedeemed": "Redeemed",
|
||||||
|
"giftStatusCancelled": "Cancelled",
|
||||||
|
"giftStatusExpired": "Expired",
|
||||||
|
"giftStatusUnknown": "Unknown",
|
||||||
|
"giftCodeCopiedToClipboard": "Gift code copied to clipboard",
|
||||||
|
"codeLabel": "Code: ",
|
||||||
|
"subscriptionLabel": "Subscription: ",
|
||||||
|
"toLabel": "To: ",
|
||||||
|
"fromLabel": "From: ",
|
||||||
|
"messageLabel": "Message: ",
|
||||||
|
"giftRedeemed": "Gift Redeemed!",
|
||||||
|
"giftRedeemedSuccessfully": "You have successfully redeemed the gift. Your new subscription is now active.",
|
||||||
|
"cancelGift": "Cancel Gift",
|
||||||
|
"cancelGiftConfirm": "Are you sure you want to cancel this gift? This action cannot be undone.",
|
||||||
|
"giftCancelledSuccessfully": "Gift cancelled successfully",
|
||||||
|
"createFund": "Create Fund",
|
||||||
|
"fundAmount": "Fund Amount",
|
||||||
|
"enterAmount": "Enter Amount",
|
||||||
|
"selectCurrency": "Select Currency",
|
||||||
|
"splitType": "Split Type",
|
||||||
|
"evenSplit": "Even Split",
|
||||||
|
"equalAmountEach": "Equal amount for each recipient",
|
||||||
|
"randomSplit": "Random Split",
|
||||||
|
"randomAmountEach": "Random amount for each recipient",
|
||||||
|
"recipientCount": "Recipient Count",
|
||||||
|
"numberOfRecipients": "Number of Recipients",
|
||||||
|
"addPersonalMessageForRecipients": "Add a personal message for recipients",
|
||||||
|
"invalidAmount": "Invalid amount",
|
||||||
|
"invalidRecipientCount": "Invalid recipient count",
|
||||||
|
"fundOverview": "Fund Overview",
|
||||||
|
"totalFundsSent": "Total Funds Sent",
|
||||||
|
"totalFundsReceived": "Total Funds Received",
|
||||||
|
"transactions": "Transactions",
|
||||||
|
"myFunds": "My Funds",
|
||||||
|
"availableFunds": "Available Funds",
|
||||||
|
"fundStatusCreated": "Created",
|
||||||
|
"fundStatusPartial": "Partially Claimed",
|
||||||
|
"fundStatusCompleted": "Fully Claimed",
|
||||||
|
"fundStatusExpired": "Expired",
|
||||||
|
"fundStatusUnknown": "Unknown",
|
||||||
|
"recipients": "Recipients",
|
||||||
|
"fundClaimedSuccessfully": "Fund claimed successfully!",
|
||||||
|
"claim": "Claim",
|
||||||
|
"noFundsCreated": "No funds created yet",
|
||||||
|
"createYourFirstFund": "Create your first fund to get started",
|
||||||
|
"noAvailableFunds": "No available funds",
|
||||||
|
"fundsWillAppearHere": "Funds you can claim will appear here",
|
||||||
|
"fundCreatedSuccessfully": "Fund created successfully!",
|
||||||
|
"selectRecipients": "Select Recipients",
|
||||||
|
"noRecipientsSelected": "No recipients selected",
|
||||||
|
"selectRecipientsToSendFund": "Select recipients to send the fund to",
|
||||||
|
"addRecipient": "Add Recipient",
|
||||||
|
"addMoreRecipients": "Add More Recipients",
|
||||||
|
"transactionDetails": "Transaction Details",
|
||||||
|
"remarks": "Remarks",
|
||||||
|
"payer": "Payer",
|
||||||
|
"payee": "Payee",
|
||||||
|
"transactionType": "Transaction Type",
|
||||||
|
"transfer": "Transfer",
|
||||||
|
"payment": "Payment",
|
||||||
|
"systemWallet": "System Wallet",
|
||||||
|
"date": "Date",
|
||||||
|
"createTransfer": "Create Transfer",
|
||||||
|
"transferAmount": "Transfer Amount",
|
||||||
|
"selectPayee": "Select Payee",
|
||||||
|
"selectedPayee": "Selected Payee",
|
||||||
|
"noPayeeSelected": "No payee selected",
|
||||||
|
"selectPayeeToTransfer": "Select payee to transfer to",
|
||||||
|
"addRemark": "Add Remark",
|
||||||
|
"transferRemark": "Transfer Remark",
|
||||||
|
"addRemarkForTransfer": "Add remark for transfer",
|
||||||
|
"enterPinToConfirmTransfer": "Enter your 6-digit PIN to confirm transfer",
|
||||||
|
"transferCreatedSuccessfully": "Transfer created successfully!",
|
||||||
|
"postUpdate": "Update",
|
||||||
|
"fileMetadata": "File Metadata",
|
||||||
|
"resend": "Resend",
|
||||||
|
"fileInfoTitle": "File Information",
|
||||||
|
"download": "Download",
|
||||||
|
"info": "Info",
|
||||||
|
"noStickers": "No Stickers",
|
||||||
|
"noStickersInPack": "This pack does not contains stickers",
|
||||||
|
"noStickerPacks": "No Sticker Packs",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"spoiler": "Spoiler",
|
||||||
|
"activityHeatmap": "Activity Heatmap",
|
||||||
|
"custom": "Custom",
|
||||||
|
"usernameColor": "Username Color",
|
||||||
|
"colorType": "Color Type",
|
||||||
|
"plain": "Plain",
|
||||||
|
"gradient": "Gradient",
|
||||||
|
"colorValue": "Color Value",
|
||||||
|
"gradientDirection": "Gradient Direction",
|
||||||
|
"gradientDirectionToRight": "To Right",
|
||||||
|
"gradientDirectionToLeft": "To Left",
|
||||||
|
"gradientDirectionToBottom": "To Bottom",
|
||||||
|
"gradientDirectionToTop": "To Top",
|
||||||
|
"gradientDirectionToBottomRight": "To Bottom Right",
|
||||||
|
"gradientDirectionToBottomLeft": "To Bottom Left",
|
||||||
|
"gradientDirectionToTopRight": "To Top Right",
|
||||||
|
"gradientDirectionToTopLeft": "To Top Left",
|
||||||
|
"gradientColors": "Gradient Colors",
|
||||||
|
"color": "Color",
|
||||||
|
"addColor": "Add Color",
|
||||||
|
"availableWithYourPlan": "Available with your plan",
|
||||||
|
"upgradeRequired": "Upgrade required",
|
||||||
|
"settingsDisableAnimation": "Disable Animation",
|
||||||
|
"addTag": "Add Tag",
|
||||||
|
"accountConnectionProviderSpotify": "Spotify",
|
||||||
|
"accountConnectionProviderSteam": "Steam",
|
||||||
|
"timezoneNotFound": "Time zone not found",
|
||||||
|
"awardPoints": "Awarded {} points",
|
||||||
|
"postFeaturedOn": "Post featured on {}",
|
||||||
|
"messageSentAt": "Sent at {}",
|
||||||
|
"myTickets": "My Tickets",
|
||||||
|
"drawHistory": "Draw History",
|
||||||
|
"lottery": "Lottery",
|
||||||
|
"noLotteryTickets": "No lottery tickets yet",
|
||||||
|
"buyYourFirstTicket": "Buy your first lottery ticket to get started!",
|
||||||
|
"buyTicket": "Buy Ticket",
|
||||||
|
"ticketNumbers": "Numbers: {}, Special: {}",
|
||||||
|
"cost": "Cost",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"prizeWon": "Prize Won",
|
||||||
|
"pending": "Pending",
|
||||||
|
"drawn": "Drawn",
|
||||||
|
"won": "Won",
|
||||||
|
"lost": "Lost",
|
||||||
|
"noDrawHistory": "No draw history yet",
|
||||||
|
"buyLotteryTicket": "Buy Lottery Ticket",
|
||||||
|
"selectNumbers": "Select Numbers",
|
||||||
|
"select5UniqueNumbers": "Select 5 unique numbers",
|
||||||
|
"selectSpecialNumber": "Select Special Number",
|
||||||
|
"selectMultiplier": "Select Multiplier",
|
||||||
|
"baseCost": "Base Cost",
|
||||||
|
"totalCost": "Total Cost",
|
||||||
|
"prizeStructure": "Prize Structure",
|
||||||
|
"enterPinToConfirmPurchase": "Enter your PIN to confirm purchase",
|
||||||
|
"ticketPurchasedSuccessfully": "Ticket purchased successfully!",
|
||||||
|
"winningNumbers": "Winning Numbers",
|
||||||
|
"specialNumber": "Special Number",
|
||||||
|
"totalTickets": "Total Tickets",
|
||||||
|
"totalWinners": "Total Winners",
|
||||||
|
"prizePool": "Prize Pool",
|
||||||
|
"enterPinToConfirmPayment": "Enter your PIN code to confirm payment",
|
||||||
|
"purchase": "Purchase",
|
||||||
|
"multiplierLabel": "Multiplier",
|
||||||
|
"specialOnly": "Special Only",
|
||||||
|
"matches": "Matches",
|
||||||
|
"thoughtDefaultTopic": "Reflection",
|
||||||
|
"thoughtAiName": "SN-chan",
|
||||||
|
"thoughtUserName": "You",
|
||||||
|
"thoughtStreamingHint": "Sn-chan is thinking...",
|
||||||
|
"thoughtInputHint": "Ask sn-chan anything...",
|
||||||
|
"thoughtNewConversation": "Start New Conversation",
|
||||||
|
"thoughtParseError": "Failed to parse AI response",
|
||||||
|
"thoughtFunctionCall": "Use {}",
|
||||||
|
"aiThought": "AI Thought",
|
||||||
|
"aiThoughtTitle": "Let sn-chan think",
|
||||||
|
"postReferenceUnavailable": "Referenced post is unavailable",
|
||||||
|
"fabLocation": "FAB Location",
|
||||||
|
"activities": "Activities",
|
||||||
|
"presenceTypeGaming": "Playing",
|
||||||
|
"presenceTypeMusic": "Listening to Music",
|
||||||
|
"presenceTypeWorkout": "Working out",
|
||||||
|
"articleCompose": "Compose Article",
|
||||||
|
"backToHub": "Back to Hub",
|
||||||
|
"advancedFilters": "Advanced Filters",
|
||||||
|
"searchPosts": "Search Posts",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"fromDate": "From Date",
|
||||||
|
"toDate": "To Date",
|
||||||
|
"popularity": "Popularity",
|
||||||
|
"descendingOrder": "Descending Order",
|
||||||
|
"selectDate": "Select Date",
|
||||||
|
"pinnedPosts": "Pinned Posts",
|
||||||
|
"customReactionHint": "Custom Reaction allow you to use user uploaded stickers as the symbol of the reaction for the post. Exclusive for Stellar Program members.",
|
||||||
|
"publicationSites": "Publication Sites",
|
||||||
|
"uploadTasks": "Upload Tasks",
|
||||||
|
"thoughtFunctionCallBegin": "Calling tool {}",
|
||||||
|
"thoughtFunctionCallFinish": "{} responded",
|
||||||
|
"thoughtUnpaidHint": "Thinking unavaiable due to unpaid orders",
|
||||||
|
"more": "More",
|
||||||
|
"collapse": "Collapse",
|
||||||
|
"pollConfirmDiscard": "Are you sure you want to leave? All the poll data you're editing will not be saved.",
|
||||||
|
"discard": "Discard",
|
||||||
|
"fund": "Fund",
|
||||||
|
"fundsRecent": "Recent Funds",
|
||||||
|
"fundCreateNew": "Create New",
|
||||||
|
"fundCreateNewHint": "Create a new fund for your message. Select recipients and amount.",
|
||||||
|
"amountOfSplits": "Amount of Splits",
|
||||||
|
"enterNumberOfSplits": "Enter Splits Amount",
|
||||||
|
"orCreateWith": "Or\ncreate with",
|
||||||
|
"unindexedFiles": "Unindexed files",
|
||||||
|
"folder": "Folder",
|
||||||
|
"clearCompleted": "Clear Completed",
|
||||||
|
"uploadSuccess": "Upload successful!",
|
||||||
|
"wouldYouLikeToViewFile": "Would you like to view the file?",
|
||||||
|
"contentCantEmpty": "Content cannot be empty",
|
||||||
|
"features": "Features",
|
||||||
|
"unnamed": "Unnamed",
|
||||||
|
"fundEnvelopeLoadFailed": "Failed to load fund envelope",
|
||||||
|
"fundEnvelope": "Fund Envelope",
|
||||||
|
"fundEnvelopeRemaining": "Remaining: {} {}",
|
||||||
|
"fundEnvelopeSplit": "Split: {}",
|
||||||
|
"fundEnvelopeSplitEvenly": "Evenly",
|
||||||
|
"fundEnvelopeSplitRandomly": "Randomly",
|
||||||
|
"fundEnvelopeClaimSuccess": "Fund claimed successfully!",
|
||||||
|
"fundEnvelopeStatusCreated": "Created",
|
||||||
|
"fundEnvelopeStatusPartial": "Partially Claimed",
|
||||||
|
"fundEnvelopeStatusCompleted": "Fully Claimed",
|
||||||
|
"fundEnvelopeStatusExpired": "Expired",
|
||||||
|
"fundEnvelopeStatusUnknown": "Unknown",
|
||||||
|
"fundEnvelopeRecipients": "Recipients ({}/{} claimed)",
|
||||||
|
"fundEnvelopeExpiredDaysAgo": {
|
||||||
|
"one": "Expired {} day ago",
|
||||||
|
"other": "Expired {} days ago"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresSoon": "Expires soon",
|
||||||
|
"fundEnvelopeExpiresInHours": {
|
||||||
|
"one": "Expires in {} hour",
|
||||||
|
"other": "Expires in {} hours"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresInDays": {
|
||||||
|
"one": "Expires in {} day",
|
||||||
|
"other": "Expires in {} days"
|
||||||
|
},
|
||||||
|
"fundEnvelopeRemainingWithSplits": "{} {} / {} splits",
|
||||||
|
"fundEnvelopeUnknownUser": "Unknown User",
|
||||||
|
"deleteSite": "Delete Site",
|
||||||
|
"deleteSiteConfirm": "Are you sure you want to delete this site?",
|
||||||
|
"siteDeletedSuccess": "Site deleted successfully",
|
||||||
|
"siteSlug": "Slug",
|
||||||
|
"siteSlugHint": "my-site",
|
||||||
|
"siteSlugRequired": "Please enter a slug",
|
||||||
|
"siteSlugInvalid": "Slug can only contain lowercase letters, numbers, and dashes",
|
||||||
|
"siteName": "Site Name",
|
||||||
|
"siteNameHint": "My Publication Site",
|
||||||
|
"siteNameRequired": "Please enter a site name",
|
||||||
|
"siteMode": "Mode",
|
||||||
|
"siteModeFullyManaged": "Fully Managed",
|
||||||
|
"siteModeSelfManaged": "Self-Managed",
|
||||||
|
"editPublicationSite": "Edit Publication Site",
|
||||||
|
"deletePublicationSite": "Delete Publication Site",
|
||||||
|
"publicationSiteSavedSuccess": "Publication site saved successfully",
|
||||||
|
"publicationSiteDeleteConfirm": "Are you sure you want to delete this publication site? This action cannot be undone.",
|
||||||
|
"publicationSiteDeletedSuccess": "Publication site deleted successfully",
|
||||||
|
"newPublicationSite": "New Publication Site",
|
||||||
|
"siteDetails": "Site Details",
|
||||||
|
"siteInformation": "Site Information",
|
||||||
|
"siteDomain": "Domain",
|
||||||
|
"siteCreated": "Created",
|
||||||
|
"siteUpdated": "Updated",
|
||||||
|
"failedToLoadSite": "Failed to load site",
|
||||||
|
"sitePages": "Pages",
|
||||||
|
"noPagesYet": "No pages yet",
|
||||||
|
"createFirstPage": "Create your first page to get started",
|
||||||
|
"failedToLoadPages": "Failed to load pages",
|
||||||
|
"fileManagement": "File Management",
|
||||||
|
"siteFiles": "Files",
|
||||||
|
"siteFolder": "Folder",
|
||||||
|
"siteRoot": "Root",
|
||||||
|
"noFilesUploadedYet": "No files uploaded yet",
|
||||||
|
"uploadFirstFile": "Upload your first file to get started",
|
||||||
|
"failedToLoadFiles": "Failed to load files",
|
||||||
|
"noFilesFoundInFolder": "No files found in the selected folder",
|
||||||
|
"fileActions": "File Actions",
|
||||||
|
"purgeFiles": "Purge Files",
|
||||||
|
"purgeFilesDescription": "Remove all uploaded files from the site",
|
||||||
|
"deploySite": "Deploy Site",
|
||||||
|
"deploySiteDescription": "Upload and deploy a new version from ZIP archive",
|
||||||
|
"confirmPurge": "Confirm Purge",
|
||||||
|
"purgeFilesConfirm": "This will permanently delete all files uploaded to this site. This action cannot be undone. Are you sure you want to continue?",
|
||||||
|
"purgeAllFiles": "Purge All Files",
|
||||||
|
"allFilesPurgedSuccess": "All files purged successfully",
|
||||||
|
"failedToPurgeFiles": "Failed to purge files: {}",
|
||||||
|
"siteDeployedSuccess": "Site deployed successfully",
|
||||||
|
"failedToDeploySite": "Failed to deploy site: {}",
|
||||||
|
"createPage": "Create Page",
|
||||||
|
"editPage": "Edit Page",
|
||||||
|
"pageType": "Page Type",
|
||||||
|
"htmlPage": "HTML Page",
|
||||||
|
"redirectPage": "Redirect Page",
|
||||||
|
"pageTypeRequired": "Please select a page type",
|
||||||
|
"pagePath": "Page Path",
|
||||||
|
"pagePathHint": "/about, /contact, etc.",
|
||||||
|
"pagePathRequired": "Please enter a page path",
|
||||||
|
"pagePathInvalid": "Page path can only contain letters, numbers, hyphens, underscores, and slashes",
|
||||||
|
"pagePathMustStartWithSlash": "Page path must start with /",
|
||||||
|
"pagePathNoConsecutiveSlashes": "Page path cannot have consecutive slashes",
|
||||||
|
"pageTitle": "Page Title",
|
||||||
|
"pageTitleHint": "About Us, Contact, etc.",
|
||||||
|
"pageTitleRequired": "Please enter a page title",
|
||||||
|
"pageContentHtml": "Page Content (HTML)",
|
||||||
|
"pageContentHint": "<h1>Hello World</h1><p>This is my page content...</p>",
|
||||||
|
"pageContentRequired": "Please enter HTML content for the page",
|
||||||
|
"redirectTarget": "Redirect Target",
|
||||||
|
"redirectTargetHint": "/new-page, https://example.com, etc.",
|
||||||
|
"redirectTargetRequired": "Please enter a redirect target",
|
||||||
|
"redirectTargetInvalid": "Target must be a relative path (/) or absolute URL (http/https)",
|
||||||
|
"deletePage": "Delete Page",
|
||||||
|
"deletePageConfirm": "Are you sure you want to delete this page?",
|
||||||
|
"savePage": "Save Page",
|
||||||
|
"pageCreatedSuccess": "Page created successfully",
|
||||||
|
"pageUpdatedSuccess": "Page updated successfully",
|
||||||
|
"pageDeletedSuccess": "Page deleted successfully",
|
||||||
|
"uploadFiles": "Upload Files",
|
||||||
|
"uploadPath": "Upload Path",
|
||||||
|
"uploadPathHint": "/ (root) or /assets/images/",
|
||||||
|
"uploadPathRequired": "Please enter an upload path",
|
||||||
|
"uploadPathMustStartWithSlash": "Path must start with /",
|
||||||
|
"uploadPathNoSpaces": "Path cannot contain spaces",
|
||||||
|
"uploadPathNoConsecutiveSlashes": "Path cannot have consecutive slashes",
|
||||||
|
"percentCompleted": "{}% completed",
|
||||||
|
"filesToUpload": "{} files to upload",
|
||||||
|
"fileSizeKb": "Size: {} KB",
|
||||||
|
"uploadingEllipsis": "Uploading...",
|
||||||
|
"uploadFilesCount": {
|
||||||
|
"one": "Upload {} File",
|
||||||
|
"other": "Upload {} Files"
|
||||||
|
},
|
||||||
|
"allUploadsCompleted": "All uploads completed",
|
||||||
|
"someUploadsFailed": "Some uploads failed",
|
||||||
|
"uploadingInProgress": "Uploading in progress",
|
||||||
|
"readyToUpload": "Ready to upload",
|
||||||
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
@@ -164,8 +164,6 @@
|
|||||||
"checkInResultLevel3": "Good Luck",
|
"checkInResultLevel3": "Good Luck",
|
||||||
"checkInResultLevel4": "Best Luck",
|
"checkInResultLevel4": "Best Luck",
|
||||||
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
"checkInActivityTitle": "{} checked in on {} and got a {}",
|
||||||
"eventCalander": "Event Calander",
|
|
||||||
"eventCalanderEmpty": "No events on that day.",
|
|
||||||
"fortuneGraph": "Fortune Trend",
|
"fortuneGraph": "Fortune Trend",
|
||||||
"noFortuneData": "No fortune data available for this month.",
|
"noFortuneData": "No fortune data available for this month.",
|
||||||
"creatorHub": "Creator Hub",
|
"creatorHub": "Creator Hub",
|
||||||
@@ -752,21 +750,6 @@
|
|||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
"markAsSensitive": "Mark as Sensitive",
|
"markAsSensitive": "Mark as Sensitive",
|
||||||
"fileName": "File name",
|
"fileName": "File name",
|
||||||
"sensitiveCategories": {
|
|
||||||
"language": "Language",
|
|
||||||
"sexualContent": "Sexual Content",
|
|
||||||
"violence": "Violence",
|
|
||||||
"profanity": "Profanity",
|
|
||||||
"hateSpeech": "Hate Speech",
|
|
||||||
"racism": "Racism",
|
|
||||||
"adultContent": "Adult Content",
|
|
||||||
"drugAbuse": "Drug Abuse",
|
|
||||||
"alcoholAbuse": "Alcohol Abuse",
|
|
||||||
"gambling": "Gambling",
|
|
||||||
"selfHarm": "Self-harm",
|
|
||||||
"childAbuse": "Child Abuse",
|
|
||||||
"other": "Other"
|
|
||||||
},
|
|
||||||
"poll": "Poll",
|
"poll": "Poll",
|
||||||
"pollsRecent": "Recent Polls",
|
"pollsRecent": "Recent Polls",
|
||||||
"pollCreateNew": "Create New",
|
"pollCreateNew": "Create New",
|
||||||
@@ -1075,5 +1058,421 @@
|
|||||||
"deleteRecycledFiles": "Delete Recycled Files",
|
"deleteRecycledFiles": "Delete Recycled Files",
|
||||||
"recycledFilesDeleted": "Recycled files deleted successfully",
|
"recycledFilesDeleted": "Recycled files deleted successfully",
|
||||||
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
||||||
"upload": "Upload"
|
"upload": "Upload",
|
||||||
|
"deleteMessage": "Delete Message",
|
||||||
|
"deleteMessageConfirmation": "Are you sure you want to delete this message?",
|
||||||
|
"customReaction": "Custom Reaction",
|
||||||
|
"customReactions": "Custom Reactions",
|
||||||
|
"stickerPlaceholder": "Sticker Placeholder",
|
||||||
|
"reactionAttitude": "Reaction Attitude",
|
||||||
|
"addReaction": "Add Reaction",
|
||||||
|
"eventCalendar": "Event Calendar",
|
||||||
|
"eventCalendarEmpty": "No events on that day.",
|
||||||
|
"walletStats": "Wallet Statistics",
|
||||||
|
"totalTransactions": "Total Transactions",
|
||||||
|
"totalOrders": "Total Orders",
|
||||||
|
"totalIncome": "Total Income",
|
||||||
|
"totalOutgoing": "Total Outgoing",
|
||||||
|
"netBalance": "Net Balance",
|
||||||
|
"messageUpdateLinks": "Server generated links previews",
|
||||||
|
"messageUpdateEdited": "Edited a message",
|
||||||
|
"settingsCardBackgroundOpacity": "Card Background Opacity",
|
||||||
|
"settingsThemeMode": "Theme Mode",
|
||||||
|
"settingsThemeModeSystem": "System",
|
||||||
|
"settingsThemeModeLight": "Light",
|
||||||
|
"settingsThemeModeDark": "Dark",
|
||||||
|
"enterPin": "Enter your PIN code",
|
||||||
|
"chatReplyingTo": "Replying to {}",
|
||||||
|
"chatForwarding": "Forwarding message",
|
||||||
|
"chatEditing": "Editing message",
|
||||||
|
"chatNoContent": "No content",
|
||||||
|
"sensitiveCategories": {
|
||||||
|
"language": "Language",
|
||||||
|
"sexualContent": "Sexual Content",
|
||||||
|
"violence": "Violence",
|
||||||
|
"profanity": "Profanity",
|
||||||
|
"hateSpeech": "Hate Speech",
|
||||||
|
"racism": "Racism",
|
||||||
|
"adultContent": "Adult Content",
|
||||||
|
"drugAbuse": "Drug Abuse",
|
||||||
|
"alcoholAbuse": "Alcohol Abuse",
|
||||||
|
"gambling": "Gambling",
|
||||||
|
"selfHarm": "Self-harm",
|
||||||
|
"childAbuse": "Child Abuse",
|
||||||
|
"other": "Other"
|
||||||
|
},
|
||||||
|
"Searching...": "Searching...",
|
||||||
|
"searchError": "Search failed. Please try again.",
|
||||||
|
"tryDifferentKeywords": "Try different keywords or remove search filters",
|
||||||
|
"settingsWindowOpacity": "Window Opacity",
|
||||||
|
"messageContent": "Message Content",
|
||||||
|
"updateAvailable": "Update available",
|
||||||
|
"noChangelogProvided": "No changelog provided.",
|
||||||
|
"useSecondarySourceForDownload": "Use secondary source for download",
|
||||||
|
"installUpdate": "Install update",
|
||||||
|
"openReleasePage": "Open release page",
|
||||||
|
"postCompose": "Compose Post",
|
||||||
|
"postPublish": "Publish Post",
|
||||||
|
"restoreDraftTitle": "Restore Draft",
|
||||||
|
"restoreDraftMessage": "A draft was found. Do you want to restore it?",
|
||||||
|
"draft": "Draft",
|
||||||
|
"purchaseGift": "Purchase Gift",
|
||||||
|
"selectRecipient": "Select Recipient",
|
||||||
|
"changeRecipient": "Change Recipient",
|
||||||
|
"addMessage": "Add Message",
|
||||||
|
"skipRecipient": "Skip Recipient",
|
||||||
|
"giftSubscriptions": "Gift Subscriptions",
|
||||||
|
"purchaseAGift": "Purchase a Gift",
|
||||||
|
"redeemAGift": "Redeem a Gift",
|
||||||
|
"giftHistory": "Gift History",
|
||||||
|
"sentGifts": "Sent Gifts",
|
||||||
|
"receivedGifts": "Received Gifts",
|
||||||
|
"noSentGifts": "No sent gifts",
|
||||||
|
"noReceivedGifts": "No received gifts",
|
||||||
|
"stellarGift": "Stellar Gift",
|
||||||
|
"novaGift": "Nova Gift",
|
||||||
|
"supernovaGift": "Supernova Gift",
|
||||||
|
"sameAsMembership": "Same as membership",
|
||||||
|
"enterGiftCodeToRedeem": "Enter gift code to redeem",
|
||||||
|
"enterGiftCode": "Enter gift code",
|
||||||
|
"giftPurchased": "Gift Purchased!",
|
||||||
|
"shareCodeWithRecipient": "Share this code with the recipient to redeem the gift.",
|
||||||
|
"openGiftAnyoneCanRedeem": "This is an open gift that anyone can redeem.",
|
||||||
|
"ok": "OK",
|
||||||
|
"selectedRecipient": "Selected recipient",
|
||||||
|
"noRecipientSelected": "No recipient selected",
|
||||||
|
"thisWillBeAnOpenGift": "This will be an open gift",
|
||||||
|
"personalMessage": "Personal Message",
|
||||||
|
"addPersonalMessageForRecipient": "Add a personal message for the recipient",
|
||||||
|
"giftStatusCreated": "Created",
|
||||||
|
"giftStatusSent": "Sent",
|
||||||
|
"giftStatusRedeemed": "Redeemed",
|
||||||
|
"giftStatusCancelled": "Cancelled",
|
||||||
|
"giftStatusExpired": "Expired",
|
||||||
|
"giftStatusUnknown": "Unknown",
|
||||||
|
"giftCodeCopiedToClipboard": "Gift code copied to clipboard",
|
||||||
|
"codeLabel": "Code: ",
|
||||||
|
"subscriptionLabel": "Subscription: ",
|
||||||
|
"toLabel": "To: ",
|
||||||
|
"fromLabel": "From: ",
|
||||||
|
"messageLabel": "Message: ",
|
||||||
|
"giftRedeemed": "Gift Redeemed!",
|
||||||
|
"giftRedeemedSuccessfully": "You have successfully redeemed the gift. Your new subscription is now active.",
|
||||||
|
"cancelGift": "Cancel Gift",
|
||||||
|
"cancelGiftConfirm": "Are you sure you want to cancel this gift? This action cannot be undone.",
|
||||||
|
"giftCancelledSuccessfully": "Gift cancelled successfully",
|
||||||
|
"createFund": "Create Fund",
|
||||||
|
"fundAmount": "Fund Amount",
|
||||||
|
"enterAmount": "Enter Amount",
|
||||||
|
"selectCurrency": "Select Currency",
|
||||||
|
"splitType": "Split Type",
|
||||||
|
"evenSplit": "Even Split",
|
||||||
|
"equalAmountEach": "Equal amount for each recipient",
|
||||||
|
"randomSplit": "Random Split",
|
||||||
|
"randomAmountEach": "Random amount for each recipient",
|
||||||
|
"recipientCount": "Recipient Count",
|
||||||
|
"numberOfRecipients": "Number of Recipients",
|
||||||
|
"addPersonalMessageForRecipients": "Add a personal message for recipients",
|
||||||
|
"invalidAmount": "Invalid amount",
|
||||||
|
"invalidRecipientCount": "Invalid recipient count",
|
||||||
|
"fundOverview": "Fund Overview",
|
||||||
|
"totalFundsSent": "Total Funds Sent",
|
||||||
|
"totalFundsReceived": "Total Funds Received",
|
||||||
|
"transactions": "Transactions",
|
||||||
|
"myFunds": "My Funds",
|
||||||
|
"availableFunds": "Available Funds",
|
||||||
|
"fundStatusCreated": "Created",
|
||||||
|
"fundStatusPartial": "Partially Claimed",
|
||||||
|
"fundStatusCompleted": "Fully Claimed",
|
||||||
|
"fundStatusExpired": "Expired",
|
||||||
|
"fundStatusUnknown": "Unknown",
|
||||||
|
"recipients": "Recipients",
|
||||||
|
"fundClaimedSuccessfully": "Fund claimed successfully!",
|
||||||
|
"claim": "Claim",
|
||||||
|
"noFundsCreated": "No funds created yet",
|
||||||
|
"createYourFirstFund": "Create your first fund to get started",
|
||||||
|
"noAvailableFunds": "No available funds",
|
||||||
|
"fundsWillAppearHere": "Funds you can claim will appear here",
|
||||||
|
"fundCreatedSuccessfully": "Fund created successfully!",
|
||||||
|
"selectRecipients": "Select Recipients",
|
||||||
|
"noRecipientsSelected": "No recipients selected",
|
||||||
|
"selectRecipientsToSendFund": "Select recipients to send the fund to",
|
||||||
|
"addRecipient": "Add Recipient",
|
||||||
|
"addMoreRecipients": "Add More Recipients",
|
||||||
|
"transactionDetails": "Transaction Details",
|
||||||
|
"remarks": "Remarks",
|
||||||
|
"payer": "Payer",
|
||||||
|
"payee": "Payee",
|
||||||
|
"transactionType": "Transaction Type",
|
||||||
|
"transfer": "Transfer",
|
||||||
|
"payment": "Payment",
|
||||||
|
"systemWallet": "System Wallet",
|
||||||
|
"date": "Date",
|
||||||
|
"createTransfer": "Create Transfer",
|
||||||
|
"transferAmount": "Transfer Amount",
|
||||||
|
"selectPayee": "Select Payee",
|
||||||
|
"selectedPayee": "Selected Payee",
|
||||||
|
"noPayeeSelected": "No payee selected",
|
||||||
|
"selectPayeeToTransfer": "Select payee to transfer to",
|
||||||
|
"addRemark": "Add Remark",
|
||||||
|
"transferRemark": "Transfer Remark",
|
||||||
|
"addRemarkForTransfer": "Add remark for transfer",
|
||||||
|
"enterPinToConfirmTransfer": "Enter your 6-digit PIN to confirm transfer",
|
||||||
|
"transferCreatedSuccessfully": "Transfer created successfully!",
|
||||||
|
"postUpdate": "Update",
|
||||||
|
"fileMetadata": "File Metadata",
|
||||||
|
"resend": "Resend",
|
||||||
|
"fileInfoTitle": "File Information",
|
||||||
|
"download": "Download",
|
||||||
|
"info": "Info",
|
||||||
|
"noStickers": "No Stickers",
|
||||||
|
"noStickersInPack": "This pack does not contains stickers",
|
||||||
|
"noStickerPacks": "No Sticker Packs",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"spoiler": "Spoiler",
|
||||||
|
"activityHeatmap": "Activity Heatmap",
|
||||||
|
"custom": "Custom",
|
||||||
|
"usernameColor": "Username Color",
|
||||||
|
"colorType": "Color Type",
|
||||||
|
"plain": "Plain",
|
||||||
|
"gradient": "Gradient",
|
||||||
|
"colorValue": "Color Value",
|
||||||
|
"gradientDirection": "Gradient Direction",
|
||||||
|
"gradientDirectionToRight": "To Right",
|
||||||
|
"gradientDirectionToLeft": "To Left",
|
||||||
|
"gradientDirectionToBottom": "To Bottom",
|
||||||
|
"gradientDirectionToTop": "To Top",
|
||||||
|
"gradientDirectionToBottomRight": "To Bottom Right",
|
||||||
|
"gradientDirectionToBottomLeft": "To Bottom Left",
|
||||||
|
"gradientDirectionToTopRight": "To Top Right",
|
||||||
|
"gradientDirectionToTopLeft": "To Top Left",
|
||||||
|
"gradientColors": "Gradient Colors",
|
||||||
|
"color": "Color",
|
||||||
|
"addColor": "Add Color",
|
||||||
|
"availableWithYourPlan": "Available with your plan",
|
||||||
|
"upgradeRequired": "Upgrade required",
|
||||||
|
"settingsDisableAnimation": "Disable Animation",
|
||||||
|
"addTag": "Add Tag",
|
||||||
|
"accountConnectionProviderSpotify": "Spotify",
|
||||||
|
"accountConnectionProviderSteam": "Steam",
|
||||||
|
"timezoneNotFound": "Time zone not found",
|
||||||
|
"awardPoints": "Awarded {} points",
|
||||||
|
"postFeaturedOn": "Post featured on {}",
|
||||||
|
"messageSentAt": "Sent at {}",
|
||||||
|
"myTickets": "My Tickets",
|
||||||
|
"drawHistory": "Draw History",
|
||||||
|
"lottery": "Lottery",
|
||||||
|
"noLotteryTickets": "No lottery tickets yet",
|
||||||
|
"buyYourFirstTicket": "Buy your first lottery ticket to get started!",
|
||||||
|
"buyTicket": "Buy Ticket",
|
||||||
|
"ticketNumbers": "Numbers: {}, Special: {}",
|
||||||
|
"cost": "Cost",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"prizeWon": "Prize Won",
|
||||||
|
"pending": "Pending",
|
||||||
|
"drawn": "Drawn",
|
||||||
|
"won": "Won",
|
||||||
|
"lost": "Lost",
|
||||||
|
"noDrawHistory": "No draw history yet",
|
||||||
|
"buyLotteryTicket": "Buy Lottery Ticket",
|
||||||
|
"selectNumbers": "Select Numbers",
|
||||||
|
"select5UniqueNumbers": "Select 5 unique numbers",
|
||||||
|
"selectSpecialNumber": "Select Special Number",
|
||||||
|
"selectMultiplier": "Select Multiplier",
|
||||||
|
"baseCost": "Base Cost",
|
||||||
|
"totalCost": "Total Cost",
|
||||||
|
"prizeStructure": "Prize Structure",
|
||||||
|
"enterPinToConfirmPurchase": "Enter your PIN to confirm purchase",
|
||||||
|
"ticketPurchasedSuccessfully": "Ticket purchased successfully!",
|
||||||
|
"winningNumbers": "Winning Numbers",
|
||||||
|
"specialNumber": "Special Number",
|
||||||
|
"totalTickets": "Total Tickets",
|
||||||
|
"totalWinners": "Total Winners",
|
||||||
|
"prizePool": "Prize Pool",
|
||||||
|
"enterPinToConfirmPayment": "Enter your PIN code to confirm payment",
|
||||||
|
"purchase": "Purchase",
|
||||||
|
"multiplierLabel": "Multiplier",
|
||||||
|
"specialOnly": "Special Only",
|
||||||
|
"matches": "Matches",
|
||||||
|
"thoughtDefaultTopic": "Reflection",
|
||||||
|
"thoughtAiName": "SN-chan",
|
||||||
|
"thoughtUserName": "You",
|
||||||
|
"thoughtStreamingHint": "Sn-chan is thinking...",
|
||||||
|
"thoughtInputHint": "Ask sn-chan anything...",
|
||||||
|
"thoughtNewConversation": "Start New Conversation",
|
||||||
|
"thoughtParseError": "Failed to parse AI response",
|
||||||
|
"thoughtFunctionCall": "Use {}",
|
||||||
|
"aiThought": "AI Thought",
|
||||||
|
"aiThoughtTitle": "Let sn-chan think",
|
||||||
|
"postReferenceUnavailable": "Referenced post is unavailable",
|
||||||
|
"fabLocation": "FAB Location",
|
||||||
|
"activities": "Activities",
|
||||||
|
"presenceTypeGaming": "Playing",
|
||||||
|
"presenceTypeMusic": "Listening to Music",
|
||||||
|
"presenceTypeWorkout": "Working out",
|
||||||
|
"articleCompose": "Compose Article",
|
||||||
|
"backToHub": "Back to Hub",
|
||||||
|
"advancedFilters": "Advanced Filters",
|
||||||
|
"searchPosts": "Search Posts",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"fromDate": "From Date",
|
||||||
|
"toDate": "To Date",
|
||||||
|
"popularity": "Popularity",
|
||||||
|
"descendingOrder": "Descending Order",
|
||||||
|
"selectDate": "Select Date",
|
||||||
|
"pinnedPosts": "Pinned Posts",
|
||||||
|
"customReactionHint": "Custom Reaction allow you to use user uploaded stickers as the symbol of the reaction for the post. Exclusive for Stellar Program members.",
|
||||||
|
"publicationSites": "Publication Sites",
|
||||||
|
"uploadTasks": "Upload Tasks",
|
||||||
|
"thoughtFunctionCallBegin": "Calling tool {}",
|
||||||
|
"thoughtFunctionCallFinish": "{} responded",
|
||||||
|
"thoughtUnpaidHint": "Thinking unavaiable due to unpaid orders",
|
||||||
|
"more": "More",
|
||||||
|
"collapse": "Collapse",
|
||||||
|
"pollConfirmDiscard": "Are you sure you want to leave? All the poll data you're editing will not be saved.",
|
||||||
|
"discard": "Discard",
|
||||||
|
"fund": "Fund",
|
||||||
|
"fundsRecent": "Recent Funds",
|
||||||
|
"fundCreateNew": "Create New",
|
||||||
|
"fundCreateNewHint": "Create a new fund for your message. Select recipients and amount.",
|
||||||
|
"amountOfSplits": "Amount of Splits",
|
||||||
|
"enterNumberOfSplits": "Enter Splits Amount",
|
||||||
|
"orCreateWith": "Or\ncreate with",
|
||||||
|
"unindexedFiles": "Unindexed files",
|
||||||
|
"folder": "Folder",
|
||||||
|
"clearCompleted": "Clear Completed",
|
||||||
|
"uploadSuccess": "Upload successful!",
|
||||||
|
"wouldYouLikeToViewFile": "Would you like to view the file?",
|
||||||
|
"contentCantEmpty": "Content cannot be empty",
|
||||||
|
"features": "Features",
|
||||||
|
"unnamed": "Unnamed",
|
||||||
|
"fundEnvelopeLoadFailed": "Failed to load fund envelope",
|
||||||
|
"fundEnvelope": "Fund Envelope",
|
||||||
|
"fundEnvelopeRemaining": "Remaining: {} {}",
|
||||||
|
"fundEnvelopeSplit": "Split: {}",
|
||||||
|
"fundEnvelopeSplitEvenly": "Evenly",
|
||||||
|
"fundEnvelopeSplitRandomly": "Randomly",
|
||||||
|
"fundEnvelopeClaimSuccess": "Fund claimed successfully!",
|
||||||
|
"fundEnvelopeStatusCreated": "Created",
|
||||||
|
"fundEnvelopeStatusPartial": "Partially Claimed",
|
||||||
|
"fundEnvelopeStatusCompleted": "Fully Claimed",
|
||||||
|
"fundEnvelopeStatusExpired": "Expired",
|
||||||
|
"fundEnvelopeStatusUnknown": "Unknown",
|
||||||
|
"fundEnvelopeRecipients": "Recipients ({}/{} claimed)",
|
||||||
|
"fundEnvelopeExpiredDaysAgo": {
|
||||||
|
"one": "Expired {} day ago",
|
||||||
|
"other": "Expired {} days ago"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresSoon": "Expires soon",
|
||||||
|
"fundEnvelopeExpiresInHours": {
|
||||||
|
"one": "Expires in {} hour",
|
||||||
|
"other": "Expires in {} hours"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresInDays": {
|
||||||
|
"one": "Expires in {} day",
|
||||||
|
"other": "Expires in {} days"
|
||||||
|
},
|
||||||
|
"fundEnvelopeRemainingWithSplits": "{} {} / {} splits",
|
||||||
|
"fundEnvelopeUnknownUser": "Unknown User",
|
||||||
|
"deleteSite": "Delete Site",
|
||||||
|
"deleteSiteConfirm": "Are you sure you want to delete this site?",
|
||||||
|
"siteDeletedSuccess": "Site deleted successfully",
|
||||||
|
"siteSlug": "Slug",
|
||||||
|
"siteSlugHint": "my-site",
|
||||||
|
"siteSlugRequired": "Please enter a slug",
|
||||||
|
"siteSlugInvalid": "Slug can only contain lowercase letters, numbers, and dashes",
|
||||||
|
"siteName": "Site Name",
|
||||||
|
"siteNameHint": "My Publication Site",
|
||||||
|
"siteNameRequired": "Please enter a site name",
|
||||||
|
"siteMode": "Mode",
|
||||||
|
"siteModeFullyManaged": "Fully Managed",
|
||||||
|
"siteModeSelfManaged": "Self-Managed",
|
||||||
|
"editPublicationSite": "Edit Publication Site",
|
||||||
|
"deletePublicationSite": "Delete Publication Site",
|
||||||
|
"publicationSiteSavedSuccess": "Publication site saved successfully",
|
||||||
|
"publicationSiteDeleteConfirm": "Are you sure you want to delete this publication site? This action cannot be undone.",
|
||||||
|
"publicationSiteDeletedSuccess": "Publication site deleted successfully",
|
||||||
|
"newPublicationSite": "New Publication Site",
|
||||||
|
"siteDetails": "Site Details",
|
||||||
|
"siteInformation": "Site Information",
|
||||||
|
"siteDomain": "Domain",
|
||||||
|
"siteCreated": "Created",
|
||||||
|
"siteUpdated": "Updated",
|
||||||
|
"failedToLoadSite": "Failed to load site",
|
||||||
|
"sitePages": "Pages",
|
||||||
|
"noPagesYet": "No pages yet",
|
||||||
|
"createFirstPage": "Create your first page to get started",
|
||||||
|
"failedToLoadPages": "Failed to load pages",
|
||||||
|
"fileManagement": "File Management",
|
||||||
|
"siteFiles": "Files",
|
||||||
|
"siteFolder": "Folder",
|
||||||
|
"siteRoot": "Root",
|
||||||
|
"noFilesUploadedYet": "No files uploaded yet",
|
||||||
|
"uploadFirstFile": "Upload your first file to get started",
|
||||||
|
"failedToLoadFiles": "Failed to load files",
|
||||||
|
"noFilesFoundInFolder": "No files found in the selected folder",
|
||||||
|
"fileActions": "File Actions",
|
||||||
|
"purgeFiles": "Purge Files",
|
||||||
|
"purgeFilesDescription": "Remove all uploaded files from the site",
|
||||||
|
"deploySite": "Deploy Site",
|
||||||
|
"deploySiteDescription": "Upload and deploy a new version from ZIP archive",
|
||||||
|
"confirmPurge": "Confirm Purge",
|
||||||
|
"purgeFilesConfirm": "This will permanently delete all files uploaded to this site. This action cannot be undone. Are you sure you want to continue?",
|
||||||
|
"purgeAllFiles": "Purge All Files",
|
||||||
|
"allFilesPurgedSuccess": "All files purged successfully",
|
||||||
|
"failedToPurgeFiles": "Failed to purge files: {}",
|
||||||
|
"siteDeployedSuccess": "Site deployed successfully",
|
||||||
|
"failedToDeploySite": "Failed to deploy site: {}",
|
||||||
|
"createPage": "Create Page",
|
||||||
|
"editPage": "Edit Page",
|
||||||
|
"pageType": "Page Type",
|
||||||
|
"htmlPage": "HTML Page",
|
||||||
|
"redirectPage": "Redirect Page",
|
||||||
|
"pageTypeRequired": "Please select a page type",
|
||||||
|
"pagePath": "Page Path",
|
||||||
|
"pagePathHint": "/about, /contact, etc.",
|
||||||
|
"pagePathRequired": "Please enter a page path",
|
||||||
|
"pagePathInvalid": "Page path can only contain letters, numbers, hyphens, underscores, and slashes",
|
||||||
|
"pagePathMustStartWithSlash": "Page path must start with /",
|
||||||
|
"pagePathNoConsecutiveSlashes": "Page path cannot have consecutive slashes",
|
||||||
|
"pageTitle": "Page Title",
|
||||||
|
"pageTitleHint": "About Us, Contact, etc.",
|
||||||
|
"pageTitleRequired": "Please enter a page title",
|
||||||
|
"pageContentHtml": "Page Content (HTML)",
|
||||||
|
"pageContentHint": "<h1>Hello World</h1><p>This is my page content...</p>",
|
||||||
|
"pageContentRequired": "Please enter HTML content for the page",
|
||||||
|
"redirectTarget": "Redirect Target",
|
||||||
|
"redirectTargetHint": "/new-page, https://example.com, etc.",
|
||||||
|
"redirectTargetRequired": "Please enter a redirect target",
|
||||||
|
"redirectTargetInvalid": "Target must be a relative path (/) or absolute URL (http/https)",
|
||||||
|
"deletePage": "Delete Page",
|
||||||
|
"deletePageConfirm": "Are you sure you want to delete this page?",
|
||||||
|
"savePage": "Save Page",
|
||||||
|
"pageCreatedSuccess": "Page created successfully",
|
||||||
|
"pageUpdatedSuccess": "Page updated successfully",
|
||||||
|
"pageDeletedSuccess": "Page deleted successfully",
|
||||||
|
"uploadFiles": "Upload Files",
|
||||||
|
"uploadPath": "Upload Path",
|
||||||
|
"uploadPathHint": "/ (root) or /assets/images/",
|
||||||
|
"uploadPathRequired": "Please enter an upload path",
|
||||||
|
"uploadPathMustStartWithSlash": "Path must start with /",
|
||||||
|
"uploadPathNoSpaces": "Path cannot contain spaces",
|
||||||
|
"uploadPathNoConsecutiveSlashes": "Path cannot have consecutive slashes",
|
||||||
|
"percentCompleted": "{}% completed",
|
||||||
|
"filesToUpload": "{} files to upload",
|
||||||
|
"fileSizeKb": "Size: {} KB",
|
||||||
|
"uploadingEllipsis": "Uploading...",
|
||||||
|
"uploadFilesCount": {
|
||||||
|
"one": "Upload {} File",
|
||||||
|
"other": "Upload {} Files"
|
||||||
|
},
|
||||||
|
"allUploadsCompleted": "All uploads completed",
|
||||||
|
"someUploadsFailed": "Some uploads failed",
|
||||||
|
"uploadingInProgress": "Uploading in progress",
|
||||||
|
"readyToUpload": "Ready to upload",
|
||||||
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -164,177 +164,175 @@
|
|||||||
"checkInResultLevel3": "吉",
|
"checkInResultLevel3": "吉",
|
||||||
"checkInResultLevel4": "大吉",
|
"checkInResultLevel4": "大吉",
|
||||||
"checkInActivityTitle": "{} 於 {} 簽到,獲 {} 籤",
|
"checkInActivityTitle": "{} 於 {} 簽到,獲 {} 籤",
|
||||||
"eventCalander": "Event Calander",
|
"fortuneGraph": "运程谶",
|
||||||
"eventCalanderEmpty": "No events on that day.",
|
"noFortuneData": "本月气数未显。",
|
||||||
"fortuneGraph": "Fortune Trend",
|
"creatorHub": "著書閣",
|
||||||
"noFortuneData": "No fortune data available for this month.",
|
"creatorHubDescription": "司理帖文、析策諸務。",
|
||||||
"creatorHub": "Creator Hub",
|
"developerPortal": "匠造司",
|
||||||
"creatorHubDescription": "Manage posts, analytics, and more.",
|
"developerPortalDescription": "築基於 Solar Network™。",
|
||||||
"developerPortal": "Developer Portal",
|
"statusCreateHint": "何所思?可添近況。",
|
||||||
"developerPortalDescription": "Build with Solar Network™.",
|
"statusCreate": "增境況",
|
||||||
"statusCreateHint": "What's on your mind? Add a status.",
|
"statusUpdate": "更境況",
|
||||||
"statusCreate": "Add a Status",
|
"statusLabel": "心境",
|
||||||
"statusUpdate": "Update Status",
|
"statusAttitude": "意態",
|
||||||
"statusLabel": "Status",
|
"attitudePositive": "昂揚",
|
||||||
"statusAttitude": "Attitude",
|
"attitudeNeutral": "平瀾",
|
||||||
"attitudePositive": "Positive",
|
"attitudeNegative": "消沉",
|
||||||
"attitudeNeutral": "Neutral",
|
"statusInvisible": "隱跡",
|
||||||
"attitudeNegative": "Negative",
|
"statusInvisibleDescription": "汝之形跡不現於人前。",
|
||||||
"statusInvisible": "Invisible",
|
"statusNotDisturb": "勿擾",
|
||||||
"statusInvisibleDescription": "Your will be showing as offline to others.",
|
"statusNotDisturbDescription": "急報皆止。",
|
||||||
"statusNotDisturb": "Do Not Disturb",
|
"statusClearTime": "滌除於",
|
||||||
"statusNotDisturbDescription": "Push notification will be disabled.",
|
"statusNoAutoClear": "不自滌",
|
||||||
"statusClearTime": "Cleared At",
|
"online": "在朝",
|
||||||
"statusNoAutoClear": "Do not auto clear",
|
"offline": "在野",
|
||||||
"online": "Online",
|
"status": "心境",
|
||||||
"offline": "Offline",
|
"statusActivityTitle": "{} 正於 {} {}",
|
||||||
"status": "Status",
|
"statusActivityEndedTitle": "{} 正於 {} {} 迄於 {}",
|
||||||
"statusActivityTitle": "{} is {} {}",
|
"appSettings": "應用設置",
|
||||||
"statusActivityEndedTitle": "{} is {} {} until {}",
|
"accountSettings": "賬戶設置",
|
||||||
"appSettings": "App Settings",
|
"settings": "設置",
|
||||||
"accountSettings": "Account Settings",
|
"language": "言語",
|
||||||
"settings": "Settings",
|
"accountLanguageHint": "此言語將行於電郵並推送告示。",
|
||||||
"language": "Language",
|
"settingsDisplayLanguage": "顯示言語",
|
||||||
"accountLanguageHint": "This language will be used for email and push notifications.",
|
"languageFollowSystem": "從系統之制",
|
||||||
"settingsDisplayLanguage": "Display Language",
|
"postsCreatedCount": "貼文",
|
||||||
"languageFollowSystem": "Follow System",
|
"stickerPacksCreatedCount": "貼札集",
|
||||||
"postsCreatedCount": "Posts",
|
"stickersCreatedCount": "貼札",
|
||||||
"stickerPacksCreatedCount": "Sticker Packs",
|
"upvoteReceived": "收擢",
|
||||||
"stickersCreatedCount": "Stickers",
|
"downvoteReceived": "收黜",
|
||||||
"upvoteReceived": "Upvotes Recieved",
|
"stickerPacks": "貼札集",
|
||||||
"downvoteReceived": "Downvotes Recieved",
|
"createStickerPack": "始創一貼札集",
|
||||||
"stickerPacks": "Sticker Packs",
|
"editStickerPack": "修訂貼札集",
|
||||||
"createStickerPack": "Create a Sticker Pack",
|
"deleteStickerPack": "革去貼札集",
|
||||||
"editStickerPack": "Edit Sticker Pack",
|
"deleteStickerPackHint": "決革去此貼札譜否?此令無可更赦。",
|
||||||
"deleteStickerPack": "Delete Sticker Pack",
|
"stickerPackPrefix": "首綴",
|
||||||
"deleteStickerPackHint": "Are you sure to delete this sticker pack? This action cannot be undone.",
|
"stickerPackPrefixHint": "此首綴將加於本帙諸貼札縮略名之前。",
|
||||||
"stickerPackPrefix": "Prefix",
|
"stickers": "貼札",
|
||||||
"stickerPackPrefixHint": "The prefix will be added before each stickers' slug in this pack.",
|
"createSticker": "始創一貼札",
|
||||||
"stickers": "Stickers",
|
"editSticker": "修訂貼札",
|
||||||
"createSticker": "Create a Sticker",
|
"deleteSticker": "革去貼札",
|
||||||
"editSticker": "Edit Sticker",
|
"deleteStickerHint": "確欲革去此貼札乎?此勢無可逆轉。",
|
||||||
"deleteSticker": "Delete Sticker",
|
"stickerImage": "圖像",
|
||||||
"deleteStickerHint": "Are you sure to delete this sticker? This action cannot be undone.",
|
"stickerSlug": "籤碼",
|
||||||
"stickerImage": "Image",
|
"stickerSlugHint": "此籤碼將聯題端以構貼札獨契。",
|
||||||
"stickerSlug": "Slug",
|
"dataEmpty": "此間尚虛。",
|
||||||
"stickerSlugHint": "The slug will be combined with the prefix to form the sticker's unique identifier.",
|
"pickFile": "擇一卷宗",
|
||||||
"dataEmpty": "Nothing's here yet.",
|
"uploading": "上呈中",
|
||||||
"pickFile": "Pick a file",
|
"uploadingProgress": "正呈 {} 於 {}",
|
||||||
"uploading": "Uploading",
|
"uploadAll": "全盤呈上",
|
||||||
"uploadingProgress": "Uploading {} of {}",
|
"stickerCopyPlaceholder": "摹寫虛位",
|
||||||
"uploadAll": "Upload All",
|
"realmSelection": "擇一界域",
|
||||||
"stickerCopyPlaceholder": "Copy Placeholder",
|
"individual": "獨詣",
|
||||||
"realmSelection": "Select a Realm",
|
"firstPostBadgeName": "處女作",
|
||||||
"individual": "Individual",
|
"firstPostBadgeDescription": "始發帖於 Solar Network",
|
||||||
"firstPostBadgeName": "First Post",
|
"popularPostBadgeName": "熱帖",
|
||||||
"firstPostBadgeDescription": "Created your first post on Solar Network",
|
"popularPostBadgeDescription": "君作得眾譽",
|
||||||
"popularPostBadgeName": "Popular Post",
|
"viralPostBadgeName": "洛陽紙",
|
||||||
"popularPostBadgeDescription": "Your post received significant engagement from the community",
|
"viralPostBadgeDescription": "君文傳抄殆遍",
|
||||||
"viralPostBadgeName": "Viral Post",
|
"helpfulCommentBadgeName": "裨益論",
|
||||||
"viralPostBadgeDescription": "Your post went viral and reached a wide audience",
|
"helpfulCommentBadgeDescription": "諸君以為斯論足以啟迪來者",
|
||||||
"helpfulCommentBadgeName": "Helpful Comment",
|
"newcomerBadgeName": "新客",
|
||||||
"helpfulCommentBadgeDescription": "Your comment was marked as helpful by others",
|
"newcomerBadgeDescription": "欣迎加入 Solar Network!請開始遊覽結緣",
|
||||||
"newcomerBadgeName": "Newcomer",
|
"contributorBadgeName": "資士",
|
||||||
"newcomerBadgeDescription": "Welcome to Solar Network! Start exploring and connecting",
|
"contributorBadgeDescription": "勤力貢獻於 Solar Network 社群",
|
||||||
"contributorBadgeName": "Contributor",
|
"expertBadgeName": "達人",
|
||||||
"contributorBadgeDescription": "Actively contributing to the Solar Network community",
|
"expertBadgeDescription": "以專精與厚獻見稱於世",
|
||||||
"expertBadgeName": "Expert",
|
"founderBadgeName": "肇基",
|
||||||
"expertBadgeDescription": "Recognized for your expertise and valuable contributions",
|
"founderBadgeDescription": "屬 Solar Network 草創先驅",
|
||||||
"founderBadgeName": "Founder",
|
"betaTesterBadgeName": "預勘師",
|
||||||
"founderBadgeDescription": "One of the earliest members of Solar Network",
|
"betaTesterBadgeDescription": "嘗輔試 Solar Network 於初創之境",
|
||||||
"betaTesterBadgeName": "Beta Tester",
|
"moderatorBadgeName": "持衡官",
|
||||||
"betaTesterBadgeDescription": "Helped test and improve Solar Network during beta",
|
"moderatorBadgeDescription": "協理談筵規矩與秩序",
|
||||||
"moderatorBadgeName": "Moderator",
|
"developerBadgeName": "開物者",
|
||||||
"moderatorBadgeDescription": "Helping maintain and moderate the community",
|
"developerBadgeDescription": "獻力於 Solar Network 之功業",
|
||||||
"developerBadgeName": "Developer",
|
"translatorBadgeName": "譯介士",
|
||||||
"developerBadgeDescription": "Contributing to Solar Network's development",
|
"translatorBadgeDescription": "助譯 Solar Network 為諸邦之言",
|
||||||
"translatorBadgeName": "Translator",
|
"wallet": "荷包",
|
||||||
"translatorBadgeDescription": "Helping translate Solar Network into different languages",
|
"walletCurrencyPoints": "新太陽點",
|
||||||
"wallet": "Wallet",
|
|
||||||
"walletCurrencyPoints": "New Solar Points",
|
|
||||||
"walletCurrencyShortPoints": "NSP",
|
"walletCurrencyShortPoints": "NSP",
|
||||||
"walletCurrencyGolds": "The Solar Dollars",
|
"walletCurrencyGolds": "太陽幣",
|
||||||
"walletCurrencyShortGolds": "NSD",
|
"walletCurrencyShortGolds": "NSD",
|
||||||
"retry": "Retry",
|
"retry": "復行",
|
||||||
"creatorHubUnselectedHint": "Pick / create a publisher to get started.",
|
"creatorHubUnselectedHint": "擇/創發布者以啟程。",
|
||||||
"relationships": "Relationships",
|
"relationships": "交誼錄",
|
||||||
"addFriend": "Send a Friend Request",
|
"addFriend": "送締交書",
|
||||||
"addFriendShort": "Add as Friend",
|
"addFriendShort": "結為知交",
|
||||||
"addFriendHint": "Add a friend to your relationship list.",
|
"addFriendHint": "添友於交誼錄中。",
|
||||||
"pendingRequest": "Pending",
|
"pendingRequest": "待決",
|
||||||
"waitingRequest": "Waiting",
|
"waitingRequest": "候音",
|
||||||
"relationshipStatusFriend": "Friend",
|
"relationshipStatusFriend": "知交",
|
||||||
"relationshipStatusBlocked": "Blocked",
|
"relationshipStatusBlocked": "已阻",
|
||||||
"blockUser": "Block User",
|
"blockUser": "禁此戶",
|
||||||
"unblockUser": "Unblock User",
|
"unblockUser": "解禁",
|
||||||
"friendRequestAccepted": "Accepted friend request from {}",
|
"friendRequestAccepted": "已納 {} 締交書",
|
||||||
"friendRequestDeclined": "Declined friend request from {}",
|
"friendRequestDeclined": "已謝 {} 締交書",
|
||||||
"requestExpiredIn": "Expired in {}",
|
"requestExpiredIn": "效期 {}",
|
||||||
"friendSentRequest": "Sent Friend Requests",
|
"friendSentRequest": "已送締交書",
|
||||||
"friendSentRequestEmpty": "No sent friend requests",
|
"friendSentRequestEmpty": "未送締交書",
|
||||||
"friendSentRequestHint": {
|
"friendSentRequestHint": {
|
||||||
"one": "{} friend request sent",
|
"one": "已送{}締交書",
|
||||||
"other": "{} friend requests sent"
|
"other": "已送{}締交書"
|
||||||
},
|
},
|
||||||
"levelingProgress": "Leveling Progress",
|
"levelingProgress": "修為進境",
|
||||||
"levelingProgressExperience": "{} EXP",
|
"levelingProgressExperience": "{} 修為",
|
||||||
"levelingProgressLevel": "Level {}",
|
"levelingProgressLevel": "第 {} 重",
|
||||||
"fileUploadingProgress": "Uploading file #{}: {}%",
|
"fileUploadingProgress": "傳輸第 {} 宗卷:{}%",
|
||||||
"removeChatMember": "Remove Chat Room Member",
|
"removeChatMember": "逐出談席",
|
||||||
"removeChatMemberHint": "Are you sure to remove this member from the room?",
|
"removeChatMemberHint": "確欲逐此客出談筵乎?",
|
||||||
"removeRealmMember": "Remove Realm Member",
|
"removeRealmMember": "革出界域",
|
||||||
"removeRealmMemberHint": "Are you sure to remove this member from the realm?",
|
"removeRealmMemberHint": "確欲革此員出界域乎?",
|
||||||
"memberRole": "Member Role",
|
"memberRole": "成員權階",
|
||||||
"memberRoleHint": "Greater number has higher permission.",
|
"memberRoleHint": "數高則權重。",
|
||||||
"memberRoleEdit": "Edit role for @{}",
|
"memberRoleEdit": "修訂 @{} 之職",
|
||||||
"openLinkConfirm": "Leaving the Solar Network",
|
"openLinkConfirm": "行將離 Solar Network",
|
||||||
"openLinkConfirmDescription": "You're going to leave the Solar Network and open the link ({}) in your browser. It is not related to Solar Network. Beware of phishing and scams.",
|
"openLinkConfirmDescription": "君將辭 Solar Network 而啟 {} 之徑於瀏覽器,此徑與 Solar Network 無干,當心詐偽之害。",
|
||||||
"brokenLink": "Unable open link {}... It might be broken or missing uri parts...",
|
"brokenLink": "未能開啟 {} 之鏈……或為殘鏈佚址……",
|
||||||
"copyToClipboard": "Copy to clipboard",
|
"copyToClipboard": "抄入剪貼板",
|
||||||
"leaveChatRoom": "Leave Chat Room",
|
"leaveChatRoom": "辭離談席",
|
||||||
"leaveChatRoomHint": "Are you sure to leave this chat room?",
|
"leaveChatRoomHint": "君確要辭此談席否?",
|
||||||
"leaveRealm": "Leave Realm",
|
"leaveRealm": "辭離界域",
|
||||||
"leaveRealmHint": "Are you sure to leave this realm?",
|
"leaveRealmHint": "君確要辭此界域否?",
|
||||||
"walletNotFound": "Wallet not found",
|
"walletNotFound": "未見荷包",
|
||||||
"walletCreateHint": "You don't have a wallet yet. Create one to start using the Solar Network eWallet.",
|
"walletCreateHint": "君尚未備荷包,請創之以啟用 Solar Network 電子荷包。",
|
||||||
"walletCreate": "Create a Wallet",
|
"walletCreate": "始創一荷包",
|
||||||
"settingsServerUrl": "Server URL",
|
"settingsServerUrl": "伺服器網址",
|
||||||
"settingsApplied": "The settings has been applied.",
|
"settingsApplied": "諸設定已施畢。",
|
||||||
"notifications": "Notifications",
|
"notifications": "報聞",
|
||||||
"posts": "Posts",
|
"posts": "貼文",
|
||||||
"settingsBackgroundImage": "Background Image",
|
"settingsBackgroundImage": "底圖",
|
||||||
"settingsBackgroundImageClear": "Clear Background Image",
|
"settingsBackgroundImageClear": "清底圖",
|
||||||
"settingsBackgroundGenerateColor": "Generate color scheme from Bacground Image",
|
"settingsBackgroundGenerateColor": "取背景畫配色",
|
||||||
"messageNone": "No content to display",
|
"messageNone": "無文可示",
|
||||||
"unreadMessages": {
|
"unreadMessages": {
|
||||||
"one": "{} unread message",
|
"one": "{} 條未讀訊",
|
||||||
"other": "{} unread messages"
|
"other": "{} 條未讀訊"
|
||||||
},
|
},
|
||||||
"chatBreakNone": "None",
|
"chatBreakNone": "無",
|
||||||
"settingsRealmCompactView": "Compact Realm View",
|
"settingsRealmCompactView": "緊湊界域視圖",
|
||||||
"settingsMixedFeed": "Mixed Feed",
|
"settingsMixedFeed": "混流饋訊",
|
||||||
"settingsAutoTranslate": "Auto Translate",
|
"settingsAutoTranslate": "自轉譯",
|
||||||
"settingsHideBottomNav": "Hide Bottom Navigation",
|
"settingsHideBottomNav": "隱底航",
|
||||||
"settingsSoundEffects": "Sound Effects",
|
"settingsSoundEffects": "音效",
|
||||||
"settingsAprilFoolFeatures": "April Fool Features",
|
"settingsAprilFoolFeatures": "謔辰妙能",
|
||||||
"settingsEnterToSend": "Enter to Send",
|
"settingsEnterToSend": "叩回車鍵即送",
|
||||||
"settingsTransparentAppBar": "Transparent App Bar",
|
"settingsTransparentAppBar": "透光應用欄",
|
||||||
"settingsCustomFonts": "Custom Fonts",
|
"settingsCustomFonts": "自定字體",
|
||||||
"settingsCustomFontsHint": "Custom fonts will be used for all text in the app. Make sure it is installed on your device.",
|
"settingsCustomFontsHint": "此字體將通施於應用內文,請先確安於裝置。",
|
||||||
"settingsColorScheme": "Color Scheme",
|
"settingsColorScheme": "設置色彩方案",
|
||||||
"postTitle": "Title",
|
"postTitle": "標題",
|
||||||
"postDescription": "Description",
|
"postDescription": "状",
|
||||||
"call": "Call",
|
"call": "传信",
|
||||||
"done": "Done",
|
"done": "已成矣",
|
||||||
"loginResetPasswordSent": "Password reset link sent, please check your email inbox.",
|
"loginResetPasswordSent": "密码重置之链已送至,恳愿于汝之邮址查阅。",
|
||||||
"accountDeletion": "Delete Account",
|
"accountDeletion": "除去此账户",
|
||||||
"accountDeletionHint": "Are you sure to delete your account? If you confirmed, we will send an confirmation email to your primary email address, you can continue the deletion process by follow the insturctions in the email.",
|
"accountDeletionHint": "汝已存心除此账户?如已一意,信将至汝邮址,随信中之言续此行。",
|
||||||
"accountDeletionSent": "Account deletion confirmation email sent, please check your email inbox.",
|
"accountDeletionSent": "除此账户之信已送至,请于汝之邮址查阅。",
|
||||||
"accountSecurityTitle": "Security",
|
"accountSecurityTitle": "Security",
|
||||||
"accountDangerZoneTitle": "Danger Zone",
|
"accountDangerZoneTitle": "Danger Zone",
|
||||||
"accountPassword": "Password",
|
"accountPassword": "密碼",
|
||||||
"accountPasswordDescription": "Change your account password",
|
"accountPasswordDescription": "變更账户密碼",
|
||||||
"accountPasswordChange": "Change Password",
|
"accountPasswordChange": "變更密碼",
|
||||||
"accountPasswordChangeSent": "Password reset link sent, please check your email inbox.",
|
"accountPasswordChangeSent": "Password reset link sent, please check your email inbox.",
|
||||||
"accountPasswordChangeDescription": "We will send an email to your primary email address to reset your password.",
|
"accountPasswordChangeDescription": "We will send an email to your primary email address to reset your password.",
|
||||||
"accountAuthFactor": "Auth factors",
|
"accountAuthFactor": "Auth factors",
|
||||||
@@ -346,14 +344,14 @@
|
|||||||
"unauthorizedHint": "You're not signed in or session expired, please sign in again.",
|
"unauthorizedHint": "You're not signed in or session expired, please sign in again.",
|
||||||
"publisherBelongsTo": "Belongs to {}",
|
"publisherBelongsTo": "Belongs to {}",
|
||||||
"postContent": "Content",
|
"postContent": "Content",
|
||||||
"postSettings": "Settings",
|
"postSettings": "設定",
|
||||||
"postPublisherUnselected": "Publisher Unspecified",
|
"postPublisherUnselected": "发信者未定",
|
||||||
"postVisibilityPublic": "Public",
|
"postVisibilityPublic": "众以见",
|
||||||
"postVisibilityFriends": "Friends Only",
|
"postVisibilityFriends": "唯友以见",
|
||||||
"postVisibilityUnlisted": "Unlisted",
|
"postVisibilityUnlisted": "非指之人以见",
|
||||||
"postVisibilityPrivate": "Private",
|
"postVisibilityPrivate": "唯己可见",
|
||||||
"postTruncated": "Content truncated, tap to view full post",
|
"postTruncated": "Content truncated, tap to view full post",
|
||||||
"copyMessage": "Copy Message",
|
"copyMessage": "抄文",
|
||||||
"authFactor": "Authentication Factor",
|
"authFactor": "Authentication Factor",
|
||||||
"authFactorDelete": "Delete the Factor",
|
"authFactorDelete": "Delete the Factor",
|
||||||
"authFactorDeleteHint": "Are you sure you want to delete this authentication factor? This action cannot be undone.",
|
"authFactorDeleteHint": "Are you sure you want to delete this authentication factor? This action cannot be undone.",
|
||||||
@@ -366,8 +364,8 @@
|
|||||||
"authFactorSecretHint": "Create an secret for this factor.",
|
"authFactorSecretHint": "Create an secret for this factor.",
|
||||||
"authFactorQrCodeScan": "Scan this QR code with your authenticator app to set up TOTP authentication",
|
"authFactorQrCodeScan": "Scan this QR code with your authenticator app to set up TOTP authentication",
|
||||||
"authFactorNoQrCode": "No QR code available for this authentication factor",
|
"authFactorNoQrCode": "No QR code available for this authentication factor",
|
||||||
"cancel": "Cancel",
|
"cancel": "止",
|
||||||
"confirm": "Confirm",
|
"confirm": "认",
|
||||||
"authFactorAdditional": "One more step",
|
"authFactorAdditional": "One more step",
|
||||||
"authFactorHint": "Contact method hint",
|
"authFactorHint": "Contact method hint",
|
||||||
"authFactorHintHelper": "You need provide a part of your contact method and we will send the verification code to that contact method if it matched our records",
|
"authFactorHintHelper": "You need provide a part of your contact method and we will send the verification code to that contact method if it matched our records",
|
||||||
@@ -387,12 +385,12 @@
|
|||||||
"authDeviceSwipeEditHint": "Swipe left to edit label",
|
"authDeviceSwipeEditHint": "Swipe left to edit label",
|
||||||
"authDeviceSwipeLogoutHint": "Swipe right to logout device",
|
"authDeviceSwipeLogoutHint": "Swipe right to logout device",
|
||||||
"typingHint": {
|
"typingHint": {
|
||||||
"one": "{} is typing...",
|
"one": "{} 正在执笔……",
|
||||||
"other": "{} are typing..."
|
"other": "{} 正在执笔……"
|
||||||
},
|
},
|
||||||
"settingsAppearance": "Appearance",
|
"settingsAppearance": "Appearance",
|
||||||
"settingsServer": "Server",
|
"settingsServer": "伺服器",
|
||||||
"settingsBehavior": "Behavior",
|
"settingsBehavior": "为",
|
||||||
"settingsDesktop": "Desktop",
|
"settingsDesktop": "Desktop",
|
||||||
"settingsKeyboardShortcuts": "Keyboard Shortcuts",
|
"settingsKeyboardShortcuts": "Keyboard Shortcuts",
|
||||||
"settingsEnterToSendDesktopHint": "Press Enter to send messages, use Shift+Enter for new line.",
|
"settingsEnterToSendDesktopHint": "Press Enter to send messages, use Shift+Enter for new line.",
|
||||||
@@ -752,21 +750,6 @@
|
|||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
"markAsSensitive": "Mark as Sensitive",
|
"markAsSensitive": "Mark as Sensitive",
|
||||||
"fileName": "File name",
|
"fileName": "File name",
|
||||||
"sensitiveCategories": {
|
|
||||||
"language": "Language",
|
|
||||||
"sexualContent": "Sexual Content",
|
|
||||||
"violence": "Violence",
|
|
||||||
"profanity": "Profanity",
|
|
||||||
"hateSpeech": "Hate Speech",
|
|
||||||
"racism": "Racism",
|
|
||||||
"adultContent": "Adult Content",
|
|
||||||
"drugAbuse": "Drug Abuse",
|
|
||||||
"alcoholAbuse": "Alcohol Abuse",
|
|
||||||
"gambling": "Gambling",
|
|
||||||
"selfHarm": "Self-harm",
|
|
||||||
"childAbuse": "Child Abuse",
|
|
||||||
"other": "Other"
|
|
||||||
},
|
|
||||||
"poll": "Poll",
|
"poll": "Poll",
|
||||||
"pollsRecent": "Recent Polls",
|
"pollsRecent": "Recent Polls",
|
||||||
"pollCreateNew": "Create New",
|
"pollCreateNew": "Create New",
|
||||||
@@ -1075,5 +1058,421 @@
|
|||||||
"deleteRecycledFiles": "Delete Recycled Files",
|
"deleteRecycledFiles": "Delete Recycled Files",
|
||||||
"recycledFilesDeleted": "Recycled files deleted successfully",
|
"recycledFilesDeleted": "Recycled files deleted successfully",
|
||||||
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
"failedToDeleteRecycledFiles": "Failed to delete recycled files",
|
||||||
"upload": "Upload"
|
"upload": "Upload",
|
||||||
|
"deleteMessage": "Delete Message",
|
||||||
|
"deleteMessageConfirmation": "Are you sure you want to delete this message?",
|
||||||
|
"customReaction": "Custom Reaction",
|
||||||
|
"customReactions": "Custom Reactions",
|
||||||
|
"stickerPlaceholder": "Sticker Placeholder",
|
||||||
|
"reactionAttitude": "Reaction Attitude",
|
||||||
|
"addReaction": "Add Reaction",
|
||||||
|
"eventCalendar": "Event Calendar",
|
||||||
|
"eventCalendarEmpty": "No events on that day.",
|
||||||
|
"walletStats": "Wallet Statistics",
|
||||||
|
"totalTransactions": "Total Transactions",
|
||||||
|
"totalOrders": "Total Orders",
|
||||||
|
"totalIncome": "Total Income",
|
||||||
|
"totalOutgoing": "Total Outgoing",
|
||||||
|
"netBalance": "Net Balance",
|
||||||
|
"messageUpdateLinks": "Server generated links previews",
|
||||||
|
"messageUpdateEdited": "Edited a message",
|
||||||
|
"settingsCardBackgroundOpacity": "Card Background Opacity",
|
||||||
|
"settingsThemeMode": "Theme Mode",
|
||||||
|
"settingsThemeModeSystem": "System",
|
||||||
|
"settingsThemeModeLight": "Light",
|
||||||
|
"settingsThemeModeDark": "Dark",
|
||||||
|
"enterPin": "Enter your PIN code",
|
||||||
|
"chatReplyingTo": "Replying to {}",
|
||||||
|
"chatForwarding": "Forwarding message",
|
||||||
|
"chatEditing": "Editing message",
|
||||||
|
"chatNoContent": "No content",
|
||||||
|
"sensitiveCategories": {
|
||||||
|
"language": "Language",
|
||||||
|
"sexualContent": "Sexual Content",
|
||||||
|
"violence": "Violence",
|
||||||
|
"profanity": "Profanity",
|
||||||
|
"hateSpeech": "Hate Speech",
|
||||||
|
"racism": "Racism",
|
||||||
|
"adultContent": "Adult Content",
|
||||||
|
"drugAbuse": "Drug Abuse",
|
||||||
|
"alcoholAbuse": "Alcohol Abuse",
|
||||||
|
"gambling": "Gambling",
|
||||||
|
"selfHarm": "Self-harm",
|
||||||
|
"childAbuse": "Child Abuse",
|
||||||
|
"other": "Other"
|
||||||
|
},
|
||||||
|
"Searching...": "Searching...",
|
||||||
|
"searchError": "Search failed. Please try again.",
|
||||||
|
"tryDifferentKeywords": "Try different keywords or remove search filters",
|
||||||
|
"settingsWindowOpacity": "Window Opacity",
|
||||||
|
"messageContent": "Message Content",
|
||||||
|
"updateAvailable": "Update available",
|
||||||
|
"noChangelogProvided": "No changelog provided.",
|
||||||
|
"useSecondarySourceForDownload": "Use secondary source for download",
|
||||||
|
"installUpdate": "Install update",
|
||||||
|
"openReleasePage": "Open release page",
|
||||||
|
"postCompose": "Compose Post",
|
||||||
|
"postPublish": "Publish Post",
|
||||||
|
"restoreDraftTitle": "Restore Draft",
|
||||||
|
"restoreDraftMessage": "A draft was found. Do you want to restore it?",
|
||||||
|
"draft": "Draft",
|
||||||
|
"purchaseGift": "Purchase Gift",
|
||||||
|
"selectRecipient": "Select Recipient",
|
||||||
|
"changeRecipient": "Change Recipient",
|
||||||
|
"addMessage": "Add Message",
|
||||||
|
"skipRecipient": "Skip Recipient",
|
||||||
|
"giftSubscriptions": "Gift Subscriptions",
|
||||||
|
"purchaseAGift": "Purchase a Gift",
|
||||||
|
"redeemAGift": "Redeem a Gift",
|
||||||
|
"giftHistory": "Gift History",
|
||||||
|
"sentGifts": "Sent Gifts",
|
||||||
|
"receivedGifts": "Received Gifts",
|
||||||
|
"noSentGifts": "No sent gifts",
|
||||||
|
"noReceivedGifts": "No received gifts",
|
||||||
|
"stellarGift": "Stellar Gift",
|
||||||
|
"novaGift": "Nova Gift",
|
||||||
|
"supernovaGift": "Supernova Gift",
|
||||||
|
"sameAsMembership": "Same as membership",
|
||||||
|
"enterGiftCodeToRedeem": "Enter gift code to redeem",
|
||||||
|
"enterGiftCode": "Enter gift code",
|
||||||
|
"giftPurchased": "Gift Purchased!",
|
||||||
|
"shareCodeWithRecipient": "Share this code with the recipient to redeem the gift.",
|
||||||
|
"openGiftAnyoneCanRedeem": "This is an open gift that anyone can redeem.",
|
||||||
|
"ok": "OK",
|
||||||
|
"selectedRecipient": "Selected recipient",
|
||||||
|
"noRecipientSelected": "No recipient selected",
|
||||||
|
"thisWillBeAnOpenGift": "This will be an open gift",
|
||||||
|
"personalMessage": "Personal Message",
|
||||||
|
"addPersonalMessageForRecipient": "Add a personal message for the recipient",
|
||||||
|
"giftStatusCreated": "Created",
|
||||||
|
"giftStatusSent": "Sent",
|
||||||
|
"giftStatusRedeemed": "Redeemed",
|
||||||
|
"giftStatusCancelled": "Cancelled",
|
||||||
|
"giftStatusExpired": "Expired",
|
||||||
|
"giftStatusUnknown": "Unknown",
|
||||||
|
"giftCodeCopiedToClipboard": "Gift code copied to clipboard",
|
||||||
|
"codeLabel": "Code: ",
|
||||||
|
"subscriptionLabel": "Subscription: ",
|
||||||
|
"toLabel": "To: ",
|
||||||
|
"fromLabel": "From: ",
|
||||||
|
"messageLabel": "Message: ",
|
||||||
|
"giftRedeemed": "Gift Redeemed!",
|
||||||
|
"giftRedeemedSuccessfully": "You have successfully redeemed the gift. Your new subscription is now active.",
|
||||||
|
"cancelGift": "Cancel Gift",
|
||||||
|
"cancelGiftConfirm": "Are you sure you want to cancel this gift? This action cannot be undone.",
|
||||||
|
"giftCancelledSuccessfully": "Gift cancelled successfully",
|
||||||
|
"createFund": "Create Fund",
|
||||||
|
"fundAmount": "Fund Amount",
|
||||||
|
"enterAmount": "Enter Amount",
|
||||||
|
"selectCurrency": "Select Currency",
|
||||||
|
"splitType": "Split Type",
|
||||||
|
"evenSplit": "Even Split",
|
||||||
|
"equalAmountEach": "Equal amount for each recipient",
|
||||||
|
"randomSplit": "Random Split",
|
||||||
|
"randomAmountEach": "Random amount for each recipient",
|
||||||
|
"recipientCount": "Recipient Count",
|
||||||
|
"numberOfRecipients": "Number of Recipients",
|
||||||
|
"addPersonalMessageForRecipients": "Add a personal message for recipients",
|
||||||
|
"invalidAmount": "Invalid amount",
|
||||||
|
"invalidRecipientCount": "Invalid recipient count",
|
||||||
|
"fundOverview": "Fund Overview",
|
||||||
|
"totalFundsSent": "Total Funds Sent",
|
||||||
|
"totalFundsReceived": "Total Funds Received",
|
||||||
|
"transactions": "Transactions",
|
||||||
|
"myFunds": "My Funds",
|
||||||
|
"availableFunds": "Available Funds",
|
||||||
|
"fundStatusCreated": "Created",
|
||||||
|
"fundStatusPartial": "Partially Claimed",
|
||||||
|
"fundStatusCompleted": "Fully Claimed",
|
||||||
|
"fundStatusExpired": "Expired",
|
||||||
|
"fundStatusUnknown": "Unknown",
|
||||||
|
"recipients": "Recipients",
|
||||||
|
"fundClaimedSuccessfully": "Fund claimed successfully!",
|
||||||
|
"claim": "Claim",
|
||||||
|
"noFundsCreated": "No funds created yet",
|
||||||
|
"createYourFirstFund": "Create your first fund to get started",
|
||||||
|
"noAvailableFunds": "No available funds",
|
||||||
|
"fundsWillAppearHere": "Funds you can claim will appear here",
|
||||||
|
"fundCreatedSuccessfully": "Fund created successfully!",
|
||||||
|
"selectRecipients": "Select Recipients",
|
||||||
|
"noRecipientsSelected": "No recipients selected",
|
||||||
|
"selectRecipientsToSendFund": "Select recipients to send the fund to",
|
||||||
|
"addRecipient": "Add Recipient",
|
||||||
|
"addMoreRecipients": "Add More Recipients",
|
||||||
|
"transactionDetails": "Transaction Details",
|
||||||
|
"remarks": "Remarks",
|
||||||
|
"payer": "Payer",
|
||||||
|
"payee": "Payee",
|
||||||
|
"transactionType": "Transaction Type",
|
||||||
|
"transfer": "Transfer",
|
||||||
|
"payment": "Payment",
|
||||||
|
"systemWallet": "System Wallet",
|
||||||
|
"date": "Date",
|
||||||
|
"createTransfer": "Create Transfer",
|
||||||
|
"transferAmount": "Transfer Amount",
|
||||||
|
"selectPayee": "Select Payee",
|
||||||
|
"selectedPayee": "Selected Payee",
|
||||||
|
"noPayeeSelected": "No payee selected",
|
||||||
|
"selectPayeeToTransfer": "Select payee to transfer to",
|
||||||
|
"addRemark": "Add Remark",
|
||||||
|
"transferRemark": "Transfer Remark",
|
||||||
|
"addRemarkForTransfer": "Add remark for transfer",
|
||||||
|
"enterPinToConfirmTransfer": "Enter your 6-digit PIN to confirm transfer",
|
||||||
|
"transferCreatedSuccessfully": "Transfer created successfully!",
|
||||||
|
"postUpdate": "Update",
|
||||||
|
"fileMetadata": "File Metadata",
|
||||||
|
"resend": "Resend",
|
||||||
|
"fileInfoTitle": "File Information",
|
||||||
|
"download": "Download",
|
||||||
|
"info": "Info",
|
||||||
|
"noStickers": "No Stickers",
|
||||||
|
"noStickersInPack": "This pack does not contains stickers",
|
||||||
|
"noStickerPacks": "No Sticker Packs",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"spoiler": "Spoiler",
|
||||||
|
"activityHeatmap": "Activity Heatmap",
|
||||||
|
"custom": "Custom",
|
||||||
|
"usernameColor": "Username Color",
|
||||||
|
"colorType": "Color Type",
|
||||||
|
"plain": "Plain",
|
||||||
|
"gradient": "Gradient",
|
||||||
|
"colorValue": "Color Value",
|
||||||
|
"gradientDirection": "Gradient Direction",
|
||||||
|
"gradientDirectionToRight": "To Right",
|
||||||
|
"gradientDirectionToLeft": "To Left",
|
||||||
|
"gradientDirectionToBottom": "To Bottom",
|
||||||
|
"gradientDirectionToTop": "To Top",
|
||||||
|
"gradientDirectionToBottomRight": "To Bottom Right",
|
||||||
|
"gradientDirectionToBottomLeft": "To Bottom Left",
|
||||||
|
"gradientDirectionToTopRight": "To Top Right",
|
||||||
|
"gradientDirectionToTopLeft": "To Top Left",
|
||||||
|
"gradientColors": "Gradient Colors",
|
||||||
|
"color": "Color",
|
||||||
|
"addColor": "Add Color",
|
||||||
|
"availableWithYourPlan": "Available with your plan",
|
||||||
|
"upgradeRequired": "Upgrade required",
|
||||||
|
"settingsDisableAnimation": "Disable Animation",
|
||||||
|
"addTag": "Add Tag",
|
||||||
|
"accountConnectionProviderSpotify": "Spotify",
|
||||||
|
"accountConnectionProviderSteam": "Steam",
|
||||||
|
"timezoneNotFound": "Time zone not found",
|
||||||
|
"awardPoints": "Awarded {} points",
|
||||||
|
"postFeaturedOn": "Post featured on {}",
|
||||||
|
"messageSentAt": "Sent at {}",
|
||||||
|
"myTickets": "My Tickets",
|
||||||
|
"drawHistory": "Draw History",
|
||||||
|
"lottery": "Lottery",
|
||||||
|
"noLotteryTickets": "No lottery tickets yet",
|
||||||
|
"buyYourFirstTicket": "Buy your first lottery ticket to get started!",
|
||||||
|
"buyTicket": "Buy Ticket",
|
||||||
|
"ticketNumbers": "Numbers: {}, Special: {}",
|
||||||
|
"cost": "Cost",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"prizeWon": "Prize Won",
|
||||||
|
"pending": "Pending",
|
||||||
|
"drawn": "Drawn",
|
||||||
|
"won": "Won",
|
||||||
|
"lost": "Lost",
|
||||||
|
"noDrawHistory": "No draw history yet",
|
||||||
|
"buyLotteryTicket": "Buy Lottery Ticket",
|
||||||
|
"selectNumbers": "Select Numbers",
|
||||||
|
"select5UniqueNumbers": "Select 5 unique numbers",
|
||||||
|
"selectSpecialNumber": "Select Special Number",
|
||||||
|
"selectMultiplier": "Select Multiplier",
|
||||||
|
"baseCost": "Base Cost",
|
||||||
|
"totalCost": "Total Cost",
|
||||||
|
"prizeStructure": "Prize Structure",
|
||||||
|
"enterPinToConfirmPurchase": "Enter your PIN to confirm purchase",
|
||||||
|
"ticketPurchasedSuccessfully": "Ticket purchased successfully!",
|
||||||
|
"winningNumbers": "Winning Numbers",
|
||||||
|
"specialNumber": "Special Number",
|
||||||
|
"totalTickets": "Total Tickets",
|
||||||
|
"totalWinners": "Total Winners",
|
||||||
|
"prizePool": "Prize Pool",
|
||||||
|
"enterPinToConfirmPayment": "Enter your PIN code to confirm payment",
|
||||||
|
"purchase": "Purchase",
|
||||||
|
"multiplierLabel": "Multiplier",
|
||||||
|
"specialOnly": "Special Only",
|
||||||
|
"matches": "Matches",
|
||||||
|
"thoughtDefaultTopic": "Reflection",
|
||||||
|
"thoughtAiName": "SN-chan",
|
||||||
|
"thoughtUserName": "You",
|
||||||
|
"thoughtStreamingHint": "Sn-chan is thinking...",
|
||||||
|
"thoughtInputHint": "Ask sn-chan anything...",
|
||||||
|
"thoughtNewConversation": "Start New Conversation",
|
||||||
|
"thoughtParseError": "Failed to parse AI response",
|
||||||
|
"thoughtFunctionCall": "Use {}",
|
||||||
|
"aiThought": "AI Thought",
|
||||||
|
"aiThoughtTitle": "Let sn-chan think",
|
||||||
|
"postReferenceUnavailable": "Referenced post is unavailable",
|
||||||
|
"fabLocation": "FAB Location",
|
||||||
|
"activities": "Activities",
|
||||||
|
"presenceTypeGaming": "Playing",
|
||||||
|
"presenceTypeMusic": "Listening to Music",
|
||||||
|
"presenceTypeWorkout": "Working out",
|
||||||
|
"articleCompose": "Compose Article",
|
||||||
|
"backToHub": "Back to Hub",
|
||||||
|
"advancedFilters": "Advanced Filters",
|
||||||
|
"searchPosts": "Search Posts",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"fromDate": "From Date",
|
||||||
|
"toDate": "To Date",
|
||||||
|
"popularity": "Popularity",
|
||||||
|
"descendingOrder": "Descending Order",
|
||||||
|
"selectDate": "Select Date",
|
||||||
|
"pinnedPosts": "Pinned Posts",
|
||||||
|
"customReactionHint": "Custom Reaction allow you to use user uploaded stickers as the symbol of the reaction for the post. Exclusive for Stellar Program members.",
|
||||||
|
"publicationSites": "Publication Sites",
|
||||||
|
"uploadTasks": "Upload Tasks",
|
||||||
|
"thoughtFunctionCallBegin": "Calling tool {}",
|
||||||
|
"thoughtFunctionCallFinish": "{} responded",
|
||||||
|
"thoughtUnpaidHint": "Thinking unavaiable due to unpaid orders",
|
||||||
|
"more": "More",
|
||||||
|
"collapse": "Collapse",
|
||||||
|
"pollConfirmDiscard": "Are you sure you want to leave? All the poll data you're editing will not be saved.",
|
||||||
|
"discard": "Discard",
|
||||||
|
"fund": "Fund",
|
||||||
|
"fundsRecent": "Recent Funds",
|
||||||
|
"fundCreateNew": "Create New",
|
||||||
|
"fundCreateNewHint": "Create a new fund for your message. Select recipients and amount.",
|
||||||
|
"amountOfSplits": "Amount of Splits",
|
||||||
|
"enterNumberOfSplits": "Enter Splits Amount",
|
||||||
|
"orCreateWith": "Or\ncreate with",
|
||||||
|
"unindexedFiles": "Unindexed files",
|
||||||
|
"folder": "Folder",
|
||||||
|
"clearCompleted": "Clear Completed",
|
||||||
|
"uploadSuccess": "Upload successful!",
|
||||||
|
"wouldYouLikeToViewFile": "Would you like to view the file?",
|
||||||
|
"contentCantEmpty": "Content cannot be empty",
|
||||||
|
"features": "Features",
|
||||||
|
"unnamed": "Unnamed",
|
||||||
|
"fundEnvelopeLoadFailed": "Failed to load fund envelope",
|
||||||
|
"fundEnvelope": "Fund Envelope",
|
||||||
|
"fundEnvelopeRemaining": "Remaining: {} {}",
|
||||||
|
"fundEnvelopeSplit": "Split: {}",
|
||||||
|
"fundEnvelopeSplitEvenly": "Evenly",
|
||||||
|
"fundEnvelopeSplitRandomly": "Randomly",
|
||||||
|
"fundEnvelopeClaimSuccess": "Fund claimed successfully!",
|
||||||
|
"fundEnvelopeStatusCreated": "Created",
|
||||||
|
"fundEnvelopeStatusPartial": "Partially Claimed",
|
||||||
|
"fundEnvelopeStatusCompleted": "Fully Claimed",
|
||||||
|
"fundEnvelopeStatusExpired": "Expired",
|
||||||
|
"fundEnvelopeStatusUnknown": "Unknown",
|
||||||
|
"fundEnvelopeRecipients": "Recipients ({}/{} claimed)",
|
||||||
|
"fundEnvelopeExpiredDaysAgo": {
|
||||||
|
"one": "Expired {} day ago",
|
||||||
|
"other": "Expired {} days ago"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresSoon": "Expires soon",
|
||||||
|
"fundEnvelopeExpiresInHours": {
|
||||||
|
"one": "Expires in {} hour",
|
||||||
|
"other": "Expires in {} hours"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresInDays": {
|
||||||
|
"one": "Expires in {} day",
|
||||||
|
"other": "Expires in {} days"
|
||||||
|
},
|
||||||
|
"fundEnvelopeRemainingWithSplits": "{} {} / {} splits",
|
||||||
|
"fundEnvelopeUnknownUser": "Unknown User",
|
||||||
|
"deleteSite": "Delete Site",
|
||||||
|
"deleteSiteConfirm": "Are you sure you want to delete this site?",
|
||||||
|
"siteDeletedSuccess": "Site deleted successfully",
|
||||||
|
"siteSlug": "Slug",
|
||||||
|
"siteSlugHint": "my-site",
|
||||||
|
"siteSlugRequired": "Please enter a slug",
|
||||||
|
"siteSlugInvalid": "Slug can only contain lowercase letters, numbers, and dashes",
|
||||||
|
"siteName": "Site Name",
|
||||||
|
"siteNameHint": "My Publication Site",
|
||||||
|
"siteNameRequired": "Please enter a site name",
|
||||||
|
"siteMode": "Mode",
|
||||||
|
"siteModeFullyManaged": "Fully Managed",
|
||||||
|
"siteModeSelfManaged": "Self-Managed",
|
||||||
|
"editPublicationSite": "Edit Publication Site",
|
||||||
|
"deletePublicationSite": "Delete Publication Site",
|
||||||
|
"publicationSiteSavedSuccess": "Publication site saved successfully",
|
||||||
|
"publicationSiteDeleteConfirm": "Are you sure you want to delete this publication site? This action cannot be undone.",
|
||||||
|
"publicationSiteDeletedSuccess": "Publication site deleted successfully",
|
||||||
|
"newPublicationSite": "New Publication Site",
|
||||||
|
"siteDetails": "Site Details",
|
||||||
|
"siteInformation": "Site Information",
|
||||||
|
"siteDomain": "Domain",
|
||||||
|
"siteCreated": "Created",
|
||||||
|
"siteUpdated": "Updated",
|
||||||
|
"failedToLoadSite": "Failed to load site",
|
||||||
|
"sitePages": "Pages",
|
||||||
|
"noPagesYet": "No pages yet",
|
||||||
|
"createFirstPage": "Create your first page to get started",
|
||||||
|
"failedToLoadPages": "Failed to load pages",
|
||||||
|
"fileManagement": "File Management",
|
||||||
|
"siteFiles": "Files",
|
||||||
|
"siteFolder": "Folder",
|
||||||
|
"siteRoot": "Root",
|
||||||
|
"noFilesUploadedYet": "No files uploaded yet",
|
||||||
|
"uploadFirstFile": "Upload your first file to get started",
|
||||||
|
"failedToLoadFiles": "Failed to load files",
|
||||||
|
"noFilesFoundInFolder": "No files found in the selected folder",
|
||||||
|
"fileActions": "File Actions",
|
||||||
|
"purgeFiles": "Purge Files",
|
||||||
|
"purgeFilesDescription": "Remove all uploaded files from the site",
|
||||||
|
"deploySite": "Deploy Site",
|
||||||
|
"deploySiteDescription": "Upload and deploy a new version from ZIP archive",
|
||||||
|
"confirmPurge": "Confirm Purge",
|
||||||
|
"purgeFilesConfirm": "This will permanently delete all files uploaded to this site. This action cannot be undone. Are you sure you want to continue?",
|
||||||
|
"purgeAllFiles": "Purge All Files",
|
||||||
|
"allFilesPurgedSuccess": "All files purged successfully",
|
||||||
|
"failedToPurgeFiles": "Failed to purge files: {}",
|
||||||
|
"siteDeployedSuccess": "Site deployed successfully",
|
||||||
|
"failedToDeploySite": "Failed to deploy site: {}",
|
||||||
|
"createPage": "Create Page",
|
||||||
|
"editPage": "Edit Page",
|
||||||
|
"pageType": "Page Type",
|
||||||
|
"htmlPage": "HTML Page",
|
||||||
|
"redirectPage": "Redirect Page",
|
||||||
|
"pageTypeRequired": "Please select a page type",
|
||||||
|
"pagePath": "Page Path",
|
||||||
|
"pagePathHint": "/about, /contact, etc.",
|
||||||
|
"pagePathRequired": "Please enter a page path",
|
||||||
|
"pagePathInvalid": "Page path can only contain letters, numbers, hyphens, underscores, and slashes",
|
||||||
|
"pagePathMustStartWithSlash": "Page path must start with /",
|
||||||
|
"pagePathNoConsecutiveSlashes": "Page path cannot have consecutive slashes",
|
||||||
|
"pageTitle": "Page Title",
|
||||||
|
"pageTitleHint": "About Us, Contact, etc.",
|
||||||
|
"pageTitleRequired": "Please enter a page title",
|
||||||
|
"pageContentHtml": "Page Content (HTML)",
|
||||||
|
"pageContentHint": "<h1>Hello World</h1><p>This is my page content...</p>",
|
||||||
|
"pageContentRequired": "Please enter HTML content for the page",
|
||||||
|
"redirectTarget": "Redirect Target",
|
||||||
|
"redirectTargetHint": "/new-page, https://example.com, etc.",
|
||||||
|
"redirectTargetRequired": "Please enter a redirect target",
|
||||||
|
"redirectTargetInvalid": "Target must be a relative path (/) or absolute URL (http/https)",
|
||||||
|
"deletePage": "Delete Page",
|
||||||
|
"deletePageConfirm": "Are you sure you want to delete this page?",
|
||||||
|
"savePage": "Save Page",
|
||||||
|
"pageCreatedSuccess": "Page created successfully",
|
||||||
|
"pageUpdatedSuccess": "Page updated successfully",
|
||||||
|
"pageDeletedSuccess": "Page deleted successfully",
|
||||||
|
"uploadFiles": "Upload Files",
|
||||||
|
"uploadPath": "Upload Path",
|
||||||
|
"uploadPathHint": "/ (root) or /assets/images/",
|
||||||
|
"uploadPathRequired": "Please enter an upload path",
|
||||||
|
"uploadPathMustStartWithSlash": "Path must start with /",
|
||||||
|
"uploadPathNoSpaces": "Path cannot contain spaces",
|
||||||
|
"uploadPathNoConsecutiveSlashes": "Path cannot have consecutive slashes",
|
||||||
|
"percentCompleted": "{}% completed",
|
||||||
|
"filesToUpload": "{} files to upload",
|
||||||
|
"fileSizeKb": "Size: {} KB",
|
||||||
|
"uploadingEllipsis": "Uploading...",
|
||||||
|
"uploadFilesCount": {
|
||||||
|
"one": "Upload {} File",
|
||||||
|
"other": "Upload {} Files"
|
||||||
|
},
|
||||||
|
"allUploadsCompleted": "All uploads completed",
|
||||||
|
"someUploadsFailed": "Some uploads failed",
|
||||||
|
"uploadingInProgress": "Uploading in progress",
|
||||||
|
"readyToUpload": "Ready to upload",
|
||||||
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
@@ -164,8 +164,6 @@
|
|||||||
"checkInResultLevel3": "好運",
|
"checkInResultLevel3": "好運",
|
||||||
"checkInResultLevel4": "最佳運氣",
|
"checkInResultLevel4": "最佳運氣",
|
||||||
"checkInActivityTitle": "{} 在 {} 簽到並獲得了 {}",
|
"checkInActivityTitle": "{} 在 {} 簽到並獲得了 {}",
|
||||||
"eventCalander": "活動日曆",
|
|
||||||
"eventCalanderEmpty": "該日無活動。",
|
|
||||||
"fortuneGraph": "時運趨勢",
|
"fortuneGraph": "時運趨勢",
|
||||||
"noFortuneData": "本月沒有時運數據。",
|
"noFortuneData": "本月沒有時運數據。",
|
||||||
"creatorHub": "創作者中心",
|
"creatorHub": "創作者中心",
|
||||||
@@ -752,21 +750,6 @@
|
|||||||
"rename": "重命名",
|
"rename": "重命名",
|
||||||
"markAsSensitive": "標記為敏感",
|
"markAsSensitive": "標記為敏感",
|
||||||
"fileName": "文件名",
|
"fileName": "文件名",
|
||||||
"sensitiveCategories": {
|
|
||||||
"language": "語言",
|
|
||||||
"sexualContent": "色情內容",
|
|
||||||
"violence": "暴力",
|
|
||||||
"profanity": "褻瀆",
|
|
||||||
"hateSpeech": "仇恨言論",
|
|
||||||
"racism": "種族主義",
|
|
||||||
"adultContent": "成人內容",
|
|
||||||
"drugAbuse": "藥物濫用",
|
|
||||||
"alcoholAbuse": "酗酒",
|
|
||||||
"gambling": "賭博",
|
|
||||||
"selfHarm": "自殘",
|
|
||||||
"childAbuse": "虐待兒童",
|
|
||||||
"other": "其他"
|
|
||||||
},
|
|
||||||
"poll": "投票",
|
"poll": "投票",
|
||||||
"pollsRecent": "最近投票",
|
"pollsRecent": "最近投票",
|
||||||
"pollCreateNew": "創建新投票",
|
"pollCreateNew": "創建新投票",
|
||||||
@@ -1076,6 +1059,420 @@
|
|||||||
"recycledFilesDeleted": "已回收檔案刪除成功",
|
"recycledFilesDeleted": "已回收檔案刪除成功",
|
||||||
"failedToDeleteRecycledFiles": "已回收檔案刪除失敗",
|
"failedToDeleteRecycledFiles": "已回收檔案刪除失敗",
|
||||||
"upload": "上傳",
|
"upload": "上傳",
|
||||||
|
"deleteMessage": "刪除訊息",
|
||||||
|
"deleteMessageConfirmation": "確定要刪除此郵件嗎?",
|
||||||
|
"customReaction": "自訂反應",
|
||||||
|
"customReactions": "自訂反應",
|
||||||
|
"stickerPlaceholder": "貼紙佔位符",
|
||||||
|
"reactionAttitude": "反應態度",
|
||||||
|
"addReaction": "添加反應",
|
||||||
|
"eventCalendar": "事件日曆",
|
||||||
|
"eventCalendarEmpty": "該日無活動。",
|
||||||
|
"walletStats": "錢包統計",
|
||||||
|
"totalTransactions": "交易總數",
|
||||||
|
"totalOrders": "訂單總數",
|
||||||
|
"totalIncome": "總收入",
|
||||||
|
"totalOutgoing": "總支出",
|
||||||
|
"netBalance": "淨餘額",
|
||||||
|
"messageUpdateLinks": "伺服器產生的連結預覽",
|
||||||
|
"messageUpdateEdited": "編輯一則訊息",
|
||||||
|
"settingsCardBackgroundOpacity": "卡片背景不透明度",
|
||||||
|
"settingsThemeMode": "主題模式",
|
||||||
|
"settingsThemeModeSystem": "跟隨系統",
|
||||||
|
"settingsThemeModeLight": "淺色",
|
||||||
|
"settingsThemeModeDark": "暗色",
|
||||||
|
"enterPin": "請輸入您的PIN碼",
|
||||||
|
"chatReplyingTo": "回復給 {}",
|
||||||
|
"chatForwarding": "正在轉傳訊息",
|
||||||
|
"chatEditing": "訊息編輯中",
|
||||||
|
"chatNoContent": "內容為空",
|
||||||
|
"sensitiveCategories": {
|
||||||
|
"language": "語言",
|
||||||
|
"sexualContent": "色情內容",
|
||||||
|
"violence": "暴力",
|
||||||
|
"profanity": "褻瀆",
|
||||||
|
"hateSpeech": "仇恨言論",
|
||||||
|
"racism": "種族主義",
|
||||||
|
"adultContent": "成人內容",
|
||||||
|
"drugAbuse": "藥物濫用",
|
||||||
|
"alcoholAbuse": "酗酒",
|
||||||
|
"gambling": "賭博",
|
||||||
|
"selfHarm": "自殘",
|
||||||
|
"childAbuse": "虐待兒童",
|
||||||
|
"other": "其他"
|
||||||
|
},
|
||||||
|
"Searching...": "檢索中……",
|
||||||
|
"searchError": "付款失敗,請重試。",
|
||||||
|
"tryDifferentKeywords": "嘗試不同的關鍵字或刪除搜尋過濾器",
|
||||||
|
"settingsWindowOpacity": "視窗不透明度",
|
||||||
|
"messageContent": "訊息內容",
|
||||||
|
"updateAvailable": "更新可用",
|
||||||
|
"noChangelogProvided": "無更新紀錄。",
|
||||||
|
"useSecondarySourceForDownload": "使用次要來源下載",
|
||||||
|
"installUpdate": "安装更新",
|
||||||
|
"openReleasePage": "開啟發行頁面",
|
||||||
"postCompose": "撰寫帖子",
|
"postCompose": "撰寫帖子",
|
||||||
"postPublish": "發佈帖子"
|
"postPublish": "發佈帖子",
|
||||||
|
"restoreDraftTitle": "還原草稿",
|
||||||
|
"restoreDraftMessage": "發現了一個草稿。你想要恢復它嗎?",
|
||||||
|
"draft": "草稿",
|
||||||
|
"purchaseGift": "充值有禮",
|
||||||
|
"selectRecipient": "選擇收件者",
|
||||||
|
"changeRecipient": "修改款件人",
|
||||||
|
"addMessage": "添加消息",
|
||||||
|
"skipRecipient": "跳過款件人",
|
||||||
|
"giftSubscriptions": "贈送訂閱",
|
||||||
|
"purchaseAGift": "充值有禮",
|
||||||
|
"redeemAGift": "兌換禮物",
|
||||||
|
"giftHistory": "禮物記錄",
|
||||||
|
"sentGifts": "發送禮物",
|
||||||
|
"receivedGifts": "接收禮物",
|
||||||
|
"noSentGifts": "沒有送過禮物",
|
||||||
|
"noReceivedGifts": "没有收到过礼物",
|
||||||
|
"stellarGift": "恆星禮物",
|
||||||
|
"novaGift": "新星禮物",
|
||||||
|
"supernovaGift": "Supernova Gift",
|
||||||
|
"sameAsMembership": "Same as membership",
|
||||||
|
"enterGiftCodeToRedeem": "Enter gift code to redeem",
|
||||||
|
"enterGiftCode": "Enter gift code",
|
||||||
|
"giftPurchased": "Gift Purchased!",
|
||||||
|
"shareCodeWithRecipient": "Share this code with the recipient to redeem the gift.",
|
||||||
|
"openGiftAnyoneCanRedeem": "This is an open gift that anyone can redeem.",
|
||||||
|
"ok": "OK",
|
||||||
|
"selectedRecipient": "Selected recipient",
|
||||||
|
"noRecipientSelected": "No recipient selected",
|
||||||
|
"thisWillBeAnOpenGift": "This will be an open gift",
|
||||||
|
"personalMessage": "Personal Message",
|
||||||
|
"addPersonalMessageForRecipient": "Add a personal message for the recipient",
|
||||||
|
"giftStatusCreated": "Created",
|
||||||
|
"giftStatusSent": "Sent",
|
||||||
|
"giftStatusRedeemed": "Redeemed",
|
||||||
|
"giftStatusCancelled": "Cancelled",
|
||||||
|
"giftStatusExpired": "Expired",
|
||||||
|
"giftStatusUnknown": "Unknown",
|
||||||
|
"giftCodeCopiedToClipboard": "Gift code copied to clipboard",
|
||||||
|
"codeLabel": "Code: ",
|
||||||
|
"subscriptionLabel": "Subscription: ",
|
||||||
|
"toLabel": "To: ",
|
||||||
|
"fromLabel": "From: ",
|
||||||
|
"messageLabel": "Message: ",
|
||||||
|
"giftRedeemed": "Gift Redeemed!",
|
||||||
|
"giftRedeemedSuccessfully": "You have successfully redeemed the gift. Your new subscription is now active.",
|
||||||
|
"cancelGift": "Cancel Gift",
|
||||||
|
"cancelGiftConfirm": "Are you sure you want to cancel this gift? This action cannot be undone.",
|
||||||
|
"giftCancelledSuccessfully": "Gift cancelled successfully",
|
||||||
|
"createFund": "Create Fund",
|
||||||
|
"fundAmount": "Fund Amount",
|
||||||
|
"enterAmount": "Enter Amount",
|
||||||
|
"selectCurrency": "Select Currency",
|
||||||
|
"splitType": "Split Type",
|
||||||
|
"evenSplit": "Even Split",
|
||||||
|
"equalAmountEach": "Equal amount for each recipient",
|
||||||
|
"randomSplit": "Random Split",
|
||||||
|
"randomAmountEach": "Random amount for each recipient",
|
||||||
|
"recipientCount": "Recipient Count",
|
||||||
|
"numberOfRecipients": "Number of Recipients",
|
||||||
|
"addPersonalMessageForRecipients": "Add a personal message for recipients",
|
||||||
|
"invalidAmount": "Invalid amount",
|
||||||
|
"invalidRecipientCount": "Invalid recipient count",
|
||||||
|
"fundOverview": "Fund Overview",
|
||||||
|
"totalFundsSent": "Total Funds Sent",
|
||||||
|
"totalFundsReceived": "Total Funds Received",
|
||||||
|
"transactions": "Transactions",
|
||||||
|
"myFunds": "My Funds",
|
||||||
|
"availableFunds": "Available Funds",
|
||||||
|
"fundStatusCreated": "Created",
|
||||||
|
"fundStatusPartial": "Partially Claimed",
|
||||||
|
"fundStatusCompleted": "Fully Claimed",
|
||||||
|
"fundStatusExpired": "Expired",
|
||||||
|
"fundStatusUnknown": "Unknown",
|
||||||
|
"recipients": "Recipients",
|
||||||
|
"fundClaimedSuccessfully": "Fund claimed successfully!",
|
||||||
|
"claim": "Claim",
|
||||||
|
"noFundsCreated": "No funds created yet",
|
||||||
|
"createYourFirstFund": "Create your first fund to get started",
|
||||||
|
"noAvailableFunds": "No available funds",
|
||||||
|
"fundsWillAppearHere": "Funds you can claim will appear here",
|
||||||
|
"fundCreatedSuccessfully": "Fund created successfully!",
|
||||||
|
"selectRecipients": "Select Recipients",
|
||||||
|
"noRecipientsSelected": "No recipients selected",
|
||||||
|
"selectRecipientsToSendFund": "Select recipients to send the fund to",
|
||||||
|
"addRecipient": "Add Recipient",
|
||||||
|
"addMoreRecipients": "Add More Recipients",
|
||||||
|
"transactionDetails": "Transaction Details",
|
||||||
|
"remarks": "Remarks",
|
||||||
|
"payer": "Payer",
|
||||||
|
"payee": "Payee",
|
||||||
|
"transactionType": "Transaction Type",
|
||||||
|
"transfer": "Transfer",
|
||||||
|
"payment": "Payment",
|
||||||
|
"systemWallet": "System Wallet",
|
||||||
|
"date": "Date",
|
||||||
|
"createTransfer": "Create Transfer",
|
||||||
|
"transferAmount": "Transfer Amount",
|
||||||
|
"selectPayee": "Select Payee",
|
||||||
|
"selectedPayee": "Selected Payee",
|
||||||
|
"noPayeeSelected": "No payee selected",
|
||||||
|
"selectPayeeToTransfer": "Select payee to transfer to",
|
||||||
|
"addRemark": "Add Remark",
|
||||||
|
"transferRemark": "Transfer Remark",
|
||||||
|
"addRemarkForTransfer": "Add remark for transfer",
|
||||||
|
"enterPinToConfirmTransfer": "Enter your 6-digit PIN to confirm transfer",
|
||||||
|
"transferCreatedSuccessfully": "Transfer created successfully!",
|
||||||
|
"postUpdate": "Update",
|
||||||
|
"fileMetadata": "File Metadata",
|
||||||
|
"resend": "Resend",
|
||||||
|
"fileInfoTitle": "File Information",
|
||||||
|
"download": "Download",
|
||||||
|
"info": "Info",
|
||||||
|
"noStickers": "No Stickers",
|
||||||
|
"noStickersInPack": "This pack does not contains stickers",
|
||||||
|
"noStickerPacks": "No Sticker Packs",
|
||||||
|
"refresh": "Refresh",
|
||||||
|
"spoiler": "Spoiler",
|
||||||
|
"activityHeatmap": "Activity Heatmap",
|
||||||
|
"custom": "Custom",
|
||||||
|
"usernameColor": "Username Color",
|
||||||
|
"colorType": "Color Type",
|
||||||
|
"plain": "Plain",
|
||||||
|
"gradient": "Gradient",
|
||||||
|
"colorValue": "Color Value",
|
||||||
|
"gradientDirection": "Gradient Direction",
|
||||||
|
"gradientDirectionToRight": "To Right",
|
||||||
|
"gradientDirectionToLeft": "To Left",
|
||||||
|
"gradientDirectionToBottom": "To Bottom",
|
||||||
|
"gradientDirectionToTop": "To Top",
|
||||||
|
"gradientDirectionToBottomRight": "To Bottom Right",
|
||||||
|
"gradientDirectionToBottomLeft": "To Bottom Left",
|
||||||
|
"gradientDirectionToTopRight": "To Top Right",
|
||||||
|
"gradientDirectionToTopLeft": "To Top Left",
|
||||||
|
"gradientColors": "Gradient Colors",
|
||||||
|
"color": "Color",
|
||||||
|
"addColor": "Add Color",
|
||||||
|
"availableWithYourPlan": "Available with your plan",
|
||||||
|
"upgradeRequired": "Upgrade required",
|
||||||
|
"settingsDisableAnimation": "Disable Animation",
|
||||||
|
"addTag": "Add Tag",
|
||||||
|
"accountConnectionProviderSpotify": "Spotify",
|
||||||
|
"accountConnectionProviderSteam": "Steam",
|
||||||
|
"timezoneNotFound": "Time zone not found",
|
||||||
|
"awardPoints": "Awarded {} points",
|
||||||
|
"postFeaturedOn": "Post featured on {}",
|
||||||
|
"messageSentAt": "Sent at {}",
|
||||||
|
"myTickets": "My Tickets",
|
||||||
|
"drawHistory": "Draw History",
|
||||||
|
"lottery": "Lottery",
|
||||||
|
"noLotteryTickets": "No lottery tickets yet",
|
||||||
|
"buyYourFirstTicket": "Buy your first lottery ticket to get started!",
|
||||||
|
"buyTicket": "Buy Ticket",
|
||||||
|
"ticketNumbers": "Numbers: {}, Special: {}",
|
||||||
|
"cost": "Cost",
|
||||||
|
"multiplier": "Multiplier",
|
||||||
|
"prizeWon": "Prize Won",
|
||||||
|
"pending": "Pending",
|
||||||
|
"drawn": "Drawn",
|
||||||
|
"won": "Won",
|
||||||
|
"lost": "Lost",
|
||||||
|
"noDrawHistory": "No draw history yet",
|
||||||
|
"buyLotteryTicket": "Buy Lottery Ticket",
|
||||||
|
"selectNumbers": "Select Numbers",
|
||||||
|
"select5UniqueNumbers": "Select 5 unique numbers",
|
||||||
|
"selectSpecialNumber": "Select Special Number",
|
||||||
|
"selectMultiplier": "Select Multiplier",
|
||||||
|
"baseCost": "Base Cost",
|
||||||
|
"totalCost": "Total Cost",
|
||||||
|
"prizeStructure": "Prize Structure",
|
||||||
|
"enterPinToConfirmPurchase": "Enter your PIN to confirm purchase",
|
||||||
|
"ticketPurchasedSuccessfully": "Ticket purchased successfully!",
|
||||||
|
"winningNumbers": "Winning Numbers",
|
||||||
|
"specialNumber": "Special Number",
|
||||||
|
"totalTickets": "Total Tickets",
|
||||||
|
"totalWinners": "Total Winners",
|
||||||
|
"prizePool": "Prize Pool",
|
||||||
|
"enterPinToConfirmPayment": "Enter your PIN code to confirm payment",
|
||||||
|
"purchase": "Purchase",
|
||||||
|
"multiplierLabel": "Multiplier",
|
||||||
|
"specialOnly": "Special Only",
|
||||||
|
"matches": "Matches",
|
||||||
|
"thoughtDefaultTopic": "Reflection",
|
||||||
|
"thoughtAiName": "SN-chan",
|
||||||
|
"thoughtUserName": "You",
|
||||||
|
"thoughtStreamingHint": "Sn-chan is thinking...",
|
||||||
|
"thoughtInputHint": "Ask sn-chan anything...",
|
||||||
|
"thoughtNewConversation": "Start New Conversation",
|
||||||
|
"thoughtParseError": "Failed to parse AI response",
|
||||||
|
"thoughtFunctionCall": "Use {}",
|
||||||
|
"aiThought": "AI Thought",
|
||||||
|
"aiThoughtTitle": "Let sn-chan think",
|
||||||
|
"postReferenceUnavailable": "Referenced post is unavailable",
|
||||||
|
"fabLocation": "FAB Location",
|
||||||
|
"activities": "Activities",
|
||||||
|
"presenceTypeGaming": "Playing",
|
||||||
|
"presenceTypeMusic": "Listening to Music",
|
||||||
|
"presenceTypeWorkout": "Working out",
|
||||||
|
"articleCompose": "Compose Article",
|
||||||
|
"backToHub": "Back to Hub",
|
||||||
|
"advancedFilters": "Advanced Filters",
|
||||||
|
"searchPosts": "Search Posts",
|
||||||
|
"sortBy": "Sort by",
|
||||||
|
"fromDate": "From Date",
|
||||||
|
"toDate": "To Date",
|
||||||
|
"popularity": "Popularity",
|
||||||
|
"descendingOrder": "Descending Order",
|
||||||
|
"selectDate": "Select Date",
|
||||||
|
"pinnedPosts": "Pinned Posts",
|
||||||
|
"customReactionHint": "Custom Reaction allow you to use user uploaded stickers as the symbol of the reaction for the post. Exclusive for Stellar Program members.",
|
||||||
|
"publicationSites": "Publication Sites",
|
||||||
|
"uploadTasks": "Upload Tasks",
|
||||||
|
"thoughtFunctionCallBegin": "Calling tool {}",
|
||||||
|
"thoughtFunctionCallFinish": "{} responded",
|
||||||
|
"thoughtUnpaidHint": "Thinking unavaiable due to unpaid orders",
|
||||||
|
"more": "More",
|
||||||
|
"collapse": "Collapse",
|
||||||
|
"pollConfirmDiscard": "Are you sure you want to leave? All the poll data you're editing will not be saved.",
|
||||||
|
"discard": "Discard",
|
||||||
|
"fund": "Fund",
|
||||||
|
"fundsRecent": "Recent Funds",
|
||||||
|
"fundCreateNew": "Create New",
|
||||||
|
"fundCreateNewHint": "Create a new fund for your message. Select recipients and amount.",
|
||||||
|
"amountOfSplits": "Amount of Splits",
|
||||||
|
"enterNumberOfSplits": "Enter Splits Amount",
|
||||||
|
"orCreateWith": "Or\ncreate with",
|
||||||
|
"unindexedFiles": "Unindexed files",
|
||||||
|
"folder": "Folder",
|
||||||
|
"clearCompleted": "Clear Completed",
|
||||||
|
"uploadSuccess": "Upload successful!",
|
||||||
|
"wouldYouLikeToViewFile": "Would you like to view the file?",
|
||||||
|
"contentCantEmpty": "Content cannot be empty",
|
||||||
|
"features": "Features",
|
||||||
|
"unnamed": "Unnamed",
|
||||||
|
"fundEnvelopeLoadFailed": "Failed to load fund envelope",
|
||||||
|
"fundEnvelope": "Fund Envelope",
|
||||||
|
"fundEnvelopeRemaining": "Remaining: {} {}",
|
||||||
|
"fundEnvelopeSplit": "Split: {}",
|
||||||
|
"fundEnvelopeSplitEvenly": "Evenly",
|
||||||
|
"fundEnvelopeSplitRandomly": "Randomly",
|
||||||
|
"fundEnvelopeClaimSuccess": "Fund claimed successfully!",
|
||||||
|
"fundEnvelopeStatusCreated": "Created",
|
||||||
|
"fundEnvelopeStatusPartial": "Partially Claimed",
|
||||||
|
"fundEnvelopeStatusCompleted": "Fully Claimed",
|
||||||
|
"fundEnvelopeStatusExpired": "Expired",
|
||||||
|
"fundEnvelopeStatusUnknown": "Unknown",
|
||||||
|
"fundEnvelopeRecipients": "Recipients ({}/{} claimed)",
|
||||||
|
"fundEnvelopeExpiredDaysAgo": {
|
||||||
|
"one": "Expired {} day ago",
|
||||||
|
"other": "Expired {} days ago"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresSoon": "Expires soon",
|
||||||
|
"fundEnvelopeExpiresInHours": {
|
||||||
|
"one": "Expires in {} hour",
|
||||||
|
"other": "Expires in {} hours"
|
||||||
|
},
|
||||||
|
"fundEnvelopeExpiresInDays": {
|
||||||
|
"one": "Expires in {} day",
|
||||||
|
"other": "Expires in {} days"
|
||||||
|
},
|
||||||
|
"fundEnvelopeRemainingWithSplits": "{} {} / {} splits",
|
||||||
|
"fundEnvelopeUnknownUser": "Unknown User",
|
||||||
|
"deleteSite": "Delete Site",
|
||||||
|
"deleteSiteConfirm": "Are you sure you want to delete this site?",
|
||||||
|
"siteDeletedSuccess": "Site deleted successfully",
|
||||||
|
"siteSlug": "Slug",
|
||||||
|
"siteSlugHint": "my-site",
|
||||||
|
"siteSlugRequired": "Please enter a slug",
|
||||||
|
"siteSlugInvalid": "Slug can only contain lowercase letters, numbers, and dashes",
|
||||||
|
"siteName": "Site Name",
|
||||||
|
"siteNameHint": "My Publication Site",
|
||||||
|
"siteNameRequired": "Please enter a site name",
|
||||||
|
"siteMode": "Mode",
|
||||||
|
"siteModeFullyManaged": "Fully Managed",
|
||||||
|
"siteModeSelfManaged": "Self-Managed",
|
||||||
|
"editPublicationSite": "Edit Publication Site",
|
||||||
|
"deletePublicationSite": "Delete Publication Site",
|
||||||
|
"publicationSiteSavedSuccess": "Publication site saved successfully",
|
||||||
|
"publicationSiteDeleteConfirm": "Are you sure you want to delete this publication site? This action cannot be undone.",
|
||||||
|
"publicationSiteDeletedSuccess": "Publication site deleted successfully",
|
||||||
|
"newPublicationSite": "New Publication Site",
|
||||||
|
"siteDetails": "Site Details",
|
||||||
|
"siteInformation": "Site Information",
|
||||||
|
"siteDomain": "Domain",
|
||||||
|
"siteCreated": "Created",
|
||||||
|
"siteUpdated": "Updated",
|
||||||
|
"failedToLoadSite": "Failed to load site",
|
||||||
|
"sitePages": "Pages",
|
||||||
|
"noPagesYet": "No pages yet",
|
||||||
|
"createFirstPage": "Create your first page to get started",
|
||||||
|
"failedToLoadPages": "Failed to load pages",
|
||||||
|
"fileManagement": "File Management",
|
||||||
|
"siteFiles": "Files",
|
||||||
|
"siteFolder": "Folder",
|
||||||
|
"siteRoot": "Root",
|
||||||
|
"noFilesUploadedYet": "No files uploaded yet",
|
||||||
|
"uploadFirstFile": "Upload your first file to get started",
|
||||||
|
"failedToLoadFiles": "Failed to load files",
|
||||||
|
"noFilesFoundInFolder": "No files found in the selected folder",
|
||||||
|
"fileActions": "File Actions",
|
||||||
|
"purgeFiles": "Purge Files",
|
||||||
|
"purgeFilesDescription": "Remove all uploaded files from the site",
|
||||||
|
"deploySite": "Deploy Site",
|
||||||
|
"deploySiteDescription": "Upload and deploy a new version from ZIP archive",
|
||||||
|
"confirmPurge": "Confirm Purge",
|
||||||
|
"purgeFilesConfirm": "This will permanently delete all files uploaded to this site. This action cannot be undone. Are you sure you want to continue?",
|
||||||
|
"purgeAllFiles": "Purge All Files",
|
||||||
|
"allFilesPurgedSuccess": "All files purged successfully",
|
||||||
|
"failedToPurgeFiles": "Failed to purge files: {}",
|
||||||
|
"siteDeployedSuccess": "Site deployed successfully",
|
||||||
|
"failedToDeploySite": "Failed to deploy site: {}",
|
||||||
|
"createPage": "Create Page",
|
||||||
|
"editPage": "Edit Page",
|
||||||
|
"pageType": "Page Type",
|
||||||
|
"htmlPage": "HTML Page",
|
||||||
|
"redirectPage": "Redirect Page",
|
||||||
|
"pageTypeRequired": "Please select a page type",
|
||||||
|
"pagePath": "Page Path",
|
||||||
|
"pagePathHint": "/about, /contact, etc.",
|
||||||
|
"pagePathRequired": "Please enter a page path",
|
||||||
|
"pagePathInvalid": "Page path can only contain letters, numbers, hyphens, underscores, and slashes",
|
||||||
|
"pagePathMustStartWithSlash": "Page path must start with /",
|
||||||
|
"pagePathNoConsecutiveSlashes": "Page path cannot have consecutive slashes",
|
||||||
|
"pageTitle": "Page Title",
|
||||||
|
"pageTitleHint": "About Us, Contact, etc.",
|
||||||
|
"pageTitleRequired": "Please enter a page title",
|
||||||
|
"pageContentHtml": "Page Content (HTML)",
|
||||||
|
"pageContentHint": "<h1>Hello World</h1><p>This is my page content...</p>",
|
||||||
|
"pageContentRequired": "Please enter HTML content for the page",
|
||||||
|
"redirectTarget": "Redirect Target",
|
||||||
|
"redirectTargetHint": "/new-page, https://example.com, etc.",
|
||||||
|
"redirectTargetRequired": "Please enter a redirect target",
|
||||||
|
"redirectTargetInvalid": "Target must be a relative path (/) or absolute URL (http/https)",
|
||||||
|
"deletePage": "Delete Page",
|
||||||
|
"deletePageConfirm": "Are you sure you want to delete this page?",
|
||||||
|
"savePage": "Save Page",
|
||||||
|
"pageCreatedSuccess": "Page created successfully",
|
||||||
|
"pageUpdatedSuccess": "Page updated successfully",
|
||||||
|
"pageDeletedSuccess": "Page deleted successfully",
|
||||||
|
"uploadFiles": "Upload Files",
|
||||||
|
"uploadPath": "Upload Path",
|
||||||
|
"uploadPathHint": "/ (root) or /assets/images/",
|
||||||
|
"uploadPathRequired": "Please enter an upload path",
|
||||||
|
"uploadPathMustStartWithSlash": "Path must start with /",
|
||||||
|
"uploadPathNoSpaces": "Path cannot contain spaces",
|
||||||
|
"uploadPathNoConsecutiveSlashes": "Path cannot have consecutive slashes",
|
||||||
|
"percentCompleted": "{}% completed",
|
||||||
|
"filesToUpload": "{} files to upload",
|
||||||
|
"fileSizeKb": "Size: {} KB",
|
||||||
|
"uploadingEllipsis": "Uploading...",
|
||||||
|
"uploadFilesCount": {
|
||||||
|
"one": "Upload {} File",
|
||||||
|
"other": "Upload {} Files"
|
||||||
|
},
|
||||||
|
"allUploadsCompleted": "All uploads completed",
|
||||||
|
"someUploadsFailed": "Some uploads failed",
|
||||||
|
"uploadingInProgress": "Uploading in progress",
|
||||||
|
"readyToUpload": "Ready to upload",
|
||||||
|
"allFilesUploadedSuccess": "All files uploaded successfully",
|
||||||
|
"lotteryLastNumberSpecial": "The last selected number will be your special number.",
|
||||||
|
"lotteryMultiplierRequired": "Please enter a multiplier",
|
||||||
|
"lotteryMultiplierRange": "Multiplier must be between 1 and 10",
|
||||||
|
"dropToShare": "Drop to share"
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,7 @@ PODS:
|
|||||||
- libwebp/sharpyuv (1.5.0)
|
- libwebp/sharpyuv (1.5.0)
|
||||||
- libwebp/webp (1.5.0):
|
- libwebp/webp (1.5.0):
|
||||||
- libwebp/sharpyuv
|
- libwebp/sharpyuv
|
||||||
- livekit_client (2.5.3):
|
- livekit_client (2.5.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- flutter_webrtc
|
- flutter_webrtc
|
||||||
- WebRTC-SDK (= 137.7151.04)
|
- WebRTC-SDK (= 137.7151.04)
|
||||||
@@ -249,13 +249,14 @@ PODS:
|
|||||||
- nanopb/encode (3.30910.0)
|
- nanopb/encode (3.30910.0)
|
||||||
- native_exif (0.0.1):
|
- native_exif (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- objective_c (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- OrderedSet (6.0.3)
|
- OrderedSet (6.0.3)
|
||||||
- package_info_plus (0.4.5):
|
- package_info_plus (0.4.5):
|
||||||
- Flutter
|
- Flutter
|
||||||
- pasteboard (0.0.1):
|
- pasteboard (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- path_provider_foundation (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- pointer_interceptor_ios (0.0.1):
|
- pointer_interceptor_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- PromisesObjC (2.4.0)
|
- PromisesObjC (2.4.0)
|
||||||
@@ -267,9 +268,9 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- record_ios (1.1.0):
|
- record_ios (1.1.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- SDWebImage (5.21.3):
|
- SDWebImage (5.21.5):
|
||||||
- SDWebImage/Core (= 5.21.3)
|
- SDWebImage/Core (= 5.21.5)
|
||||||
- SDWebImage/Core (5.21.3)
|
- SDWebImage/Core (5.21.5)
|
||||||
- share_plus (0.0.1):
|
- share_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
@@ -280,25 +281,25 @@ PODS:
|
|||||||
- sqflite_darwin (0.0.4):
|
- sqflite_darwin (0.0.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- sqlite3 (3.50.4):
|
- sqlite3 (3.51.1):
|
||||||
- sqlite3/common (= 3.50.4)
|
- sqlite3/common (= 3.51.1)
|
||||||
- sqlite3/common (3.50.4)
|
- sqlite3/common (3.51.1)
|
||||||
- sqlite3/dbstatvtab (3.50.4):
|
- sqlite3/dbstatvtab (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3/fts5 (3.50.4):
|
- sqlite3/fts5 (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3/math (3.50.4):
|
- sqlite3/math (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3/perf-threadsafe (3.50.4):
|
- sqlite3/perf-threadsafe (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3/rtree (3.50.4):
|
- sqlite3/rtree (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3/session (3.50.4):
|
- sqlite3/session (3.51.1):
|
||||||
- sqlite3/common
|
- sqlite3/common
|
||||||
- sqlite3_flutter_libs (0.0.1):
|
- sqlite3_flutter_libs (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- sqlite3 (~> 3.50.4)
|
- sqlite3 (~> 3.51.1)
|
||||||
- sqlite3/dbstatvtab
|
- sqlite3/dbstatvtab
|
||||||
- sqlite3/fts5
|
- sqlite3/fts5
|
||||||
- sqlite3/math
|
- sqlite3/math
|
||||||
@@ -347,9 +348,9 @@ DEPENDENCIES:
|
|||||||
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
||||||
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
||||||
- native_exif (from `.symlinks/plugins/native_exif/ios`)
|
- native_exif (from `.symlinks/plugins/native_exif/ios`)
|
||||||
- objective_c (from `.symlinks/plugins/objective_c/ios`)
|
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- pasteboard (from `.symlinks/plugins/pasteboard/ios`)
|
- pasteboard (from `.symlinks/plugins/pasteboard/ios`)
|
||||||
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- pointer_interceptor_ios (from `.symlinks/plugins/pointer_interceptor_ios/ios`)
|
- pointer_interceptor_ios (from `.symlinks/plugins/pointer_interceptor_ios/ios`)
|
||||||
- protocol_handler_ios (from `.symlinks/plugins/protocol_handler_ios/ios`)
|
- protocol_handler_ios (from `.symlinks/plugins/protocol_handler_ios/ios`)
|
||||||
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
|
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
|
||||||
@@ -451,12 +452,12 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/media_kit_video/ios"
|
:path: ".symlinks/plugins/media_kit_video/ios"
|
||||||
native_exif:
|
native_exif:
|
||||||
:path: ".symlinks/plugins/native_exif/ios"
|
:path: ".symlinks/plugins/native_exif/ios"
|
||||||
objective_c:
|
|
||||||
:path: ".symlinks/plugins/objective_c/ios"
|
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
pasteboard:
|
pasteboard:
|
||||||
:path: ".symlinks/plugins/pasteboard/ios"
|
:path: ".symlinks/plugins/pasteboard/ios"
|
||||||
|
path_provider_foundation:
|
||||||
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
pointer_interceptor_ios:
|
pointer_interceptor_ios:
|
||||||
:path: ".symlinks/plugins/pointer_interceptor_ios/ios"
|
:path: ".symlinks/plugins/pointer_interceptor_ios/ios"
|
||||||
protocol_handler_ios:
|
protocol_handler_ios:
|
||||||
@@ -528,29 +529,29 @@ SPEC CHECKSUMS:
|
|||||||
Kingfisher: 23d18f54677d973b713e54ce6a8f5eef6e7056ba
|
Kingfisher: 23d18f54677d973b713e54ce6a8f5eef6e7056ba
|
||||||
KingfisherWebP: 38b9721821947f547afb78f933f75f4f9e0ae402
|
KingfisherWebP: 38b9721821947f547afb78f933f75f4f9e0ae402
|
||||||
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
|
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
|
||||||
livekit_client: 86c8af579274e4b7a215185a8080db2d4e176f40
|
livekit_client: 53ca658779b78710fb458cccee28b53a13356c15
|
||||||
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
|
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
|
||||||
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
|
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
|
||||||
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
|
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
|
||||||
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
|
||||||
native_exif: 0eb73d3d5b3ca892719228df8d2d1b13d1ae396c
|
native_exif: 0eb73d3d5b3ca892719228df8d2d1b13d1ae396c
|
||||||
objective_c: 89e720c30d716b036faf9c9684022048eee1eee2
|
|
||||||
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||||
pasteboard: 49088aeb6119d51f976a421db60d8e1ab079b63c
|
pasteboard: 49088aeb6119d51f976a421db60d8e1ab079b63c
|
||||||
|
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
||||||
pointer_interceptor_ios: da06a662d5bfd329602b45b2ab41bc0fb5fdb0f0
|
pointer_interceptor_ios: da06a662d5bfd329602b45b2ab41bc0fb5fdb0f0
|
||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||||
protocol_handler_ios: 59f23ee71f3ec602d67902ca7f669a80957888d5
|
protocol_handler_ios: 59f23ee71f3ec602d67902ca7f669a80957888d5
|
||||||
receive_sharing_intent: 222384f00ffe7e952bbfabaa9e3967cb87e5fe00
|
receive_sharing_intent: 222384f00ffe7e952bbfabaa9e3967cb87e5fe00
|
||||||
record_ios: f75fa1d57f840012775c0e93a38a7f3ceea1a374
|
record_ios: f75fa1d57f840012775c0e93a38a7f3ceea1a374
|
||||||
SDWebImage: 16309af6d214ba3f77a7c6f6fdda888cb313a50a
|
SDWebImage: e9c98383c7572d713c1a0d7dd2783b10599b9838
|
||||||
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
|
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
|
||||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
||||||
sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418
|
sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418
|
||||||
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
|
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
|
||||||
sqlite3: 73513155ec6979715d3904ef53a8d68892d4032b
|
sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b
|
||||||
sqlite3_flutter_libs: 83f8e9f5b6554077f1d93119fe20ebaa5f3a9ef1
|
sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41
|
||||||
super_native_extensions: b763c02dc3a8fd078389f410bf15149179020cb4
|
super_native_extensions: b763c02dc3a8fd078389f410bf15149179020cb4
|
||||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||||
syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14
|
syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14
|
||||||
|
|||||||
@@ -140,21 +140,29 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
|
|
||||||
guard !attachmentUrls.isEmpty else {
|
guard !attachmentUrls.isEmpty else {
|
||||||
print("Invalid URLs for attachments: \(attachmentUrls)")
|
print("Invalid URLs for attachments: \(attachmentUrls)")
|
||||||
|
self.contentHandler?(content)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetSize = 512
|
let targetSize = 512
|
||||||
let scaleProcessor = ResizingImageProcessor(referenceSize: CGSize(width: targetSize, height: targetSize), mode: .aspectFit)
|
let scaleProcessor = ResizingImageProcessor(referenceSize: CGSize(width: targetSize, height: targetSize), mode: .aspectFit)
|
||||||
|
|
||||||
|
let dispatchGroup = DispatchGroup()
|
||||||
|
var attachments: [UNNotificationAttachment] = []
|
||||||
|
let lock = NSLock() // To synchronize access to the attachments array
|
||||||
|
|
||||||
for attachmentUrl in attachmentUrls {
|
for attachmentUrl in attachmentUrls {
|
||||||
guard let remoteUrl = URL(string: attachmentUrl) else {
|
guard let remoteUrl = URL(string: attachmentUrl) else {
|
||||||
print("Invalid URL for attachment: \(attachmentUrl)")
|
print("Invalid URL for attachment: \(attachmentUrl)")
|
||||||
continue // Skip this URL and move to the next one
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispatchGroup.enter()
|
||||||
|
|
||||||
KingfisherManager.shared.retrieveImage(with: remoteUrl, options: scaleDown ? [
|
KingfisherManager.shared.retrieveImage(with: remoteUrl, options: scaleDown ? [
|
||||||
.processor(scaleProcessor)
|
.processor(scaleProcessor)
|
||||||
] : nil) { [weak self] result in
|
] : nil) { [weak self] result in
|
||||||
|
defer { dispatchGroup.leave() }
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
|
|
||||||
switch result {
|
switch result {
|
||||||
@@ -166,49 +174,34 @@ class NotificationService: UNNotificationServiceExtension {
|
|||||||
do {
|
do {
|
||||||
// Write the image data to a temporary file for UNNotificationAttachment
|
// Write the image data to a temporary file for UNNotificationAttachment
|
||||||
try retrievalResult.image.pngData()?.write(to: cachedFileUrl)
|
try retrievalResult.image.pngData()?.write(to: cachedFileUrl)
|
||||||
self.attachLocalMedia(to: content, fileType: type?.identifier, from: cachedFileUrl, withIdentifier: attachmentUrl)
|
|
||||||
|
if let attachment = try? UNNotificationAttachment(identifier: attachmentUrl, url: cachedFileUrl, options: [
|
||||||
|
UNNotificationAttachmentOptionsTypeHintKey: type?.identifier as Any,
|
||||||
|
UNNotificationAttachmentOptionsThumbnailHiddenKey: 0,
|
||||||
|
]) {
|
||||||
|
lock.lock()
|
||||||
|
attachments.append(attachment)
|
||||||
|
lock.unlock()
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to write media to temporary file: \(error.localizedDescription)")
|
print("Failed to write media to temporary file: \(error.localizedDescription)")
|
||||||
self.contentHandler?(content)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
print("Failed to retrieve image: \(error.localizedDescription)")
|
print("Failed to retrieve image: \(error.localizedDescription)")
|
||||||
self.contentHandler?(content)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private func attachLocalMedia(to content: UNMutableNotificationContent, fileType type: String?, from localUrl: URL, withIdentifier identifier: String) {
|
|
||||||
do {
|
|
||||||
let attachment = try UNNotificationAttachment(identifier: identifier, url: localUrl, options: [
|
|
||||||
UNNotificationAttachmentOptionsTypeHintKey: type as Any,
|
|
||||||
UNNotificationAttachmentOptionsThumbnailHiddenKey: 0,
|
|
||||||
])
|
|
||||||
content.attachments = [attachment]
|
|
||||||
} catch let error as NSError {
|
|
||||||
// Log detailed error information
|
|
||||||
print("Failed to create attachment from file at \(localUrl.path)")
|
|
||||||
print("Error: \(error.localizedDescription)")
|
|
||||||
|
|
||||||
// Check specific error codes if needed
|
|
||||||
if error.domain == NSCocoaErrorDomain {
|
|
||||||
switch error.code {
|
|
||||||
case NSFileReadNoSuchFileError:
|
|
||||||
print("File does not exist at \(localUrl.path)")
|
|
||||||
case NSFileReadNoPermissionError:
|
|
||||||
print("No permission to read file at \(localUrl.path)")
|
|
||||||
default:
|
|
||||||
print("Unhandled file error: \(error.code)")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call content handler regardless of success or failure
|
dispatchGroup.notify(queue: .main) { [weak self] in
|
||||||
self.contentHandler?(content)
|
guard let self = self else { return }
|
||||||
|
content.attachments = attachments
|
||||||
|
self.contentHandler?(content)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private func createMessageIntent(with sender: INPerson, meta: [AnyHashable: Any], body: String) -> INSendMessageIntent {
|
private func createMessageIntent(with sender: INPerson, meta: [AnyHashable: Any], body: String) -> INSendMessageIntent {
|
||||||
INSendMessageIntent(
|
INSendMessageIntent(
|
||||||
recipients: nil,
|
recipients: nil,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
AppDatabase(super.e);
|
AppDatabase(super.e);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get schemaVersion => 8;
|
int get schemaVersion => 9;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
MigrationStrategy get migration => MigrationStrategy(
|
MigrationStrategy get migration => MigrationStrategy(
|
||||||
@@ -62,6 +62,15 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
await m.createTable(chatRooms);
|
await m.createTable(chatRooms);
|
||||||
await m.createTable(chatMembers);
|
await m.createTable(chatMembers);
|
||||||
}
|
}
|
||||||
|
if (from < 9) {
|
||||||
|
// Remove unused columns from chat_members
|
||||||
|
await customStatement('ALTER TABLE chat_members DROP COLUMN role');
|
||||||
|
await customStatement('ALTER TABLE chat_members DROP COLUMN is_bot');
|
||||||
|
await customStatement('ALTER TABLE chat_members DROP COLUMN status');
|
||||||
|
await customStatement(
|
||||||
|
'ALTER TABLE chat_members DROP COLUMN last_typed',
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -237,14 +246,11 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
accountId: senderRow.accountId,
|
accountId: senderRow.accountId,
|
||||||
account: senderAccount,
|
account: senderAccount,
|
||||||
nick: senderRow.nick,
|
nick: senderRow.nick,
|
||||||
role: senderRow.role,
|
|
||||||
notify: senderRow.notify,
|
notify: senderRow.notify,
|
||||||
joinedAt: senderRow.joinedAt,
|
joinedAt: senderRow.joinedAt,
|
||||||
breakUntil: senderRow.breakUntil,
|
breakUntil: senderRow.breakUntil,
|
||||||
timeoutUntil: senderRow.timeoutUntil,
|
timeoutUntil: senderRow.timeoutUntil,
|
||||||
isBot: senderRow.isBot,
|
|
||||||
status: null,
|
status: null,
|
||||||
lastTyped: senderRow.lastTyped,
|
|
||||||
createdAt: senderRow.createdAt,
|
createdAt: senderRow.createdAt,
|
||||||
updatedAt: senderRow.updatedAt,
|
updatedAt: senderRow.updatedAt,
|
||||||
deletedAt: senderRow.deletedAt,
|
deletedAt: senderRow.deletedAt,
|
||||||
@@ -260,6 +266,7 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
id: 'unknown',
|
id: 'unknown',
|
||||||
name: 'unknown',
|
name: 'unknown',
|
||||||
nick: dbMessage.senderId, // Show the ID instead of Unknown
|
nick: dbMessage.senderId, // Show the ID instead of Unknown
|
||||||
|
activatedAt: null,
|
||||||
profile: SnAccountProfile(
|
profile: SnAccountProfile(
|
||||||
picture: null,
|
picture: null,
|
||||||
id: 'unknown',
|
id: 'unknown',
|
||||||
@@ -281,12 +288,10 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
updatedAt: DateTime.now(),
|
updatedAt: DateTime.now(),
|
||||||
),
|
),
|
||||||
nick: dbMessage.senderId, // Show the senderId as fallback
|
nick: dbMessage.senderId, // Show the senderId as fallback
|
||||||
role: 0,
|
|
||||||
notify: 0,
|
notify: 0,
|
||||||
joinedAt: null,
|
joinedAt: null,
|
||||||
breakUntil: null,
|
breakUntil: null,
|
||||||
timeoutUntil: null,
|
timeoutUntil: null,
|
||||||
isBot: false,
|
|
||||||
status: null,
|
status: null,
|
||||||
lastTyped: null,
|
lastTyped: null,
|
||||||
createdAt: DateTime.now(),
|
createdAt: DateTime.now(),
|
||||||
@@ -343,39 +348,39 @@ class AppDatabase extends _$AppDatabase {
|
|||||||
accountId: Value(member.accountId),
|
accountId: Value(member.accountId),
|
||||||
account: Value(member.account.toJson()),
|
account: Value(member.account.toJson()),
|
||||||
nick: Value(member.nick),
|
nick: Value(member.nick),
|
||||||
role: Value(member.role),
|
|
||||||
notify: Value(member.notify),
|
notify: Value(member.notify),
|
||||||
joinedAt: Value(member.joinedAt),
|
joinedAt: Value(member.joinedAt),
|
||||||
breakUntil: Value(member.breakUntil),
|
breakUntil: Value(member.breakUntil),
|
||||||
timeoutUntil: Value(member.timeoutUntil),
|
timeoutUntil: Value(member.timeoutUntil),
|
||||||
isBot: Value(member.isBot),
|
|
||||||
status: Value(
|
|
||||||
member.status == null ? null : jsonEncode(member.status!.toJson()),
|
|
||||||
),
|
|
||||||
lastTyped: Value(member.lastTyped),
|
|
||||||
createdAt: Value(member.createdAt),
|
createdAt: Value(member.createdAt),
|
||||||
updatedAt: Value(member.updatedAt),
|
updatedAt: Value(member.updatedAt),
|
||||||
deletedAt: Value(member.deletedAt),
|
deletedAt: Value(member.deletedAt),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> saveChatRooms(List<SnChatRoom> rooms) async {
|
Future<void> saveChatRooms(
|
||||||
|
List<SnChatRoom> rooms, {
|
||||||
|
bool override = false,
|
||||||
|
}) async {
|
||||||
await transaction(() async {
|
await transaction(() async {
|
||||||
// 1. Identify rooms to remove
|
if (override) {
|
||||||
final remoteRoomIds = rooms.map((r) => r.id).toSet();
|
// 1. Identify rooms to remove
|
||||||
final currentRooms = await select(chatRooms).get();
|
final remoteRoomIds = rooms.map((r) => r.id).toSet();
|
||||||
final currentRoomIds = currentRooms.map((r) => r.id).toSet();
|
final currentRooms = await select(chatRooms).get();
|
||||||
final idsToRemove = currentRoomIds.difference(remoteRoomIds);
|
final currentRoomIds = currentRooms.map((r) => r.id).toSet();
|
||||||
|
final idsToRemove = currentRoomIds.difference(remoteRoomIds);
|
||||||
|
|
||||||
if (idsToRemove.isNotEmpty) {
|
if (idsToRemove.isNotEmpty) {
|
||||||
final idsList = idsToRemove.toList();
|
final idsList = idsToRemove.toList();
|
||||||
// Remove messages
|
// Remove messages
|
||||||
await (delete(chatMessages)..where((t) => t.roomId.isIn(idsList))).go();
|
await (delete(chatMessages)
|
||||||
// Remove members
|
..where((t) => t.roomId.isIn(idsList))).go();
|
||||||
await (delete(chatMembers)
|
// Remove members
|
||||||
..where((t) => t.chatRoomId.isIn(idsList))).go();
|
await (delete(chatMembers)
|
||||||
// Remove rooms
|
..where((t) => t.chatRoomId.isIn(idsList))).go();
|
||||||
await (delete(chatRooms)..where((t) => t.id.isIn(idsList))).go();
|
// Remove rooms
|
||||||
|
await (delete(chatRooms)..where((t) => t.id.isIn(idsList))).go();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Upsert remote rooms
|
// 2. Upsert remote rooms
|
||||||
|
|||||||
@@ -106,6 +106,17 @@ class $ChatRoomsTable extends ChatRooms
|
|||||||
type: DriftSqlType.string,
|
type: DriftSqlType.string,
|
||||||
requiredDuringInsert: false,
|
requiredDuringInsert: false,
|
||||||
);
|
);
|
||||||
|
static const VerificationMeta _accountIdMeta = const VerificationMeta(
|
||||||
|
'accountId',
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
late final GeneratedColumn<String> accountId = GeneratedColumn<String>(
|
||||||
|
'account_id',
|
||||||
|
aliasedName,
|
||||||
|
true,
|
||||||
|
type: DriftSqlType.string,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
);
|
||||||
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
||||||
'createdAt',
|
'createdAt',
|
||||||
);
|
);
|
||||||
@@ -150,6 +161,7 @@ class $ChatRoomsTable extends ChatRooms
|
|||||||
picture,
|
picture,
|
||||||
background,
|
background,
|
||||||
realmId,
|
realmId,
|
||||||
|
accountId,
|
||||||
createdAt,
|
createdAt,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
deletedAt,
|
deletedAt,
|
||||||
@@ -215,6 +227,12 @@ class $ChatRoomsTable extends ChatRooms
|
|||||||
realmId.isAcceptableOrUnknown(data['realm_id']!, _realmIdMeta),
|
realmId.isAcceptableOrUnknown(data['realm_id']!, _realmIdMeta),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (data.containsKey('account_id')) {
|
||||||
|
context.handle(
|
||||||
|
_accountIdMeta,
|
||||||
|
accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta),
|
||||||
|
);
|
||||||
|
}
|
||||||
if (data.containsKey('created_at')) {
|
if (data.containsKey('created_at')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_createdAtMeta,
|
_createdAtMeta,
|
||||||
@@ -288,6 +306,10 @@ class $ChatRoomsTable extends ChatRooms
|
|||||||
DriftSqlType.string,
|
DriftSqlType.string,
|
||||||
data['${effectivePrefix}realm_id'],
|
data['${effectivePrefix}realm_id'],
|
||||||
),
|
),
|
||||||
|
accountId: attachedDatabase.typeMapping.read(
|
||||||
|
DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}account_id'],
|
||||||
|
),
|
||||||
createdAt:
|
createdAt:
|
||||||
attachedDatabase.typeMapping.read(
|
attachedDatabase.typeMapping.read(
|
||||||
DriftSqlType.dateTime,
|
DriftSqlType.dateTime,
|
||||||
@@ -330,6 +352,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
final Map<String, dynamic>? picture;
|
final Map<String, dynamic>? picture;
|
||||||
final Map<String, dynamic>? background;
|
final Map<String, dynamic>? background;
|
||||||
final String? realmId;
|
final String? realmId;
|
||||||
|
final String? accountId;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final DateTime? deletedAt;
|
final DateTime? deletedAt;
|
||||||
@@ -343,6 +366,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
this.picture,
|
this.picture,
|
||||||
this.background,
|
this.background,
|
||||||
this.realmId,
|
this.realmId,
|
||||||
|
this.accountId,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
this.deletedAt,
|
this.deletedAt,
|
||||||
@@ -377,6 +401,9 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
if (!nullToAbsent || realmId != null) {
|
if (!nullToAbsent || realmId != null) {
|
||||||
map['realm_id'] = Variable<String>(realmId);
|
map['realm_id'] = Variable<String>(realmId);
|
||||||
}
|
}
|
||||||
|
if (!nullToAbsent || accountId != null) {
|
||||||
|
map['account_id'] = Variable<String>(accountId);
|
||||||
|
}
|
||||||
map['created_at'] = Variable<DateTime>(createdAt);
|
map['created_at'] = Variable<DateTime>(createdAt);
|
||||||
map['updated_at'] = Variable<DateTime>(updatedAt);
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
||||||
if (!nullToAbsent || deletedAt != null) {
|
if (!nullToAbsent || deletedAt != null) {
|
||||||
@@ -414,6 +441,10 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
realmId == null && nullToAbsent
|
realmId == null && nullToAbsent
|
||||||
? const Value.absent()
|
? const Value.absent()
|
||||||
: Value(realmId),
|
: Value(realmId),
|
||||||
|
accountId:
|
||||||
|
accountId == null && nullToAbsent
|
||||||
|
? const Value.absent()
|
||||||
|
: Value(accountId),
|
||||||
createdAt: Value(createdAt),
|
createdAt: Value(createdAt),
|
||||||
updatedAt: Value(updatedAt),
|
updatedAt: Value(updatedAt),
|
||||||
deletedAt:
|
deletedAt:
|
||||||
@@ -440,6 +471,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
json['background'],
|
json['background'],
|
||||||
),
|
),
|
||||||
realmId: serializer.fromJson<String?>(json['realmId']),
|
realmId: serializer.fromJson<String?>(json['realmId']),
|
||||||
|
accountId: serializer.fromJson<String?>(json['accountId']),
|
||||||
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
||||||
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
||||||
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
||||||
@@ -458,6 +490,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
'picture': serializer.toJson<Map<String, dynamic>?>(picture),
|
'picture': serializer.toJson<Map<String, dynamic>?>(picture),
|
||||||
'background': serializer.toJson<Map<String, dynamic>?>(background),
|
'background': serializer.toJson<Map<String, dynamic>?>(background),
|
||||||
'realmId': serializer.toJson<String?>(realmId),
|
'realmId': serializer.toJson<String?>(realmId),
|
||||||
|
'accountId': serializer.toJson<String?>(accountId),
|
||||||
'createdAt': serializer.toJson<DateTime>(createdAt),
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
||||||
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
||||||
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
||||||
@@ -474,6 +507,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
||||||
Value<Map<String, dynamic>?> background = const Value.absent(),
|
Value<Map<String, dynamic>?> background = const Value.absent(),
|
||||||
Value<String?> realmId = const Value.absent(),
|
Value<String?> realmId = const Value.absent(),
|
||||||
|
Value<String?> accountId = const Value.absent(),
|
||||||
DateTime? createdAt,
|
DateTime? createdAt,
|
||||||
DateTime? updatedAt,
|
DateTime? updatedAt,
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -487,6 +521,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
picture: picture.present ? picture.value : this.picture,
|
picture: picture.present ? picture.value : this.picture,
|
||||||
background: background.present ? background.value : this.background,
|
background: background.present ? background.value : this.background,
|
||||||
realmId: realmId.present ? realmId.value : this.realmId,
|
realmId: realmId.present ? realmId.value : this.realmId,
|
||||||
|
accountId: accountId.present ? accountId.value : this.accountId,
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
||||||
@@ -505,6 +540,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
background:
|
background:
|
||||||
data.background.present ? data.background.value : this.background,
|
data.background.present ? data.background.value : this.background,
|
||||||
realmId: data.realmId.present ? data.realmId.value : this.realmId,
|
realmId: data.realmId.present ? data.realmId.value : this.realmId,
|
||||||
|
accountId: data.accountId.present ? data.accountId.value : this.accountId,
|
||||||
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
||||||
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
||||||
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
||||||
@@ -523,6 +559,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
..write('picture: $picture, ')
|
..write('picture: $picture, ')
|
||||||
..write('background: $background, ')
|
..write('background: $background, ')
|
||||||
..write('realmId: $realmId, ')
|
..write('realmId: $realmId, ')
|
||||||
|
..write('accountId: $accountId, ')
|
||||||
..write('createdAt: $createdAt, ')
|
..write('createdAt: $createdAt, ')
|
||||||
..write('updatedAt: $updatedAt, ')
|
..write('updatedAt: $updatedAt, ')
|
||||||
..write('deletedAt: $deletedAt')
|
..write('deletedAt: $deletedAt')
|
||||||
@@ -541,6 +578,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
picture,
|
picture,
|
||||||
background,
|
background,
|
||||||
realmId,
|
realmId,
|
||||||
|
accountId,
|
||||||
createdAt,
|
createdAt,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
deletedAt,
|
deletedAt,
|
||||||
@@ -558,6 +596,7 @@ class ChatRoom extends DataClass implements Insertable<ChatRoom> {
|
|||||||
other.picture == this.picture &&
|
other.picture == this.picture &&
|
||||||
other.background == this.background &&
|
other.background == this.background &&
|
||||||
other.realmId == this.realmId &&
|
other.realmId == this.realmId &&
|
||||||
|
other.accountId == this.accountId &&
|
||||||
other.createdAt == this.createdAt &&
|
other.createdAt == this.createdAt &&
|
||||||
other.updatedAt == this.updatedAt &&
|
other.updatedAt == this.updatedAt &&
|
||||||
other.deletedAt == this.deletedAt);
|
other.deletedAt == this.deletedAt);
|
||||||
@@ -573,6 +612,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
final Value<Map<String, dynamic>?> picture;
|
final Value<Map<String, dynamic>?> picture;
|
||||||
final Value<Map<String, dynamic>?> background;
|
final Value<Map<String, dynamic>?> background;
|
||||||
final Value<String?> realmId;
|
final Value<String?> realmId;
|
||||||
|
final Value<String?> accountId;
|
||||||
final Value<DateTime> createdAt;
|
final Value<DateTime> createdAt;
|
||||||
final Value<DateTime> updatedAt;
|
final Value<DateTime> updatedAt;
|
||||||
final Value<DateTime?> deletedAt;
|
final Value<DateTime?> deletedAt;
|
||||||
@@ -587,6 +627,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
this.picture = const Value.absent(),
|
this.picture = const Value.absent(),
|
||||||
this.background = const Value.absent(),
|
this.background = const Value.absent(),
|
||||||
this.realmId = const Value.absent(),
|
this.realmId = const Value.absent(),
|
||||||
|
this.accountId = const Value.absent(),
|
||||||
this.createdAt = const Value.absent(),
|
this.createdAt = const Value.absent(),
|
||||||
this.updatedAt = const Value.absent(),
|
this.updatedAt = const Value.absent(),
|
||||||
this.deletedAt = const Value.absent(),
|
this.deletedAt = const Value.absent(),
|
||||||
@@ -602,6 +643,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
this.picture = const Value.absent(),
|
this.picture = const Value.absent(),
|
||||||
this.background = const Value.absent(),
|
this.background = const Value.absent(),
|
||||||
this.realmId = const Value.absent(),
|
this.realmId = const Value.absent(),
|
||||||
|
this.accountId = const Value.absent(),
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
this.deletedAt = const Value.absent(),
|
this.deletedAt = const Value.absent(),
|
||||||
@@ -620,6 +662,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
Expression<String>? picture,
|
Expression<String>? picture,
|
||||||
Expression<String>? background,
|
Expression<String>? background,
|
||||||
Expression<String>? realmId,
|
Expression<String>? realmId,
|
||||||
|
Expression<String>? accountId,
|
||||||
Expression<DateTime>? createdAt,
|
Expression<DateTime>? createdAt,
|
||||||
Expression<DateTime>? updatedAt,
|
Expression<DateTime>? updatedAt,
|
||||||
Expression<DateTime>? deletedAt,
|
Expression<DateTime>? deletedAt,
|
||||||
@@ -635,6 +678,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
if (picture != null) 'picture': picture,
|
if (picture != null) 'picture': picture,
|
||||||
if (background != null) 'background': background,
|
if (background != null) 'background': background,
|
||||||
if (realmId != null) 'realm_id': realmId,
|
if (realmId != null) 'realm_id': realmId,
|
||||||
|
if (accountId != null) 'account_id': accountId,
|
||||||
if (createdAt != null) 'created_at': createdAt,
|
if (createdAt != null) 'created_at': createdAt,
|
||||||
if (updatedAt != null) 'updated_at': updatedAt,
|
if (updatedAt != null) 'updated_at': updatedAt,
|
||||||
if (deletedAt != null) 'deleted_at': deletedAt,
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
||||||
@@ -652,6 +696,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
Value<Map<String, dynamic>?>? picture,
|
Value<Map<String, dynamic>?>? picture,
|
||||||
Value<Map<String, dynamic>?>? background,
|
Value<Map<String, dynamic>?>? background,
|
||||||
Value<String?>? realmId,
|
Value<String?>? realmId,
|
||||||
|
Value<String?>? accountId,
|
||||||
Value<DateTime>? createdAt,
|
Value<DateTime>? createdAt,
|
||||||
Value<DateTime>? updatedAt,
|
Value<DateTime>? updatedAt,
|
||||||
Value<DateTime?>? deletedAt,
|
Value<DateTime?>? deletedAt,
|
||||||
@@ -667,6 +712,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
picture: picture ?? this.picture,
|
picture: picture ?? this.picture,
|
||||||
background: background ?? this.background,
|
background: background ?? this.background,
|
||||||
realmId: realmId ?? this.realmId,
|
realmId: realmId ?? this.realmId,
|
||||||
|
accountId: accountId ?? this.accountId,
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
deletedAt: deletedAt ?? this.deletedAt,
|
deletedAt: deletedAt ?? this.deletedAt,
|
||||||
@@ -708,6 +754,9 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
if (realmId.present) {
|
if (realmId.present) {
|
||||||
map['realm_id'] = Variable<String>(realmId.value);
|
map['realm_id'] = Variable<String>(realmId.value);
|
||||||
}
|
}
|
||||||
|
if (accountId.present) {
|
||||||
|
map['account_id'] = Variable<String>(accountId.value);
|
||||||
|
}
|
||||||
if (createdAt.present) {
|
if (createdAt.present) {
|
||||||
map['created_at'] = Variable<DateTime>(createdAt.value);
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
||||||
}
|
}
|
||||||
@@ -735,6 +784,7 @@ class ChatRoomsCompanion extends UpdateCompanion<ChatRoom> {
|
|||||||
..write('picture: $picture, ')
|
..write('picture: $picture, ')
|
||||||
..write('background: $background, ')
|
..write('background: $background, ')
|
||||||
..write('realmId: $realmId, ')
|
..write('realmId: $realmId, ')
|
||||||
|
..write('accountId: $accountId, ')
|
||||||
..write('createdAt: $createdAt, ')
|
..write('createdAt: $createdAt, ')
|
||||||
..write('updatedAt: $updatedAt, ')
|
..write('updatedAt: $updatedAt, ')
|
||||||
..write('deletedAt: $deletedAt, ')
|
..write('deletedAt: $deletedAt, ')
|
||||||
@@ -802,15 +852,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
type: DriftSqlType.string,
|
type: DriftSqlType.string,
|
||||||
requiredDuringInsert: false,
|
requiredDuringInsert: false,
|
||||||
);
|
);
|
||||||
static const VerificationMeta _roleMeta = const VerificationMeta('role');
|
|
||||||
@override
|
|
||||||
late final GeneratedColumn<int> role = GeneratedColumn<int>(
|
|
||||||
'role',
|
|
||||||
aliasedName,
|
|
||||||
false,
|
|
||||||
type: DriftSqlType.int,
|
|
||||||
requiredDuringInsert: true,
|
|
||||||
);
|
|
||||||
static const VerificationMeta _notifyMeta = const VerificationMeta('notify');
|
static const VerificationMeta _notifyMeta = const VerificationMeta('notify');
|
||||||
@override
|
@override
|
||||||
late final GeneratedColumn<int> notify = GeneratedColumn<int>(
|
late final GeneratedColumn<int> notify = GeneratedColumn<int>(
|
||||||
@@ -853,38 +894,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
type: DriftSqlType.dateTime,
|
type: DriftSqlType.dateTime,
|
||||||
requiredDuringInsert: false,
|
requiredDuringInsert: false,
|
||||||
);
|
);
|
||||||
static const VerificationMeta _isBotMeta = const VerificationMeta('isBot');
|
|
||||||
@override
|
|
||||||
late final GeneratedColumn<bool> isBot = GeneratedColumn<bool>(
|
|
||||||
'is_bot',
|
|
||||||
aliasedName,
|
|
||||||
false,
|
|
||||||
type: DriftSqlType.bool,
|
|
||||||
requiredDuringInsert: true,
|
|
||||||
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
||||||
'CHECK ("is_bot" IN (0, 1))',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
||||||
@override
|
|
||||||
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
||||||
'status',
|
|
||||||
aliasedName,
|
|
||||||
true,
|
|
||||||
type: DriftSqlType.string,
|
|
||||||
requiredDuringInsert: false,
|
|
||||||
);
|
|
||||||
static const VerificationMeta _lastTypedMeta = const VerificationMeta(
|
|
||||||
'lastTyped',
|
|
||||||
);
|
|
||||||
@override
|
|
||||||
late final GeneratedColumn<DateTime> lastTyped = GeneratedColumn<DateTime>(
|
|
||||||
'last_typed',
|
|
||||||
aliasedName,
|
|
||||||
true,
|
|
||||||
type: DriftSqlType.dateTime,
|
|
||||||
requiredDuringInsert: false,
|
|
||||||
);
|
|
||||||
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
||||||
'createdAt',
|
'createdAt',
|
||||||
);
|
);
|
||||||
@@ -925,14 +934,10 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
accountId,
|
accountId,
|
||||||
account,
|
account,
|
||||||
nick,
|
nick,
|
||||||
role,
|
|
||||||
notify,
|
notify,
|
||||||
joinedAt,
|
joinedAt,
|
||||||
breakUntil,
|
breakUntil,
|
||||||
timeoutUntil,
|
timeoutUntil,
|
||||||
isBot,
|
|
||||||
status,
|
|
||||||
lastTyped,
|
|
||||||
createdAt,
|
createdAt,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
deletedAt,
|
deletedAt,
|
||||||
@@ -979,14 +984,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
nick.isAcceptableOrUnknown(data['nick']!, _nickMeta),
|
nick.isAcceptableOrUnknown(data['nick']!, _nickMeta),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('role')) {
|
|
||||||
context.handle(
|
|
||||||
_roleMeta,
|
|
||||||
role.isAcceptableOrUnknown(data['role']!, _roleMeta),
|
|
||||||
);
|
|
||||||
} else if (isInserting) {
|
|
||||||
context.missing(_roleMeta);
|
|
||||||
}
|
|
||||||
if (data.containsKey('notify')) {
|
if (data.containsKey('notify')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_notifyMeta,
|
_notifyMeta,
|
||||||
@@ -1016,26 +1013,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('is_bot')) {
|
|
||||||
context.handle(
|
|
||||||
_isBotMeta,
|
|
||||||
isBot.isAcceptableOrUnknown(data['is_bot']!, _isBotMeta),
|
|
||||||
);
|
|
||||||
} else if (isInserting) {
|
|
||||||
context.missing(_isBotMeta);
|
|
||||||
}
|
|
||||||
if (data.containsKey('status')) {
|
|
||||||
context.handle(
|
|
||||||
_statusMeta,
|
|
||||||
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (data.containsKey('last_typed')) {
|
|
||||||
context.handle(
|
|
||||||
_lastTypedMeta,
|
|
||||||
lastTyped.isAcceptableOrUnknown(data['last_typed']!, _lastTypedMeta),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (data.containsKey('created_at')) {
|
if (data.containsKey('created_at')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_createdAtMeta,
|
_createdAtMeta,
|
||||||
@@ -1092,11 +1069,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
DriftSqlType.string,
|
DriftSqlType.string,
|
||||||
data['${effectivePrefix}nick'],
|
data['${effectivePrefix}nick'],
|
||||||
),
|
),
|
||||||
role:
|
|
||||||
attachedDatabase.typeMapping.read(
|
|
||||||
DriftSqlType.int,
|
|
||||||
data['${effectivePrefix}role'],
|
|
||||||
)!,
|
|
||||||
notify:
|
notify:
|
||||||
attachedDatabase.typeMapping.read(
|
attachedDatabase.typeMapping.read(
|
||||||
DriftSqlType.int,
|
DriftSqlType.int,
|
||||||
@@ -1114,19 +1086,6 @@ class $ChatMembersTable extends ChatMembers
|
|||||||
DriftSqlType.dateTime,
|
DriftSqlType.dateTime,
|
||||||
data['${effectivePrefix}timeout_until'],
|
data['${effectivePrefix}timeout_until'],
|
||||||
),
|
),
|
||||||
isBot:
|
|
||||||
attachedDatabase.typeMapping.read(
|
|
||||||
DriftSqlType.bool,
|
|
||||||
data['${effectivePrefix}is_bot'],
|
|
||||||
)!,
|
|
||||||
status: attachedDatabase.typeMapping.read(
|
|
||||||
DriftSqlType.string,
|
|
||||||
data['${effectivePrefix}status'],
|
|
||||||
),
|
|
||||||
lastTyped: attachedDatabase.typeMapping.read(
|
|
||||||
DriftSqlType.dateTime,
|
|
||||||
data['${effectivePrefix}last_typed'],
|
|
||||||
),
|
|
||||||
createdAt:
|
createdAt:
|
||||||
attachedDatabase.typeMapping.read(
|
attachedDatabase.typeMapping.read(
|
||||||
DriftSqlType.dateTime,
|
DriftSqlType.dateTime,
|
||||||
@@ -1159,14 +1118,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
final String accountId;
|
final String accountId;
|
||||||
final Map<String, dynamic> account;
|
final Map<String, dynamic> account;
|
||||||
final String? nick;
|
final String? nick;
|
||||||
final int role;
|
|
||||||
final int notify;
|
final int notify;
|
||||||
final DateTime? joinedAt;
|
final DateTime? joinedAt;
|
||||||
final DateTime? breakUntil;
|
final DateTime? breakUntil;
|
||||||
final DateTime? timeoutUntil;
|
final DateTime? timeoutUntil;
|
||||||
final bool isBot;
|
|
||||||
final String? status;
|
|
||||||
final DateTime? lastTyped;
|
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final DateTime? deletedAt;
|
final DateTime? deletedAt;
|
||||||
@@ -1176,14 +1131,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
required this.accountId,
|
required this.accountId,
|
||||||
required this.account,
|
required this.account,
|
||||||
this.nick,
|
this.nick,
|
||||||
required this.role,
|
|
||||||
required this.notify,
|
required this.notify,
|
||||||
this.joinedAt,
|
this.joinedAt,
|
||||||
this.breakUntil,
|
this.breakUntil,
|
||||||
this.timeoutUntil,
|
this.timeoutUntil,
|
||||||
required this.isBot,
|
|
||||||
this.status,
|
|
||||||
this.lastTyped,
|
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
this.deletedAt,
|
this.deletedAt,
|
||||||
@@ -1202,7 +1153,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
if (!nullToAbsent || nick != null) {
|
if (!nullToAbsent || nick != null) {
|
||||||
map['nick'] = Variable<String>(nick);
|
map['nick'] = Variable<String>(nick);
|
||||||
}
|
}
|
||||||
map['role'] = Variable<int>(role);
|
|
||||||
map['notify'] = Variable<int>(notify);
|
map['notify'] = Variable<int>(notify);
|
||||||
if (!nullToAbsent || joinedAt != null) {
|
if (!nullToAbsent || joinedAt != null) {
|
||||||
map['joined_at'] = Variable<DateTime>(joinedAt);
|
map['joined_at'] = Variable<DateTime>(joinedAt);
|
||||||
@@ -1213,13 +1163,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
if (!nullToAbsent || timeoutUntil != null) {
|
if (!nullToAbsent || timeoutUntil != null) {
|
||||||
map['timeout_until'] = Variable<DateTime>(timeoutUntil);
|
map['timeout_until'] = Variable<DateTime>(timeoutUntil);
|
||||||
}
|
}
|
||||||
map['is_bot'] = Variable<bool>(isBot);
|
|
||||||
if (!nullToAbsent || status != null) {
|
|
||||||
map['status'] = Variable<String>(status);
|
|
||||||
}
|
|
||||||
if (!nullToAbsent || lastTyped != null) {
|
|
||||||
map['last_typed'] = Variable<DateTime>(lastTyped);
|
|
||||||
}
|
|
||||||
map['created_at'] = Variable<DateTime>(createdAt);
|
map['created_at'] = Variable<DateTime>(createdAt);
|
||||||
map['updated_at'] = Variable<DateTime>(updatedAt);
|
map['updated_at'] = Variable<DateTime>(updatedAt);
|
||||||
if (!nullToAbsent || deletedAt != null) {
|
if (!nullToAbsent || deletedAt != null) {
|
||||||
@@ -1235,7 +1178,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
accountId: Value(accountId),
|
accountId: Value(accountId),
|
||||||
account: Value(account),
|
account: Value(account),
|
||||||
nick: nick == null && nullToAbsent ? const Value.absent() : Value(nick),
|
nick: nick == null && nullToAbsent ? const Value.absent() : Value(nick),
|
||||||
role: Value(role),
|
|
||||||
notify: Value(notify),
|
notify: Value(notify),
|
||||||
joinedAt:
|
joinedAt:
|
||||||
joinedAt == null && nullToAbsent
|
joinedAt == null && nullToAbsent
|
||||||
@@ -1249,13 +1191,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
timeoutUntil == null && nullToAbsent
|
timeoutUntil == null && nullToAbsent
|
||||||
? const Value.absent()
|
? const Value.absent()
|
||||||
: Value(timeoutUntil),
|
: Value(timeoutUntil),
|
||||||
isBot: Value(isBot),
|
|
||||||
status:
|
|
||||||
status == null && nullToAbsent ? const Value.absent() : Value(status),
|
|
||||||
lastTyped:
|
|
||||||
lastTyped == null && nullToAbsent
|
|
||||||
? const Value.absent()
|
|
||||||
: Value(lastTyped),
|
|
||||||
createdAt: Value(createdAt),
|
createdAt: Value(createdAt),
|
||||||
updatedAt: Value(updatedAt),
|
updatedAt: Value(updatedAt),
|
||||||
deletedAt:
|
deletedAt:
|
||||||
@@ -1276,14 +1211,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
accountId: serializer.fromJson<String>(json['accountId']),
|
accountId: serializer.fromJson<String>(json['accountId']),
|
||||||
account: serializer.fromJson<Map<String, dynamic>>(json['account']),
|
account: serializer.fromJson<Map<String, dynamic>>(json['account']),
|
||||||
nick: serializer.fromJson<String?>(json['nick']),
|
nick: serializer.fromJson<String?>(json['nick']),
|
||||||
role: serializer.fromJson<int>(json['role']),
|
|
||||||
notify: serializer.fromJson<int>(json['notify']),
|
notify: serializer.fromJson<int>(json['notify']),
|
||||||
joinedAt: serializer.fromJson<DateTime?>(json['joinedAt']),
|
joinedAt: serializer.fromJson<DateTime?>(json['joinedAt']),
|
||||||
breakUntil: serializer.fromJson<DateTime?>(json['breakUntil']),
|
breakUntil: serializer.fromJson<DateTime?>(json['breakUntil']),
|
||||||
timeoutUntil: serializer.fromJson<DateTime?>(json['timeoutUntil']),
|
timeoutUntil: serializer.fromJson<DateTime?>(json['timeoutUntil']),
|
||||||
isBot: serializer.fromJson<bool>(json['isBot']),
|
|
||||||
status: serializer.fromJson<String?>(json['status']),
|
|
||||||
lastTyped: serializer.fromJson<DateTime?>(json['lastTyped']),
|
|
||||||
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
||||||
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
|
||||||
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
|
||||||
@@ -1298,14 +1229,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
'accountId': serializer.toJson<String>(accountId),
|
'accountId': serializer.toJson<String>(accountId),
|
||||||
'account': serializer.toJson<Map<String, dynamic>>(account),
|
'account': serializer.toJson<Map<String, dynamic>>(account),
|
||||||
'nick': serializer.toJson<String?>(nick),
|
'nick': serializer.toJson<String?>(nick),
|
||||||
'role': serializer.toJson<int>(role),
|
|
||||||
'notify': serializer.toJson<int>(notify),
|
'notify': serializer.toJson<int>(notify),
|
||||||
'joinedAt': serializer.toJson<DateTime?>(joinedAt),
|
'joinedAt': serializer.toJson<DateTime?>(joinedAt),
|
||||||
'breakUntil': serializer.toJson<DateTime?>(breakUntil),
|
'breakUntil': serializer.toJson<DateTime?>(breakUntil),
|
||||||
'timeoutUntil': serializer.toJson<DateTime?>(timeoutUntil),
|
'timeoutUntil': serializer.toJson<DateTime?>(timeoutUntil),
|
||||||
'isBot': serializer.toJson<bool>(isBot),
|
|
||||||
'status': serializer.toJson<String?>(status),
|
|
||||||
'lastTyped': serializer.toJson<DateTime?>(lastTyped),
|
|
||||||
'createdAt': serializer.toJson<DateTime>(createdAt),
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
||||||
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
||||||
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
'deletedAt': serializer.toJson<DateTime?>(deletedAt),
|
||||||
@@ -1318,14 +1245,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
String? accountId,
|
String? accountId,
|
||||||
Map<String, dynamic>? account,
|
Map<String, dynamic>? account,
|
||||||
Value<String?> nick = const Value.absent(),
|
Value<String?> nick = const Value.absent(),
|
||||||
int? role,
|
|
||||||
int? notify,
|
int? notify,
|
||||||
Value<DateTime?> joinedAt = const Value.absent(),
|
Value<DateTime?> joinedAt = const Value.absent(),
|
||||||
Value<DateTime?> breakUntil = const Value.absent(),
|
Value<DateTime?> breakUntil = const Value.absent(),
|
||||||
Value<DateTime?> timeoutUntil = const Value.absent(),
|
Value<DateTime?> timeoutUntil = const Value.absent(),
|
||||||
bool? isBot,
|
|
||||||
Value<String?> status = const Value.absent(),
|
|
||||||
Value<DateTime?> lastTyped = const Value.absent(),
|
|
||||||
DateTime? createdAt,
|
DateTime? createdAt,
|
||||||
DateTime? updatedAt,
|
DateTime? updatedAt,
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -1335,14 +1258,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
accountId: accountId ?? this.accountId,
|
accountId: accountId ?? this.accountId,
|
||||||
account: account ?? this.account,
|
account: account ?? this.account,
|
||||||
nick: nick.present ? nick.value : this.nick,
|
nick: nick.present ? nick.value : this.nick,
|
||||||
role: role ?? this.role,
|
|
||||||
notify: notify ?? this.notify,
|
notify: notify ?? this.notify,
|
||||||
joinedAt: joinedAt.present ? joinedAt.value : this.joinedAt,
|
joinedAt: joinedAt.present ? joinedAt.value : this.joinedAt,
|
||||||
breakUntil: breakUntil.present ? breakUntil.value : this.breakUntil,
|
breakUntil: breakUntil.present ? breakUntil.value : this.breakUntil,
|
||||||
timeoutUntil: timeoutUntil.present ? timeoutUntil.value : this.timeoutUntil,
|
timeoutUntil: timeoutUntil.present ? timeoutUntil.value : this.timeoutUntil,
|
||||||
isBot: isBot ?? this.isBot,
|
|
||||||
status: status.present ? status.value : this.status,
|
|
||||||
lastTyped: lastTyped.present ? lastTyped.value : this.lastTyped,
|
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
|
||||||
@@ -1355,7 +1274,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
accountId: data.accountId.present ? data.accountId.value : this.accountId,
|
accountId: data.accountId.present ? data.accountId.value : this.accountId,
|
||||||
account: data.account.present ? data.account.value : this.account,
|
account: data.account.present ? data.account.value : this.account,
|
||||||
nick: data.nick.present ? data.nick.value : this.nick,
|
nick: data.nick.present ? data.nick.value : this.nick,
|
||||||
role: data.role.present ? data.role.value : this.role,
|
|
||||||
notify: data.notify.present ? data.notify.value : this.notify,
|
notify: data.notify.present ? data.notify.value : this.notify,
|
||||||
joinedAt: data.joinedAt.present ? data.joinedAt.value : this.joinedAt,
|
joinedAt: data.joinedAt.present ? data.joinedAt.value : this.joinedAt,
|
||||||
breakUntil:
|
breakUntil:
|
||||||
@@ -1364,9 +1282,6 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
data.timeoutUntil.present
|
data.timeoutUntil.present
|
||||||
? data.timeoutUntil.value
|
? data.timeoutUntil.value
|
||||||
: this.timeoutUntil,
|
: this.timeoutUntil,
|
||||||
isBot: data.isBot.present ? data.isBot.value : this.isBot,
|
|
||||||
status: data.status.present ? data.status.value : this.status,
|
|
||||||
lastTyped: data.lastTyped.present ? data.lastTyped.value : this.lastTyped,
|
|
||||||
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
||||||
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
|
||||||
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
|
||||||
@@ -1381,14 +1296,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
..write('accountId: $accountId, ')
|
..write('accountId: $accountId, ')
|
||||||
..write('account: $account, ')
|
..write('account: $account, ')
|
||||||
..write('nick: $nick, ')
|
..write('nick: $nick, ')
|
||||||
..write('role: $role, ')
|
|
||||||
..write('notify: $notify, ')
|
..write('notify: $notify, ')
|
||||||
..write('joinedAt: $joinedAt, ')
|
..write('joinedAt: $joinedAt, ')
|
||||||
..write('breakUntil: $breakUntil, ')
|
..write('breakUntil: $breakUntil, ')
|
||||||
..write('timeoutUntil: $timeoutUntil, ')
|
..write('timeoutUntil: $timeoutUntil, ')
|
||||||
..write('isBot: $isBot, ')
|
|
||||||
..write('status: $status, ')
|
|
||||||
..write('lastTyped: $lastTyped, ')
|
|
||||||
..write('createdAt: $createdAt, ')
|
..write('createdAt: $createdAt, ')
|
||||||
..write('updatedAt: $updatedAt, ')
|
..write('updatedAt: $updatedAt, ')
|
||||||
..write('deletedAt: $deletedAt')
|
..write('deletedAt: $deletedAt')
|
||||||
@@ -1403,14 +1314,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
accountId,
|
accountId,
|
||||||
account,
|
account,
|
||||||
nick,
|
nick,
|
||||||
role,
|
|
||||||
notify,
|
notify,
|
||||||
joinedAt,
|
joinedAt,
|
||||||
breakUntil,
|
breakUntil,
|
||||||
timeoutUntil,
|
timeoutUntil,
|
||||||
isBot,
|
|
||||||
status,
|
|
||||||
lastTyped,
|
|
||||||
createdAt,
|
createdAt,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
deletedAt,
|
deletedAt,
|
||||||
@@ -1424,14 +1331,10 @@ class ChatMember extends DataClass implements Insertable<ChatMember> {
|
|||||||
other.accountId == this.accountId &&
|
other.accountId == this.accountId &&
|
||||||
other.account == this.account &&
|
other.account == this.account &&
|
||||||
other.nick == this.nick &&
|
other.nick == this.nick &&
|
||||||
other.role == this.role &&
|
|
||||||
other.notify == this.notify &&
|
other.notify == this.notify &&
|
||||||
other.joinedAt == this.joinedAt &&
|
other.joinedAt == this.joinedAt &&
|
||||||
other.breakUntil == this.breakUntil &&
|
other.breakUntil == this.breakUntil &&
|
||||||
other.timeoutUntil == this.timeoutUntil &&
|
other.timeoutUntil == this.timeoutUntil &&
|
||||||
other.isBot == this.isBot &&
|
|
||||||
other.status == this.status &&
|
|
||||||
other.lastTyped == this.lastTyped &&
|
|
||||||
other.createdAt == this.createdAt &&
|
other.createdAt == this.createdAt &&
|
||||||
other.updatedAt == this.updatedAt &&
|
other.updatedAt == this.updatedAt &&
|
||||||
other.deletedAt == this.deletedAt);
|
other.deletedAt == this.deletedAt);
|
||||||
@@ -1443,14 +1346,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
final Value<String> accountId;
|
final Value<String> accountId;
|
||||||
final Value<Map<String, dynamic>> account;
|
final Value<Map<String, dynamic>> account;
|
||||||
final Value<String?> nick;
|
final Value<String?> nick;
|
||||||
final Value<int> role;
|
|
||||||
final Value<int> notify;
|
final Value<int> notify;
|
||||||
final Value<DateTime?> joinedAt;
|
final Value<DateTime?> joinedAt;
|
||||||
final Value<DateTime?> breakUntil;
|
final Value<DateTime?> breakUntil;
|
||||||
final Value<DateTime?> timeoutUntil;
|
final Value<DateTime?> timeoutUntil;
|
||||||
final Value<bool> isBot;
|
|
||||||
final Value<String?> status;
|
|
||||||
final Value<DateTime?> lastTyped;
|
|
||||||
final Value<DateTime> createdAt;
|
final Value<DateTime> createdAt;
|
||||||
final Value<DateTime> updatedAt;
|
final Value<DateTime> updatedAt;
|
||||||
final Value<DateTime?> deletedAt;
|
final Value<DateTime?> deletedAt;
|
||||||
@@ -1461,14 +1360,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
this.accountId = const Value.absent(),
|
this.accountId = const Value.absent(),
|
||||||
this.account = const Value.absent(),
|
this.account = const Value.absent(),
|
||||||
this.nick = const Value.absent(),
|
this.nick = const Value.absent(),
|
||||||
this.role = const Value.absent(),
|
|
||||||
this.notify = const Value.absent(),
|
this.notify = const Value.absent(),
|
||||||
this.joinedAt = const Value.absent(),
|
this.joinedAt = const Value.absent(),
|
||||||
this.breakUntil = const Value.absent(),
|
this.breakUntil = const Value.absent(),
|
||||||
this.timeoutUntil = const Value.absent(),
|
this.timeoutUntil = const Value.absent(),
|
||||||
this.isBot = const Value.absent(),
|
|
||||||
this.status = const Value.absent(),
|
|
||||||
this.lastTyped = const Value.absent(),
|
|
||||||
this.createdAt = const Value.absent(),
|
this.createdAt = const Value.absent(),
|
||||||
this.updatedAt = const Value.absent(),
|
this.updatedAt = const Value.absent(),
|
||||||
this.deletedAt = const Value.absent(),
|
this.deletedAt = const Value.absent(),
|
||||||
@@ -1480,14 +1375,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
required String accountId,
|
required String accountId,
|
||||||
required Map<String, dynamic> account,
|
required Map<String, dynamic> account,
|
||||||
this.nick = const Value.absent(),
|
this.nick = const Value.absent(),
|
||||||
required int role,
|
|
||||||
required int notify,
|
required int notify,
|
||||||
this.joinedAt = const Value.absent(),
|
this.joinedAt = const Value.absent(),
|
||||||
this.breakUntil = const Value.absent(),
|
this.breakUntil = const Value.absent(),
|
||||||
this.timeoutUntil = const Value.absent(),
|
this.timeoutUntil = const Value.absent(),
|
||||||
required bool isBot,
|
|
||||||
this.status = const Value.absent(),
|
|
||||||
this.lastTyped = const Value.absent(),
|
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
this.deletedAt = const Value.absent(),
|
this.deletedAt = const Value.absent(),
|
||||||
@@ -1496,9 +1387,7 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
chatRoomId = Value(chatRoomId),
|
chatRoomId = Value(chatRoomId),
|
||||||
accountId = Value(accountId),
|
accountId = Value(accountId),
|
||||||
account = Value(account),
|
account = Value(account),
|
||||||
role = Value(role),
|
|
||||||
notify = Value(notify),
|
notify = Value(notify),
|
||||||
isBot = Value(isBot),
|
|
||||||
createdAt = Value(createdAt),
|
createdAt = Value(createdAt),
|
||||||
updatedAt = Value(updatedAt);
|
updatedAt = Value(updatedAt);
|
||||||
static Insertable<ChatMember> custom({
|
static Insertable<ChatMember> custom({
|
||||||
@@ -1507,14 +1396,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
Expression<String>? accountId,
|
Expression<String>? accountId,
|
||||||
Expression<String>? account,
|
Expression<String>? account,
|
||||||
Expression<String>? nick,
|
Expression<String>? nick,
|
||||||
Expression<int>? role,
|
|
||||||
Expression<int>? notify,
|
Expression<int>? notify,
|
||||||
Expression<DateTime>? joinedAt,
|
Expression<DateTime>? joinedAt,
|
||||||
Expression<DateTime>? breakUntil,
|
Expression<DateTime>? breakUntil,
|
||||||
Expression<DateTime>? timeoutUntil,
|
Expression<DateTime>? timeoutUntil,
|
||||||
Expression<bool>? isBot,
|
|
||||||
Expression<String>? status,
|
|
||||||
Expression<DateTime>? lastTyped,
|
|
||||||
Expression<DateTime>? createdAt,
|
Expression<DateTime>? createdAt,
|
||||||
Expression<DateTime>? updatedAt,
|
Expression<DateTime>? updatedAt,
|
||||||
Expression<DateTime>? deletedAt,
|
Expression<DateTime>? deletedAt,
|
||||||
@@ -1526,14 +1411,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
if (accountId != null) 'account_id': accountId,
|
if (accountId != null) 'account_id': accountId,
|
||||||
if (account != null) 'account': account,
|
if (account != null) 'account': account,
|
||||||
if (nick != null) 'nick': nick,
|
if (nick != null) 'nick': nick,
|
||||||
if (role != null) 'role': role,
|
|
||||||
if (notify != null) 'notify': notify,
|
if (notify != null) 'notify': notify,
|
||||||
if (joinedAt != null) 'joined_at': joinedAt,
|
if (joinedAt != null) 'joined_at': joinedAt,
|
||||||
if (breakUntil != null) 'break_until': breakUntil,
|
if (breakUntil != null) 'break_until': breakUntil,
|
||||||
if (timeoutUntil != null) 'timeout_until': timeoutUntil,
|
if (timeoutUntil != null) 'timeout_until': timeoutUntil,
|
||||||
if (isBot != null) 'is_bot': isBot,
|
|
||||||
if (status != null) 'status': status,
|
|
||||||
if (lastTyped != null) 'last_typed': lastTyped,
|
|
||||||
if (createdAt != null) 'created_at': createdAt,
|
if (createdAt != null) 'created_at': createdAt,
|
||||||
if (updatedAt != null) 'updated_at': updatedAt,
|
if (updatedAt != null) 'updated_at': updatedAt,
|
||||||
if (deletedAt != null) 'deleted_at': deletedAt,
|
if (deletedAt != null) 'deleted_at': deletedAt,
|
||||||
@@ -1547,14 +1428,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
Value<String>? accountId,
|
Value<String>? accountId,
|
||||||
Value<Map<String, dynamic>>? account,
|
Value<Map<String, dynamic>>? account,
|
||||||
Value<String?>? nick,
|
Value<String?>? nick,
|
||||||
Value<int>? role,
|
|
||||||
Value<int>? notify,
|
Value<int>? notify,
|
||||||
Value<DateTime?>? joinedAt,
|
Value<DateTime?>? joinedAt,
|
||||||
Value<DateTime?>? breakUntil,
|
Value<DateTime?>? breakUntil,
|
||||||
Value<DateTime?>? timeoutUntil,
|
Value<DateTime?>? timeoutUntil,
|
||||||
Value<bool>? isBot,
|
|
||||||
Value<String?>? status,
|
|
||||||
Value<DateTime?>? lastTyped,
|
|
||||||
Value<DateTime>? createdAt,
|
Value<DateTime>? createdAt,
|
||||||
Value<DateTime>? updatedAt,
|
Value<DateTime>? updatedAt,
|
||||||
Value<DateTime?>? deletedAt,
|
Value<DateTime?>? deletedAt,
|
||||||
@@ -1566,14 +1443,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
accountId: accountId ?? this.accountId,
|
accountId: accountId ?? this.accountId,
|
||||||
account: account ?? this.account,
|
account: account ?? this.account,
|
||||||
nick: nick ?? this.nick,
|
nick: nick ?? this.nick,
|
||||||
role: role ?? this.role,
|
|
||||||
notify: notify ?? this.notify,
|
notify: notify ?? this.notify,
|
||||||
joinedAt: joinedAt ?? this.joinedAt,
|
joinedAt: joinedAt ?? this.joinedAt,
|
||||||
breakUntil: breakUntil ?? this.breakUntil,
|
breakUntil: breakUntil ?? this.breakUntil,
|
||||||
timeoutUntil: timeoutUntil ?? this.timeoutUntil,
|
timeoutUntil: timeoutUntil ?? this.timeoutUntil,
|
||||||
isBot: isBot ?? this.isBot,
|
|
||||||
status: status ?? this.status,
|
|
||||||
lastTyped: lastTyped ?? this.lastTyped,
|
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
deletedAt: deletedAt ?? this.deletedAt,
|
deletedAt: deletedAt ?? this.deletedAt,
|
||||||
@@ -1601,9 +1474,6 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
if (nick.present) {
|
if (nick.present) {
|
||||||
map['nick'] = Variable<String>(nick.value);
|
map['nick'] = Variable<String>(nick.value);
|
||||||
}
|
}
|
||||||
if (role.present) {
|
|
||||||
map['role'] = Variable<int>(role.value);
|
|
||||||
}
|
|
||||||
if (notify.present) {
|
if (notify.present) {
|
||||||
map['notify'] = Variable<int>(notify.value);
|
map['notify'] = Variable<int>(notify.value);
|
||||||
}
|
}
|
||||||
@@ -1616,15 +1486,6 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
if (timeoutUntil.present) {
|
if (timeoutUntil.present) {
|
||||||
map['timeout_until'] = Variable<DateTime>(timeoutUntil.value);
|
map['timeout_until'] = Variable<DateTime>(timeoutUntil.value);
|
||||||
}
|
}
|
||||||
if (isBot.present) {
|
|
||||||
map['is_bot'] = Variable<bool>(isBot.value);
|
|
||||||
}
|
|
||||||
if (status.present) {
|
|
||||||
map['status'] = Variable<String>(status.value);
|
|
||||||
}
|
|
||||||
if (lastTyped.present) {
|
|
||||||
map['last_typed'] = Variable<DateTime>(lastTyped.value);
|
|
||||||
}
|
|
||||||
if (createdAt.present) {
|
if (createdAt.present) {
|
||||||
map['created_at'] = Variable<DateTime>(createdAt.value);
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
||||||
}
|
}
|
||||||
@@ -1648,14 +1509,10 @@ class ChatMembersCompanion extends UpdateCompanion<ChatMember> {
|
|||||||
..write('accountId: $accountId, ')
|
..write('accountId: $accountId, ')
|
||||||
..write('account: $account, ')
|
..write('account: $account, ')
|
||||||
..write('nick: $nick, ')
|
..write('nick: $nick, ')
|
||||||
..write('role: $role, ')
|
|
||||||
..write('notify: $notify, ')
|
..write('notify: $notify, ')
|
||||||
..write('joinedAt: $joinedAt, ')
|
..write('joinedAt: $joinedAt, ')
|
||||||
..write('breakUntil: $breakUntil, ')
|
..write('breakUntil: $breakUntil, ')
|
||||||
..write('timeoutUntil: $timeoutUntil, ')
|
..write('timeoutUntil: $timeoutUntil, ')
|
||||||
..write('isBot: $isBot, ')
|
|
||||||
..write('status: $status, ')
|
|
||||||
..write('lastTyped: $lastTyped, ')
|
|
||||||
..write('createdAt: $createdAt, ')
|
..write('createdAt: $createdAt, ')
|
||||||
..write('updatedAt: $updatedAt, ')
|
..write('updatedAt: $updatedAt, ')
|
||||||
..write('deletedAt: $deletedAt, ')
|
..write('deletedAt: $deletedAt, ')
|
||||||
@@ -3327,6 +3184,7 @@ typedef $$ChatRoomsTableCreateCompanionBuilder =
|
|||||||
Value<Map<String, dynamic>?> picture,
|
Value<Map<String, dynamic>?> picture,
|
||||||
Value<Map<String, dynamic>?> background,
|
Value<Map<String, dynamic>?> background,
|
||||||
Value<String?> realmId,
|
Value<String?> realmId,
|
||||||
|
Value<String?> accountId,
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
Value<DateTime?> deletedAt,
|
Value<DateTime?> deletedAt,
|
||||||
@@ -3343,6 +3201,7 @@ typedef $$ChatRoomsTableUpdateCompanionBuilder =
|
|||||||
Value<Map<String, dynamic>?> picture,
|
Value<Map<String, dynamic>?> picture,
|
||||||
Value<Map<String, dynamic>?> background,
|
Value<Map<String, dynamic>?> background,
|
||||||
Value<String?> realmId,
|
Value<String?> realmId,
|
||||||
|
Value<String?> accountId,
|
||||||
Value<DateTime> createdAt,
|
Value<DateTime> createdAt,
|
||||||
Value<DateTime> updatedAt,
|
Value<DateTime> updatedAt,
|
||||||
Value<DateTime?> deletedAt,
|
Value<DateTime?> deletedAt,
|
||||||
@@ -3454,6 +3313,11 @@ class $$ChatRoomsTableFilterComposer
|
|||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ColumnFilters<String> get accountId => $composableBuilder(
|
||||||
|
column: $table.accountId,
|
||||||
|
builder: (column) => ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt,
|
column: $table.createdAt,
|
||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
@@ -3574,6 +3438,11 @@ class $$ChatRoomsTableOrderingComposer
|
|||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ColumnOrderings<String> get accountId => $composableBuilder(
|
||||||
|
column: $table.accountId,
|
||||||
|
builder: (column) => ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt,
|
column: $table.createdAt,
|
||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
@@ -3633,6 +3502,9 @@ class $$ChatRoomsTableAnnotationComposer
|
|||||||
GeneratedColumn<String> get realmId =>
|
GeneratedColumn<String> get realmId =>
|
||||||
$composableBuilder(column: $table.realmId, builder: (column) => column);
|
$composableBuilder(column: $table.realmId, builder: (column) => column);
|
||||||
|
|
||||||
|
GeneratedColumn<String> get accountId =>
|
||||||
|
$composableBuilder(column: $table.accountId, builder: (column) => column);
|
||||||
|
|
||||||
GeneratedColumn<DateTime> get createdAt =>
|
GeneratedColumn<DateTime> get createdAt =>
|
||||||
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
||||||
|
|
||||||
@@ -3730,6 +3602,7 @@ class $$ChatRoomsTableTableManager
|
|||||||
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
||||||
Value<Map<String, dynamic>?> background = const Value.absent(),
|
Value<Map<String, dynamic>?> background = const Value.absent(),
|
||||||
Value<String?> realmId = const Value.absent(),
|
Value<String?> realmId = const Value.absent(),
|
||||||
|
Value<String?> accountId = const Value.absent(),
|
||||||
Value<DateTime> createdAt = const Value.absent(),
|
Value<DateTime> createdAt = const Value.absent(),
|
||||||
Value<DateTime> updatedAt = const Value.absent(),
|
Value<DateTime> updatedAt = const Value.absent(),
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -3744,6 +3617,7 @@ class $$ChatRoomsTableTableManager
|
|||||||
picture: picture,
|
picture: picture,
|
||||||
background: background,
|
background: background,
|
||||||
realmId: realmId,
|
realmId: realmId,
|
||||||
|
accountId: accountId,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
deletedAt: deletedAt,
|
deletedAt: deletedAt,
|
||||||
@@ -3760,6 +3634,7 @@ class $$ChatRoomsTableTableManager
|
|||||||
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
Value<Map<String, dynamic>?> picture = const Value.absent(),
|
||||||
Value<Map<String, dynamic>?> background = const Value.absent(),
|
Value<Map<String, dynamic>?> background = const Value.absent(),
|
||||||
Value<String?> realmId = const Value.absent(),
|
Value<String?> realmId = const Value.absent(),
|
||||||
|
Value<String?> accountId = const Value.absent(),
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -3774,6 +3649,7 @@ class $$ChatRoomsTableTableManager
|
|||||||
picture: picture,
|
picture: picture,
|
||||||
background: background,
|
background: background,
|
||||||
realmId: realmId,
|
realmId: realmId,
|
||||||
|
accountId: accountId,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
deletedAt: deletedAt,
|
deletedAt: deletedAt,
|
||||||
@@ -3874,14 +3750,10 @@ typedef $$ChatMembersTableCreateCompanionBuilder =
|
|||||||
required String accountId,
|
required String accountId,
|
||||||
required Map<String, dynamic> account,
|
required Map<String, dynamic> account,
|
||||||
Value<String?> nick,
|
Value<String?> nick,
|
||||||
required int role,
|
|
||||||
required int notify,
|
required int notify,
|
||||||
Value<DateTime?> joinedAt,
|
Value<DateTime?> joinedAt,
|
||||||
Value<DateTime?> breakUntil,
|
Value<DateTime?> breakUntil,
|
||||||
Value<DateTime?> timeoutUntil,
|
Value<DateTime?> timeoutUntil,
|
||||||
required bool isBot,
|
|
||||||
Value<String?> status,
|
|
||||||
Value<DateTime?> lastTyped,
|
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
Value<DateTime?> deletedAt,
|
Value<DateTime?> deletedAt,
|
||||||
@@ -3894,14 +3766,10 @@ typedef $$ChatMembersTableUpdateCompanionBuilder =
|
|||||||
Value<String> accountId,
|
Value<String> accountId,
|
||||||
Value<Map<String, dynamic>> account,
|
Value<Map<String, dynamic>> account,
|
||||||
Value<String?> nick,
|
Value<String?> nick,
|
||||||
Value<int> role,
|
|
||||||
Value<int> notify,
|
Value<int> notify,
|
||||||
Value<DateTime?> joinedAt,
|
Value<DateTime?> joinedAt,
|
||||||
Value<DateTime?> breakUntil,
|
Value<DateTime?> breakUntil,
|
||||||
Value<DateTime?> timeoutUntil,
|
Value<DateTime?> timeoutUntil,
|
||||||
Value<bool> isBot,
|
|
||||||
Value<String?> status,
|
|
||||||
Value<DateTime?> lastTyped,
|
|
||||||
Value<DateTime> createdAt,
|
Value<DateTime> createdAt,
|
||||||
Value<DateTime> updatedAt,
|
Value<DateTime> updatedAt,
|
||||||
Value<DateTime?> deletedAt,
|
Value<DateTime?> deletedAt,
|
||||||
@@ -3987,11 +3855,6 @@ class $$ChatMembersTableFilterComposer
|
|||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
ColumnFilters<int> get role => $composableBuilder(
|
|
||||||
column: $table.role,
|
|
||||||
builder: (column) => ColumnFilters(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnFilters<int> get notify => $composableBuilder(
|
ColumnFilters<int> get notify => $composableBuilder(
|
||||||
column: $table.notify,
|
column: $table.notify,
|
||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
@@ -4012,21 +3875,6 @@ class $$ChatMembersTableFilterComposer
|
|||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
ColumnFilters<bool> get isBot => $composableBuilder(
|
|
||||||
column: $table.isBot,
|
|
||||||
builder: (column) => ColumnFilters(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnFilters<String> get status => $composableBuilder(
|
|
||||||
column: $table.status,
|
|
||||||
builder: (column) => ColumnFilters(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnFilters<DateTime> get lastTyped => $composableBuilder(
|
|
||||||
column: $table.lastTyped,
|
|
||||||
builder: (column) => ColumnFilters(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt,
|
column: $table.createdAt,
|
||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
@@ -4120,11 +3968,6 @@ class $$ChatMembersTableOrderingComposer
|
|||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
ColumnOrderings<int> get role => $composableBuilder(
|
|
||||||
column: $table.role,
|
|
||||||
builder: (column) => ColumnOrderings(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnOrderings<int> get notify => $composableBuilder(
|
ColumnOrderings<int> get notify => $composableBuilder(
|
||||||
column: $table.notify,
|
column: $table.notify,
|
||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
@@ -4145,21 +3988,6 @@ class $$ChatMembersTableOrderingComposer
|
|||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
ColumnOrderings<bool> get isBot => $composableBuilder(
|
|
||||||
column: $table.isBot,
|
|
||||||
builder: (column) => ColumnOrderings(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnOrderings<String> get status => $composableBuilder(
|
|
||||||
column: $table.status,
|
|
||||||
builder: (column) => ColumnOrderings(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnOrderings<DateTime> get lastTyped => $composableBuilder(
|
|
||||||
column: $table.lastTyped,
|
|
||||||
builder: (column) => ColumnOrderings(column),
|
|
||||||
);
|
|
||||||
|
|
||||||
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt,
|
column: $table.createdAt,
|
||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
@@ -4220,9 +4048,6 @@ class $$ChatMembersTableAnnotationComposer
|
|||||||
GeneratedColumn<String> get nick =>
|
GeneratedColumn<String> get nick =>
|
||||||
$composableBuilder(column: $table.nick, builder: (column) => column);
|
$composableBuilder(column: $table.nick, builder: (column) => column);
|
||||||
|
|
||||||
GeneratedColumn<int> get role =>
|
|
||||||
$composableBuilder(column: $table.role, builder: (column) => column);
|
|
||||||
|
|
||||||
GeneratedColumn<int> get notify =>
|
GeneratedColumn<int> get notify =>
|
||||||
$composableBuilder(column: $table.notify, builder: (column) => column);
|
$composableBuilder(column: $table.notify, builder: (column) => column);
|
||||||
|
|
||||||
@@ -4239,15 +4064,6 @@ class $$ChatMembersTableAnnotationComposer
|
|||||||
builder: (column) => column,
|
builder: (column) => column,
|
||||||
);
|
);
|
||||||
|
|
||||||
GeneratedColumn<bool> get isBot =>
|
|
||||||
$composableBuilder(column: $table.isBot, builder: (column) => column);
|
|
||||||
|
|
||||||
GeneratedColumn<String> get status =>
|
|
||||||
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
||||||
|
|
||||||
GeneratedColumn<DateTime> get lastTyped =>
|
|
||||||
$composableBuilder(column: $table.lastTyped, builder: (column) => column);
|
|
||||||
|
|
||||||
GeneratedColumn<DateTime> get createdAt =>
|
GeneratedColumn<DateTime> get createdAt =>
|
||||||
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
||||||
|
|
||||||
@@ -4340,14 +4156,10 @@ class $$ChatMembersTableTableManager
|
|||||||
Value<String> accountId = const Value.absent(),
|
Value<String> accountId = const Value.absent(),
|
||||||
Value<Map<String, dynamic>> account = const Value.absent(),
|
Value<Map<String, dynamic>> account = const Value.absent(),
|
||||||
Value<String?> nick = const Value.absent(),
|
Value<String?> nick = const Value.absent(),
|
||||||
Value<int> role = const Value.absent(),
|
|
||||||
Value<int> notify = const Value.absent(),
|
Value<int> notify = const Value.absent(),
|
||||||
Value<DateTime?> joinedAt = const Value.absent(),
|
Value<DateTime?> joinedAt = const Value.absent(),
|
||||||
Value<DateTime?> breakUntil = const Value.absent(),
|
Value<DateTime?> breakUntil = const Value.absent(),
|
||||||
Value<DateTime?> timeoutUntil = const Value.absent(),
|
Value<DateTime?> timeoutUntil = const Value.absent(),
|
||||||
Value<bool> isBot = const Value.absent(),
|
|
||||||
Value<String?> status = const Value.absent(),
|
|
||||||
Value<DateTime?> lastTyped = const Value.absent(),
|
|
||||||
Value<DateTime> createdAt = const Value.absent(),
|
Value<DateTime> createdAt = const Value.absent(),
|
||||||
Value<DateTime> updatedAt = const Value.absent(),
|
Value<DateTime> updatedAt = const Value.absent(),
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -4358,14 +4170,10 @@ class $$ChatMembersTableTableManager
|
|||||||
accountId: accountId,
|
accountId: accountId,
|
||||||
account: account,
|
account: account,
|
||||||
nick: nick,
|
nick: nick,
|
||||||
role: role,
|
|
||||||
notify: notify,
|
notify: notify,
|
||||||
joinedAt: joinedAt,
|
joinedAt: joinedAt,
|
||||||
breakUntil: breakUntil,
|
breakUntil: breakUntil,
|
||||||
timeoutUntil: timeoutUntil,
|
timeoutUntil: timeoutUntil,
|
||||||
isBot: isBot,
|
|
||||||
status: status,
|
|
||||||
lastTyped: lastTyped,
|
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
deletedAt: deletedAt,
|
deletedAt: deletedAt,
|
||||||
@@ -4378,14 +4186,10 @@ class $$ChatMembersTableTableManager
|
|||||||
required String accountId,
|
required String accountId,
|
||||||
required Map<String, dynamic> account,
|
required Map<String, dynamic> account,
|
||||||
Value<String?> nick = const Value.absent(),
|
Value<String?> nick = const Value.absent(),
|
||||||
required int role,
|
|
||||||
required int notify,
|
required int notify,
|
||||||
Value<DateTime?> joinedAt = const Value.absent(),
|
Value<DateTime?> joinedAt = const Value.absent(),
|
||||||
Value<DateTime?> breakUntil = const Value.absent(),
|
Value<DateTime?> breakUntil = const Value.absent(),
|
||||||
Value<DateTime?> timeoutUntil = const Value.absent(),
|
Value<DateTime?> timeoutUntil = const Value.absent(),
|
||||||
required bool isBot,
|
|
||||||
Value<String?> status = const Value.absent(),
|
|
||||||
Value<DateTime?> lastTyped = const Value.absent(),
|
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
Value<DateTime?> deletedAt = const Value.absent(),
|
Value<DateTime?> deletedAt = const Value.absent(),
|
||||||
@@ -4396,14 +4200,10 @@ class $$ChatMembersTableTableManager
|
|||||||
accountId: accountId,
|
accountId: accountId,
|
||||||
account: account,
|
account: account,
|
||||||
nick: nick,
|
nick: nick,
|
||||||
role: role,
|
|
||||||
notify: notify,
|
notify: notify,
|
||||||
joinedAt: joinedAt,
|
joinedAt: joinedAt,
|
||||||
breakUntil: breakUntil,
|
breakUntil: breakUntil,
|
||||||
timeoutUntil: timeoutUntil,
|
timeoutUntil: timeoutUntil,
|
||||||
isBot: isBot,
|
|
||||||
status: status,
|
|
||||||
lastTyped: lastTyped,
|
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
deletedAt: deletedAt,
|
deletedAt: deletedAt,
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class ChatRooms extends Table {
|
|||||||
TextColumn get picture => text().map(const MapConverter()).nullable()();
|
TextColumn get picture => text().map(const MapConverter()).nullable()();
|
||||||
TextColumn get background => text().map(const MapConverter()).nullable()();
|
TextColumn get background => text().map(const MapConverter()).nullable()();
|
||||||
TextColumn get realmId => text().nullable()();
|
TextColumn get realmId => text().nullable()();
|
||||||
|
TextColumn get accountId => text().nullable()();
|
||||||
DateTimeColumn get createdAt => dateTime()();
|
DateTimeColumn get createdAt => dateTime()();
|
||||||
DateTimeColumn get updatedAt => dateTime()();
|
DateTimeColumn get updatedAt => dateTime()();
|
||||||
DateTimeColumn get deletedAt => dateTime().nullable()();
|
DateTimeColumn get deletedAt => dateTime().nullable()();
|
||||||
@@ -62,14 +63,10 @@ class ChatMembers extends Table {
|
|||||||
TextColumn get accountId => text()();
|
TextColumn get accountId => text()();
|
||||||
TextColumn get account => text().map(const MapConverter())();
|
TextColumn get account => text().map(const MapConverter())();
|
||||||
TextColumn get nick => text().nullable()();
|
TextColumn get nick => text().nullable()();
|
||||||
IntColumn get role => integer()();
|
|
||||||
IntColumn get notify => integer()();
|
IntColumn get notify => integer()();
|
||||||
DateTimeColumn get joinedAt => dateTime().nullable()();
|
DateTimeColumn get joinedAt => dateTime().nullable()();
|
||||||
DateTimeColumn get breakUntil => dateTime().nullable()();
|
DateTimeColumn get breakUntil => dateTime().nullable()();
|
||||||
DateTimeColumn get timeoutUntil => dateTime().nullable()();
|
DateTimeColumn get timeoutUntil => dateTime().nullable()();
|
||||||
BoolColumn get isBot => boolean()();
|
|
||||||
TextColumn get status => text().nullable()();
|
|
||||||
DateTimeColumn get lastTyped => dateTime().nullable()();
|
|
||||||
DateTimeColumn get createdAt => dateTime()();
|
DateTimeColumn get createdAt => dateTime()();
|
||||||
DateTimeColumn get updatedAt => dateTime()();
|
DateTimeColumn get updatedAt => dateTime()();
|
||||||
DateTimeColumn get deletedAt => dateTime().nullable()();
|
DateTimeColumn get deletedAt => dateTime().nullable()();
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class IslandApp extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final theme = ref.watch(themeProvider);
|
final theme = ref.watch(themeProvider);
|
||||||
final settings = ref.watch(appSettingsNotifierProvider);
|
final settings = ref.watch(appSettingsProvider);
|
||||||
|
|
||||||
// Convert string theme mode to ThemeMode enum
|
// Convert string theme mode to ThemeMode enum
|
||||||
ThemeMode getThemeMode() {
|
ThemeMode getThemeMode() {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ sealed class SnAccount with _$SnAccount {
|
|||||||
required SnWalletSubscriptionRef? perkSubscription,
|
required SnWalletSubscriptionRef? perkSubscription,
|
||||||
@Default([]) List<SnAccountBadge> badges,
|
@Default([]) List<SnAccountBadge> badges,
|
||||||
@Default([]) List<SnContactMethod> contacts,
|
@Default([]) List<SnContactMethod> contacts,
|
||||||
|
required DateTime? activatedAt,
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
required DateTime? deletedAt,
|
required DateTime? deletedAt,
|
||||||
@@ -215,20 +216,20 @@ sealed class SnAuthDevice with _$SnAuthDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
sealed class SnAuthDeviceWithChallenge with _$SnAuthDeviceWithChallenge {
|
sealed class SnAuthDeviceWithSession with _$SnAuthDeviceWithSession {
|
||||||
const factory SnAuthDeviceWithChallenge({
|
const factory SnAuthDeviceWithSession({
|
||||||
required String id,
|
required String id,
|
||||||
required String deviceId,
|
required String deviceId,
|
||||||
required String deviceName,
|
required String deviceName,
|
||||||
required String? deviceLabel,
|
required String? deviceLabel,
|
||||||
required String accountId,
|
required String accountId,
|
||||||
required int platform,
|
required int platform,
|
||||||
required List<SnAuthChallenge> challenges,
|
required List<SnAuthSession> sessions,
|
||||||
@Default(false) bool isCurrent,
|
@Default(false) bool isCurrent,
|
||||||
}) = _SnAuthDeviceWithChallengee;
|
}) = _SnAuthDeviceWithSessione;
|
||||||
|
|
||||||
factory SnAuthDeviceWithChallenge.fromJson(Map<String, dynamic> json) =>
|
factory SnAuthDeviceWithSession.fromJson(Map<String, dynamic> json) =>
|
||||||
_$SnAuthDeviceWithChallengeFromJson(json);
|
_$SnAuthDeviceWithSessionFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnAccount {
|
mixin _$SnAccount {
|
||||||
|
|
||||||
String get id; String get name; String get nick; String get language; String get region; bool get isSuperuser; String? get automatedId; SnAccountProfile get profile; SnWalletSubscriptionRef? get perkSubscription; List<SnAccountBadge> get badges; List<SnContactMethod> get contacts; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
String get id; String get name; String get nick; String get language; String get region; bool get isSuperuser; String? get automatedId; SnAccountProfile get profile; SnWalletSubscriptionRef? get perkSubscription; List<SnAccountBadge> get badges; List<SnContactMethod> get contacts; DateTime? get activatedAt; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
||||||
/// Create a copy of SnAccount
|
/// Create a copy of SnAccount
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -28,16 +28,16 @@ $SnAccountCopyWith<SnAccount> get copyWith => _$SnAccountCopyWithImpl<SnAccount>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.language, language) || other.language == language)&&(identical(other.region, region) || other.region == region)&&(identical(other.isSuperuser, isSuperuser) || other.isSuperuser == isSuperuser)&&(identical(other.automatedId, automatedId) || other.automatedId == automatedId)&&(identical(other.profile, profile) || other.profile == profile)&&(identical(other.perkSubscription, perkSubscription) || other.perkSubscription == perkSubscription)&&const DeepCollectionEquality().equals(other.badges, badges)&&const DeepCollectionEquality().equals(other.contacts, contacts)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.language, language) || other.language == language)&&(identical(other.region, region) || other.region == region)&&(identical(other.isSuperuser, isSuperuser) || other.isSuperuser == isSuperuser)&&(identical(other.automatedId, automatedId) || other.automatedId == automatedId)&&(identical(other.profile, profile) || other.profile == profile)&&(identical(other.perkSubscription, perkSubscription) || other.perkSubscription == perkSubscription)&&const DeepCollectionEquality().equals(other.badges, badges)&&const DeepCollectionEquality().equals(other.contacts, contacts)&&(identical(other.activatedAt, activatedAt) || other.activatedAt == activatedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,nick,language,region,isSuperuser,automatedId,profile,perkSubscription,const DeepCollectionEquality().hash(badges),const DeepCollectionEquality().hash(contacts),createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,name,nick,language,region,isSuperuser,automatedId,profile,perkSubscription,const DeepCollectionEquality().hash(badges),const DeepCollectionEquality().hash(contacts),activatedAt,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAccount(id: $id, name: $name, nick: $nick, language: $language, region: $region, isSuperuser: $isSuperuser, automatedId: $automatedId, profile: $profile, perkSubscription: $perkSubscription, badges: $badges, contacts: $contacts, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAccount(id: $id, name: $name, nick: $nick, language: $language, region: $region, isSuperuser: $isSuperuser, automatedId: $automatedId, profile: $profile, perkSubscription: $perkSubscription, badges: $badges, contacts: $contacts, activatedAt: $activatedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ abstract mixin class $SnAccountCopyWith<$Res> {
|
|||||||
factory $SnAccountCopyWith(SnAccount value, $Res Function(SnAccount) _then) = _$SnAccountCopyWithImpl;
|
factory $SnAccountCopyWith(SnAccount value, $Res Function(SnAccount) _then) = _$SnAccountCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime? activatedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class _$SnAccountCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAccount
|
/// Create a copy of SnAccount
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? region = null,Object? isSuperuser = null,Object? automatedId = freezed,Object? profile = null,Object? perkSubscription = freezed,Object? badges = null,Object? contacts = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? region = null,Object? isSuperuser = null,Object? automatedId = freezed,Object? profile = null,Object? perkSubscription = freezed,Object? badges = null,Object? contacts = null,Object? activatedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -78,7 +78,8 @@ as String?,profile: null == profile ? _self.profile : profile // ignore: cast_nu
|
|||||||
as SnAccountProfile,perkSubscription: freezed == perkSubscription ? _self.perkSubscription : perkSubscription // ignore: cast_nullable_to_non_nullable
|
as SnAccountProfile,perkSubscription: freezed == perkSubscription ? _self.perkSubscription : perkSubscription // ignore: cast_nullable_to_non_nullable
|
||||||
as SnWalletSubscriptionRef?,badges: null == badges ? _self.badges : badges // ignore: cast_nullable_to_non_nullable
|
as SnWalletSubscriptionRef?,badges: null == badges ? _self.badges : badges // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnAccountBadge>,contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable
|
as List<SnAccountBadge>,contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnContactMethod>,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as List<SnContactMethod>,activatedAt: freezed == activatedAt ? _self.activatedAt : activatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
@@ -184,10 +185,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime? activatedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAccount() when $default != null:
|
case _SnAccount() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.activatedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -205,10 +206,10 @@ return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime? activatedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAccount():
|
case _SnAccount():
|
||||||
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.activatedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -222,10 +223,10 @@ return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime? activatedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAccount() when $default != null:
|
case _SnAccount() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that.isSuperuser,_that.automatedId,_that.profile,_that.perkSubscription,_that.badges,_that.contacts,_that.activatedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -237,7 +238,7 @@ return $default(_that.id,_that.name,_that.nick,_that.language,_that.region,_that
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnAccount implements SnAccount {
|
class _SnAccount implements SnAccount {
|
||||||
const _SnAccount({required this.id, required this.name, required this.nick, required this.language, this.region = "", required this.isSuperuser, required this.automatedId, required this.profile, required this.perkSubscription, final List<SnAccountBadge> badges = const [], final List<SnContactMethod> contacts = const [], required this.createdAt, required this.updatedAt, required this.deletedAt}): _badges = badges,_contacts = contacts;
|
const _SnAccount({required this.id, required this.name, required this.nick, required this.language, this.region = "", required this.isSuperuser, required this.automatedId, required this.profile, required this.perkSubscription, final List<SnAccountBadge> badges = const [], final List<SnContactMethod> contacts = const [], required this.activatedAt, required this.createdAt, required this.updatedAt, required this.deletedAt}): _badges = badges,_contacts = contacts;
|
||||||
factory _SnAccount.fromJson(Map<String, dynamic> json) => _$SnAccountFromJson(json);
|
factory _SnAccount.fromJson(Map<String, dynamic> json) => _$SnAccountFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@@ -263,6 +264,7 @@ class _SnAccount implements SnAccount {
|
|||||||
return EqualUnmodifiableListView(_contacts);
|
return EqualUnmodifiableListView(_contacts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override final DateTime? activatedAt;
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@override final DateTime updatedAt;
|
@override final DateTime updatedAt;
|
||||||
@override final DateTime? deletedAt;
|
@override final DateTime? deletedAt;
|
||||||
@@ -280,16 +282,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.language, language) || other.language == language)&&(identical(other.region, region) || other.region == region)&&(identical(other.isSuperuser, isSuperuser) || other.isSuperuser == isSuperuser)&&(identical(other.automatedId, automatedId) || other.automatedId == automatedId)&&(identical(other.profile, profile) || other.profile == profile)&&(identical(other.perkSubscription, perkSubscription) || other.perkSubscription == perkSubscription)&&const DeepCollectionEquality().equals(other._badges, _badges)&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.language, language) || other.language == language)&&(identical(other.region, region) || other.region == region)&&(identical(other.isSuperuser, isSuperuser) || other.isSuperuser == isSuperuser)&&(identical(other.automatedId, automatedId) || other.automatedId == automatedId)&&(identical(other.profile, profile) || other.profile == profile)&&(identical(other.perkSubscription, perkSubscription) || other.perkSubscription == perkSubscription)&&const DeepCollectionEquality().equals(other._badges, _badges)&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&(identical(other.activatedAt, activatedAt) || other.activatedAt == activatedAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,nick,language,region,isSuperuser,automatedId,profile,perkSubscription,const DeepCollectionEquality().hash(_badges),const DeepCollectionEquality().hash(_contacts),createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,name,nick,language,region,isSuperuser,automatedId,profile,perkSubscription,const DeepCollectionEquality().hash(_badges),const DeepCollectionEquality().hash(_contacts),activatedAt,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAccount(id: $id, name: $name, nick: $nick, language: $language, region: $region, isSuperuser: $isSuperuser, automatedId: $automatedId, profile: $profile, perkSubscription: $perkSubscription, badges: $badges, contacts: $contacts, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAccount(id: $id, name: $name, nick: $nick, language: $language, region: $region, isSuperuser: $isSuperuser, automatedId: $automatedId, profile: $profile, perkSubscription: $perkSubscription, badges: $badges, contacts: $contacts, activatedAt: $activatedAt, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -300,7 +302,7 @@ abstract mixin class _$SnAccountCopyWith<$Res> implements $SnAccountCopyWith<$Re
|
|||||||
factory _$SnAccountCopyWith(_SnAccount value, $Res Function(_SnAccount) _then) = __$SnAccountCopyWithImpl;
|
factory _$SnAccountCopyWith(_SnAccount value, $Res Function(_SnAccount) _then) = __$SnAccountCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, String name, String nick, String language, String region, bool isSuperuser, String? automatedId, SnAccountProfile profile, SnWalletSubscriptionRef? perkSubscription, List<SnAccountBadge> badges, List<SnContactMethod> contacts, DateTime? activatedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -317,7 +319,7 @@ class __$SnAccountCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAccount
|
/// Create a copy of SnAccount
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? region = null,Object? isSuperuser = null,Object? automatedId = freezed,Object? profile = null,Object? perkSubscription = freezed,Object? badges = null,Object? contacts = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? region = null,Object? isSuperuser = null,Object? automatedId = freezed,Object? profile = null,Object? perkSubscription = freezed,Object? badges = null,Object? contacts = null,Object? activatedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_SnAccount(
|
return _then(_SnAccount(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -330,7 +332,8 @@ as String?,profile: null == profile ? _self.profile : profile // ignore: cast_nu
|
|||||||
as SnAccountProfile,perkSubscription: freezed == perkSubscription ? _self.perkSubscription : perkSubscription // ignore: cast_nullable_to_non_nullable
|
as SnAccountProfile,perkSubscription: freezed == perkSubscription ? _self.perkSubscription : perkSubscription // ignore: cast_nullable_to_non_nullable
|
||||||
as SnWalletSubscriptionRef?,badges: null == badges ? _self._badges : badges // ignore: cast_nullable_to_non_nullable
|
as SnWalletSubscriptionRef?,badges: null == badges ? _self._badges : badges // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnAccountBadge>,contacts: null == contacts ? _self._contacts : contacts // ignore: cast_nullable_to_non_nullable
|
as List<SnAccountBadge>,contacts: null == contacts ? _self._contacts : contacts // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnContactMethod>,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as List<SnContactMethod>,activatedAt: freezed == activatedAt ? _self.activatedAt : activatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
@@ -3065,51 +3068,51 @@ as bool,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SnAuthDeviceWithChallenge _$SnAuthDeviceWithChallengeFromJson(
|
SnAuthDeviceWithSession _$SnAuthDeviceWithSessionFromJson(
|
||||||
Map<String, dynamic> json
|
Map<String, dynamic> json
|
||||||
) {
|
) {
|
||||||
return _SnAuthDeviceWithChallengee.fromJson(
|
return _SnAuthDeviceWithSessione.fromJson(
|
||||||
json
|
json
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnAuthDeviceWithChallenge {
|
mixin _$SnAuthDeviceWithSession {
|
||||||
|
|
||||||
String get id; String get deviceId; String get deviceName; String? get deviceLabel; String get accountId; int get platform; List<SnAuthChallenge> get challenges; bool get isCurrent;
|
String get id; String get deviceId; String get deviceName; String? get deviceLabel; String get accountId; int get platform; List<SnAuthSession> get sessions; bool get isCurrent;
|
||||||
/// Create a copy of SnAuthDeviceWithChallenge
|
/// Create a copy of SnAuthDeviceWithSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
$SnAuthDeviceWithChallengeCopyWith<SnAuthDeviceWithChallenge> get copyWith => _$SnAuthDeviceWithChallengeCopyWithImpl<SnAuthDeviceWithChallenge>(this as SnAuthDeviceWithChallenge, _$identity);
|
$SnAuthDeviceWithSessionCopyWith<SnAuthDeviceWithSession> get copyWith => _$SnAuthDeviceWithSessionCopyWithImpl<SnAuthDeviceWithSession>(this as SnAuthDeviceWithSession, _$identity);
|
||||||
|
|
||||||
/// Serializes this SnAuthDeviceWithChallenge to a JSON map.
|
/// Serializes this SnAuthDeviceWithSession to a JSON map.
|
||||||
Map<String, dynamic> toJson();
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthDeviceWithChallenge&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceId, deviceId) || other.deviceId == deviceId)&&(identical(other.deviceName, deviceName) || other.deviceName == deviceName)&&(identical(other.deviceLabel, deviceLabel) || other.deviceLabel == deviceLabel)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.platform, platform) || other.platform == platform)&&const DeepCollectionEquality().equals(other.challenges, challenges)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthDeviceWithSession&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceId, deviceId) || other.deviceId == deviceId)&&(identical(other.deviceName, deviceName) || other.deviceName == deviceName)&&(identical(other.deviceLabel, deviceLabel) || other.deviceLabel == deviceLabel)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.platform, platform) || other.platform == platform)&&const DeepCollectionEquality().equals(other.sessions, sessions)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,deviceId,deviceName,deviceLabel,accountId,platform,const DeepCollectionEquality().hash(challenges),isCurrent);
|
int get hashCode => Object.hash(runtimeType,id,deviceId,deviceName,deviceLabel,accountId,platform,const DeepCollectionEquality().hash(sessions),isCurrent);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthDeviceWithChallenge(id: $id, deviceId: $deviceId, deviceName: $deviceName, deviceLabel: $deviceLabel, accountId: $accountId, platform: $platform, challenges: $challenges, isCurrent: $isCurrent)';
|
return 'SnAuthDeviceWithSession(id: $id, deviceId: $deviceId, deviceName: $deviceName, deviceLabel: $deviceLabel, accountId: $accountId, platform: $platform, sessions: $sessions, isCurrent: $isCurrent)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract mixin class $SnAuthDeviceWithChallengeCopyWith<$Res> {
|
abstract mixin class $SnAuthDeviceWithSessionCopyWith<$Res> {
|
||||||
factory $SnAuthDeviceWithChallengeCopyWith(SnAuthDeviceWithChallenge value, $Res Function(SnAuthDeviceWithChallenge) _then) = _$SnAuthDeviceWithChallengeCopyWithImpl;
|
factory $SnAuthDeviceWithSessionCopyWith(SnAuthDeviceWithSession value, $Res Function(SnAuthDeviceWithSession) _then) = _$SnAuthDeviceWithSessionCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthChallenge> challenges, bool isCurrent
|
String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthSession> sessions, bool isCurrent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -3117,16 +3120,16 @@ $Res call({
|
|||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class _$SnAuthDeviceWithChallengeCopyWithImpl<$Res>
|
class _$SnAuthDeviceWithSessionCopyWithImpl<$Res>
|
||||||
implements $SnAuthDeviceWithChallengeCopyWith<$Res> {
|
implements $SnAuthDeviceWithSessionCopyWith<$Res> {
|
||||||
_$SnAuthDeviceWithChallengeCopyWithImpl(this._self, this._then);
|
_$SnAuthDeviceWithSessionCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
final SnAuthDeviceWithChallenge _self;
|
final SnAuthDeviceWithSession _self;
|
||||||
final $Res Function(SnAuthDeviceWithChallenge) _then;
|
final $Res Function(SnAuthDeviceWithSession) _then;
|
||||||
|
|
||||||
/// Create a copy of SnAuthDeviceWithChallenge
|
/// Create a copy of SnAuthDeviceWithSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceId = null,Object? deviceName = null,Object? deviceLabel = freezed,Object? accountId = null,Object? platform = null,Object? challenges = null,Object? isCurrent = null,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceId = null,Object? deviceName = null,Object? deviceLabel = freezed,Object? accountId = null,Object? platform = null,Object? sessions = null,Object? isCurrent = null,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,deviceId: null == deviceId ? _self.deviceId : deviceId // ignore: cast_nullable_to_non_nullable
|
as String,deviceId: null == deviceId ? _self.deviceId : deviceId // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -3134,8 +3137,8 @@ as String,deviceName: null == deviceName ? _self.deviceName : deviceName // igno
|
|||||||
as String,deviceLabel: freezed == deviceLabel ? _self.deviceLabel : deviceLabel // ignore: cast_nullable_to_non_nullable
|
as String,deviceLabel: freezed == deviceLabel ? _self.deviceLabel : deviceLabel // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,platform: null == platform ? _self.platform : platform // ignore: cast_nullable_to_non_nullable
|
as String,platform: null == platform ? _self.platform : platform // ignore: cast_nullable_to_non_nullable
|
||||||
as int,challenges: null == challenges ? _self.challenges : challenges // ignore: cast_nullable_to_non_nullable
|
as int,sessions: null == sessions ? _self.sessions : sessions // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnAuthChallenge>,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable
|
as List<SnAuthSession>,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,
|
as bool,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -3143,8 +3146,8 @@ as bool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Adds pattern-matching-related methods to [SnAuthDeviceWithChallenge].
|
/// Adds pattern-matching-related methods to [SnAuthDeviceWithSession].
|
||||||
extension SnAuthDeviceWithChallengePatterns on SnAuthDeviceWithChallenge {
|
extension SnAuthDeviceWithSessionPatterns on SnAuthDeviceWithSession {
|
||||||
/// A variant of `map` that fallback to returning `orElse`.
|
/// A variant of `map` that fallback to returning `orElse`.
|
||||||
///
|
///
|
||||||
/// It is equivalent to doing:
|
/// It is equivalent to doing:
|
||||||
@@ -3157,10 +3160,10 @@ extension SnAuthDeviceWithChallengePatterns on SnAuthDeviceWithChallenge {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SnAuthDeviceWithChallengee value)? $default,{required TResult orElse(),}){
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SnAuthDeviceWithSessione value)? $default,{required TResult orElse(),}){
|
||||||
final _that = this;
|
final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee() when $default != null:
|
case _SnAuthDeviceWithSessione() when $default != null:
|
||||||
return $default(_that);case _:
|
return $default(_that);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
@@ -3179,10 +3182,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SnAuthDeviceWithChallengee value) $default,){
|
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SnAuthDeviceWithSessione value) $default,){
|
||||||
final _that = this;
|
final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee():
|
case _SnAuthDeviceWithSessione():
|
||||||
return $default(_that);}
|
return $default(_that);}
|
||||||
}
|
}
|
||||||
/// A variant of `map` that fallback to returning `null`.
|
/// A variant of `map` that fallback to returning `null`.
|
||||||
@@ -3197,10 +3200,10 @@ return $default(_that);}
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SnAuthDeviceWithChallengee value)? $default,){
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SnAuthDeviceWithSessione value)? $default,){
|
||||||
final _that = this;
|
final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee() when $default != null:
|
case _SnAuthDeviceWithSessione() when $default != null:
|
||||||
return $default(_that);case _:
|
return $default(_that);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3218,10 +3221,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthChallenge> challenges, bool isCurrent)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthSession> sessions, bool isCurrent)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee() when $default != null:
|
case _SnAuthDeviceWithSessione() when $default != null:
|
||||||
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.challenges,_that.isCurrent);case _:
|
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.sessions,_that.isCurrent);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3239,10 +3242,10 @@ return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthChallenge> challenges, bool isCurrent) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthSession> sessions, bool isCurrent) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee():
|
case _SnAuthDeviceWithSessione():
|
||||||
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.challenges,_that.isCurrent);}
|
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.sessions,_that.isCurrent);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -3256,10 +3259,10 @@ return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthChallenge> challenges, bool isCurrent)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthSession> sessions, bool isCurrent)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthDeviceWithChallengee() when $default != null:
|
case _SnAuthDeviceWithSessione() when $default != null:
|
||||||
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.challenges,_that.isCurrent);case _:
|
return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that.accountId,_that.platform,_that.sessions,_that.isCurrent);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3270,9 +3273,9 @@ return $default(_that.id,_that.deviceId,_that.deviceName,_that.deviceLabel,_that
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnAuthDeviceWithChallengee implements SnAuthDeviceWithChallenge {
|
class _SnAuthDeviceWithSessione implements SnAuthDeviceWithSession {
|
||||||
const _SnAuthDeviceWithChallengee({required this.id, required this.deviceId, required this.deviceName, required this.deviceLabel, required this.accountId, required this.platform, required final List<SnAuthChallenge> challenges, this.isCurrent = false}): _challenges = challenges;
|
const _SnAuthDeviceWithSessione({required this.id, required this.deviceId, required this.deviceName, required this.deviceLabel, required this.accountId, required this.platform, required final List<SnAuthSession> sessions, this.isCurrent = false}): _sessions = sessions;
|
||||||
factory _SnAuthDeviceWithChallengee.fromJson(Map<String, dynamic> json) => _$SnAuthDeviceWithChallengeeFromJson(json);
|
factory _SnAuthDeviceWithSessione.fromJson(Map<String, dynamic> json) => _$SnAuthDeviceWithSessioneFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@override final String deviceId;
|
@override final String deviceId;
|
||||||
@@ -3280,49 +3283,49 @@ class _SnAuthDeviceWithChallengee implements SnAuthDeviceWithChallenge {
|
|||||||
@override final String? deviceLabel;
|
@override final String? deviceLabel;
|
||||||
@override final String accountId;
|
@override final String accountId;
|
||||||
@override final int platform;
|
@override final int platform;
|
||||||
final List<SnAuthChallenge> _challenges;
|
final List<SnAuthSession> _sessions;
|
||||||
@override List<SnAuthChallenge> get challenges {
|
@override List<SnAuthSession> get sessions {
|
||||||
if (_challenges is EqualUnmodifiableListView) return _challenges;
|
if (_sessions is EqualUnmodifiableListView) return _sessions;
|
||||||
// ignore: implicit_dynamic_type
|
// ignore: implicit_dynamic_type
|
||||||
return EqualUnmodifiableListView(_challenges);
|
return EqualUnmodifiableListView(_sessions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override@JsonKey() final bool isCurrent;
|
@override@JsonKey() final bool isCurrent;
|
||||||
|
|
||||||
/// Create a copy of SnAuthDeviceWithChallenge
|
/// Create a copy of SnAuthDeviceWithSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
_$SnAuthDeviceWithChallengeeCopyWith<_SnAuthDeviceWithChallengee> get copyWith => __$SnAuthDeviceWithChallengeeCopyWithImpl<_SnAuthDeviceWithChallengee>(this, _$identity);
|
_$SnAuthDeviceWithSessioneCopyWith<_SnAuthDeviceWithSessione> get copyWith => __$SnAuthDeviceWithSessioneCopyWithImpl<_SnAuthDeviceWithSessione>(this, _$identity);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return _$SnAuthDeviceWithChallengeeToJson(this, );
|
return _$SnAuthDeviceWithSessioneToJson(this, );
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthDeviceWithChallengee&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceId, deviceId) || other.deviceId == deviceId)&&(identical(other.deviceName, deviceName) || other.deviceName == deviceName)&&(identical(other.deviceLabel, deviceLabel) || other.deviceLabel == deviceLabel)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.platform, platform) || other.platform == platform)&&const DeepCollectionEquality().equals(other._challenges, _challenges)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthDeviceWithSessione&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceId, deviceId) || other.deviceId == deviceId)&&(identical(other.deviceName, deviceName) || other.deviceName == deviceName)&&(identical(other.deviceLabel, deviceLabel) || other.deviceLabel == deviceLabel)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.platform, platform) || other.platform == platform)&&const DeepCollectionEquality().equals(other._sessions, _sessions)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,deviceId,deviceName,deviceLabel,accountId,platform,const DeepCollectionEquality().hash(_challenges),isCurrent);
|
int get hashCode => Object.hash(runtimeType,id,deviceId,deviceName,deviceLabel,accountId,platform,const DeepCollectionEquality().hash(_sessions),isCurrent);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthDeviceWithChallenge(id: $id, deviceId: $deviceId, deviceName: $deviceName, deviceLabel: $deviceLabel, accountId: $accountId, platform: $platform, challenges: $challenges, isCurrent: $isCurrent)';
|
return 'SnAuthDeviceWithSession(id: $id, deviceId: $deviceId, deviceName: $deviceName, deviceLabel: $deviceLabel, accountId: $accountId, platform: $platform, sessions: $sessions, isCurrent: $isCurrent)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract mixin class _$SnAuthDeviceWithChallengeeCopyWith<$Res> implements $SnAuthDeviceWithChallengeCopyWith<$Res> {
|
abstract mixin class _$SnAuthDeviceWithSessioneCopyWith<$Res> implements $SnAuthDeviceWithSessionCopyWith<$Res> {
|
||||||
factory _$SnAuthDeviceWithChallengeeCopyWith(_SnAuthDeviceWithChallengee value, $Res Function(_SnAuthDeviceWithChallengee) _then) = __$SnAuthDeviceWithChallengeeCopyWithImpl;
|
factory _$SnAuthDeviceWithSessioneCopyWith(_SnAuthDeviceWithSessione value, $Res Function(_SnAuthDeviceWithSessione) _then) = __$SnAuthDeviceWithSessioneCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthChallenge> challenges, bool isCurrent
|
String id, String deviceId, String deviceName, String? deviceLabel, String accountId, int platform, List<SnAuthSession> sessions, bool isCurrent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -3330,25 +3333,25 @@ $Res call({
|
|||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class __$SnAuthDeviceWithChallengeeCopyWithImpl<$Res>
|
class __$SnAuthDeviceWithSessioneCopyWithImpl<$Res>
|
||||||
implements _$SnAuthDeviceWithChallengeeCopyWith<$Res> {
|
implements _$SnAuthDeviceWithSessioneCopyWith<$Res> {
|
||||||
__$SnAuthDeviceWithChallengeeCopyWithImpl(this._self, this._then);
|
__$SnAuthDeviceWithSessioneCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
final _SnAuthDeviceWithChallengee _self;
|
final _SnAuthDeviceWithSessione _self;
|
||||||
final $Res Function(_SnAuthDeviceWithChallengee) _then;
|
final $Res Function(_SnAuthDeviceWithSessione) _then;
|
||||||
|
|
||||||
/// Create a copy of SnAuthDeviceWithChallenge
|
/// Create a copy of SnAuthDeviceWithSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceId = null,Object? deviceName = null,Object? deviceLabel = freezed,Object? accountId = null,Object? platform = null,Object? challenges = null,Object? isCurrent = null,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceId = null,Object? deviceName = null,Object? deviceLabel = freezed,Object? accountId = null,Object? platform = null,Object? sessions = null,Object? isCurrent = null,}) {
|
||||||
return _then(_SnAuthDeviceWithChallengee(
|
return _then(_SnAuthDeviceWithSessione(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,deviceId: null == deviceId ? _self.deviceId : deviceId // ignore: cast_nullable_to_non_nullable
|
as String,deviceId: null == deviceId ? _self.deviceId : deviceId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,deviceName: null == deviceName ? _self.deviceName : deviceName // ignore: cast_nullable_to_non_nullable
|
as String,deviceName: null == deviceName ? _self.deviceName : deviceName // ignore: cast_nullable_to_non_nullable
|
||||||
as String,deviceLabel: freezed == deviceLabel ? _self.deviceLabel : deviceLabel // ignore: cast_nullable_to_non_nullable
|
as String,deviceLabel: freezed == deviceLabel ? _self.deviceLabel : deviceLabel // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,platform: null == platform ? _self.platform : platform // ignore: cast_nullable_to_non_nullable
|
as String,platform: null == platform ? _self.platform : platform // ignore: cast_nullable_to_non_nullable
|
||||||
as int,challenges: null == challenges ? _self._challenges : challenges // ignore: cast_nullable_to_non_nullable
|
as int,sessions: null == sessions ? _self._sessions : sessions // ignore: cast_nullable_to_non_nullable
|
||||||
as List<SnAuthChallenge>,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable
|
as List<SnAuthSession>,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,
|
as bool,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ _SnAccount _$SnAccountFromJson(Map<String, dynamic> json) => _SnAccount(
|
|||||||
?.map((e) => SnContactMethod.fromJson(e as Map<String, dynamic>))
|
?.map((e) => SnContactMethod.fromJson(e as Map<String, dynamic>))
|
||||||
.toList() ??
|
.toList() ??
|
||||||
const [],
|
const [],
|
||||||
|
activatedAt:
|
||||||
|
json['activated_at'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json['activated_at'] as String),
|
||||||
createdAt: DateTime.parse(json['created_at'] as String),
|
createdAt: DateTime.parse(json['created_at'] as String),
|
||||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||||
deletedAt:
|
deletedAt:
|
||||||
@@ -52,6 +56,7 @@ Map<String, dynamic> _$SnAccountToJson(_SnAccount instance) =>
|
|||||||
'perk_subscription': instance.perkSubscription?.toJson(),
|
'perk_subscription': instance.perkSubscription?.toJson(),
|
||||||
'badges': instance.badges.map((e) => e.toJson()).toList(),
|
'badges': instance.badges.map((e) => e.toJson()).toList(),
|
||||||
'contacts': instance.contacts.map((e) => e.toJson()).toList(),
|
'contacts': instance.contacts.map((e) => e.toJson()).toList(),
|
||||||
|
'activated_at': instance.activatedAt?.toIso8601String(),
|
||||||
'created_at': instance.createdAt.toIso8601String(),
|
'created_at': instance.createdAt.toIso8601String(),
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
'updated_at': instance.updatedAt.toIso8601String(),
|
||||||
'deleted_at': instance.deletedAt?.toIso8601String(),
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
||||||
@@ -362,24 +367,24 @@ Map<String, dynamic> _$SnAuthDeviceToJson(_SnAuthDevice instance) =>
|
|||||||
'is_current': instance.isCurrent,
|
'is_current': instance.isCurrent,
|
||||||
};
|
};
|
||||||
|
|
||||||
_SnAuthDeviceWithChallengee _$SnAuthDeviceWithChallengeeFromJson(
|
_SnAuthDeviceWithSessione _$SnAuthDeviceWithSessioneFromJson(
|
||||||
Map<String, dynamic> json,
|
Map<String, dynamic> json,
|
||||||
) => _SnAuthDeviceWithChallengee(
|
) => _SnAuthDeviceWithSessione(
|
||||||
id: json['id'] as String,
|
id: json['id'] as String,
|
||||||
deviceId: json['device_id'] as String,
|
deviceId: json['device_id'] as String,
|
||||||
deviceName: json['device_name'] as String,
|
deviceName: json['device_name'] as String,
|
||||||
deviceLabel: json['device_label'] as String?,
|
deviceLabel: json['device_label'] as String?,
|
||||||
accountId: json['account_id'] as String,
|
accountId: json['account_id'] as String,
|
||||||
platform: (json['platform'] as num).toInt(),
|
platform: (json['platform'] as num).toInt(),
|
||||||
challenges:
|
sessions:
|
||||||
(json['challenges'] as List<dynamic>)
|
(json['sessions'] as List<dynamic>)
|
||||||
.map((e) => SnAuthChallenge.fromJson(e as Map<String, dynamic>))
|
.map((e) => SnAuthSession.fromJson(e as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList(),
|
||||||
isCurrent: json['is_current'] as bool? ?? false,
|
isCurrent: json['is_current'] as bool? ?? false,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$SnAuthDeviceWithChallengeeToJson(
|
Map<String, dynamic> _$SnAuthDeviceWithSessioneToJson(
|
||||||
_SnAuthDeviceWithChallengee instance,
|
_SnAuthDeviceWithSessione instance,
|
||||||
) => <String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'id': instance.id,
|
||||||
'device_id': instance.deviceId,
|
'device_id': instance.deviceId,
|
||||||
@@ -387,7 +392,7 @@ Map<String, dynamic> _$SnAuthDeviceWithChallengeeToJson(
|
|||||||
'device_label': instance.deviceLabel,
|
'device_label': instance.deviceLabel,
|
||||||
'account_id': instance.accountId,
|
'account_id': instance.accountId,
|
||||||
'platform': instance.platform,
|
'platform': instance.platform,
|
||||||
'challenges': instance.challenges.map((e) => e.toJson()).toList(),
|
'sessions': instance.sessions.map((e) => e.toJson()).toList(),
|
||||||
'is_current': instance.isCurrent,
|
'is_current': instance.isCurrent,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ sealed class SnAuthChallenge with _$SnAuthChallenge {
|
|||||||
required int stepRemain,
|
required int stepRemain,
|
||||||
required int stepTotal,
|
required int stepTotal,
|
||||||
required int failedAttempts,
|
required int failedAttempts,
|
||||||
required int type,
|
|
||||||
required List<String> blacklistFactors,
|
required List<String> blacklistFactors,
|
||||||
required List<dynamic> audiences,
|
required List<dynamic> audiences,
|
||||||
required List<dynamic> scopes,
|
required List<dynamic> scopes,
|
||||||
@@ -58,9 +57,13 @@ sealed class SnAuthSession with _$SnAuthSession {
|
|||||||
required String? label,
|
required String? label,
|
||||||
required DateTime lastGrantedAt,
|
required DateTime lastGrantedAt,
|
||||||
required DateTime? expiredAt,
|
required DateTime? expiredAt,
|
||||||
|
required List<dynamic> audiences,
|
||||||
|
required List<dynamic> scopes,
|
||||||
|
required String? ipAddress,
|
||||||
|
required String? userAgent,
|
||||||
|
required GeoIpLocation? location,
|
||||||
|
required int type,
|
||||||
required String accountId,
|
required String accountId,
|
||||||
required String challengeId,
|
|
||||||
required SnAuthChallenge challenge,
|
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
required DateTime? deletedAt,
|
required DateTime? deletedAt,
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ as String?,
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnAuthChallenge {
|
mixin _$SnAuthChallenge {
|
||||||
|
|
||||||
String get id; DateTime? get expiredAt; int get stepRemain; int get stepTotal; int get failedAttempts; int get type; List<String> get blacklistFactors; List<dynamic> get audiences; List<dynamic> get scopes; String get ipAddress; String get userAgent; String? get nonce; GeoIpLocation? get location; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
String get id; DateTime? get expiredAt; int get stepRemain; int get stepTotal; int get failedAttempts; List<String> get blacklistFactors; List<dynamic> get audiences; List<dynamic> get scopes; String get ipAddress; String get userAgent; String? get nonce; GeoIpLocation? get location; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
||||||
/// Create a copy of SnAuthChallenge
|
/// Create a copy of SnAuthChallenge
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -554,16 +554,16 @@ $SnAuthChallengeCopyWith<SnAuthChallenge> get copyWith => _$SnAuthChallengeCopyW
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthChallenge&&(identical(other.id, id) || other.id == id)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.stepRemain, stepRemain) || other.stepRemain == stepRemain)&&(identical(other.stepTotal, stepTotal) || other.stepTotal == stepTotal)&&(identical(other.failedAttempts, failedAttempts) || other.failedAttempts == failedAttempts)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.blacklistFactors, blacklistFactors)&&const DeepCollectionEquality().equals(other.audiences, audiences)&&const DeepCollectionEquality().equals(other.scopes, scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.nonce, nonce) || other.nonce == nonce)&&(identical(other.location, location) || other.location == location)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthChallenge&&(identical(other.id, id) || other.id == id)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.stepRemain, stepRemain) || other.stepRemain == stepRemain)&&(identical(other.stepTotal, stepTotal) || other.stepTotal == stepTotal)&&(identical(other.failedAttempts, failedAttempts) || other.failedAttempts == failedAttempts)&&const DeepCollectionEquality().equals(other.blacklistFactors, blacklistFactors)&&const DeepCollectionEquality().equals(other.audiences, audiences)&&const DeepCollectionEquality().equals(other.scopes, scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.nonce, nonce) || other.nonce == nonce)&&(identical(other.location, location) || other.location == location)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,expiredAt,stepRemain,stepTotal,failedAttempts,type,const DeepCollectionEquality().hash(blacklistFactors),const DeepCollectionEquality().hash(audiences),const DeepCollectionEquality().hash(scopes),ipAddress,userAgent,nonce,location,accountId,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,expiredAt,stepRemain,stepTotal,failedAttempts,const DeepCollectionEquality().hash(blacklistFactors),const DeepCollectionEquality().hash(audiences),const DeepCollectionEquality().hash(scopes),ipAddress,userAgent,nonce,location,accountId,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthChallenge(id: $id, expiredAt: $expiredAt, stepRemain: $stepRemain, stepTotal: $stepTotal, failedAttempts: $failedAttempts, type: $type, blacklistFactors: $blacklistFactors, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, nonce: $nonce, location: $location, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAuthChallenge(id: $id, expiredAt: $expiredAt, stepRemain: $stepRemain, stepTotal: $stepTotal, failedAttempts: $failedAttempts, blacklistFactors: $blacklistFactors, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, nonce: $nonce, location: $location, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -574,7 +574,7 @@ abstract mixin class $SnAuthChallengeCopyWith<$Res> {
|
|||||||
factory $SnAuthChallengeCopyWith(SnAuthChallenge value, $Res Function(SnAuthChallenge) _then) = _$SnAuthChallengeCopyWithImpl;
|
factory $SnAuthChallengeCopyWith(SnAuthChallenge value, $Res Function(SnAuthChallenge) _then) = _$SnAuthChallengeCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, int type, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -591,14 +591,13 @@ class _$SnAuthChallengeCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAuthChallenge
|
/// Create a copy of SnAuthChallenge
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? expiredAt = freezed,Object? stepRemain = null,Object? stepTotal = null,Object? failedAttempts = null,Object? type = null,Object? blacklistFactors = null,Object? audiences = null,Object? scopes = null,Object? ipAddress = null,Object? userAgent = null,Object? nonce = freezed,Object? location = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? expiredAt = freezed,Object? stepRemain = null,Object? stepTotal = null,Object? failedAttempts = null,Object? blacklistFactors = null,Object? audiences = null,Object? scopes = null,Object? ipAddress = null,Object? userAgent = null,Object? nonce = freezed,Object? location = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
as String,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,stepRemain: null == stepRemain ? _self.stepRemain : stepRemain // ignore: cast_nullable_to_non_nullable
|
as DateTime?,stepRemain: null == stepRemain ? _self.stepRemain : stepRemain // ignore: cast_nullable_to_non_nullable
|
||||||
as int,stepTotal: null == stepTotal ? _self.stepTotal : stepTotal // ignore: cast_nullable_to_non_nullable
|
as int,stepTotal: null == stepTotal ? _self.stepTotal : stepTotal // ignore: cast_nullable_to_non_nullable
|
||||||
as int,failedAttempts: null == failedAttempts ? _self.failedAttempts : failedAttempts // ignore: cast_nullable_to_non_nullable
|
as int,failedAttempts: null == failedAttempts ? _self.failedAttempts : failedAttempts // ignore: cast_nullable_to_non_nullable
|
||||||
as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,blacklistFactors: null == blacklistFactors ? _self.blacklistFactors : blacklistFactors // ignore: cast_nullable_to_non_nullable
|
as int,blacklistFactors: null == blacklistFactors ? _self.blacklistFactors : blacklistFactors // ignore: cast_nullable_to_non_nullable
|
||||||
as List<String>,audiences: null == audiences ? _self.audiences : audiences // ignore: cast_nullable_to_non_nullable
|
as List<String>,audiences: null == audiences ? _self.audiences : audiences // ignore: cast_nullable_to_non_nullable
|
||||||
as List<dynamic>,scopes: null == scopes ? _self.scopes : scopes // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,scopes: null == scopes ? _self.scopes : scopes // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -704,10 +703,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, int type, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthChallenge() when $default != null:
|
case _SnAuthChallenge() when $default != null:
|
||||||
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -725,10 +724,10 @@ return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, int type, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthChallenge():
|
case _SnAuthChallenge():
|
||||||
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -742,10 +741,10 @@ return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, int type, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthChallenge() when $default != null:
|
case _SnAuthChallenge() when $default != null:
|
||||||
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -757,7 +756,7 @@ return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnAuthChallenge implements SnAuthChallenge {
|
class _SnAuthChallenge implements SnAuthChallenge {
|
||||||
const _SnAuthChallenge({required this.id, required this.expiredAt, required this.stepRemain, required this.stepTotal, required this.failedAttempts, required this.type, required final List<String> blacklistFactors, required final List<dynamic> audiences, required final List<dynamic> scopes, required this.ipAddress, required this.userAgent, required this.nonce, required this.location, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}): _blacklistFactors = blacklistFactors,_audiences = audiences,_scopes = scopes;
|
const _SnAuthChallenge({required this.id, required this.expiredAt, required this.stepRemain, required this.stepTotal, required this.failedAttempts, required final List<String> blacklistFactors, required final List<dynamic> audiences, required final List<dynamic> scopes, required this.ipAddress, required this.userAgent, required this.nonce, required this.location, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}): _blacklistFactors = blacklistFactors,_audiences = audiences,_scopes = scopes;
|
||||||
factory _SnAuthChallenge.fromJson(Map<String, dynamic> json) => _$SnAuthChallengeFromJson(json);
|
factory _SnAuthChallenge.fromJson(Map<String, dynamic> json) => _$SnAuthChallengeFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@@ -765,7 +764,6 @@ class _SnAuthChallenge implements SnAuthChallenge {
|
|||||||
@override final int stepRemain;
|
@override final int stepRemain;
|
||||||
@override final int stepTotal;
|
@override final int stepTotal;
|
||||||
@override final int failedAttempts;
|
@override final int failedAttempts;
|
||||||
@override final int type;
|
|
||||||
final List<String> _blacklistFactors;
|
final List<String> _blacklistFactors;
|
||||||
@override List<String> get blacklistFactors {
|
@override List<String> get blacklistFactors {
|
||||||
if (_blacklistFactors is EqualUnmodifiableListView) return _blacklistFactors;
|
if (_blacklistFactors is EqualUnmodifiableListView) return _blacklistFactors;
|
||||||
@@ -809,16 +807,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthChallenge&&(identical(other.id, id) || other.id == id)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.stepRemain, stepRemain) || other.stepRemain == stepRemain)&&(identical(other.stepTotal, stepTotal) || other.stepTotal == stepTotal)&&(identical(other.failedAttempts, failedAttempts) || other.failedAttempts == failedAttempts)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._blacklistFactors, _blacklistFactors)&&const DeepCollectionEquality().equals(other._audiences, _audiences)&&const DeepCollectionEquality().equals(other._scopes, _scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.nonce, nonce) || other.nonce == nonce)&&(identical(other.location, location) || other.location == location)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthChallenge&&(identical(other.id, id) || other.id == id)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.stepRemain, stepRemain) || other.stepRemain == stepRemain)&&(identical(other.stepTotal, stepTotal) || other.stepTotal == stepTotal)&&(identical(other.failedAttempts, failedAttempts) || other.failedAttempts == failedAttempts)&&const DeepCollectionEquality().equals(other._blacklistFactors, _blacklistFactors)&&const DeepCollectionEquality().equals(other._audiences, _audiences)&&const DeepCollectionEquality().equals(other._scopes, _scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.nonce, nonce) || other.nonce == nonce)&&(identical(other.location, location) || other.location == location)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,expiredAt,stepRemain,stepTotal,failedAttempts,type,const DeepCollectionEquality().hash(_blacklistFactors),const DeepCollectionEquality().hash(_audiences),const DeepCollectionEquality().hash(_scopes),ipAddress,userAgent,nonce,location,accountId,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,expiredAt,stepRemain,stepTotal,failedAttempts,const DeepCollectionEquality().hash(_blacklistFactors),const DeepCollectionEquality().hash(_audiences),const DeepCollectionEquality().hash(_scopes),ipAddress,userAgent,nonce,location,accountId,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthChallenge(id: $id, expiredAt: $expiredAt, stepRemain: $stepRemain, stepTotal: $stepTotal, failedAttempts: $failedAttempts, type: $type, blacklistFactors: $blacklistFactors, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, nonce: $nonce, location: $location, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAuthChallenge(id: $id, expiredAt: $expiredAt, stepRemain: $stepRemain, stepTotal: $stepTotal, failedAttempts: $failedAttempts, blacklistFactors: $blacklistFactors, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, nonce: $nonce, location: $location, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -829,7 +827,7 @@ abstract mixin class _$SnAuthChallengeCopyWith<$Res> implements $SnAuthChallenge
|
|||||||
factory _$SnAuthChallengeCopyWith(_SnAuthChallenge value, $Res Function(_SnAuthChallenge) _then) = __$SnAuthChallengeCopyWithImpl;
|
factory _$SnAuthChallengeCopyWith(_SnAuthChallenge value, $Res Function(_SnAuthChallenge) _then) = __$SnAuthChallengeCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, int type, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, DateTime? expiredAt, int stepRemain, int stepTotal, int failedAttempts, List<String> blacklistFactors, List<dynamic> audiences, List<dynamic> scopes, String ipAddress, String userAgent, String? nonce, GeoIpLocation? location, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -846,14 +844,13 @@ class __$SnAuthChallengeCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAuthChallenge
|
/// Create a copy of SnAuthChallenge
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? expiredAt = freezed,Object? stepRemain = null,Object? stepTotal = null,Object? failedAttempts = null,Object? type = null,Object? blacklistFactors = null,Object? audiences = null,Object? scopes = null,Object? ipAddress = null,Object? userAgent = null,Object? nonce = freezed,Object? location = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? expiredAt = freezed,Object? stepRemain = null,Object? stepTotal = null,Object? failedAttempts = null,Object? blacklistFactors = null,Object? audiences = null,Object? scopes = null,Object? ipAddress = null,Object? userAgent = null,Object? nonce = freezed,Object? location = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_SnAuthChallenge(
|
return _then(_SnAuthChallenge(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
as String,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,stepRemain: null == stepRemain ? _self.stepRemain : stepRemain // ignore: cast_nullable_to_non_nullable
|
as DateTime?,stepRemain: null == stepRemain ? _self.stepRemain : stepRemain // ignore: cast_nullable_to_non_nullable
|
||||||
as int,stepTotal: null == stepTotal ? _self.stepTotal : stepTotal // ignore: cast_nullable_to_non_nullable
|
as int,stepTotal: null == stepTotal ? _self.stepTotal : stepTotal // ignore: cast_nullable_to_non_nullable
|
||||||
as int,failedAttempts: null == failedAttempts ? _self.failedAttempts : failedAttempts // ignore: cast_nullable_to_non_nullable
|
as int,failedAttempts: null == failedAttempts ? _self.failedAttempts : failedAttempts // ignore: cast_nullable_to_non_nullable
|
||||||
as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,blacklistFactors: null == blacklistFactors ? _self._blacklistFactors : blacklistFactors // ignore: cast_nullable_to_non_nullable
|
as int,blacklistFactors: null == blacklistFactors ? _self._blacklistFactors : blacklistFactors // ignore: cast_nullable_to_non_nullable
|
||||||
as List<String>,audiences: null == audiences ? _self._audiences : audiences // ignore: cast_nullable_to_non_nullable
|
as List<String>,audiences: null == audiences ? _self._audiences : audiences // ignore: cast_nullable_to_non_nullable
|
||||||
as List<dynamic>,scopes: null == scopes ? _self._scopes : scopes // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,scopes: null == scopes ? _self._scopes : scopes // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -888,7 +885,7 @@ $GeoIpLocationCopyWith<$Res>? get location {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnAuthSession {
|
mixin _$SnAuthSession {
|
||||||
|
|
||||||
String get id; String? get label; DateTime get lastGrantedAt; DateTime? get expiredAt; String get accountId; String get challengeId; SnAuthChallenge get challenge; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
String get id; String? get label; DateTime get lastGrantedAt; DateTime? get expiredAt; List<dynamic> get audiences; List<dynamic> get scopes; String? get ipAddress; String? get userAgent; GeoIpLocation? get location; int get type; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
|
||||||
/// Create a copy of SnAuthSession
|
/// Create a copy of SnAuthSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -901,16 +898,16 @@ $SnAuthSessionCopyWith<SnAuthSession> get copyWith => _$SnAuthSessionCopyWithImp
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthSession&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.lastGrantedAt, lastGrantedAt) || other.lastGrantedAt == lastGrantedAt)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.challengeId, challengeId) || other.challengeId == challengeId)&&(identical(other.challenge, challenge) || other.challenge == challenge)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAuthSession&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.lastGrantedAt, lastGrantedAt) || other.lastGrantedAt == lastGrantedAt)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&const DeepCollectionEquality().equals(other.audiences, audiences)&&const DeepCollectionEquality().equals(other.scopes, scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.location, location) || other.location == location)&&(identical(other.type, type) || other.type == type)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,label,lastGrantedAt,expiredAt,accountId,challengeId,challenge,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,label,lastGrantedAt,expiredAt,const DeepCollectionEquality().hash(audiences),const DeepCollectionEquality().hash(scopes),ipAddress,userAgent,location,type,accountId,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthSession(id: $id, label: $label, lastGrantedAt: $lastGrantedAt, expiredAt: $expiredAt, accountId: $accountId, challengeId: $challengeId, challenge: $challenge, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAuthSession(id: $id, label: $label, lastGrantedAt: $lastGrantedAt, expiredAt: $expiredAt, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, location: $location, type: $type, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -921,11 +918,11 @@ abstract mixin class $SnAuthSessionCopyWith<$Res> {
|
|||||||
factory $SnAuthSessionCopyWith(SnAuthSession value, $Res Function(SnAuthSession) _then) = _$SnAuthSessionCopyWithImpl;
|
factory $SnAuthSessionCopyWith(SnAuthSession value, $Res Function(SnAuthSession) _then) = _$SnAuthSessionCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, String accountId, String challengeId, SnAuthChallenge challenge, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, List<dynamic> audiences, List<dynamic> scopes, String? ipAddress, String? userAgent, GeoIpLocation? location, int type, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$SnAuthChallengeCopyWith<$Res> get challenge;
|
$GeoIpLocationCopyWith<$Res>? get location;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -938,16 +935,20 @@ class _$SnAuthSessionCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAuthSession
|
/// Create a copy of SnAuthSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? label = freezed,Object? lastGrantedAt = null,Object? expiredAt = freezed,Object? accountId = null,Object? challengeId = null,Object? challenge = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? label = freezed,Object? lastGrantedAt = null,Object? expiredAt = freezed,Object? audiences = null,Object? scopes = null,Object? ipAddress = freezed,Object? userAgent = freezed,Object? location = freezed,Object? type = null,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
as String,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,lastGrantedAt: null == lastGrantedAt ? _self.lastGrantedAt : lastGrantedAt // ignore: cast_nullable_to_non_nullable
|
as String?,lastGrantedAt: null == lastGrantedAt ? _self.lastGrantedAt : lastGrantedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as DateTime?,audiences: null == audiences ? _self.audiences : audiences // ignore: cast_nullable_to_non_nullable
|
||||||
as String,challengeId: null == challengeId ? _self.challengeId : challengeId // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,scopes: null == scopes ? _self.scopes : scopes // ignore: cast_nullable_to_non_nullable
|
||||||
as String,challenge: null == challenge ? _self.challenge : challenge // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable
|
||||||
as SnAuthChallenge,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as String?,userAgent: freezed == userAgent ? _self.userAgent : userAgent // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
|
||||||
|
as GeoIpLocation?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
@@ -957,10 +958,13 @@ as DateTime?,
|
|||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override
|
@override
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
$SnAuthChallengeCopyWith<$Res> get challenge {
|
$GeoIpLocationCopyWith<$Res>? get location {
|
||||||
|
if (_self.location == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $SnAuthChallengeCopyWith<$Res>(_self.challenge, (value) {
|
return $GeoIpLocationCopyWith<$Res>(_self.location!, (value) {
|
||||||
return _then(_self.copyWith(challenge: value));
|
return _then(_self.copyWith(location: value));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1041,10 +1045,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, String accountId, String challengeId, SnAuthChallenge challenge, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, List<dynamic> audiences, List<dynamic> scopes, String? ipAddress, String? userAgent, GeoIpLocation? location, int type, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthSession() when $default != null:
|
case _SnAuthSession() when $default != null:
|
||||||
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.location,_that.type,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1062,10 +1066,10 @@ return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.a
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, String accountId, String challengeId, SnAuthChallenge challenge, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, List<dynamic> audiences, List<dynamic> scopes, String? ipAddress, String? userAgent, GeoIpLocation? location, int type, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthSession():
|
case _SnAuthSession():
|
||||||
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.location,_that.type,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -1079,10 +1083,10 @@ return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.a
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, String accountId, String challengeId, SnAuthChallenge challenge, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, List<dynamic> audiences, List<dynamic> scopes, String? ipAddress, String? userAgent, GeoIpLocation? location, int type, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnAuthSession() when $default != null:
|
case _SnAuthSession() when $default != null:
|
||||||
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.location,_that.type,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1094,16 +1098,32 @@ return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.a
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnAuthSession implements SnAuthSession {
|
class _SnAuthSession implements SnAuthSession {
|
||||||
const _SnAuthSession({required this.id, required this.label, required this.lastGrantedAt, required this.expiredAt, required this.accountId, required this.challengeId, required this.challenge, required this.createdAt, required this.updatedAt, required this.deletedAt});
|
const _SnAuthSession({required this.id, required this.label, required this.lastGrantedAt, required this.expiredAt, required final List<dynamic> audiences, required final List<dynamic> scopes, required this.ipAddress, required this.userAgent, required this.location, required this.type, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}): _audiences = audiences,_scopes = scopes;
|
||||||
factory _SnAuthSession.fromJson(Map<String, dynamic> json) => _$SnAuthSessionFromJson(json);
|
factory _SnAuthSession.fromJson(Map<String, dynamic> json) => _$SnAuthSessionFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@override final String? label;
|
@override final String? label;
|
||||||
@override final DateTime lastGrantedAt;
|
@override final DateTime lastGrantedAt;
|
||||||
@override final DateTime? expiredAt;
|
@override final DateTime? expiredAt;
|
||||||
|
final List<dynamic> _audiences;
|
||||||
|
@override List<dynamic> get audiences {
|
||||||
|
if (_audiences is EqualUnmodifiableListView) return _audiences;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_audiences);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<dynamic> _scopes;
|
||||||
|
@override List<dynamic> get scopes {
|
||||||
|
if (_scopes is EqualUnmodifiableListView) return _scopes;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_scopes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override final String? ipAddress;
|
||||||
|
@override final String? userAgent;
|
||||||
|
@override final GeoIpLocation? location;
|
||||||
|
@override final int type;
|
||||||
@override final String accountId;
|
@override final String accountId;
|
||||||
@override final String challengeId;
|
|
||||||
@override final SnAuthChallenge challenge;
|
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@override final DateTime updatedAt;
|
@override final DateTime updatedAt;
|
||||||
@override final DateTime? deletedAt;
|
@override final DateTime? deletedAt;
|
||||||
@@ -1121,16 +1141,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthSession&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.lastGrantedAt, lastGrantedAt) || other.lastGrantedAt == lastGrantedAt)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.challengeId, challengeId) || other.challengeId == challengeId)&&(identical(other.challenge, challenge) || other.challenge == challenge)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAuthSession&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.lastGrantedAt, lastGrantedAt) || other.lastGrantedAt == lastGrantedAt)&&(identical(other.expiredAt, expiredAt) || other.expiredAt == expiredAt)&&const DeepCollectionEquality().equals(other._audiences, _audiences)&&const DeepCollectionEquality().equals(other._scopes, _scopes)&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)&&(identical(other.location, location) || other.location == location)&&(identical(other.type, type) || other.type == type)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,label,lastGrantedAt,expiredAt,accountId,challengeId,challenge,createdAt,updatedAt,deletedAt);
|
int get hashCode => Object.hash(runtimeType,id,label,lastGrantedAt,expiredAt,const DeepCollectionEquality().hash(_audiences),const DeepCollectionEquality().hash(_scopes),ipAddress,userAgent,location,type,accountId,createdAt,updatedAt,deletedAt);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnAuthSession(id: $id, label: $label, lastGrantedAt: $lastGrantedAt, expiredAt: $expiredAt, accountId: $accountId, challengeId: $challengeId, challenge: $challenge, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
return 'SnAuthSession(id: $id, label: $label, lastGrantedAt: $lastGrantedAt, expiredAt: $expiredAt, audiences: $audiences, scopes: $scopes, ipAddress: $ipAddress, userAgent: $userAgent, location: $location, type: $type, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1141,11 +1161,11 @@ abstract mixin class _$SnAuthSessionCopyWith<$Res> implements $SnAuthSessionCopy
|
|||||||
factory _$SnAuthSessionCopyWith(_SnAuthSession value, $Res Function(_SnAuthSession) _then) = __$SnAuthSessionCopyWithImpl;
|
factory _$SnAuthSessionCopyWith(_SnAuthSession value, $Res Function(_SnAuthSession) _then) = __$SnAuthSessionCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, String accountId, String challengeId, SnAuthChallenge challenge, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
String id, String? label, DateTime lastGrantedAt, DateTime? expiredAt, List<dynamic> audiences, List<dynamic> scopes, String? ipAddress, String? userAgent, GeoIpLocation? location, int type, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@override $SnAuthChallengeCopyWith<$Res> get challenge;
|
@override $GeoIpLocationCopyWith<$Res>? get location;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -1158,16 +1178,20 @@ class __$SnAuthSessionCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnAuthSession
|
/// Create a copy of SnAuthSession
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? label = freezed,Object? lastGrantedAt = null,Object? expiredAt = freezed,Object? accountId = null,Object? challengeId = null,Object? challenge = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? label = freezed,Object? lastGrantedAt = null,Object? expiredAt = freezed,Object? audiences = null,Object? scopes = null,Object? ipAddress = freezed,Object? userAgent = freezed,Object? location = freezed,Object? type = null,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) {
|
||||||
return _then(_SnAuthSession(
|
return _then(_SnAuthSession(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
as String,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,lastGrantedAt: null == lastGrantedAt ? _self.lastGrantedAt : lastGrantedAt // ignore: cast_nullable_to_non_nullable
|
as String?,lastGrantedAt: null == lastGrantedAt ? _self.lastGrantedAt : lastGrantedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as DateTime?,audiences: null == audiences ? _self._audiences : audiences // ignore: cast_nullable_to_non_nullable
|
||||||
as String,challengeId: null == challengeId ? _self.challengeId : challengeId // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,scopes: null == scopes ? _self._scopes : scopes // ignore: cast_nullable_to_non_nullable
|
||||||
as String,challenge: null == challenge ? _self.challenge : challenge // ignore: cast_nullable_to_non_nullable
|
as List<dynamic>,ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable
|
||||||
as SnAuthChallenge,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as String?,userAgent: freezed == userAgent ? _self.userAgent : userAgent // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,location: freezed == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
|
||||||
|
as GeoIpLocation?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||||
|
as int,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
@@ -1178,10 +1202,13 @@ as DateTime?,
|
|||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override
|
@override
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
$SnAuthChallengeCopyWith<$Res> get challenge {
|
$GeoIpLocationCopyWith<$Res>? get location {
|
||||||
|
if (_self.location == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return $SnAuthChallengeCopyWith<$Res>(_self.challenge, (value) {
|
return $GeoIpLocationCopyWith<$Res>(_self.location!, (value) {
|
||||||
return _then(_self.copyWith(challenge: value));
|
return _then(_self.copyWith(location: value));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ _SnAuthChallenge _$SnAuthChallengeFromJson(Map<String, dynamic> json) =>
|
|||||||
stepRemain: (json['step_remain'] as num).toInt(),
|
stepRemain: (json['step_remain'] as num).toInt(),
|
||||||
stepTotal: (json['step_total'] as num).toInt(),
|
stepTotal: (json['step_total'] as num).toInt(),
|
||||||
failedAttempts: (json['failed_attempts'] as num).toInt(),
|
failedAttempts: (json['failed_attempts'] as num).toInt(),
|
||||||
type: (json['type'] as num).toInt(),
|
|
||||||
blacklistFactors:
|
blacklistFactors:
|
||||||
(json['blacklist_factors'] as List<dynamic>)
|
(json['blacklist_factors'] as List<dynamic>)
|
||||||
.map((e) => e as String)
|
.map((e) => e as String)
|
||||||
@@ -73,7 +72,6 @@ Map<String, dynamic> _$SnAuthChallengeToJson(_SnAuthChallenge instance) =>
|
|||||||
'step_remain': instance.stepRemain,
|
'step_remain': instance.stepRemain,
|
||||||
'step_total': instance.stepTotal,
|
'step_total': instance.stepTotal,
|
||||||
'failed_attempts': instance.failedAttempts,
|
'failed_attempts': instance.failedAttempts,
|
||||||
'type': instance.type,
|
|
||||||
'blacklist_factors': instance.blacklistFactors,
|
'blacklist_factors': instance.blacklistFactors,
|
||||||
'audiences': instance.audiences,
|
'audiences': instance.audiences,
|
||||||
'scopes': instance.scopes,
|
'scopes': instance.scopes,
|
||||||
@@ -96,11 +94,18 @@ _SnAuthSession _$SnAuthSessionFromJson(Map<String, dynamic> json) =>
|
|||||||
json['expired_at'] == null
|
json['expired_at'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json['expired_at'] as String),
|
: DateTime.parse(json['expired_at'] as String),
|
||||||
|
audiences: json['audiences'] as List<dynamic>,
|
||||||
|
scopes: json['scopes'] as List<dynamic>,
|
||||||
|
ipAddress: json['ip_address'] as String?,
|
||||||
|
userAgent: json['user_agent'] as String?,
|
||||||
|
location:
|
||||||
|
json['location'] == null
|
||||||
|
? null
|
||||||
|
: GeoIpLocation.fromJson(
|
||||||
|
json['location'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
|
type: (json['type'] as num).toInt(),
|
||||||
accountId: json['account_id'] as String,
|
accountId: json['account_id'] as String,
|
||||||
challengeId: json['challenge_id'] as String,
|
|
||||||
challenge: SnAuthChallenge.fromJson(
|
|
||||||
json['challenge'] as Map<String, dynamic>,
|
|
||||||
),
|
|
||||||
createdAt: DateTime.parse(json['created_at'] as String),
|
createdAt: DateTime.parse(json['created_at'] as String),
|
||||||
updatedAt: DateTime.parse(json['updated_at'] as String),
|
updatedAt: DateTime.parse(json['updated_at'] as String),
|
||||||
deletedAt:
|
deletedAt:
|
||||||
@@ -115,9 +120,13 @@ Map<String, dynamic> _$SnAuthSessionToJson(_SnAuthSession instance) =>
|
|||||||
'label': instance.label,
|
'label': instance.label,
|
||||||
'last_granted_at': instance.lastGrantedAt.toIso8601String(),
|
'last_granted_at': instance.lastGrantedAt.toIso8601String(),
|
||||||
'expired_at': instance.expiredAt?.toIso8601String(),
|
'expired_at': instance.expiredAt?.toIso8601String(),
|
||||||
|
'audiences': instance.audiences,
|
||||||
|
'scopes': instance.scopes,
|
||||||
|
'ip_address': instance.ipAddress,
|
||||||
|
'user_agent': instance.userAgent,
|
||||||
|
'location': instance.location?.toJson(),
|
||||||
|
'type': instance.type,
|
||||||
'account_id': instance.accountId,
|
'account_id': instance.accountId,
|
||||||
'challenge_id': instance.challengeId,
|
|
||||||
'challenge': instance.challenge.toJson(),
|
|
||||||
'created_at': instance.createdAt.toIso8601String(),
|
'created_at': instance.createdAt.toIso8601String(),
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
'updated_at': instance.updatedAt.toIso8601String(),
|
||||||
'deleted_at': instance.deletedAt?.toIso8601String(),
|
'deleted_at': instance.deletedAt?.toIso8601String(),
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ sealed class SnChatRoom with _$SnChatRoom {
|
|||||||
required SnCloudFile? picture,
|
required SnCloudFile? picture,
|
||||||
required SnCloudFile? background,
|
required SnCloudFile? background,
|
||||||
required String? realmId,
|
required String? realmId,
|
||||||
|
required String? accountId,
|
||||||
required SnRealm? realm,
|
required SnRealm? realm,
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
@@ -85,12 +86,10 @@ sealed class SnChatMember with _$SnChatMember {
|
|||||||
required String accountId,
|
required String accountId,
|
||||||
required SnAccount account,
|
required SnAccount account,
|
||||||
required String? nick,
|
required String? nick,
|
||||||
required int role,
|
|
||||||
required int notify,
|
required int notify,
|
||||||
required DateTime? joinedAt,
|
required DateTime? joinedAt,
|
||||||
required DateTime? breakUntil,
|
required DateTime? breakUntil,
|
||||||
required DateTime? timeoutUntil,
|
required DateTime? timeoutUntil,
|
||||||
required bool isBot,
|
|
||||||
required SnAccountStatus? status,
|
required SnAccountStatus? status,
|
||||||
// Frontend data
|
// Frontend data
|
||||||
DateTime? lastTyped,
|
DateTime? lastTyped,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnChatRoom {
|
mixin _$SnChatRoom {
|
||||||
|
|
||||||
String get id; String? get name; String? get description; int get type; bool get isPublic; bool get isCommunity; SnCloudFile? get picture; SnCloudFile? get background; String? get realmId; SnRealm? get realm; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List<SnChatMember>? get members;
|
String get id; String? get name; String? get description; int get type; bool get isPublic; bool get isCommunity; SnCloudFile? get picture; SnCloudFile? get background; String? get realmId; String? get accountId; SnRealm? get realm; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List<SnChatMember>? get members;
|
||||||
/// Create a copy of SnChatRoom
|
/// Create a copy of SnChatRoom
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -28,16 +28,16 @@ $SnChatRoomCopyWith<SnChatRoom> get copyWith => _$SnChatRoomCopyWithImpl<SnChatR
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatRoom&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&(identical(other.isPublic, isPublic) || other.isPublic == isPublic)&&(identical(other.isCommunity, isCommunity) || other.isCommunity == isCommunity)&&(identical(other.picture, picture) || other.picture == picture)&&(identical(other.background, background) || other.background == background)&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other.members, members));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatRoom&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&(identical(other.isPublic, isPublic) || other.isPublic == isPublic)&&(identical(other.isCommunity, isCommunity) || other.isCommunity == isCommunity)&&(identical(other.picture, picture) || other.picture == picture)&&(identical(other.background, background) || other.background == background)&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other.members, members));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,description,type,isPublic,isCommunity,picture,background,realmId,realm,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(members));
|
int get hashCode => Object.hash(runtimeType,id,name,description,type,isPublic,isCommunity,picture,background,realmId,accountId,realm,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(members));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatRoom(id: $id, name: $name, description: $description, type: $type, isPublic: $isPublic, isCommunity: $isCommunity, picture: $picture, background: $background, realmId: $realmId, realm: $realm, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, members: $members)';
|
return 'SnChatRoom(id: $id, name: $name, description: $description, type: $type, isPublic: $isPublic, isCommunity: $isCommunity, picture: $picture, background: $background, realmId: $realmId, accountId: $accountId, realm: $realm, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, members: $members)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ abstract mixin class $SnChatRoomCopyWith<$Res> {
|
|||||||
factory $SnChatRoomCopyWith(SnChatRoom value, $Res Function(SnChatRoom) _then) = _$SnChatRoomCopyWithImpl;
|
factory $SnChatRoomCopyWith(SnChatRoom value, $Res Function(SnChatRoom) _then) = _$SnChatRoomCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members
|
String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, String? accountId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class _$SnChatRoomCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatRoom
|
/// Create a copy of SnChatRoom
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = freezed,Object? description = freezed,Object? type = null,Object? isPublic = null,Object? isCommunity = null,Object? picture = freezed,Object? background = freezed,Object? realmId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = freezed,Object? description = freezed,Object? type = null,Object? isPublic = null,Object? isCommunity = null,Object? picture = freezed,Object? background = freezed,Object? realmId = freezed,Object? accountId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -76,6 +76,7 @@ as bool,isCommunity: null == isCommunity ? _self.isCommunity : isCommunity // ig
|
|||||||
as bool,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable
|
as bool,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable
|
||||||
as SnCloudFile?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable
|
as SnCloudFile?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable
|
||||||
as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,accountId: freezed == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
||||||
as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -199,10 +200,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, String? accountId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatRoom() when $default != null:
|
case _SnChatRoom() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);case _:
|
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.accountId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -220,10 +221,10 @@ return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, String? accountId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatRoom():
|
case _SnChatRoom():
|
||||||
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);}
|
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.accountId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -237,10 +238,10 @@ return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, String? accountId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatRoom() when $default != null:
|
case _SnChatRoom() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);case _:
|
return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,_that.isCommunity,_that.picture,_that.background,_that.realmId,_that.accountId,_that.realm,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.members);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -252,7 +253,7 @@ return $default(_that.id,_that.name,_that.description,_that.type,_that.isPublic,
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnChatRoom implements SnChatRoom {
|
class _SnChatRoom implements SnChatRoom {
|
||||||
const _SnChatRoom({required this.id, required this.name, required this.description, required this.type, this.isPublic = false, this.isCommunity = false, required this.picture, required this.background, required this.realmId, required this.realm, required this.createdAt, required this.updatedAt, required this.deletedAt, required final List<SnChatMember>? members}): _members = members;
|
const _SnChatRoom({required this.id, required this.name, required this.description, required this.type, this.isPublic = false, this.isCommunity = false, required this.picture, required this.background, required this.realmId, required this.accountId, required this.realm, required this.createdAt, required this.updatedAt, required this.deletedAt, required final List<SnChatMember>? members}): _members = members;
|
||||||
factory _SnChatRoom.fromJson(Map<String, dynamic> json) => _$SnChatRoomFromJson(json);
|
factory _SnChatRoom.fromJson(Map<String, dynamic> json) => _$SnChatRoomFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@@ -264,6 +265,7 @@ class _SnChatRoom implements SnChatRoom {
|
|||||||
@override final SnCloudFile? picture;
|
@override final SnCloudFile? picture;
|
||||||
@override final SnCloudFile? background;
|
@override final SnCloudFile? background;
|
||||||
@override final String? realmId;
|
@override final String? realmId;
|
||||||
|
@override final String? accountId;
|
||||||
@override final SnRealm? realm;
|
@override final SnRealm? realm;
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@override final DateTime updatedAt;
|
@override final DateTime updatedAt;
|
||||||
@@ -291,16 +293,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatRoom&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&(identical(other.isPublic, isPublic) || other.isPublic == isPublic)&&(identical(other.isCommunity, isCommunity) || other.isCommunity == isCommunity)&&(identical(other.picture, picture) || other.picture == picture)&&(identical(other.background, background) || other.background == background)&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other._members, _members));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatRoom&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.type, type) || other.type == type)&&(identical(other.isPublic, isPublic) || other.isPublic == isPublic)&&(identical(other.isCommunity, isCommunity) || other.isCommunity == isCommunity)&&(identical(other.picture, picture) || other.picture == picture)&&(identical(other.background, background) || other.background == background)&&(identical(other.realmId, realmId) || other.realmId == realmId)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.realm, realm) || other.realm == realm)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other._members, _members));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,description,type,isPublic,isCommunity,picture,background,realmId,realm,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(_members));
|
int get hashCode => Object.hash(runtimeType,id,name,description,type,isPublic,isCommunity,picture,background,realmId,accountId,realm,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(_members));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatRoom(id: $id, name: $name, description: $description, type: $type, isPublic: $isPublic, isCommunity: $isCommunity, picture: $picture, background: $background, realmId: $realmId, realm: $realm, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, members: $members)';
|
return 'SnChatRoom(id: $id, name: $name, description: $description, type: $type, isPublic: $isPublic, isCommunity: $isCommunity, picture: $picture, background: $background, realmId: $realmId, accountId: $accountId, realm: $realm, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, members: $members)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -311,7 +313,7 @@ abstract mixin class _$SnChatRoomCopyWith<$Res> implements $SnChatRoomCopyWith<$
|
|||||||
factory _$SnChatRoomCopyWith(_SnChatRoom value, $Res Function(_SnChatRoom) _then) = __$SnChatRoomCopyWithImpl;
|
factory _$SnChatRoomCopyWith(_SnChatRoom value, $Res Function(_SnChatRoom) _then) = __$SnChatRoomCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members
|
String id, String? name, String? description, int type, bool isPublic, bool isCommunity, SnCloudFile? picture, SnCloudFile? background, String? realmId, String? accountId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnChatMember>? members
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -328,7 +330,7 @@ class __$SnChatRoomCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatRoom
|
/// Create a copy of SnChatRoom
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = freezed,Object? description = freezed,Object? type = null,Object? isPublic = null,Object? isCommunity = null,Object? picture = freezed,Object? background = freezed,Object? realmId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = freezed,Object? description = freezed,Object? type = null,Object? isPublic = null,Object? isCommunity = null,Object? picture = freezed,Object? background = freezed,Object? realmId = freezed,Object? accountId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) {
|
||||||
return _then(_SnChatRoom(
|
return _then(_SnChatRoom(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -339,6 +341,7 @@ as bool,isCommunity: null == isCommunity ? _self.isCommunity : isCommunity // ig
|
|||||||
as bool,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable
|
as bool,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable
|
||||||
as SnCloudFile?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable
|
as SnCloudFile?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable
|
||||||
as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,accountId: freezed == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable
|
||||||
as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1037,7 +1040,7 @@ $SnChatMemberCopyWith<$Res> get sender {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnChatMember {
|
mixin _$SnChatMember {
|
||||||
|
|
||||||
DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String get chatRoomId; SnChatRoom? get chatRoom; String get accountId; SnAccount get account; String? get nick; int get role; int get notify; DateTime? get joinedAt; DateTime? get breakUntil; DateTime? get timeoutUntil; bool get isBot; SnAccountStatus? get status;// Frontend data
|
DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String get chatRoomId; SnChatRoom? get chatRoom; String get accountId; SnAccount get account; String? get nick; int get notify; DateTime? get joinedAt; DateTime? get breakUntil; DateTime? get timeoutUntil; SnAccountStatus? get status;// Frontend data
|
||||||
DateTime? get lastTyped;
|
DateTime? get lastTyped;
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@@ -1051,16 +1054,16 @@ $SnChatMemberCopyWith<SnChatMember> get copyWith => _$SnChatMemberCopyWithImpl<S
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,status,lastTyped);
|
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,notify,joinedAt,breakUntil,timeoutUntil,status,lastTyped);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, status: $status, lastTyped: $lastTyped)';
|
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, status: $status, lastTyped: $lastTyped)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1071,7 +1074,7 @@ abstract mixin class $SnChatMemberCopyWith<$Res> {
|
|||||||
factory $SnChatMemberCopyWith(SnChatMember value, $Res Function(SnChatMember) _then) = _$SnChatMemberCopyWithImpl;
|
factory $SnChatMemberCopyWith(SnChatMember value, $Res Function(SnChatMember) _then) = _$SnChatMemberCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped
|
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, SnAccountStatus? status, DateTime? lastTyped
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1088,7 +1091,7 @@ class _$SnChatMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? status = freezed,Object? lastTyped = freezed,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? status = freezed,Object? lastTyped = freezed,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1099,13 +1102,11 @@ as String,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: c
|
|||||||
as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
|
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
|
||||||
as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable
|
as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
as String?,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable
|
||||||
as int,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
|
as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
as DateTime?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
));
|
));
|
||||||
@@ -1222,10 +1223,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, SnAccountStatus? status, DateTime? lastTyped)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember() when $default != null:
|
case _SnChatMember() when $default != null:
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);case _:
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.status,_that.lastTyped);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1243,10 +1244,10 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, SnAccountStatus? status, DateTime? lastTyped) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember():
|
case _SnChatMember():
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);}
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.status,_that.lastTyped);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -1260,10 +1261,10 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, SnAccountStatus? status, DateTime? lastTyped)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnChatMember() when $default != null:
|
case _SnChatMember() when $default != null:
|
||||||
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.role,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.isBot,_that.status,_that.lastTyped);case _:
|
return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.chatRoomId,_that.chatRoom,_that.accountId,_that.account,_that.nick,_that.notify,_that.joinedAt,_that.breakUntil,_that.timeoutUntil,_that.status,_that.lastTyped);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1275,7 +1276,7 @@ return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.id,_that.c
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnChatMember implements SnChatMember {
|
class _SnChatMember implements SnChatMember {
|
||||||
const _SnChatMember({required this.createdAt, required this.updatedAt, required this.deletedAt, required this.id, required this.chatRoomId, required this.chatRoom, required this.accountId, required this.account, required this.nick, required this.role, required this.notify, required this.joinedAt, required this.breakUntil, required this.timeoutUntil, required this.isBot, required this.status, this.lastTyped});
|
const _SnChatMember({required this.createdAt, required this.updatedAt, required this.deletedAt, required this.id, required this.chatRoomId, required this.chatRoom, required this.accountId, required this.account, required this.nick, required this.notify, required this.joinedAt, required this.breakUntil, required this.timeoutUntil, required this.status, this.lastTyped});
|
||||||
factory _SnChatMember.fromJson(Map<String, dynamic> json) => _$SnChatMemberFromJson(json);
|
factory _SnChatMember.fromJson(Map<String, dynamic> json) => _$SnChatMemberFromJson(json);
|
||||||
|
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@@ -1287,12 +1288,10 @@ class _SnChatMember implements SnChatMember {
|
|||||||
@override final String accountId;
|
@override final String accountId;
|
||||||
@override final SnAccount account;
|
@override final SnAccount account;
|
||||||
@override final String? nick;
|
@override final String? nick;
|
||||||
@override final int role;
|
|
||||||
@override final int notify;
|
@override final int notify;
|
||||||
@override final DateTime? joinedAt;
|
@override final DateTime? joinedAt;
|
||||||
@override final DateTime? breakUntil;
|
@override final DateTime? breakUntil;
|
||||||
@override final DateTime? timeoutUntil;
|
@override final DateTime? timeoutUntil;
|
||||||
@override final bool isBot;
|
|
||||||
@override final SnAccountStatus? status;
|
@override final SnAccountStatus? status;
|
||||||
// Frontend data
|
// Frontend data
|
||||||
@override final DateTime? lastTyped;
|
@override final DateTime? lastTyped;
|
||||||
@@ -1310,16 +1309,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.role, role) || other.role == role)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.isBot, isBot) || other.isBot == isBot)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnChatMember&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&(identical(other.id, id) || other.id == id)&&(identical(other.chatRoomId, chatRoomId) || other.chatRoomId == chatRoomId)&&(identical(other.chatRoom, chatRoom) || other.chatRoom == chatRoom)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.nick, nick) || other.nick == nick)&&(identical(other.notify, notify) || other.notify == notify)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt)&&(identical(other.breakUntil, breakUntil) || other.breakUntil == breakUntil)&&(identical(other.timeoutUntil, timeoutUntil) || other.timeoutUntil == timeoutUntil)&&(identical(other.status, status) || other.status == status)&&(identical(other.lastTyped, lastTyped) || other.lastTyped == lastTyped));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,role,notify,joinedAt,breakUntil,timeoutUntil,isBot,status,lastTyped);
|
int get hashCode => Object.hash(runtimeType,createdAt,updatedAt,deletedAt,id,chatRoomId,chatRoom,accountId,account,nick,notify,joinedAt,breakUntil,timeoutUntil,status,lastTyped);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, role: $role, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, isBot: $isBot, status: $status, lastTyped: $lastTyped)';
|
return 'SnChatMember(createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, id: $id, chatRoomId: $chatRoomId, chatRoom: $chatRoom, accountId: $accountId, account: $account, nick: $nick, notify: $notify, joinedAt: $joinedAt, breakUntil: $breakUntil, timeoutUntil: $timeoutUntil, status: $status, lastTyped: $lastTyped)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1330,7 +1329,7 @@ abstract mixin class _$SnChatMemberCopyWith<$Res> implements $SnChatMemberCopyWi
|
|||||||
factory _$SnChatMemberCopyWith(_SnChatMember value, $Res Function(_SnChatMember) _then) = __$SnChatMemberCopyWithImpl;
|
factory _$SnChatMemberCopyWith(_SnChatMember value, $Res Function(_SnChatMember) _then) = __$SnChatMemberCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, bool isBot, SnAccountStatus? status, DateTime? lastTyped
|
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int notify, DateTime? joinedAt, DateTime? breakUntil, DateTime? timeoutUntil, SnAccountStatus? status, DateTime? lastTyped
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1347,7 +1346,7 @@ class __$SnChatMemberCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnChatMember
|
/// Create a copy of SnChatMember
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? role = null,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? isBot = null,Object? status = freezed,Object? lastTyped = freezed,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? id = null,Object? chatRoomId = null,Object? chatRoom = freezed,Object? accountId = null,Object? account = null,Object? nick = freezed,Object? notify = null,Object? joinedAt = freezed,Object? breakUntil = freezed,Object? timeoutUntil = freezed,Object? status = freezed,Object? lastTyped = freezed,}) {
|
||||||
return _then(_SnChatMember(
|
return _then(_SnChatMember(
|
||||||
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -1358,13 +1357,11 @@ as String,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: c
|
|||||||
as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
|
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
|
||||||
as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable
|
as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable
|
||||||
as String?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
as String?,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable
|
||||||
as int,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable
|
|
||||||
as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
|
as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,breakUntil: freezed == breakUntil ? _self.breakUntil : breakUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
as DateTime?,timeoutUntil: freezed == timeoutUntil ? _self.timeoutUntil : timeoutUntil // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,isBot: null == isBot ? _self.isBot : isBot // ignore: cast_nullable_to_non_nullable
|
as DateTime?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||||||
as bool,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
|
||||||
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
as SnAccountStatus?,lastTyped: freezed == lastTyped ? _self.lastTyped : lastTyped // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime?,
|
as DateTime?,
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ _SnChatRoom _$SnChatRoomFromJson(Map<String, dynamic> json) => _SnChatRoom(
|
|||||||
? null
|
? null
|
||||||
: SnCloudFile.fromJson(json['background'] as Map<String, dynamic>),
|
: SnCloudFile.fromJson(json['background'] as Map<String, dynamic>),
|
||||||
realmId: json['realm_id'] as String?,
|
realmId: json['realm_id'] as String?,
|
||||||
|
accountId: json['account_id'] as String?,
|
||||||
realm:
|
realm:
|
||||||
json['realm'] == null
|
json['realm'] == null
|
||||||
? null
|
? null
|
||||||
@@ -49,6 +50,7 @@ Map<String, dynamic> _$SnChatRoomToJson(_SnChatRoom instance) =>
|
|||||||
'picture': instance.picture?.toJson(),
|
'picture': instance.picture?.toJson(),
|
||||||
'background': instance.background?.toJson(),
|
'background': instance.background?.toJson(),
|
||||||
'realm_id': instance.realmId,
|
'realm_id': instance.realmId,
|
||||||
|
'account_id': instance.accountId,
|
||||||
'realm': instance.realm?.toJson(),
|
'realm': instance.realm?.toJson(),
|
||||||
'created_at': instance.createdAt.toIso8601String(),
|
'created_at': instance.createdAt.toIso8601String(),
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
'updated_at': instance.updatedAt.toIso8601String(),
|
||||||
@@ -162,7 +164,6 @@ _SnChatMember _$SnChatMemberFromJson(Map<String, dynamic> json) =>
|
|||||||
accountId: json['account_id'] as String,
|
accountId: json['account_id'] as String,
|
||||||
account: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
|
account: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
|
||||||
nick: json['nick'] as String?,
|
nick: json['nick'] as String?,
|
||||||
role: (json['role'] as num).toInt(),
|
|
||||||
notify: (json['notify'] as num).toInt(),
|
notify: (json['notify'] as num).toInt(),
|
||||||
joinedAt:
|
joinedAt:
|
||||||
json['joined_at'] == null
|
json['joined_at'] == null
|
||||||
@@ -176,7 +177,6 @@ _SnChatMember _$SnChatMemberFromJson(Map<String, dynamic> json) =>
|
|||||||
json['timeout_until'] == null
|
json['timeout_until'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json['timeout_until'] as String),
|
: DateTime.parse(json['timeout_until'] as String),
|
||||||
isBot: json['is_bot'] as bool,
|
|
||||||
status:
|
status:
|
||||||
json['status'] == null
|
json['status'] == null
|
||||||
? null
|
? null
|
||||||
@@ -200,12 +200,10 @@ Map<String, dynamic> _$SnChatMemberToJson(_SnChatMember instance) =>
|
|||||||
'account_id': instance.accountId,
|
'account_id': instance.accountId,
|
||||||
'account': instance.account.toJson(),
|
'account': instance.account.toJson(),
|
||||||
'nick': instance.nick,
|
'nick': instance.nick,
|
||||||
'role': instance.role,
|
|
||||||
'notify': instance.notify,
|
'notify': instance.notify,
|
||||||
'joined_at': instance.joinedAt?.toIso8601String(),
|
'joined_at': instance.joinedAt?.toIso8601String(),
|
||||||
'break_until': instance.breakUntil?.toIso8601String(),
|
'break_until': instance.breakUntil?.toIso8601String(),
|
||||||
'timeout_until': instance.timeoutUntil?.toIso8601String(),
|
'timeout_until': instance.timeoutUntil?.toIso8601String(),
|
||||||
'is_bot': instance.isBot,
|
|
||||||
'status': instance.status?.toJson(),
|
'status': instance.status?.toJson(),
|
||||||
'last_typed': instance.lastTyped?.toIso8601String(),
|
'last_typed': instance.lastTyped?.toIso8601String(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ sealed class SnStickerPack with _$SnStickerPack {
|
|||||||
required String description,
|
required String description,
|
||||||
required String prefix,
|
required String prefix,
|
||||||
required String publisherId,
|
required String publisherId,
|
||||||
|
required SnCloudFile? icon,
|
||||||
required SnPublisher? publisher,
|
required SnPublisher? publisher,
|
||||||
required DateTime createdAt,
|
required DateTime createdAt,
|
||||||
required DateTime updatedAt,
|
required DateTime updatedAt,
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ $SnStickerPackCopyWith<$Res>? get pack {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$SnStickerPack {
|
mixin _$SnStickerPack {
|
||||||
|
|
||||||
String get id; String get name; String get description; String get prefix; String get publisherId; SnPublisher? get publisher; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List<SnSticker> get stickers;
|
String get id; String get name; String get description; String get prefix; String get publisherId; SnCloudFile? get icon; SnPublisher? get publisher; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List<SnSticker> get stickers;
|
||||||
/// Create a copy of SnStickerPack
|
/// Create a copy of SnStickerPack
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@@ -348,16 +348,16 @@ $SnStickerPackCopyWith<SnStickerPack> get copyWith => _$SnStickerPackCopyWithImp
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnStickerPack&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.prefix, prefix) || other.prefix == prefix)&&(identical(other.publisherId, publisherId) || other.publisherId == publisherId)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other.stickers, stickers));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is SnStickerPack&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.prefix, prefix) || other.prefix == prefix)&&(identical(other.publisherId, publisherId) || other.publisherId == publisherId)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other.stickers, stickers));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,description,prefix,publisherId,publisher,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(stickers));
|
int get hashCode => Object.hash(runtimeType,id,name,description,prefix,publisherId,icon,publisher,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(stickers));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnStickerPack(id: $id, name: $name, description: $description, prefix: $prefix, publisherId: $publisherId, publisher: $publisher, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, stickers: $stickers)';
|
return 'SnStickerPack(id: $id, name: $name, description: $description, prefix: $prefix, publisherId: $publisherId, icon: $icon, publisher: $publisher, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, stickers: $stickers)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -368,11 +368,11 @@ abstract mixin class $SnStickerPackCopyWith<$Res> {
|
|||||||
factory $SnStickerPackCopyWith(SnStickerPack value, $Res Function(SnStickerPack) _then) = _$SnStickerPackCopyWithImpl;
|
factory $SnStickerPackCopyWith(SnStickerPack value, $Res Function(SnStickerPack) _then) = _$SnStickerPackCopyWithImpl;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String name, String description, String prefix, String publisherId, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers
|
String id, String name, String description, String prefix, String publisherId, SnCloudFile? icon, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$SnPublisherCopyWith<$Res>? get publisher;
|
$SnCloudFileCopyWith<$Res>? get icon;$SnPublisherCopyWith<$Res>? get publisher;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -385,14 +385,15 @@ class _$SnStickerPackCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnStickerPack
|
/// Create a copy of SnStickerPack
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? description = null,Object? prefix = null,Object? publisherId = null,Object? publisher = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? stickers = null,}) {
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? description = null,Object? prefix = null,Object? publisherId = null,Object? icon = freezed,Object? publisher = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? stickers = null,}) {
|
||||||
return _then(_self.copyWith(
|
return _then(_self.copyWith(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
as String,prefix: null == prefix ? _self.prefix : prefix // ignore: cast_nullable_to_non_nullable
|
as String,prefix: null == prefix ? _self.prefix : prefix // ignore: cast_nullable_to_non_nullable
|
||||||
as String,publisherId: null == publisherId ? _self.publisherId : publisherId // ignore: cast_nullable_to_non_nullable
|
as String,publisherId: null == publisherId ? _self.publisherId : publisherId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,publisher: freezed == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable
|
as String,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnCloudFile?,publisher: freezed == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable
|
||||||
as SnPublisher?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as SnPublisher?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -404,6 +405,18 @@ as List<SnSticker>,
|
|||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override
|
@override
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnCloudFileCopyWith<$Res>? get icon {
|
||||||
|
if (_self.icon == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnCloudFileCopyWith<$Res>(_self.icon!, (value) {
|
||||||
|
return _then(_self.copyWith(icon: value));
|
||||||
|
});
|
||||||
|
}/// Create a copy of SnStickerPack
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
$SnPublisherCopyWith<$Res>? get publisher {
|
$SnPublisherCopyWith<$Res>? get publisher {
|
||||||
if (_self.publisher == null) {
|
if (_self.publisher == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -491,10 +504,10 @@ return $default(_that);case _:
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name, String description, String prefix, String publisherId, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers)? $default,{required TResult orElse(),}) {final _that = this;
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name, String description, String prefix, String publisherId, SnCloudFile? icon, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnStickerPack() when $default != null:
|
case _SnStickerPack() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);case _:
|
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.icon,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);case _:
|
||||||
return orElse();
|
return orElse();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -512,10 +525,10 @@ return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publish
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name, String description, String prefix, String publisherId, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers) $default,) {final _that = this;
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name, String description, String prefix, String publisherId, SnCloudFile? icon, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers) $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnStickerPack():
|
case _SnStickerPack():
|
||||||
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);}
|
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.icon,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);}
|
||||||
}
|
}
|
||||||
/// A variant of `when` that fallback to returning `null`
|
/// A variant of `when` that fallback to returning `null`
|
||||||
///
|
///
|
||||||
@@ -529,10 +542,10 @@ return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publish
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name, String description, String prefix, String publisherId, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers)? $default,) {final _that = this;
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name, String description, String prefix, String publisherId, SnCloudFile? icon, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers)? $default,) {final _that = this;
|
||||||
switch (_that) {
|
switch (_that) {
|
||||||
case _SnStickerPack() when $default != null:
|
case _SnStickerPack() when $default != null:
|
||||||
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);case _:
|
return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.icon,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.stickers);case _:
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -544,7 +557,7 @@ return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publish
|
|||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
|
|
||||||
class _SnStickerPack implements SnStickerPack {
|
class _SnStickerPack implements SnStickerPack {
|
||||||
const _SnStickerPack({required this.id, required this.name, required this.description, required this.prefix, required this.publisherId, required this.publisher, required this.createdAt, required this.updatedAt, required this.deletedAt, final List<SnSticker> stickers = const []}): _stickers = stickers;
|
const _SnStickerPack({required this.id, required this.name, required this.description, required this.prefix, required this.publisherId, required this.icon, required this.publisher, required this.createdAt, required this.updatedAt, required this.deletedAt, final List<SnSticker> stickers = const []}): _stickers = stickers;
|
||||||
factory _SnStickerPack.fromJson(Map<String, dynamic> json) => _$SnStickerPackFromJson(json);
|
factory _SnStickerPack.fromJson(Map<String, dynamic> json) => _$SnStickerPackFromJson(json);
|
||||||
|
|
||||||
@override final String id;
|
@override final String id;
|
||||||
@@ -552,6 +565,7 @@ class _SnStickerPack implements SnStickerPack {
|
|||||||
@override final String description;
|
@override final String description;
|
||||||
@override final String prefix;
|
@override final String prefix;
|
||||||
@override final String publisherId;
|
@override final String publisherId;
|
||||||
|
@override final SnCloudFile? icon;
|
||||||
@override final SnPublisher? publisher;
|
@override final SnPublisher? publisher;
|
||||||
@override final DateTime createdAt;
|
@override final DateTime createdAt;
|
||||||
@override final DateTime updatedAt;
|
@override final DateTime updatedAt;
|
||||||
@@ -577,16 +591,16 @@ Map<String, dynamic> toJson() {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnStickerPack&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.prefix, prefix) || other.prefix == prefix)&&(identical(other.publisherId, publisherId) || other.publisherId == publisherId)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other._stickers, _stickers));
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnStickerPack&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.prefix, prefix) || other.prefix == prefix)&&(identical(other.publisherId, publisherId) || other.publisherId == publisherId)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)&&const DeepCollectionEquality().equals(other._stickers, _stickers));
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(runtimeType,id,name,description,prefix,publisherId,publisher,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(_stickers));
|
int get hashCode => Object.hash(runtimeType,id,name,description,prefix,publisherId,icon,publisher,createdAt,updatedAt,deletedAt,const DeepCollectionEquality().hash(_stickers));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return 'SnStickerPack(id: $id, name: $name, description: $description, prefix: $prefix, publisherId: $publisherId, publisher: $publisher, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, stickers: $stickers)';
|
return 'SnStickerPack(id: $id, name: $name, description: $description, prefix: $prefix, publisherId: $publisherId, icon: $icon, publisher: $publisher, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, stickers: $stickers)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -597,11 +611,11 @@ abstract mixin class _$SnStickerPackCopyWith<$Res> implements $SnStickerPackCopy
|
|||||||
factory _$SnStickerPackCopyWith(_SnStickerPack value, $Res Function(_SnStickerPack) _then) = __$SnStickerPackCopyWithImpl;
|
factory _$SnStickerPackCopyWith(_SnStickerPack value, $Res Function(_SnStickerPack) _then) = __$SnStickerPackCopyWithImpl;
|
||||||
@override @useResult
|
@override @useResult
|
||||||
$Res call({
|
$Res call({
|
||||||
String id, String name, String description, String prefix, String publisherId, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers
|
String id, String name, String description, String prefix, String publisherId, SnCloudFile? icon, SnPublisher? publisher, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List<SnSticker> stickers
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@override $SnPublisherCopyWith<$Res>? get publisher;
|
@override $SnCloudFileCopyWith<$Res>? get icon;@override $SnPublisherCopyWith<$Res>? get publisher;
|
||||||
|
|
||||||
}
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -614,14 +628,15 @@ class __$SnStickerPackCopyWithImpl<$Res>
|
|||||||
|
|
||||||
/// Create a copy of SnStickerPack
|
/// Create a copy of SnStickerPack
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? description = null,Object? prefix = null,Object? publisherId = null,Object? publisher = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? stickers = null,}) {
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? description = null,Object? prefix = null,Object? publisherId = null,Object? icon = freezed,Object? publisher = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? stickers = null,}) {
|
||||||
return _then(_SnStickerPack(
|
return _then(_SnStickerPack(
|
||||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||||
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||||
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
as String,prefix: null == prefix ? _self.prefix : prefix // ignore: cast_nullable_to_non_nullable
|
as String,prefix: null == prefix ? _self.prefix : prefix // ignore: cast_nullable_to_non_nullable
|
||||||
as String,publisherId: null == publisherId ? _self.publisherId : publisherId // ignore: cast_nullable_to_non_nullable
|
as String,publisherId: null == publisherId ? _self.publisherId : publisherId // ignore: cast_nullable_to_non_nullable
|
||||||
as String,publisher: freezed == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable
|
as String,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable
|
||||||
|
as SnCloudFile?,publisher: freezed == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable
|
||||||
as SnPublisher?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
as SnPublisher?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||||
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable
|
||||||
@@ -634,6 +649,18 @@ as List<SnSticker>,
|
|||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@override
|
@override
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline')
|
||||||
|
$SnCloudFileCopyWith<$Res>? get icon {
|
||||||
|
if (_self.icon == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $SnCloudFileCopyWith<$Res>(_self.icon!, (value) {
|
||||||
|
return _then(_self.copyWith(icon: value));
|
||||||
|
});
|
||||||
|
}/// Create a copy of SnStickerPack
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
$SnPublisherCopyWith<$Res>? get publisher {
|
$SnPublisherCopyWith<$Res>? get publisher {
|
||||||
if (_self.publisher == null) {
|
if (_self.publisher == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ _SnStickerPack _$SnStickerPackFromJson(Map<String, dynamic> json) =>
|
|||||||
description: json['description'] as String,
|
description: json['description'] as String,
|
||||||
prefix: json['prefix'] as String,
|
prefix: json['prefix'] as String,
|
||||||
publisherId: json['publisher_id'] as String,
|
publisherId: json['publisher_id'] as String,
|
||||||
|
icon:
|
||||||
|
json['icon'] == null
|
||||||
|
? null
|
||||||
|
: SnCloudFile.fromJson(json['icon'] as Map<String, dynamic>),
|
||||||
publisher:
|
publisher:
|
||||||
json['publisher'] == null
|
json['publisher'] == null
|
||||||
? null
|
? null
|
||||||
@@ -66,6 +70,7 @@ Map<String, dynamic> _$SnStickerPackToJson(_SnStickerPack instance) =>
|
|||||||
'description': instance.description,
|
'description': instance.description,
|
||||||
'prefix': instance.prefix,
|
'prefix': instance.prefix,
|
||||||
'publisher_id': instance.publisherId,
|
'publisher_id': instance.publisherId,
|
||||||
|
'icon': instance.icon?.toJson(),
|
||||||
'publisher': instance.publisher?.toJson(),
|
'publisher': instance.publisher?.toJson(),
|
||||||
'created_at': instance.createdAt.toIso8601String(),
|
'created_at': instance.createdAt.toIso8601String(),
|
||||||
'updated_at': instance.updatedAt.toIso8601String(),
|
'updated_at': instance.updatedAt.toIso8601String(),
|
||||||
|
|||||||
@@ -330,13 +330,127 @@ class ServerState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ServerStateNotifier extends StateNotifier<ServerState> {
|
class ServerStateNotifier extends Notifier<ServerState> {
|
||||||
final ActivityRpcServer server;
|
late final ActivityRpcServer server;
|
||||||
final Dio apiClient;
|
late final Dio apiClient;
|
||||||
Timer? _renewalTimer;
|
Timer? _renewalTimer;
|
||||||
|
|
||||||
ServerStateNotifier(this.apiClient, this.server)
|
@override
|
||||||
: super(ServerState(status: 'Server not started'));
|
ServerState build() {
|
||||||
|
apiClient = ref.watch(apiClientProvider);
|
||||||
|
server = ActivityRpcServer({});
|
||||||
|
_setupHandlers();
|
||||||
|
ref.onDispose(() {
|
||||||
|
_stopRenewal();
|
||||||
|
server.stop();
|
||||||
|
});
|
||||||
|
return ServerState(status: 'Server not started');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _setupHandlers() {
|
||||||
|
server.updateHandlers({
|
||||||
|
'connection': (socket) {
|
||||||
|
final clientId =
|
||||||
|
socket is _WsSocketWrapper
|
||||||
|
? socket.clientId
|
||||||
|
: (socket as IpcSocketWrapper).clientId;
|
||||||
|
updateStatus('Client connected (ID: $clientId)');
|
||||||
|
socket.send({
|
||||||
|
'cmd': 'DISPATCH',
|
||||||
|
'data': {
|
||||||
|
'v': 1,
|
||||||
|
'config': {
|
||||||
|
'cdn_host': 'fake.cdn',
|
||||||
|
'api_endpoint': '//fake.api',
|
||||||
|
'environment': 'dev',
|
||||||
|
},
|
||||||
|
'user': {
|
||||||
|
'id': 'fake_user_id',
|
||||||
|
'username': 'FakeUser',
|
||||||
|
'discriminator': '0001',
|
||||||
|
'avatar': null,
|
||||||
|
'bot': false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'evt': 'READY',
|
||||||
|
'nonce': '12345',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'message': (socket, dynamic data) async {
|
||||||
|
if (data['cmd'] == 'SET_ACTIVITY') {
|
||||||
|
final activity = data['args']['activity'];
|
||||||
|
final appId = 'rpc:${socket.clientId}';
|
||||||
|
|
||||||
|
final currentId = currentActivityManualId;
|
||||||
|
if (currentId != null && currentId != appId) {
|
||||||
|
talker.info(
|
||||||
|
'Skipped the new SET_ACTIVITY command due to there is one existing...',
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
addActivity('Activity: ${activity['details'] ?? 'Untitled'}');
|
||||||
|
// https://discord.com/developers/docs/topics/rpc#setactivity-set-activity-argument-structure
|
||||||
|
final type = switch (activity['type']) {
|
||||||
|
0 => 1, // Discord Playing -> Playing
|
||||||
|
2 => 2, // Discord Music -> Listening
|
||||||
|
3 => 2, // Discord Watching -> Listening
|
||||||
|
_ => 1, // Discord Competing (or null) -> Playing
|
||||||
|
};
|
||||||
|
final title = activity['name'] ?? activity['assets']?['small_text'];
|
||||||
|
final subtitle =
|
||||||
|
activity['details'] ?? activity['assets']?['large_text'];
|
||||||
|
var imageSmall = activity['assets']?['small_image'];
|
||||||
|
var imageLarge = activity['assets']?['large_image'];
|
||||||
|
if (imageSmall != null && !imageSmall!.contains(':')) {
|
||||||
|
imageSmall = 'discord:$imageSmall';
|
||||||
|
}
|
||||||
|
if (imageLarge != null && !imageLarge!.contains(':')) {
|
||||||
|
imageLarge = 'discord:$imageLarge';
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
final activityData = {
|
||||||
|
'type': type,
|
||||||
|
'manual_id': appId,
|
||||||
|
'title': title,
|
||||||
|
'subtitle': subtitle,
|
||||||
|
'caption': activity['state'],
|
||||||
|
'title_url': activity['assets']?['small_text_url'],
|
||||||
|
'subtitle_url': activity['assets']?['large_text_url'],
|
||||||
|
'small_image': imageSmall,
|
||||||
|
'large_image': imageLarge,
|
||||||
|
'meta': activity,
|
||||||
|
'lease_minutes': kPresenceActivityLease,
|
||||||
|
};
|
||||||
|
|
||||||
|
await apiClient.post('/pass/activities', data: activityData);
|
||||||
|
setCurrentActivity(appId, activityData);
|
||||||
|
} catch (e) {
|
||||||
|
talker.log('Failed to set remote activity status: $e');
|
||||||
|
}
|
||||||
|
socket.send({
|
||||||
|
'cmd': 'SET_ACTIVITY',
|
||||||
|
'data': data['args']['activity'],
|
||||||
|
'evt': null,
|
||||||
|
'nonce': data['nonce'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'close': (socket) async {
|
||||||
|
updateStatus('Client disconnected');
|
||||||
|
final currentId = currentActivityManualId;
|
||||||
|
try {
|
||||||
|
await apiClient.delete(
|
||||||
|
'/pass/activities',
|
||||||
|
queryParameters: {'manualId': currentId},
|
||||||
|
);
|
||||||
|
setCurrentActivity(null, null);
|
||||||
|
} catch (e) {
|
||||||
|
talker.log('Failed to unset remote activity status: $e');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
String? get currentActivityManualId => state.currentActivityManualId;
|
String? get currentActivityManualId => state.currentActivityManualId;
|
||||||
|
|
||||||
@@ -408,119 +522,8 @@ class ServerStateNotifier extends StateNotifier<ServerState> {
|
|||||||
const kPresenceActivityLease = 5;
|
const kPresenceActivityLease = 5;
|
||||||
|
|
||||||
// Providers
|
// Providers
|
||||||
final rpcServerStateProvider = StateNotifierProvider<
|
final rpcServerStateProvider =
|
||||||
ServerStateNotifier,
|
NotifierProvider<ServerStateNotifier, ServerState>(ServerStateNotifier.new);
|
||||||
ServerState
|
|
||||||
>((ref) {
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
|
||||||
final server = ActivityRpcServer({});
|
|
||||||
final notifier = ServerStateNotifier(apiClient, server);
|
|
||||||
server.updateHandlers({
|
|
||||||
'connection': (socket) {
|
|
||||||
final clientId =
|
|
||||||
socket is _WsSocketWrapper
|
|
||||||
? socket.clientId
|
|
||||||
: (socket as IpcSocketWrapper).clientId;
|
|
||||||
notifier.updateStatus('Client connected (ID: $clientId)');
|
|
||||||
socket.send({
|
|
||||||
'cmd': 'DISPATCH',
|
|
||||||
'data': {
|
|
||||||
'v': 1,
|
|
||||||
'config': {
|
|
||||||
'cdn_host': 'fake.cdn',
|
|
||||||
'api_endpoint': '//fake.api',
|
|
||||||
'environment': 'dev',
|
|
||||||
},
|
|
||||||
'user': {
|
|
||||||
'id': 'fake_user_id',
|
|
||||||
'username': 'FakeUser',
|
|
||||||
'discriminator': '0001',
|
|
||||||
'avatar': null,
|
|
||||||
'bot': false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'evt': 'READY',
|
|
||||||
'nonce': '12345',
|
|
||||||
});
|
|
||||||
},
|
|
||||||
'message': (socket, dynamic data) async {
|
|
||||||
if (data['cmd'] == 'SET_ACTIVITY') {
|
|
||||||
final activity = data['args']['activity'];
|
|
||||||
final appId = 'rpc:${socket.clientId}';
|
|
||||||
|
|
||||||
final currentId = notifier.currentActivityManualId;
|
|
||||||
if (currentId != null && currentId != appId) {
|
|
||||||
talker.info(
|
|
||||||
'Skipped the new SET_ACTIVITY command due to there is one existing...',
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notifier.addActivity('Activity: ${activity['details'] ?? 'Untitled'}');
|
|
||||||
// https://discord.com/developers/docs/topics/rpc#setactivity-set-activity-argument-structure
|
|
||||||
final type = switch (activity['type']) {
|
|
||||||
0 => 1, // Discord Playing -> Playing
|
|
||||||
2 => 2, // Discord Music -> Listening
|
|
||||||
3 => 2, // Discord Watching -> Listening
|
|
||||||
_ => 1, // Discord Competing (or null) -> Playing
|
|
||||||
};
|
|
||||||
final title = activity['name'] ?? activity['assets']?['small_text'];
|
|
||||||
final subtitle =
|
|
||||||
activity['details'] ?? activity['assets']?['large_text'];
|
|
||||||
var imageSmall = activity['assets']?['small_image'];
|
|
||||||
var imageLarge = activity['assets']?['large_image'];
|
|
||||||
if (imageSmall != null && !imageSmall!.contains(':')) {
|
|
||||||
imageSmall = 'discord:$imageSmall';
|
|
||||||
}
|
|
||||||
if (imageLarge != null && !imageLarge!.contains(':')) {
|
|
||||||
imageLarge = 'discord:$imageLarge';
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
|
||||||
final activityData = {
|
|
||||||
'type': type,
|
|
||||||
'manual_id': appId,
|
|
||||||
'title': title,
|
|
||||||
'subtitle': subtitle,
|
|
||||||
'caption': activity['state'],
|
|
||||||
'title_url': activity['assets']?['small_text_url'],
|
|
||||||
'subtitle_url': activity['assets']?['large_text_url'],
|
|
||||||
'small_image': imageSmall,
|
|
||||||
'large_image': imageLarge,
|
|
||||||
'meta': activity,
|
|
||||||
'lease_minutes': kPresenceActivityLease,
|
|
||||||
};
|
|
||||||
|
|
||||||
await apiClient.post('/pass/activities', data: activityData);
|
|
||||||
notifier.setCurrentActivity(appId, activityData);
|
|
||||||
} catch (e) {
|
|
||||||
talker.log('Failed to set remote activity status: $e');
|
|
||||||
}
|
|
||||||
socket.send({
|
|
||||||
'cmd': 'SET_ACTIVITY',
|
|
||||||
'data': data['args']['activity'],
|
|
||||||
'evt': null,
|
|
||||||
'nonce': data['nonce'],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'close': (socket) async {
|
|
||||||
notifier.updateStatus('Client disconnected');
|
|
||||||
final currentId = notifier.currentActivityManualId;
|
|
||||||
try {
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
|
||||||
await apiClient.delete(
|
|
||||||
'/pass/activities',
|
|
||||||
queryParameters: {'manualId': currentId},
|
|
||||||
);
|
|
||||||
notifier.setCurrentActivity(null, null);
|
|
||||||
} catch (e) {
|
|
||||||
talker.log('Failed to unset remote activity status: $e');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return notifier;
|
|
||||||
});
|
|
||||||
|
|
||||||
final rpcServerProvider = Provider<ActivityRpcServer>((ref) {
|
final rpcServerProvider = Provider<ActivityRpcServer>((ref) {
|
||||||
final notifier = ref.watch(rpcServerStateProvider.notifier);
|
final notifier = ref.watch(rpcServerStateProvider.notifier);
|
||||||
|
|||||||
@@ -6,152 +6,83 @@ part of 'activity_rpc.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$presenceActivitiesHash() =>
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
r'3bfaa638eeb961ecd62a32d6a7760a6a7e7bf6f2';
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [presenceActivities].
|
|
||||||
@ProviderFor(presenceActivities)
|
@ProviderFor(presenceActivities)
|
||||||
const presenceActivitiesProvider = PresenceActivitiesFamily();
|
const presenceActivitiesProvider = PresenceActivitiesFamily._();
|
||||||
|
|
||||||
/// See also [presenceActivities].
|
final class PresenceActivitiesProvider
|
||||||
class PresenceActivitiesFamily
|
extends
|
||||||
extends Family<AsyncValue<List<SnPresenceActivity>>> {
|
$FunctionalProvider<
|
||||||
/// See also [presenceActivities].
|
AsyncValue<List<SnPresenceActivity>>,
|
||||||
const PresenceActivitiesFamily();
|
List<SnPresenceActivity>,
|
||||||
|
FutureOr<List<SnPresenceActivity>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnPresenceActivity>>,
|
||||||
|
$FutureProvider<List<SnPresenceActivity>> {
|
||||||
|
const PresenceActivitiesProvider._({
|
||||||
|
required PresenceActivitiesFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'presenceActivitiesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [presenceActivities].
|
@override
|
||||||
PresenceActivitiesProvider call(String uname) {
|
String debugGetCreateSourceHash() => _$presenceActivitiesHash();
|
||||||
return PresenceActivitiesProvider(uname);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'presenceActivitiesProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
PresenceActivitiesProvider getProviderOverride(
|
$FutureProviderElement<List<SnPresenceActivity>> $createElement(
|
||||||
covariant PresenceActivitiesProvider provider,
|
$ProviderPointer pointer,
|
||||||
) {
|
) => $FutureProviderElement(pointer);
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<List<SnPresenceActivity>> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return presenceActivities(ref, argument);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'presenceActivitiesProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [presenceActivities].
|
|
||||||
class PresenceActivitiesProvider
|
|
||||||
extends AutoDisposeFutureProvider<List<SnPresenceActivity>> {
|
|
||||||
/// See also [presenceActivities].
|
|
||||||
PresenceActivitiesProvider(String uname)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => presenceActivities(ref as PresenceActivitiesRef, uname),
|
|
||||||
from: presenceActivitiesProvider,
|
|
||||||
name: r'presenceActivitiesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$presenceActivitiesHash,
|
|
||||||
dependencies: PresenceActivitiesFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PresenceActivitiesFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
|
||||||
|
|
||||||
PresenceActivitiesProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String uname;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<List<SnPresenceActivity>> Function(PresenceActivitiesRef provider)
|
|
||||||
create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PresenceActivitiesProvider._internal(
|
|
||||||
(ref) => create(ref as PresenceActivitiesRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
uname: uname,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<List<SnPresenceActivity>> createElement() {
|
|
||||||
return _PresenceActivitiesProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PresenceActivitiesProvider && other.uname == uname;
|
return other is PresenceActivitiesProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$presenceActivitiesHash() =>
|
||||||
// ignore: unused_element
|
r'3bfaa638eeb961ecd62a32d6a7760a6a7e7bf6f2';
|
||||||
mixin PresenceActivitiesRef
|
|
||||||
on AutoDisposeFutureProviderRef<List<SnPresenceActivity>> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PresenceActivitiesProviderElement
|
final class PresenceActivitiesFamily extends $Family
|
||||||
extends AutoDisposeFutureProviderElement<List<SnPresenceActivity>>
|
with $FunctionalFamilyOverride<FutureOr<List<SnPresenceActivity>>, String> {
|
||||||
with PresenceActivitiesRef {
|
const PresenceActivitiesFamily._()
|
||||||
_PresenceActivitiesProviderElement(super.provider);
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'presenceActivitiesProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
PresenceActivitiesProvider call(String uname) =>
|
||||||
|
PresenceActivitiesProvider._(argument: uname, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get uname => (origin as PresenceActivitiesProvider).uname;
|
String toString() => r'presenceActivitiesProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -6,19 +6,58 @@ part of 'call.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(CallNotifier)
|
||||||
|
const callProvider = CallNotifierProvider._();
|
||||||
|
|
||||||
|
final class CallNotifierProvider
|
||||||
|
extends $NotifierProvider<CallNotifier, CallState> {
|
||||||
|
const CallNotifierProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'callProvider',
|
||||||
|
isAutoDispose: false,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$callNotifierHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
CallNotifier create() => CallNotifier();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(CallState value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<CallState>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$callNotifierHash() => r'ef4e3e9c9d411cf9dce1ceb456a3b866b2c87db3';
|
String _$callNotifierHash() => r'ef4e3e9c9d411cf9dce1ceb456a3b866b2c87db3';
|
||||||
|
|
||||||
/// See also [CallNotifier].
|
abstract class _$CallNotifier extends $Notifier<CallState> {
|
||||||
@ProviderFor(CallNotifier)
|
CallState build();
|
||||||
final callNotifierProvider = NotifierProvider<CallNotifier, CallState>.internal(
|
@$mustCallSuper
|
||||||
CallNotifier.new,
|
@override
|
||||||
name: r'callNotifierProvider',
|
void runBuild() {
|
||||||
debugGetCreateSourceHash:
|
final created = build();
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$callNotifierHash,
|
final ref = this.ref as $Ref<CallState, CallState>;
|
||||||
dependencies: null,
|
final element =
|
||||||
allTransitiveDependencies: null,
|
ref.element
|
||||||
);
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<CallState, CallState>,
|
||||||
typedef _$CallNotifier = Notifier<CallState>;
|
CallState,
|
||||||
// ignore_for_file: type=lint
|
Object?,
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,163 +6,97 @@ part of 'chat_online_count.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$chatOnlineCountNotifierHash() =>
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
r'19af8fd0e9f62c65e12a68215406776085235fa3';
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _$ChatOnlineCountNotifier
|
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<int> {
|
|
||||||
late final String chatroomId;
|
|
||||||
|
|
||||||
FutureOr<int> build(String chatroomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatOnlineCountNotifier].
|
|
||||||
@ProviderFor(ChatOnlineCountNotifier)
|
@ProviderFor(ChatOnlineCountNotifier)
|
||||||
const chatOnlineCountNotifierProvider = ChatOnlineCountNotifierFamily();
|
const chatOnlineCountProvider = ChatOnlineCountNotifierFamily._();
|
||||||
|
|
||||||
/// See also [ChatOnlineCountNotifier].
|
final class ChatOnlineCountNotifierProvider
|
||||||
class ChatOnlineCountNotifierFamily extends Family<AsyncValue<int>> {
|
extends $AsyncNotifierProvider<ChatOnlineCountNotifier, int> {
|
||||||
/// See also [ChatOnlineCountNotifier].
|
const ChatOnlineCountNotifierProvider._({
|
||||||
const ChatOnlineCountNotifierFamily();
|
required ChatOnlineCountNotifierFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatOnlineCountProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [ChatOnlineCountNotifier].
|
@override
|
||||||
ChatOnlineCountNotifierProvider call(String chatroomId) {
|
String debugGetCreateSourceHash() => _$chatOnlineCountNotifierHash();
|
||||||
return ChatOnlineCountNotifierProvider(chatroomId);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'chatOnlineCountProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
ChatOnlineCountNotifierProvider getProviderOverride(
|
ChatOnlineCountNotifier create() => ChatOnlineCountNotifier();
|
||||||
covariant ChatOnlineCountNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.chatroomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'chatOnlineCountNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatOnlineCountNotifier].
|
|
||||||
class ChatOnlineCountNotifierProvider
|
|
||||||
extends AutoDisposeAsyncNotifierProviderImpl<ChatOnlineCountNotifier, int> {
|
|
||||||
/// See also [ChatOnlineCountNotifier].
|
|
||||||
ChatOnlineCountNotifierProvider(String chatroomId)
|
|
||||||
: this._internal(
|
|
||||||
() => ChatOnlineCountNotifier()..chatroomId = chatroomId,
|
|
||||||
from: chatOnlineCountNotifierProvider,
|
|
||||||
name: r'chatOnlineCountNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatOnlineCountNotifierHash,
|
|
||||||
dependencies: ChatOnlineCountNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
ChatOnlineCountNotifierFamily._allTransitiveDependencies,
|
|
||||||
chatroomId: chatroomId,
|
|
||||||
);
|
|
||||||
|
|
||||||
ChatOnlineCountNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.chatroomId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String chatroomId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<int> runNotifierBuild(covariant ChatOnlineCountNotifier notifier) {
|
|
||||||
return notifier.build(chatroomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(ChatOnlineCountNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: ChatOnlineCountNotifierProvider._internal(
|
|
||||||
() => create()..chatroomId = chatroomId,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
chatroomId: chatroomId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<ChatOnlineCountNotifier, int>
|
|
||||||
createElement() {
|
|
||||||
return _ChatOnlineCountNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is ChatOnlineCountNotifierProvider &&
|
return other is ChatOnlineCountNotifierProvider &&
|
||||||
other.chatroomId == chatroomId;
|
other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, chatroomId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$chatOnlineCountNotifierHash() =>
|
||||||
// ignore: unused_element
|
r'19af8fd0e9f62c65e12a68215406776085235fa3';
|
||||||
mixin ChatOnlineCountNotifierRef on AutoDisposeAsyncNotifierProviderRef<int> {
|
|
||||||
/// The parameter `chatroomId` of this provider.
|
|
||||||
String get chatroomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatOnlineCountNotifierProviderElement
|
final class ChatOnlineCountNotifierFamily extends $Family
|
||||||
extends
|
with
|
||||||
AutoDisposeAsyncNotifierProviderElement<ChatOnlineCountNotifier, int>
|
$ClassFamilyOverride<
|
||||||
with ChatOnlineCountNotifierRef {
|
ChatOnlineCountNotifier,
|
||||||
_ChatOnlineCountNotifierProviderElement(super.provider);
|
AsyncValue<int>,
|
||||||
|
int,
|
||||||
|
FutureOr<int>,
|
||||||
|
String
|
||||||
|
> {
|
||||||
|
const ChatOnlineCountNotifierFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatOnlineCountProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
ChatOnlineCountNotifierProvider call(String chatroomId) =>
|
||||||
|
ChatOnlineCountNotifierProvider._(argument: chatroomId, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get chatroomId =>
|
String toString() => r'chatOnlineCountProvider';
|
||||||
(origin as ChatOnlineCountNotifierProvider).chatroomId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
abstract class _$ChatOnlineCountNotifier extends $AsyncNotifier<int> {
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
late final _$args = ref.$arg as String;
|
||||||
|
String get chatroomId => _$args;
|
||||||
|
|
||||||
|
FutureOr<int> build(String chatroomId);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref = this.ref as $Ref<AsyncValue<int>, int>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AsyncValue<int>, int>,
|
||||||
|
AsyncValue<int>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
396
lib/pods/chat/chat_room.dart
Normal file
396
lib/pods/chat/chat_room.dart
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:island/database/drift_db.dart';
|
||||||
|
import 'package:island/models/account.dart';
|
||||||
|
import 'package:island/models/chat.dart';
|
||||||
|
import 'package:island/models/file.dart';
|
||||||
|
import 'package:island/pods/database.dart';
|
||||||
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/userinfo.dart';
|
||||||
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|
||||||
|
part 'chat_room.g.dart';
|
||||||
|
|
||||||
|
final chatSyncingProvider = NotifierProvider<ChatSyncingNotifier, bool>(
|
||||||
|
ChatSyncingNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
|
class ChatSyncingNotifier extends Notifier<bool> {
|
||||||
|
@override
|
||||||
|
bool build() => false;
|
||||||
|
|
||||||
|
void set(bool value) => state = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
final flashingMessagesProvider =
|
||||||
|
NotifierProvider<FlashingMessagesNotifier, Set<String>>(
|
||||||
|
FlashingMessagesNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
|
class FlashingMessagesNotifier extends Notifier<Set<String>> {
|
||||||
|
@override
|
||||||
|
Set<String> build() => {};
|
||||||
|
|
||||||
|
void update(Set<String> Function(Set<String>) cb) {
|
||||||
|
state = cb(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear() => state = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
class ChatRoomJoinedNotifier extends _$ChatRoomJoinedNotifier {
|
||||||
|
@override
|
||||||
|
Future<List<SnChatRoom>> build() async {
|
||||||
|
final db = ref.watch(databaseProvider);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final localRoomsData = await db.select(db.chatRooms).get();
|
||||||
|
if (localRoomsData.isNotEmpty) {
|
||||||
|
final localRooms = await Future.wait(
|
||||||
|
localRoomsData.map((row) async {
|
||||||
|
final membersRows =
|
||||||
|
await (db.select(db.chatMembers)
|
||||||
|
..where((m) => m.chatRoomId.equals(row.id))).get();
|
||||||
|
final members =
|
||||||
|
membersRows.map((mRow) {
|
||||||
|
final account = SnAccount.fromJson(mRow.account);
|
||||||
|
return SnChatMember(
|
||||||
|
id: mRow.id,
|
||||||
|
chatRoomId: mRow.chatRoomId,
|
||||||
|
accountId: mRow.accountId,
|
||||||
|
account: account,
|
||||||
|
nick: mRow.nick,
|
||||||
|
notify: mRow.notify,
|
||||||
|
joinedAt: mRow.joinedAt,
|
||||||
|
breakUntil: mRow.breakUntil,
|
||||||
|
timeoutUntil: mRow.timeoutUntil,
|
||||||
|
status: null,
|
||||||
|
createdAt: mRow.createdAt,
|
||||||
|
updatedAt: mRow.updatedAt,
|
||||||
|
deletedAt: mRow.deletedAt,
|
||||||
|
chatRoom: null,
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
return SnChatRoom(
|
||||||
|
id: row.id,
|
||||||
|
name: row.name,
|
||||||
|
description: row.description,
|
||||||
|
type: row.type,
|
||||||
|
isPublic: row.isPublic!,
|
||||||
|
isCommunity: row.isCommunity!,
|
||||||
|
picture:
|
||||||
|
row.picture != null
|
||||||
|
? SnCloudFile.fromJson(row.picture!)
|
||||||
|
: null,
|
||||||
|
background:
|
||||||
|
row.background != null
|
||||||
|
? SnCloudFile.fromJson(row.background!)
|
||||||
|
: null,
|
||||||
|
realmId: row.realmId,
|
||||||
|
accountId: row.accountId,
|
||||||
|
realm: null,
|
||||||
|
createdAt: row.createdAt,
|
||||||
|
updatedAt: row.updatedAt,
|
||||||
|
deletedAt: row.deletedAt,
|
||||||
|
members: members,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Background sync
|
||||||
|
Future(() async {
|
||||||
|
try {
|
||||||
|
final client = ref.read(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat');
|
||||||
|
final remoteRooms =
|
||||||
|
resp.data
|
||||||
|
.map((e) => SnChatRoom.fromJson(e))
|
||||||
|
.cast<SnChatRoom>()
|
||||||
|
.toList();
|
||||||
|
await db.saveChatRooms(remoteRooms, override: true);
|
||||||
|
// Update state with fresh data
|
||||||
|
state = AsyncData(await _buildRoomsFromDb(db));
|
||||||
|
} catch (_) {}
|
||||||
|
}).ignore();
|
||||||
|
|
||||||
|
return localRooms;
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
|
// Fallback to API
|
||||||
|
final client = ref.watch(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat');
|
||||||
|
final rooms =
|
||||||
|
resp.data
|
||||||
|
.map((e) => SnChatRoom.fromJson(e))
|
||||||
|
.cast<SnChatRoom>()
|
||||||
|
.toList();
|
||||||
|
await db.saveChatRooms(rooms, override: true);
|
||||||
|
return rooms;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<SnChatRoom>> _buildRoomsFromDb(AppDatabase db) async {
|
||||||
|
final localRoomsData = await db.select(db.chatRooms).get();
|
||||||
|
return Future.wait(
|
||||||
|
localRoomsData.map((row) async {
|
||||||
|
final membersRows =
|
||||||
|
await (db.select(db.chatMembers)
|
||||||
|
..where((m) => m.chatRoomId.equals(row.id))).get();
|
||||||
|
final members =
|
||||||
|
membersRows.map((mRow) {
|
||||||
|
final account = SnAccount.fromJson(mRow.account);
|
||||||
|
return SnChatMember(
|
||||||
|
id: mRow.id,
|
||||||
|
chatRoomId: mRow.chatRoomId,
|
||||||
|
accountId: mRow.accountId,
|
||||||
|
account: account,
|
||||||
|
nick: mRow.nick,
|
||||||
|
notify: mRow.notify,
|
||||||
|
joinedAt: mRow.joinedAt,
|
||||||
|
breakUntil: mRow.breakUntil,
|
||||||
|
timeoutUntil: mRow.timeoutUntil,
|
||||||
|
status: null,
|
||||||
|
createdAt: mRow.createdAt,
|
||||||
|
updatedAt: mRow.updatedAt,
|
||||||
|
deletedAt: mRow.deletedAt,
|
||||||
|
chatRoom: null,
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
return SnChatRoom(
|
||||||
|
id: row.id,
|
||||||
|
name: row.name,
|
||||||
|
description: row.description,
|
||||||
|
type: row.type,
|
||||||
|
isPublic: row.isPublic!,
|
||||||
|
isCommunity: row.isCommunity!,
|
||||||
|
picture:
|
||||||
|
row.picture != null ? SnCloudFile.fromJson(row.picture!) : null,
|
||||||
|
background:
|
||||||
|
row.background != null
|
||||||
|
? SnCloudFile.fromJson(row.background!)
|
||||||
|
: null,
|
||||||
|
realmId: row.realmId,
|
||||||
|
accountId: row.accountId,
|
||||||
|
realm: null,
|
||||||
|
createdAt: row.createdAt,
|
||||||
|
updatedAt: row.updatedAt,
|
||||||
|
deletedAt: row.deletedAt,
|
||||||
|
members: members,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
class ChatRoomNotifier extends _$ChatRoomNotifier {
|
||||||
|
@override
|
||||||
|
Future<SnChatRoom?> build(String? identifier) async {
|
||||||
|
if (identifier == null) return null;
|
||||||
|
final db = ref.watch(databaseProvider);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Try to get from local database first
|
||||||
|
final localRoomData =
|
||||||
|
await (db.select(db.chatRooms)
|
||||||
|
..where((r) => r.id.equals(identifier))).getSingleOrNull();
|
||||||
|
|
||||||
|
if (localRoomData != null) {
|
||||||
|
// Fetch members for this room
|
||||||
|
final membersRows =
|
||||||
|
await (db.select(db.chatMembers)
|
||||||
|
..where((m) => m.chatRoomId.equals(localRoomData.id))).get();
|
||||||
|
final members =
|
||||||
|
membersRows.map((mRow) {
|
||||||
|
final account = SnAccount.fromJson(mRow.account);
|
||||||
|
return SnChatMember(
|
||||||
|
id: mRow.id,
|
||||||
|
chatRoomId: mRow.chatRoomId,
|
||||||
|
accountId: mRow.accountId,
|
||||||
|
account: account,
|
||||||
|
nick: mRow.nick,
|
||||||
|
notify: mRow.notify,
|
||||||
|
joinedAt: mRow.joinedAt,
|
||||||
|
breakUntil: mRow.breakUntil,
|
||||||
|
timeoutUntil: mRow.timeoutUntil,
|
||||||
|
status: null,
|
||||||
|
createdAt: mRow.createdAt,
|
||||||
|
updatedAt: mRow.updatedAt,
|
||||||
|
deletedAt: mRow.deletedAt,
|
||||||
|
chatRoom: null,
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
final localRoom = SnChatRoom(
|
||||||
|
id: localRoomData.id,
|
||||||
|
name: localRoomData.name,
|
||||||
|
description: localRoomData.description,
|
||||||
|
type: localRoomData.type,
|
||||||
|
isPublic: localRoomData.isPublic!,
|
||||||
|
isCommunity: localRoomData.isCommunity!,
|
||||||
|
picture:
|
||||||
|
localRoomData.picture != null
|
||||||
|
? SnCloudFile.fromJson(localRoomData.picture!)
|
||||||
|
: null,
|
||||||
|
background:
|
||||||
|
localRoomData.background != null
|
||||||
|
? SnCloudFile.fromJson(localRoomData.background!)
|
||||||
|
: null,
|
||||||
|
realmId: localRoomData.realmId,
|
||||||
|
accountId: localRoomData.accountId,
|
||||||
|
realm: null,
|
||||||
|
createdAt: localRoomData.createdAt,
|
||||||
|
updatedAt: localRoomData.updatedAt,
|
||||||
|
deletedAt: localRoomData.deletedAt,
|
||||||
|
members: members,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Background sync
|
||||||
|
Future(() async {
|
||||||
|
try {
|
||||||
|
final client = ref.read(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat/$identifier');
|
||||||
|
final remoteRoom = SnChatRoom.fromJson(resp.data);
|
||||||
|
// Update state with fresh data directly without saving to DB
|
||||||
|
// DB will be updated by ChatRoomJoinedNotifier's full sync
|
||||||
|
state = AsyncData(remoteRoom);
|
||||||
|
} catch (_) {}
|
||||||
|
}).ignore();
|
||||||
|
|
||||||
|
return localRoom;
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
|
// Fallback to API
|
||||||
|
try {
|
||||||
|
final client = ref.watch(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat/$identifier');
|
||||||
|
final room = SnChatRoom.fromJson(resp.data);
|
||||||
|
await db.saveChatRooms([room]);
|
||||||
|
return room;
|
||||||
|
} catch (err) {
|
||||||
|
if (err is DioException && err.response?.statusCode == 404) {
|
||||||
|
return null; // Chat room not found
|
||||||
|
}
|
||||||
|
rethrow; // Rethrow other errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
class ChatRoomIdentityNotifier extends _$ChatRoomIdentityNotifier {
|
||||||
|
@override
|
||||||
|
Future<SnChatMember?> build(String? identifier) async {
|
||||||
|
if (identifier == null) return null;
|
||||||
|
final db = ref.watch(databaseProvider);
|
||||||
|
final userInfo = ref.watch(userInfoProvider);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Try to get from local database first
|
||||||
|
if (userInfo.value != null) {
|
||||||
|
final localMemberData =
|
||||||
|
await (db.select(db.chatMembers)
|
||||||
|
..where((m) => m.chatRoomId.equals(identifier))
|
||||||
|
..where((m) => m.accountId.equals(userInfo.value!.id)))
|
||||||
|
.getSingleOrNull();
|
||||||
|
|
||||||
|
if (localMemberData != null) {
|
||||||
|
final account = SnAccount.fromJson(localMemberData.account);
|
||||||
|
final localMember = SnChatMember(
|
||||||
|
id: localMemberData.id,
|
||||||
|
chatRoomId: localMemberData.chatRoomId,
|
||||||
|
accountId: localMemberData.accountId,
|
||||||
|
account: account,
|
||||||
|
nick: localMemberData.nick,
|
||||||
|
notify: localMemberData.notify,
|
||||||
|
joinedAt: localMemberData.joinedAt,
|
||||||
|
breakUntil: localMemberData.breakUntil,
|
||||||
|
timeoutUntil: localMemberData.timeoutUntil,
|
||||||
|
status: null,
|
||||||
|
createdAt: localMemberData.createdAt,
|
||||||
|
updatedAt: localMemberData.updatedAt,
|
||||||
|
deletedAt: localMemberData.deletedAt,
|
||||||
|
chatRoom: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Background sync
|
||||||
|
Future(() async {
|
||||||
|
try {
|
||||||
|
final client = ref.read(apiClientProvider);
|
||||||
|
final resp = await client.get(
|
||||||
|
'/sphere/chat/$identifier/members/me',
|
||||||
|
);
|
||||||
|
final remoteMember = SnChatMember.fromJson(resp.data);
|
||||||
|
await db.saveMember(remoteMember);
|
||||||
|
// Update state with fresh data
|
||||||
|
if (userInfo.value != null) {
|
||||||
|
state = AsyncData(
|
||||||
|
await _buildMemberFromDb(db, identifier, userInfo.value!.id),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
}).ignore();
|
||||||
|
|
||||||
|
return localMember;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
|
// Fallback to API
|
||||||
|
try {
|
||||||
|
final client = ref.watch(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat/$identifier/members/me');
|
||||||
|
final member = SnChatMember.fromJson(resp.data);
|
||||||
|
await db.saveMember(member);
|
||||||
|
return member;
|
||||||
|
} catch (err) {
|
||||||
|
if (err is DioException && err.response?.statusCode == 404) {
|
||||||
|
return null; // Chat member not found
|
||||||
|
}
|
||||||
|
rethrow; // Rethrow other errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<SnChatMember?> _buildMemberFromDb(
|
||||||
|
AppDatabase db,
|
||||||
|
String identifier,
|
||||||
|
String accountId,
|
||||||
|
) async {
|
||||||
|
final localMemberData =
|
||||||
|
await (db.select(db.chatMembers)
|
||||||
|
..where((m) => m.chatRoomId.equals(identifier))
|
||||||
|
..where((m) => m.accountId.equals(accountId)))
|
||||||
|
.getSingleOrNull();
|
||||||
|
|
||||||
|
if (localMemberData == null) return null;
|
||||||
|
|
||||||
|
final account = SnAccount.fromJson(localMemberData.account);
|
||||||
|
return SnChatMember(
|
||||||
|
id: localMemberData.id,
|
||||||
|
chatRoomId: localMemberData.chatRoomId,
|
||||||
|
accountId: localMemberData.accountId,
|
||||||
|
account: account,
|
||||||
|
nick: localMemberData.nick,
|
||||||
|
notify: localMemberData.notify,
|
||||||
|
joinedAt: localMemberData.joinedAt,
|
||||||
|
breakUntil: localMemberData.breakUntil,
|
||||||
|
timeoutUntil: localMemberData.timeoutUntil,
|
||||||
|
status: null,
|
||||||
|
createdAt: localMemberData.createdAt,
|
||||||
|
updatedAt: localMemberData.updatedAt,
|
||||||
|
deletedAt: localMemberData.deletedAt,
|
||||||
|
chatRoom: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
Future<List<SnChatMember>> chatroomInvites(Ref ref) async {
|
||||||
|
final client = ref.watch(apiClientProvider);
|
||||||
|
final resp = await client.get('/sphere/chat/invites');
|
||||||
|
return resp.data
|
||||||
|
.map((e) => SnChatMember.fromJson(e))
|
||||||
|
.cast<SnChatMember>()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
282
lib/pods/chat/chat_room.g.dart
Normal file
282
lib/pods/chat/chat_room.g.dart
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'chat_room.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// RiverpodGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(ChatRoomJoinedNotifier)
|
||||||
|
const chatRoomJoinedProvider = ChatRoomJoinedNotifierProvider._();
|
||||||
|
|
||||||
|
final class ChatRoomJoinedNotifierProvider
|
||||||
|
extends $AsyncNotifierProvider<ChatRoomJoinedNotifier, List<SnChatRoom>> {
|
||||||
|
const ChatRoomJoinedNotifierProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'chatRoomJoinedProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatRoomJoinedNotifierHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
ChatRoomJoinedNotifier create() => ChatRoomJoinedNotifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$chatRoomJoinedNotifierHash() =>
|
||||||
|
r'c8092225ba0d9c08b2b5bca6f800f1877303b4ff';
|
||||||
|
|
||||||
|
abstract class _$ChatRoomJoinedNotifier
|
||||||
|
extends $AsyncNotifier<List<SnChatRoom>> {
|
||||||
|
FutureOr<List<SnChatRoom>> build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build();
|
||||||
|
final ref =
|
||||||
|
this.ref as $Ref<AsyncValue<List<SnChatRoom>>, List<SnChatRoom>>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AsyncValue<List<SnChatRoom>>, List<SnChatRoom>>,
|
||||||
|
AsyncValue<List<SnChatRoom>>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ProviderFor(ChatRoomNotifier)
|
||||||
|
const chatRoomProvider = ChatRoomNotifierFamily._();
|
||||||
|
|
||||||
|
final class ChatRoomNotifierProvider
|
||||||
|
extends $AsyncNotifierProvider<ChatRoomNotifier, SnChatRoom?> {
|
||||||
|
const ChatRoomNotifierProvider._({
|
||||||
|
required ChatRoomNotifierFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatRoomProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatRoomNotifierHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'chatRoomProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
ChatRoomNotifier create() => ChatRoomNotifier();
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is ChatRoomNotifierProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$chatRoomNotifierHash() => r'1e6391e2ab4eeb114fa001aaa6b06ab2bd646f38';
|
||||||
|
|
||||||
|
final class ChatRoomNotifierFamily extends $Family
|
||||||
|
with
|
||||||
|
$ClassFamilyOverride<
|
||||||
|
ChatRoomNotifier,
|
||||||
|
AsyncValue<SnChatRoom?>,
|
||||||
|
SnChatRoom?,
|
||||||
|
FutureOr<SnChatRoom?>,
|
||||||
|
String?
|
||||||
|
> {
|
||||||
|
const ChatRoomNotifierFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatRoomProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
ChatRoomNotifierProvider call(String? identifier) =>
|
||||||
|
ChatRoomNotifierProvider._(argument: identifier, from: this);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => r'chatRoomProvider';
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _$ChatRoomNotifier extends $AsyncNotifier<SnChatRoom?> {
|
||||||
|
late final _$args = ref.$arg as String?;
|
||||||
|
String? get identifier => _$args;
|
||||||
|
|
||||||
|
FutureOr<SnChatRoom?> build(String? identifier);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref = this.ref as $Ref<AsyncValue<SnChatRoom?>, SnChatRoom?>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AsyncValue<SnChatRoom?>, SnChatRoom?>,
|
||||||
|
AsyncValue<SnChatRoom?>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ProviderFor(ChatRoomIdentityNotifier)
|
||||||
|
const chatRoomIdentityProvider = ChatRoomIdentityNotifierFamily._();
|
||||||
|
|
||||||
|
final class ChatRoomIdentityNotifierProvider
|
||||||
|
extends $AsyncNotifierProvider<ChatRoomIdentityNotifier, SnChatMember?> {
|
||||||
|
const ChatRoomIdentityNotifierProvider._({
|
||||||
|
required ChatRoomIdentityNotifierFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatRoomIdentityProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatRoomIdentityNotifierHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'chatRoomIdentityProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
ChatRoomIdentityNotifier create() => ChatRoomIdentityNotifier();
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is ChatRoomIdentityNotifierProvider &&
|
||||||
|
other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$chatRoomIdentityNotifierHash() =>
|
||||||
|
r'27c17d55366d39be81d7209837e5c01f80a68a24';
|
||||||
|
|
||||||
|
final class ChatRoomIdentityNotifierFamily extends $Family
|
||||||
|
with
|
||||||
|
$ClassFamilyOverride<
|
||||||
|
ChatRoomIdentityNotifier,
|
||||||
|
AsyncValue<SnChatMember?>,
|
||||||
|
SnChatMember?,
|
||||||
|
FutureOr<SnChatMember?>,
|
||||||
|
String?
|
||||||
|
> {
|
||||||
|
const ChatRoomIdentityNotifierFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatRoomIdentityProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
ChatRoomIdentityNotifierProvider call(String? identifier) =>
|
||||||
|
ChatRoomIdentityNotifierProvider._(argument: identifier, from: this);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => r'chatRoomIdentityProvider';
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class _$ChatRoomIdentityNotifier
|
||||||
|
extends $AsyncNotifier<SnChatMember?> {
|
||||||
|
late final _$args = ref.$arg as String?;
|
||||||
|
String? get identifier => _$args;
|
||||||
|
|
||||||
|
FutureOr<SnChatMember?> build(String? identifier);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref = this.ref as $Ref<AsyncValue<SnChatMember?>, SnChatMember?>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AsyncValue<SnChatMember?>, SnChatMember?>,
|
||||||
|
AsyncValue<SnChatMember?>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ProviderFor(chatroomInvites)
|
||||||
|
const chatroomInvitesProvider = ChatroomInvitesProvider._();
|
||||||
|
|
||||||
|
final class ChatroomInvitesProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<List<SnChatMember>>,
|
||||||
|
List<SnChatMember>,
|
||||||
|
FutureOr<List<SnChatMember>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnChatMember>>,
|
||||||
|
$FutureProvider<List<SnChatMember>> {
|
||||||
|
const ChatroomInvitesProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'chatroomInvitesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatroomInvitesHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnChatMember>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<SnChatMember>> create(Ref ref) {
|
||||||
|
return chatroomInvites(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$chatroomInvitesHash() => r'5cd6391b09c5517ede19bacce43b45c8d71dd087';
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import "package:hooks_riverpod/hooks_riverpod.dart";
|
|
||||||
|
|
||||||
final isSyncingProvider = StateProvider.autoDispose<bool>((ref) => false);
|
|
||||||
|
|
||||||
final flashingMessagesProvider = StateProvider<Set<String>>((ref) => {});
|
|
||||||
@@ -3,23 +3,32 @@ import "dart:convert";
|
|||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
import "package:island/models/chat.dart";
|
import "package:island/models/chat.dart";
|
||||||
|
import "package:island/pods/chat/chat_room.dart";
|
||||||
import "package:island/pods/lifecycle.dart";
|
import "package:island/pods/lifecycle.dart";
|
||||||
import "package:island/pods/chat/messages_notifier.dart";
|
import "package:island/pods/chat/messages_notifier.dart";
|
||||||
import "package:island/pods/websocket.dart";
|
import "package:island/pods/websocket.dart";
|
||||||
import "package:island/screens/chat/chat.dart";
|
|
||||||
import "package:island/widgets/chat/call_button.dart";
|
import "package:island/widgets/chat/call_button.dart";
|
||||||
import "package:riverpod_annotation/riverpod_annotation.dart";
|
import "package:riverpod_annotation/riverpod_annotation.dart";
|
||||||
|
|
||||||
part 'chat_subscribe.g.dart';
|
part 'chat_subscribe.g.dart';
|
||||||
|
|
||||||
final currentSubscribedChatIdProvider = StateProvider<String?>((ref) => null);
|
final currentSubscribedChatIdProvider =
|
||||||
|
NotifierProvider<CurrentSubscribedChatIdNotifier, String?>(
|
||||||
|
CurrentSubscribedChatIdNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
|
class CurrentSubscribedChatIdNotifier extends Notifier<String?> {
|
||||||
|
@override
|
||||||
|
String? build() => null;
|
||||||
|
|
||||||
|
void set(String? value) => state = value;
|
||||||
|
}
|
||||||
|
|
||||||
@riverpod
|
@riverpod
|
||||||
class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
||||||
late final String _roomId;
|
late SnChatRoom _chatRoom;
|
||||||
late final SnChatRoom _chatRoom;
|
late SnChatMember _chatIdentity;
|
||||||
late final SnChatMember _chatIdentity;
|
late MessagesNotifier _messagesNotifier;
|
||||||
late final MessagesNotifier _messagesNotifier;
|
|
||||||
|
|
||||||
final List<SnChatMember> _typingStatuses = [];
|
final List<SnChatMember> _typingStatuses = [];
|
||||||
Timer? _typingCleanupTimer;
|
Timer? _typingCleanupTimer;
|
||||||
@@ -29,11 +38,10 @@ class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
List<SnChatMember> build(String roomId) {
|
List<SnChatMember> build(String roomId) {
|
||||||
_roomId = roomId;
|
|
||||||
final ws = ref.watch(websocketProvider);
|
final ws = ref.watch(websocketProvider);
|
||||||
final chatRoomAsync = ref.watch(chatroomProvider(roomId));
|
final chatRoomAsync = ref.watch(chatRoomProvider(roomId));
|
||||||
final chatIdentityAsync = ref.watch(chatroomIdentityProvider(roomId));
|
final chatIdentityAsync = ref.watch(chatRoomIdentityProvider(roomId));
|
||||||
_messagesNotifier = ref.watch(messagesNotifierProvider(roomId).notifier);
|
_messagesNotifier = ref.watch(messagesProvider(roomId).notifier);
|
||||||
|
|
||||||
if (chatRoomAsync.isLoading || chatIdentityAsync.isLoading) {
|
if (chatRoomAsync.isLoading || chatIdentityAsync.isLoading) {
|
||||||
return [];
|
return [];
|
||||||
@@ -59,7 +67,7 @@ class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Future.microtask(
|
Future.microtask(
|
||||||
() => ref.read(currentSubscribedChatIdProvider.notifier).state = roomId,
|
() => ref.read(currentSubscribedChatIdProvider.notifier).set(roomId),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Send initial read receipt
|
// Send initial read receipt
|
||||||
@@ -130,7 +138,7 @@ class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
|||||||
|
|
||||||
// Cleanup on dispose
|
// Cleanup on dispose
|
||||||
ref.onDispose(() {
|
ref.onDispose(() {
|
||||||
ref.read(currentSubscribedChatIdProvider.notifier).state = null;
|
ref.read(currentSubscribedChatIdProvider.notifier).set(null);
|
||||||
wsState.sendMessage(
|
wsState.sendMessage(
|
||||||
jsonEncode(
|
jsonEncode(
|
||||||
WebSocketPacket(
|
WebSocketPacket(
|
||||||
@@ -199,7 +207,7 @@ class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
|||||||
jsonEncode(
|
jsonEncode(
|
||||||
WebSocketPacket(
|
WebSocketPacket(
|
||||||
type: 'messages.read',
|
type: 'messages.read',
|
||||||
data: {'chat_room_id': _roomId},
|
data: {'chat_room_id': roomId},
|
||||||
endpoint: 'sphere',
|
endpoint: 'sphere',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -216,7 +224,7 @@ class ChatSubscribeNotifier extends _$ChatSubscribeNotifier {
|
|||||||
jsonEncode(
|
jsonEncode(
|
||||||
WebSocketPacket(
|
WebSocketPacket(
|
||||||
type: 'messages.typing',
|
type: 'messages.typing',
|
||||||
data: {'chat_room_id': _roomId},
|
data: {'chat_room_id': roomId},
|
||||||
endpoint: 'sphere',
|
endpoint: 'sphere',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,171 +6,104 @@ part of 'chat_subscribe.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$chatSubscribeNotifierHash() =>
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
r'c605e0c9c45df64e5ba7b65f8de9b47bde8e2b3b';
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _$ChatSubscribeNotifier
|
|
||||||
extends BuildlessAutoDisposeNotifier<List<SnChatMember>> {
|
|
||||||
late final String roomId;
|
|
||||||
|
|
||||||
List<SnChatMember> build(String roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatSubscribeNotifier].
|
|
||||||
@ProviderFor(ChatSubscribeNotifier)
|
@ProviderFor(ChatSubscribeNotifier)
|
||||||
const chatSubscribeNotifierProvider = ChatSubscribeNotifierFamily();
|
const chatSubscribeProvider = ChatSubscribeNotifierFamily._();
|
||||||
|
|
||||||
/// See also [ChatSubscribeNotifier].
|
final class ChatSubscribeNotifierProvider
|
||||||
class ChatSubscribeNotifierFamily extends Family<List<SnChatMember>> {
|
extends $NotifierProvider<ChatSubscribeNotifier, List<SnChatMember>> {
|
||||||
/// See also [ChatSubscribeNotifier].
|
const ChatSubscribeNotifierProvider._({
|
||||||
const ChatSubscribeNotifierFamily();
|
required ChatSubscribeNotifierFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatSubscribeProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [ChatSubscribeNotifier].
|
@override
|
||||||
ChatSubscribeNotifierProvider call(String roomId) {
|
String debugGetCreateSourceHash() => _$chatSubscribeNotifierHash();
|
||||||
return ChatSubscribeNotifierProvider(roomId);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'chatSubscribeProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
ChatSubscribeNotifierProvider getProviderOverride(
|
ChatSubscribeNotifier create() => ChatSubscribeNotifier();
|
||||||
covariant ChatSubscribeNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(List<SnChatMember> value) {
|
||||||
@override
|
return $ProviderOverride(
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'chatSubscribeNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatSubscribeNotifier].
|
|
||||||
class ChatSubscribeNotifierProvider
|
|
||||||
extends
|
|
||||||
AutoDisposeNotifierProviderImpl<
|
|
||||||
ChatSubscribeNotifier,
|
|
||||||
List<SnChatMember>
|
|
||||||
> {
|
|
||||||
/// See also [ChatSubscribeNotifier].
|
|
||||||
ChatSubscribeNotifierProvider(String roomId)
|
|
||||||
: this._internal(
|
|
||||||
() => ChatSubscribeNotifier()..roomId = roomId,
|
|
||||||
from: chatSubscribeNotifierProvider,
|
|
||||||
name: r'chatSubscribeNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatSubscribeNotifierHash,
|
|
||||||
dependencies: ChatSubscribeNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
ChatSubscribeNotifierFamily._allTransitiveDependencies,
|
|
||||||
roomId: roomId,
|
|
||||||
);
|
|
||||||
|
|
||||||
ChatSubscribeNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.roomId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String roomId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
List<SnChatMember> runNotifierBuild(
|
|
||||||
covariant ChatSubscribeNotifier notifier,
|
|
||||||
) {
|
|
||||||
return notifier.build(roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(ChatSubscribeNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
origin: this,
|
||||||
override: ChatSubscribeNotifierProvider._internal(
|
providerOverride: $SyncValueProvider<List<SnChatMember>>(value),
|
||||||
() => create()..roomId = roomId,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
roomId: roomId,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeNotifierProviderElement<ChatSubscribeNotifier, List<SnChatMember>>
|
|
||||||
createElement() {
|
|
||||||
return _ChatSubscribeNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is ChatSubscribeNotifierProvider && other.roomId == roomId;
|
return other is ChatSubscribeNotifierProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, roomId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$chatSubscribeNotifierHash() =>
|
||||||
// ignore: unused_element
|
r'2b9fae96eb1f96a514a074985e5efa1c13d10aa4';
|
||||||
mixin ChatSubscribeNotifierRef
|
|
||||||
on AutoDisposeNotifierProviderRef<List<SnChatMember>> {
|
|
||||||
/// The parameter `roomId` of this provider.
|
|
||||||
String get roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatSubscribeNotifierProviderElement
|
final class ChatSubscribeNotifierFamily extends $Family
|
||||||
extends
|
with
|
||||||
AutoDisposeNotifierProviderElement<
|
$ClassFamilyOverride<
|
||||||
ChatSubscribeNotifier,
|
ChatSubscribeNotifier,
|
||||||
List<SnChatMember>
|
List<SnChatMember>,
|
||||||
>
|
List<SnChatMember>,
|
||||||
with ChatSubscribeNotifierRef {
|
List<SnChatMember>,
|
||||||
_ChatSubscribeNotifierProviderElement(super.provider);
|
String
|
||||||
|
> {
|
||||||
|
const ChatSubscribeNotifierFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'chatSubscribeProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
ChatSubscribeNotifierProvider call(String roomId) =>
|
||||||
|
ChatSubscribeNotifierProvider._(argument: roomId, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get roomId => (origin as ChatSubscribeNotifierProvider).roomId;
|
String toString() => r'chatSubscribeProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
abstract class _$ChatSubscribeNotifier extends $Notifier<List<SnChatMember>> {
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
late final _$args = ref.$arg as String;
|
||||||
|
String get roomId => _$args;
|
||||||
|
|
||||||
|
List<SnChatMember> build(String roomId);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref = this.ref as $Ref<List<SnChatMember>, List<SnChatMember>>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<List<SnChatMember>, List<SnChatMember>>,
|
||||||
|
List<SnChatMember>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class ChatUnreadCountNotifier extends _$ChatUnreadCountNotifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
@Riverpod(keepAlive: true)
|
||||||
class ChatSummary extends _$ChatSummary {
|
class ChatSummary extends _$ChatSummary {
|
||||||
@override
|
@override
|
||||||
Future<Map<String, SnChatSummary>> build() async {
|
Future<Map<String, SnChatSummary>> build() async {
|
||||||
@@ -99,7 +99,7 @@ class ChatSummary extends _$ChatSummary {
|
|||||||
final unreadToDecrement = summary.unreadCount;
|
final unreadToDecrement = summary.unreadCount;
|
||||||
if (unreadToDecrement > 0) {
|
if (unreadToDecrement > 0) {
|
||||||
ref
|
ref
|
||||||
.read(chatUnreadCountNotifierProvider.notifier)
|
.read(chatUnreadCountProvider.notifier)
|
||||||
.decrement(unreadToDecrement);
|
.decrement(unreadToDecrement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,40 +6,105 @@ part of 'chat_summary.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(ChatUnreadCountNotifier)
|
||||||
|
const chatUnreadCountProvider = ChatUnreadCountNotifierProvider._();
|
||||||
|
|
||||||
|
final class ChatUnreadCountNotifierProvider
|
||||||
|
extends $AsyncNotifierProvider<ChatUnreadCountNotifier, int> {
|
||||||
|
const ChatUnreadCountNotifierProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'chatUnreadCountProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatUnreadCountNotifierHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
ChatUnreadCountNotifier create() => ChatUnreadCountNotifier();
|
||||||
|
}
|
||||||
|
|
||||||
String _$chatUnreadCountNotifierHash() =>
|
String _$chatUnreadCountNotifierHash() =>
|
||||||
r'b8d93589dc37f772d4c3a07d9afd81c37026e57d';
|
r'b8d93589dc37f772d4c3a07d9afd81c37026e57d';
|
||||||
|
|
||||||
/// See also [ChatUnreadCountNotifier].
|
abstract class _$ChatUnreadCountNotifier extends $AsyncNotifier<int> {
|
||||||
@ProviderFor(ChatUnreadCountNotifier)
|
FutureOr<int> build();
|
||||||
final chatUnreadCountNotifierProvider =
|
@$mustCallSuper
|
||||||
AutoDisposeAsyncNotifierProvider<ChatUnreadCountNotifier, int>.internal(
|
@override
|
||||||
ChatUnreadCountNotifier.new,
|
void runBuild() {
|
||||||
name: r'chatUnreadCountNotifierProvider',
|
final created = build();
|
||||||
debugGetCreateSourceHash:
|
final ref = this.ref as $Ref<AsyncValue<int>, int>;
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
final element =
|
||||||
? null
|
ref.element
|
||||||
: _$chatUnreadCountNotifierHash,
|
as $ClassProviderElement<
|
||||||
dependencies: null,
|
AnyNotifier<AsyncValue<int>, int>,
|
||||||
allTransitiveDependencies: null,
|
AsyncValue<int>,
|
||||||
);
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typedef _$ChatUnreadCountNotifier = AutoDisposeAsyncNotifier<int>;
|
|
||||||
String _$chatSummaryHash() => r'33815a3bd81d20902b7063e8194fe336930df9b4';
|
|
||||||
|
|
||||||
/// See also [ChatSummary].
|
|
||||||
@ProviderFor(ChatSummary)
|
@ProviderFor(ChatSummary)
|
||||||
final chatSummaryProvider = AutoDisposeAsyncNotifierProvider<
|
const chatSummaryProvider = ChatSummaryProvider._();
|
||||||
ChatSummary,
|
|
||||||
Map<String, SnChatSummary>
|
|
||||||
>.internal(
|
|
||||||
ChatSummary.new,
|
|
||||||
name: r'chatSummaryProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$chatSummaryHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$ChatSummary = AutoDisposeAsyncNotifier<Map<String, SnChatSummary>>;
|
final class ChatSummaryProvider
|
||||||
// ignore_for_file: type=lint
|
extends $AsyncNotifierProvider<ChatSummary, Map<String, SnChatSummary>> {
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
const ChatSummaryProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'chatSummaryProvider',
|
||||||
|
isAutoDispose: false,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$chatSummaryHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
ChatSummary create() => ChatSummary();
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$chatSummaryHash() => r'dfa5e487586482ebdafef8d711f74db68ee86f84';
|
||||||
|
|
||||||
|
abstract class _$ChatSummary
|
||||||
|
extends $AsyncNotifier<Map<String, SnChatSummary>> {
|
||||||
|
FutureOr<Map<String, SnChatSummary>> build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build();
|
||||||
|
final ref =
|
||||||
|
this.ref
|
||||||
|
as $Ref<
|
||||||
|
AsyncValue<Map<String, SnChatSummary>>,
|
||||||
|
Map<String, SnChatSummary>
|
||||||
|
>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<
|
||||||
|
AsyncValue<Map<String, SnChatSummary>>,
|
||||||
|
Map<String, SnChatSummary>
|
||||||
|
>,
|
||||||
|
AsyncValue<Map<String, SnChatSummary>>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import "package:island/models/chat.dart";
|
|||||||
import "package:island/models/file.dart";
|
import "package:island/models/file.dart";
|
||||||
import "package:island/models/poll.dart";
|
import "package:island/models/poll.dart";
|
||||||
import "package:island/models/wallet.dart";
|
import "package:island/models/wallet.dart";
|
||||||
|
import "package:island/pods/chat/chat_room.dart";
|
||||||
import "package:island/pods/database.dart";
|
import "package:island/pods/database.dart";
|
||||||
import "package:island/pods/lifecycle.dart";
|
import "package:island/pods/lifecycle.dart";
|
||||||
import "package:island/pods/network.dart";
|
import "package:island/pods/network.dart";
|
||||||
@@ -19,18 +20,16 @@ import "package:island/talker.dart";
|
|||||||
import "package:island/widgets/alert.dart";
|
import "package:island/widgets/alert.dart";
|
||||||
import "package:riverpod_annotation/riverpod_annotation.dart";
|
import "package:riverpod_annotation/riverpod_annotation.dart";
|
||||||
import "package:uuid/uuid.dart";
|
import "package:uuid/uuid.dart";
|
||||||
import "package:island/screens/chat/chat.dart";
|
|
||||||
import "package:island/pods/chat/chat_rooms.dart";
|
|
||||||
import "package:island/screens/account/profile.dart";
|
import "package:island/screens/account/profile.dart";
|
||||||
|
|
||||||
part 'messages_notifier.g.dart';
|
part 'messages_notifier.g.dart';
|
||||||
|
|
||||||
@riverpod
|
@riverpod
|
||||||
class MessagesNotifier extends _$MessagesNotifier {
|
class MessagesNotifier extends _$MessagesNotifier {
|
||||||
late final Dio _apiClient;
|
late Dio _apiClient;
|
||||||
late final AppDatabase _database;
|
late AppDatabase _database;
|
||||||
late final SnChatRoom _room;
|
late SnChatRoom _room;
|
||||||
late final SnChatMember _identity;
|
late SnChatMember _identity;
|
||||||
|
|
||||||
final Map<String, LocalChatMessage> _pendingMessages = {};
|
final Map<String, LocalChatMessage> _pendingMessages = {};
|
||||||
final Map<String, Map<int, double?>> _fileUploadProgress = {};
|
final Map<String, Map<int, double?>> _fileUploadProgress = {};
|
||||||
@@ -39,7 +38,6 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
bool? _withLinks;
|
bool? _withLinks;
|
||||||
bool? _withAttachments;
|
bool? _withAttachments;
|
||||||
|
|
||||||
late final String _roomId;
|
|
||||||
static const int _pageSize = 20;
|
static const int _pageSize = 20;
|
||||||
bool _hasMore = true;
|
bool _hasMore = true;
|
||||||
bool _isSyncing = false;
|
bool _isSyncing = false;
|
||||||
@@ -48,15 +46,14 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
bool _allRemoteMessagesFetched = false;
|
bool _allRemoteMessagesFetched = false;
|
||||||
DateTime? _lastPauseTime;
|
DateTime? _lastPauseTime;
|
||||||
|
|
||||||
late final Future<SnAccount?> Function(String) _fetchAccount;
|
late Future<SnAccount?> Function(String) _fetchAccount;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureOr<List<LocalChatMessage>> build(String roomId) async {
|
FutureOr<List<LocalChatMessage>> build(String roomId) async {
|
||||||
_roomId = roomId;
|
|
||||||
_apiClient = ref.watch(apiClientProvider);
|
_apiClient = ref.watch(apiClientProvider);
|
||||||
_database = ref.watch(databaseProvider);
|
_database = ref.watch(databaseProvider);
|
||||||
final room = await ref.watch(chatroomProvider(roomId).future);
|
final room = await ref.watch(chatRoomProvider(roomId).future);
|
||||||
final identity = await ref.watch(chatroomIdentityProvider(roomId).future);
|
final identity = await ref.watch(chatRoomIdentityProvider(roomId).future);
|
||||||
|
|
||||||
// Initialize fetch account method for corrupted data recovery
|
// Initialize fetch account method for corrupted data recovery
|
||||||
_fetchAccount = (String accountId) async {
|
_fetchAccount = (String accountId) async {
|
||||||
@@ -144,14 +141,14 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
if (searchQuery != null && searchQuery.isNotEmpty) {
|
if (searchQuery != null && searchQuery.isNotEmpty) {
|
||||||
dbMessages = await _database.searchMessages(
|
dbMessages = await _database.searchMessages(
|
||||||
_roomId,
|
roomId,
|
||||||
searchQuery,
|
searchQuery,
|
||||||
withAttachments: withAttachments,
|
withAttachments: withAttachments,
|
||||||
fetchAccount: _fetchAccount,
|
fetchAccount: _fetchAccount,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
final chatMessagesFromDb = await _database.getMessagesForRoom(
|
final chatMessagesFromDb = await _database.getMessagesForRoom(
|
||||||
_roomId,
|
roomId,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
limit: take,
|
limit: take,
|
||||||
);
|
);
|
||||||
@@ -194,9 +191,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
final pendingForRoom =
|
final pendingForRoom =
|
||||||
_pendingMessages.values
|
_pendingMessages.values.where((msg) => msg.roomId == roomId).toList();
|
||||||
.where((msg) => msg.roomId == _roomId)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
final allMessages = [...pendingForRoom, ...uniqueMessages];
|
final allMessages = [...pendingForRoom, ...uniqueMessages];
|
||||||
_sortMessages(allMessages); // Use the helper function
|
_sortMessages(allMessages); // Use the helper function
|
||||||
@@ -221,7 +216,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}) async {
|
}) async {
|
||||||
talker.log('Getting all messages for jump from offset $offset, take $take');
|
talker.log('Getting all messages for jump from offset $offset, take $take');
|
||||||
final chatMessagesFromDb = await _database.getMessagesForRoom(
|
final chatMessagesFromDb = await _database.getMessagesForRoom(
|
||||||
_roomId,
|
roomId,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
limit: take,
|
limit: take,
|
||||||
);
|
);
|
||||||
@@ -245,9 +240,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
final pendingForRoom =
|
final pendingForRoom =
|
||||||
_pendingMessages.values
|
_pendingMessages.values.where((msg) => msg.roomId == roomId).toList();
|
||||||
.where((msg) => msg.roomId == _roomId)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
final allMessages = [...pendingForRoom, ...uniqueMessages];
|
final allMessages = [...pendingForRoom, ...uniqueMessages];
|
||||||
_sortMessages(allMessages);
|
_sortMessages(allMessages);
|
||||||
@@ -272,7 +265,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
talker.log('Fetching messages from API, offset $offset, take $take');
|
talker.log('Fetching messages from API, offset $offset, take $take');
|
||||||
if (_totalCount == null) {
|
if (_totalCount == null) {
|
||||||
final response = await _apiClient.get(
|
final response = await _apiClient.get(
|
||||||
'/sphere/chat/$_roomId/messages',
|
'/sphere/chat/$roomId/messages',
|
||||||
queryParameters: {'offset': 0, 'take': 1},
|
queryParameters: {'offset': 0, 'take': 1},
|
||||||
);
|
);
|
||||||
_totalCount = int.parse(response.headers['x-total']?.firstOrNull ?? '0');
|
_totalCount = int.parse(response.headers['x-total']?.firstOrNull ?? '0');
|
||||||
@@ -284,7 +277,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final response = await _apiClient.get(
|
final response = await _apiClient.get(
|
||||||
'/sphere/chat/$_roomId/messages',
|
'/sphere/chat/$roomId/messages',
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
queryParameters: {'offset': offset, 'take': take},
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -326,7 +319,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
_allRemoteMessagesFetched = false;
|
_allRemoteMessagesFetched = false;
|
||||||
|
|
||||||
talker.log('Starting message sync');
|
talker.log('Starting message sync');
|
||||||
Future.microtask(() => ref.read(isSyncingProvider.notifier).state = true);
|
Future.microtask(() => ref.read(chatSyncingProvider.notifier).set(true));
|
||||||
try {
|
try {
|
||||||
final dbMessages = await _database.getMessagesForRoom(
|
final dbMessages = await _database.getMessagesForRoom(
|
||||||
_room.id,
|
_room.id,
|
||||||
@@ -402,9 +395,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
} finally {
|
} finally {
|
||||||
talker.log('Finished message sync');
|
talker.log('Finished message sync');
|
||||||
Future.microtask(
|
Future.microtask(() => ref.read(chatSyncingProvider.notifier).set(false));
|
||||||
() => ref.read(isSyncingProvider.notifier).state = false,
|
|
||||||
);
|
|
||||||
_isSyncing = false;
|
_isSyncing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -501,7 +492,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
if (!_hasMore || state is AsyncLoading) return;
|
if (!_hasMore || state is AsyncLoading) return;
|
||||||
talker.log('Loading more messages');
|
talker.log('Loading more messages');
|
||||||
|
|
||||||
Future.microtask(() => ref.read(isSyncingProvider.notifier).state = true);
|
Future.microtask(() => ref.read(chatSyncingProvider.notifier).set(true));
|
||||||
try {
|
try {
|
||||||
final currentMessages = state.value ?? [];
|
final currentMessages = state.value ?? [];
|
||||||
final offset = currentMessages.length;
|
final offset = currentMessages.length;
|
||||||
@@ -524,9 +515,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
);
|
);
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
} finally {
|
} finally {
|
||||||
Future.microtask(
|
Future.microtask(() => ref.read(chatSyncingProvider.notifier).set(false));
|
||||||
() => ref.read(isSyncingProvider.notifier).state = false,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,7 +535,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
final mockMessage = SnChatMessage(
|
final mockMessage = SnChatMessage(
|
||||||
id: 'pending_$nonce',
|
id: 'pending_$nonce',
|
||||||
chatRoomId: _roomId,
|
chatRoomId: roomId,
|
||||||
senderId: _identity.id,
|
senderId: _identity.id,
|
||||||
content: content,
|
content: content,
|
||||||
createdAt: DateTime.now(),
|
createdAt: DateTime.now(),
|
||||||
@@ -590,8 +579,8 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
|
|
||||||
final response = await _apiClient.request(
|
final response = await _apiClient.request(
|
||||||
editingTo == null
|
editingTo == null
|
||||||
? '/sphere/chat/$_roomId/messages'
|
? '/sphere/chat/$roomId/messages'
|
||||||
: '/sphere/chat/$_roomId/messages/${editingTo.id}',
|
: '/sphere/chat/$roomId/messages/${editingTo.id}',
|
||||||
data: {
|
data: {
|
||||||
'content': content,
|
'content': content,
|
||||||
'attachments_id': cloudAttachments.map((e) => e.id).toList(),
|
'attachments_id': cloudAttachments.map((e) => e.id).toList(),
|
||||||
@@ -731,7 +720,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> receiveMessage(SnChatMessage remoteMessage) async {
|
Future<void> receiveMessage(SnChatMessage remoteMessage) async {
|
||||||
if (remoteMessage.chatRoomId != _roomId) return;
|
if (remoteMessage.chatRoomId != roomId) return;
|
||||||
|
|
||||||
// Block message receiving during jumps to prevent list resets
|
// Block message receiving during jumps to prevent list resets
|
||||||
if (_isJumping) {
|
if (_isJumping) {
|
||||||
@@ -783,7 +772,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> receiveMessageUpdate(SnChatMessage remoteMessage) async {
|
Future<void> receiveMessageUpdate(SnChatMessage remoteMessage) async {
|
||||||
if (remoteMessage.chatRoomId != _roomId) return;
|
if (remoteMessage.chatRoomId != roomId) return;
|
||||||
|
|
||||||
// Block message updates during jumps to prevent list resets
|
// Block message updates during jumps to prevent list resets
|
||||||
if (_isJumping) {
|
if (_isJumping) {
|
||||||
@@ -883,7 +872,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await _apiClient.delete('/sphere/chat/$_roomId/messages/$messageId');
|
await _apiClient.delete('/sphere/chat/$roomId/messages/$messageId');
|
||||||
await receiveMessageDeletion(messageId);
|
await receiveMessageDeletion(messageId);
|
||||||
} catch (err, stackTrace) {
|
} catch (err, stackTrace) {
|
||||||
talker.log(
|
talker.log(
|
||||||
@@ -991,7 +980,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final response = await _apiClient.get(
|
final response = await _apiClient.get(
|
||||||
'/sphere/chat/$_roomId/messages/$messageId',
|
'/sphere/chat/$roomId/messages/$messageId',
|
||||||
);
|
);
|
||||||
final remoteMessage = SnChatMessage.fromJson(response.data);
|
final remoteMessage = SnChatMessage.fromJson(response.data);
|
||||||
final message = LocalChatMessage.fromRemoteMessage(
|
final message = LocalChatMessage.fromRemoteMessage(
|
||||||
@@ -1048,7 +1037,7 @@ class MessagesNotifier extends _$MessagesNotifier {
|
|||||||
final query = _database.customSelect(
|
final query = _database.customSelect(
|
||||||
'SELECT COUNT(*) as count FROM chat_messages WHERE room_id = ? AND created_at > ?',
|
'SELECT COUNT(*) as count FROM chat_messages WHERE room_id = ? AND created_at > ?',
|
||||||
variables: [
|
variables: [
|
||||||
Variable.withString(_roomId),
|
Variable.withString(roomId),
|
||||||
Variable.withDateTime(message.createdAt),
|
Variable.withDateTime(message.createdAt),
|
||||||
],
|
],
|
||||||
readsFrom: {_database.chatMessages},
|
readsFrom: {_database.chatMessages},
|
||||||
|
|||||||
@@ -6,174 +6,101 @@ part of 'messages_notifier.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$messagesNotifierHash() => r'27ce32c54e317a04e1d554ed4a70a24e4503fdd1';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _$MessagesNotifier
|
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<List<LocalChatMessage>> {
|
|
||||||
late final String roomId;
|
|
||||||
|
|
||||||
FutureOr<List<LocalChatMessage>> build(String roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [MessagesNotifier].
|
|
||||||
@ProviderFor(MessagesNotifier)
|
@ProviderFor(MessagesNotifier)
|
||||||
const messagesNotifierProvider = MessagesNotifierFamily();
|
const messagesProvider = MessagesNotifierFamily._();
|
||||||
|
|
||||||
/// See also [MessagesNotifier].
|
final class MessagesNotifierProvider
|
||||||
class MessagesNotifierFamily
|
extends $AsyncNotifierProvider<MessagesNotifier, List<LocalChatMessage>> {
|
||||||
extends Family<AsyncValue<List<LocalChatMessage>>> {
|
const MessagesNotifierProvider._({
|
||||||
/// See also [MessagesNotifier].
|
required MessagesNotifierFamily super.from,
|
||||||
const MessagesNotifierFamily();
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'messagesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [MessagesNotifier].
|
@override
|
||||||
MessagesNotifierProvider call(String roomId) {
|
String debugGetCreateSourceHash() => _$messagesNotifierHash();
|
||||||
return MessagesNotifierProvider(roomId);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'messagesProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
MessagesNotifierProvider getProviderOverride(
|
MessagesNotifier create() => MessagesNotifier();
|
||||||
covariant MessagesNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'messagesNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [MessagesNotifier].
|
|
||||||
class MessagesNotifierProvider
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderImpl<
|
|
||||||
MessagesNotifier,
|
|
||||||
List<LocalChatMessage>
|
|
||||||
> {
|
|
||||||
/// See also [MessagesNotifier].
|
|
||||||
MessagesNotifierProvider(String roomId)
|
|
||||||
: this._internal(
|
|
||||||
() => MessagesNotifier()..roomId = roomId,
|
|
||||||
from: messagesNotifierProvider,
|
|
||||||
name: r'messagesNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$messagesNotifierHash,
|
|
||||||
dependencies: MessagesNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
MessagesNotifierFamily._allTransitiveDependencies,
|
|
||||||
roomId: roomId,
|
|
||||||
);
|
|
||||||
|
|
||||||
MessagesNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.roomId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String roomId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<List<LocalChatMessage>> runNotifierBuild(
|
|
||||||
covariant MessagesNotifier notifier,
|
|
||||||
) {
|
|
||||||
return notifier.build(roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(MessagesNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: MessagesNotifierProvider._internal(
|
|
||||||
() => create()..roomId = roomId,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
roomId: roomId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
MessagesNotifier,
|
|
||||||
List<LocalChatMessage>
|
|
||||||
>
|
|
||||||
createElement() {
|
|
||||||
return _MessagesNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is MessagesNotifierProvider && other.roomId == roomId;
|
return other is MessagesNotifierProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, roomId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$messagesNotifierHash() => r'2f3f19cb99357184e82d66e74a31863fcfc48856';
|
||||||
// ignore: unused_element
|
|
||||||
mixin MessagesNotifierRef
|
|
||||||
on AutoDisposeAsyncNotifierProviderRef<List<LocalChatMessage>> {
|
|
||||||
/// The parameter `roomId` of this provider.
|
|
||||||
String get roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MessagesNotifierProviderElement
|
final class MessagesNotifierFamily extends $Family
|
||||||
extends
|
with
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
$ClassFamilyOverride<
|
||||||
MessagesNotifier,
|
MessagesNotifier,
|
||||||
List<LocalChatMessage>
|
AsyncValue<List<LocalChatMessage>>,
|
||||||
>
|
List<LocalChatMessage>,
|
||||||
with MessagesNotifierRef {
|
FutureOr<List<LocalChatMessage>>,
|
||||||
_MessagesNotifierProviderElement(super.provider);
|
String
|
||||||
|
> {
|
||||||
|
const MessagesNotifierFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'messagesProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
MessagesNotifierProvider call(String roomId) =>
|
||||||
|
MessagesNotifierProvider._(argument: roomId, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get roomId => (origin as MessagesNotifierProvider).roomId;
|
String toString() => r'messagesProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
abstract class _$MessagesNotifier
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
extends $AsyncNotifier<List<LocalChatMessage>> {
|
||||||
|
late final _$args = ref.$arg as String;
|
||||||
|
String get roomId => _$args;
|
||||||
|
|
||||||
|
FutureOr<List<LocalChatMessage>> build(String roomId);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref =
|
||||||
|
this.ref
|
||||||
|
as $Ref<AsyncValue<List<LocalChatMessage>>, List<LocalChatMessage>>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<
|
||||||
|
AsyncValue<List<LocalChatMessage>>,
|
||||||
|
List<LocalChatMessage>
|
||||||
|
>,
|
||||||
|
AsyncValue<List<LocalChatMessage>>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -294,12 +294,15 @@ class AppSettingsNotifier extends _$AppSettingsNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final updateInfoProvider =
|
final updateInfoProvider =
|
||||||
StateNotifierProvider<UpdateInfoNotifier, (String?, String?)>((ref) {
|
NotifierProvider<UpdateInfoNotifier, (String?, String?)>(
|
||||||
return UpdateInfoNotifier();
|
UpdateInfoNotifier.new,
|
||||||
});
|
);
|
||||||
|
|
||||||
class UpdateInfoNotifier extends StateNotifier<(String?, String?)> {
|
class UpdateInfoNotifier extends Notifier<(String?, String?)> {
|
||||||
UpdateInfoNotifier() : super((null, null));
|
@override
|
||||||
|
(String?, String?) build() {
|
||||||
|
return (null, null);
|
||||||
|
}
|
||||||
|
|
||||||
void setUpdate(String newVersion, String newChangelog) {
|
void setUpdate(String newVersion, String newChangelog) {
|
||||||
state = (newVersion, newChangelog);
|
state = (newVersion, newChangelog);
|
||||||
|
|||||||
@@ -29,23 +29,59 @@ Map<String, dynamic> _$ThemeColorsToJson(_ThemeColors instance) =>
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(AppSettingsNotifier)
|
||||||
|
const appSettingsProvider = AppSettingsNotifierProvider._();
|
||||||
|
|
||||||
|
final class AppSettingsNotifierProvider
|
||||||
|
extends $NotifierProvider<AppSettingsNotifier, AppSettings> {
|
||||||
|
const AppSettingsNotifierProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'appSettingsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$appSettingsNotifierHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
AppSettingsNotifier create() => AppSettingsNotifier();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(AppSettings value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<AppSettings>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$appSettingsNotifierHash() =>
|
String _$appSettingsNotifierHash() =>
|
||||||
r'22b695f2023e3251db3296858acd701f7211d757';
|
r'22b695f2023e3251db3296858acd701f7211d757';
|
||||||
|
|
||||||
/// See also [AppSettingsNotifier].
|
abstract class _$AppSettingsNotifier extends $Notifier<AppSettings> {
|
||||||
@ProviderFor(AppSettingsNotifier)
|
AppSettings build();
|
||||||
final appSettingsNotifierProvider =
|
@$mustCallSuper
|
||||||
AutoDisposeNotifierProvider<AppSettingsNotifier, AppSettings>.internal(
|
@override
|
||||||
AppSettingsNotifier.new,
|
void runBuild() {
|
||||||
name: r'appSettingsNotifierProvider',
|
final created = build();
|
||||||
debugGetCreateSourceHash:
|
final ref = this.ref as $Ref<AppSettings, AppSettings>;
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
final element =
|
||||||
? null
|
ref.element
|
||||||
: _$appSettingsNotifierHash,
|
as $ClassProviderElement<
|
||||||
dependencies: null,
|
AnyNotifier<AppSettings, AppSettings>,
|
||||||
allTransitiveDependencies: null,
|
AppSettings,
|
||||||
);
|
Object?,
|
||||||
|
Object?
|
||||||
typedef _$AppSettingsNotifier = AutoDisposeNotifier<AppSettings>;
|
>;
|
||||||
// ignore_for_file: type=lint
|
element.handleValue(ref, created);
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
||||||
import 'package:island/models/activity.dart';
|
import 'package:island/models/activity.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|||||||
@@ -6,169 +6,99 @@ part of 'event_calendar.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$eventCalendarHash() => r'3a33581c28bcd44bc5eb3abdb770171b4d275a5d';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provider for fetching event calendar data
|
/// Provider for fetching event calendar data
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
/// This can be used anywhere in the app where calendar data is needed
|
||||||
///
|
|
||||||
/// Copied from [eventCalendar].
|
|
||||||
@ProviderFor(eventCalendar)
|
@ProviderFor(eventCalendar)
|
||||||
const eventCalendarProvider = EventCalendarFamily();
|
const eventCalendarProvider = EventCalendarFamily._();
|
||||||
|
|
||||||
/// Provider for fetching event calendar data
|
/// Provider for fetching event calendar data
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
/// This can be used anywhere in the app where calendar data is needed
|
||||||
///
|
|
||||||
/// Copied from [eventCalendar].
|
final class EventCalendarProvider
|
||||||
class EventCalendarFamily
|
extends
|
||||||
extends Family<AsyncValue<List<SnEventCalendarEntry>>> {
|
$FunctionalProvider<
|
||||||
|
AsyncValue<List<SnEventCalendarEntry>>,
|
||||||
|
List<SnEventCalendarEntry>,
|
||||||
|
FutureOr<List<SnEventCalendarEntry>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnEventCalendarEntry>>,
|
||||||
|
$FutureProvider<List<SnEventCalendarEntry>> {
|
||||||
/// Provider for fetching event calendar data
|
/// Provider for fetching event calendar data
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
/// This can be used anywhere in the app where calendar data is needed
|
||||||
///
|
const EventCalendarProvider._({
|
||||||
/// Copied from [eventCalendar].
|
required EventCalendarFamily super.from,
|
||||||
const EventCalendarFamily();
|
required EventCalendarQuery super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'eventCalendarProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// Provider for fetching event calendar data
|
@override
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
String debugGetCreateSourceHash() => _$eventCalendarHash();
|
||||||
///
|
|
||||||
/// Copied from [eventCalendar].
|
@override
|
||||||
EventCalendarProvider call(EventCalendarQuery query) {
|
String toString() {
|
||||||
return EventCalendarProvider(query);
|
return r'eventCalendarProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
EventCalendarProvider getProviderOverride(
|
$FutureProviderElement<List<SnEventCalendarEntry>> $createElement(
|
||||||
covariant EventCalendarProvider provider,
|
$ProviderPointer pointer,
|
||||||
) {
|
) => $FutureProviderElement(pointer);
|
||||||
return call(provider.query);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<List<SnEventCalendarEntry>> create(Ref ref) {
|
||||||
|
final argument = this.argument as EventCalendarQuery;
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return eventCalendar(ref, argument);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'eventCalendarProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provider for fetching event calendar data
|
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
|
||||||
///
|
|
||||||
/// Copied from [eventCalendar].
|
|
||||||
class EventCalendarProvider
|
|
||||||
extends AutoDisposeFutureProvider<List<SnEventCalendarEntry>> {
|
|
||||||
/// Provider for fetching event calendar data
|
|
||||||
/// This can be used anywhere in the app where calendar data is needed
|
|
||||||
///
|
|
||||||
/// Copied from [eventCalendar].
|
|
||||||
EventCalendarProvider(EventCalendarQuery query)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => eventCalendar(ref as EventCalendarRef, query),
|
|
||||||
from: eventCalendarProvider,
|
|
||||||
name: r'eventCalendarProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$eventCalendarHash,
|
|
||||||
dependencies: EventCalendarFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
EventCalendarFamily._allTransitiveDependencies,
|
|
||||||
query: query,
|
|
||||||
);
|
|
||||||
|
|
||||||
EventCalendarProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.query,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final EventCalendarQuery query;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<List<SnEventCalendarEntry>> Function(EventCalendarRef provider)
|
|
||||||
create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: EventCalendarProvider._internal(
|
|
||||||
(ref) => create(ref as EventCalendarRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
query: query,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<List<SnEventCalendarEntry>> createElement() {
|
|
||||||
return _EventCalendarProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is EventCalendarProvider && other.query == query;
|
return other is EventCalendarProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, query.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$eventCalendarHash() => r'3a33581c28bcd44bc5eb3abdb770171b4d275a5d';
|
||||||
// ignore: unused_element
|
|
||||||
mixin EventCalendarRef
|
|
||||||
on AutoDisposeFutureProviderRef<List<SnEventCalendarEntry>> {
|
|
||||||
/// The parameter `query` of this provider.
|
|
||||||
EventCalendarQuery get query;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _EventCalendarProviderElement
|
/// Provider for fetching event calendar data
|
||||||
extends AutoDisposeFutureProviderElement<List<SnEventCalendarEntry>>
|
/// This can be used anywhere in the app where calendar data is needed
|
||||||
with EventCalendarRef {
|
|
||||||
_EventCalendarProviderElement(super.provider);
|
final class EventCalendarFamily extends $Family
|
||||||
|
with
|
||||||
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<List<SnEventCalendarEntry>>,
|
||||||
|
EventCalendarQuery
|
||||||
|
> {
|
||||||
|
const EventCalendarFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'eventCalendarProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Provider for fetching event calendar data
|
||||||
|
/// This can be used anywhere in the app where calendar data is needed
|
||||||
|
|
||||||
|
EventCalendarProvider call(EventCalendarQuery query) =>
|
||||||
|
EventCalendarProvider._(argument: query, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
EventCalendarQuery get query => (origin as EventCalendarProvider).query;
|
String toString() => r'eventCalendarProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -2,14 +2,24 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:island/models/file.dart';
|
import 'package:island/models/file.dart';
|
||||||
import 'package:island/models/file_list_item.dart';
|
import 'package:island/models/file_list_item.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
|
|
||||||
part 'file_list.g.dart';
|
part 'file_list.g.dart';
|
||||||
|
|
||||||
@riverpod
|
@riverpod
|
||||||
class CloudFileListNotifier extends _$CloudFileListNotifier
|
Future<Map<String, dynamic>?> billingUsage(Ref ref) async {
|
||||||
with CursorPagingNotifierMixin<FileListItem> {
|
final client = ref.read(apiClientProvider);
|
||||||
|
final response = await client.get('/drive/billing/usage');
|
||||||
|
return response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
final indexedCloudFileListProvider = AsyncNotifierProvider(
|
||||||
|
IndexedCloudFileListNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
|
class IndexedCloudFileListNotifier extends AsyncNotifier<List<FileListItem>>
|
||||||
|
with AsyncPaginationController<FileListItem> {
|
||||||
String _currentPath = '/';
|
String _currentPath = '/';
|
||||||
String? _poolId;
|
String? _poolId;
|
||||||
String? _query;
|
String? _query;
|
||||||
@@ -42,12 +52,7 @@ class CloudFileListNotifier extends _$CloudFileListNotifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<FileListItem>> build() => fetch(cursor: null);
|
Future<List<FileListItem>> fetch() async {
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<FileListItem>> fetch({
|
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
|
|
||||||
final queryParameters = <String, String>{'path': _currentPath};
|
final queryParameters = <String, String>{'path': _currentPath};
|
||||||
@@ -83,21 +88,16 @@ class CloudFileListNotifier extends _$CloudFileListNotifier
|
|||||||
...files.map((file) => FileListItem.file(file)),
|
...files.map((file) => FileListItem.file(file)),
|
||||||
];
|
];
|
||||||
|
|
||||||
// The new API returns all files in the path, no pagination
|
return items;
|
||||||
return CursorPagingData(items: items, hasMore: false, nextCursor: null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
final unindexedFileListProvider = AsyncNotifierProvider(
|
||||||
Future<Map<String, dynamic>?> billingUsage(Ref ref) async {
|
UnindexedFileListNotifier.new,
|
||||||
final client = ref.read(apiClientProvider);
|
);
|
||||||
final response = await client.get('/drive/billing/usage');
|
|
||||||
return response.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@riverpod
|
class UnindexedFileListNotifier extends AsyncNotifier<List<FileListItem>>
|
||||||
class UnindexedFileListNotifier extends _$UnindexedFileListNotifier
|
with AsyncPaginationController<FileListItem> {
|
||||||
with CursorPagingNotifierMixin<FileListItem> {
|
|
||||||
String? _poolId;
|
String? _poolId;
|
||||||
bool _recycled = false;
|
bool _recycled = false;
|
||||||
String? _query;
|
String? _query;
|
||||||
@@ -129,21 +129,15 @@ class UnindexedFileListNotifier extends _$UnindexedFileListNotifier
|
|||||||
ref.invalidateSelf();
|
ref.invalidateSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
static const int pageSize = 20;
|
||||||
Future<CursorPagingData<FileListItem>> build() => fetch(cursor: null);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<FileListItem>> fetch({
|
Future<List<FileListItem>> fetch() async {
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
|
|
||||||
final offset = cursor != null ? int.tryParse(cursor) ?? 0 : 0;
|
|
||||||
const take = 50; // Default page size
|
|
||||||
|
|
||||||
final queryParameters = <String, String>{
|
final queryParameters = <String, String>{
|
||||||
'take': take.toString(),
|
'take': pageSize.toString(),
|
||||||
'offset': offset.toString(),
|
'offset': fetchedCount.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_poolId != null) {
|
if (_poolId != null) {
|
||||||
@@ -169,7 +163,7 @@ class UnindexedFileListNotifier extends _$UnindexedFileListNotifier
|
|||||||
queryParameters: queryParameters,
|
queryParameters: queryParameters,
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.tryParse(response.headers.value('x-total') ?? '0') ?? 0;
|
totalCount = int.tryParse(response.headers.value('x-total') ?? '0') ?? 0;
|
||||||
|
|
||||||
final List<SnCloudFile> files =
|
final List<SnCloudFile> files =
|
||||||
(response.data as List)
|
(response.data as List)
|
||||||
@@ -179,14 +173,7 @@ class UnindexedFileListNotifier extends _$UnindexedFileListNotifier
|
|||||||
final List<FileListItem> items =
|
final List<FileListItem> items =
|
||||||
files.map((file) => FileListItem.unindexedFile(file)).toList();
|
files.map((file) => FileListItem.unindexedFile(file)).toList();
|
||||||
|
|
||||||
final hasMore = offset + take < total;
|
return items;
|
||||||
final nextCursor = hasMore ? (offset + take).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
|
||||||
items: items,
|
|
||||||
hasMore: hasMore,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,85 +6,87 @@ part of 'file_list.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(billingUsage)
|
||||||
|
const billingUsageProvider = BillingUsageProvider._();
|
||||||
|
|
||||||
|
final class BillingUsageProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<Map<String, dynamic>?>,
|
||||||
|
Map<String, dynamic>?,
|
||||||
|
FutureOr<Map<String, dynamic>?>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<Map<String, dynamic>?>,
|
||||||
|
$FutureProvider<Map<String, dynamic>?> {
|
||||||
|
const BillingUsageProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'billingUsageProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$billingUsageHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<Map<String, dynamic>?> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<Map<String, dynamic>?> create(Ref ref) {
|
||||||
|
return billingUsage(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$billingUsageHash() => r'58d8bc774868d60781574c85d6b25869a79c57aa';
|
String _$billingUsageHash() => r'58d8bc774868d60781574c85d6b25869a79c57aa';
|
||||||
|
|
||||||
/// See also [billingUsage].
|
|
||||||
@ProviderFor(billingUsage)
|
|
||||||
final billingUsageProvider =
|
|
||||||
AutoDisposeFutureProvider<Map<String, dynamic>?>.internal(
|
|
||||||
billingUsage,
|
|
||||||
name: r'billingUsageProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$billingUsageHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef BillingUsageRef = AutoDisposeFutureProviderRef<Map<String, dynamic>?>;
|
|
||||||
String _$billingQuotaHash() => r'4ec5d728e439015800abb2d0d673b5a7329cc654';
|
|
||||||
|
|
||||||
/// See also [billingQuota].
|
|
||||||
@ProviderFor(billingQuota)
|
@ProviderFor(billingQuota)
|
||||||
final billingQuotaProvider =
|
const billingQuotaProvider = BillingQuotaProvider._();
|
||||||
AutoDisposeFutureProvider<Map<String, dynamic>?>.internal(
|
|
||||||
billingQuota,
|
|
||||||
name: r'billingQuotaProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$billingQuotaHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class BillingQuotaProvider
|
||||||
// ignore: unused_element
|
extends
|
||||||
typedef BillingQuotaRef = AutoDisposeFutureProviderRef<Map<String, dynamic>?>;
|
$FunctionalProvider<
|
||||||
String _$cloudFileListNotifierHash() =>
|
AsyncValue<Map<String, dynamic>?>,
|
||||||
r'533dfa86f920b60cf7491fb4aeb95ece19e428af';
|
Map<String, dynamic>?,
|
||||||
|
FutureOr<Map<String, dynamic>?>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<Map<String, dynamic>?>,
|
||||||
|
$FutureProvider<Map<String, dynamic>?> {
|
||||||
|
const BillingQuotaProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'billingQuotaProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [CloudFileListNotifier].
|
@override
|
||||||
@ProviderFor(CloudFileListNotifier)
|
String debugGetCreateSourceHash() => _$billingQuotaHash();
|
||||||
final cloudFileListNotifierProvider = AutoDisposeAsyncNotifierProvider<
|
|
||||||
CloudFileListNotifier,
|
|
||||||
CursorPagingData<FileListItem>
|
|
||||||
>.internal(
|
|
||||||
CloudFileListNotifier.new,
|
|
||||||
name: r'cloudFileListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$cloudFileListNotifierHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$CloudFileListNotifier =
|
@$internal
|
||||||
AutoDisposeAsyncNotifier<CursorPagingData<FileListItem>>;
|
@override
|
||||||
String _$unindexedFileListNotifierHash() =>
|
$FutureProviderElement<Map<String, dynamic>?> $createElement(
|
||||||
r'afa487d7b956b71b21ca1b073a01364a34ede1d5';
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
/// See also [UnindexedFileListNotifier].
|
@override
|
||||||
@ProviderFor(UnindexedFileListNotifier)
|
FutureOr<Map<String, dynamic>?> create(Ref ref) {
|
||||||
final unindexedFileListNotifierProvider = AutoDisposeAsyncNotifierProvider<
|
return billingQuota(ref);
|
||||||
UnindexedFileListNotifier,
|
}
|
||||||
CursorPagingData<FileListItem>
|
}
|
||||||
>.internal(
|
|
||||||
UnindexedFileListNotifier.new,
|
|
||||||
name: r'unindexedFileListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$unindexedFileListNotifierHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$UnindexedFileListNotifier =
|
String _$billingQuotaHash() => r'4ec5d728e439015800abb2d0d673b5a7329cc654';
|
||||||
AutoDisposeAsyncNotifier<CursorPagingData<FileListItem>>;
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ final poolsProvider = FutureProvider<List<SnFilePool>>((ref) async {
|
|||||||
});
|
});
|
||||||
|
|
||||||
String? resolveDefaultPoolId(WidgetRef ref, List<SnFilePool> pools) {
|
String? resolveDefaultPoolId(WidgetRef ref, List<SnFilePool> pools) {
|
||||||
final settings = ref.watch(appSettingsNotifierProvider);
|
final settings = ref.watch(appSettingsProvider);
|
||||||
|
|
||||||
final configuredId = settings.defaultPoolId;
|
final configuredId = settings.defaultPoolId;
|
||||||
if (configuredId != null && pools.any((p) => p.id == configuredId)) {
|
if (configuredId != null && pools.any((p) => p.id == configuredId)) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:island/models/reference.dart';
|
import 'package:island/models/reference.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
|||||||
@@ -6,148 +6,80 @@ part of 'file_references.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$fileReferencesHash() => r'd66c678c221f61978bdb242b98e6dbe31d0c204b';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [fileReferences].
|
|
||||||
@ProviderFor(fileReferences)
|
@ProviderFor(fileReferences)
|
||||||
const fileReferencesProvider = FileReferencesFamily();
|
const fileReferencesProvider = FileReferencesFamily._();
|
||||||
|
|
||||||
/// See also [fileReferences].
|
final class FileReferencesProvider
|
||||||
class FileReferencesFamily extends Family<AsyncValue<List<Reference>>> {
|
extends
|
||||||
/// See also [fileReferences].
|
$FunctionalProvider<
|
||||||
const FileReferencesFamily();
|
AsyncValue<List<Reference>>,
|
||||||
|
List<Reference>,
|
||||||
|
FutureOr<List<Reference>>
|
||||||
|
>
|
||||||
|
with $FutureModifier<List<Reference>>, $FutureProvider<List<Reference>> {
|
||||||
|
const FileReferencesProvider._({
|
||||||
|
required FileReferencesFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'fileReferencesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [fileReferences].
|
@override
|
||||||
FileReferencesProvider call(String fileId) {
|
String debugGetCreateSourceHash() => _$fileReferencesHash();
|
||||||
return FileReferencesProvider(fileId);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'fileReferencesProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
FileReferencesProvider getProviderOverride(
|
$FutureProviderElement<List<Reference>> $createElement(
|
||||||
covariant FileReferencesProvider provider,
|
$ProviderPointer pointer,
|
||||||
) {
|
) => $FutureProviderElement(pointer);
|
||||||
return call(provider.fileId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<List<Reference>> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return fileReferences(ref, argument);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'fileReferencesProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [fileReferences].
|
|
||||||
class FileReferencesProvider
|
|
||||||
extends AutoDisposeFutureProvider<List<Reference>> {
|
|
||||||
/// See also [fileReferences].
|
|
||||||
FileReferencesProvider(String fileId)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => fileReferences(ref as FileReferencesRef, fileId),
|
|
||||||
from: fileReferencesProvider,
|
|
||||||
name: r'fileReferencesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$fileReferencesHash,
|
|
||||||
dependencies: FileReferencesFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
FileReferencesFamily._allTransitiveDependencies,
|
|
||||||
fileId: fileId,
|
|
||||||
);
|
|
||||||
|
|
||||||
FileReferencesProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.fileId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String fileId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<List<Reference>> Function(FileReferencesRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: FileReferencesProvider._internal(
|
|
||||||
(ref) => create(ref as FileReferencesRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
fileId: fileId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<List<Reference>> createElement() {
|
|
||||||
return _FileReferencesProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is FileReferencesProvider && other.fileId == fileId;
|
return other is FileReferencesProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, fileId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$fileReferencesHash() => r'd66c678c221f61978bdb242b98e6dbe31d0c204b';
|
||||||
// ignore: unused_element
|
|
||||||
mixin FileReferencesRef on AutoDisposeFutureProviderRef<List<Reference>> {
|
|
||||||
/// The parameter `fileId` of this provider.
|
|
||||||
String get fileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _FileReferencesProviderElement
|
final class FileReferencesFamily extends $Family
|
||||||
extends AutoDisposeFutureProviderElement<List<Reference>>
|
with $FunctionalFamilyOverride<FutureOr<List<Reference>>, String> {
|
||||||
with FileReferencesRef {
|
const FileReferencesFamily._()
|
||||||
_FileReferencesProviderElement(super.provider);
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'fileReferencesProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
FileReferencesProvider call(String fileId) =>
|
||||||
|
FileReferencesProvider._(argument: fileId, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get fileId => (origin as FileReferencesProvider).fileId;
|
String toString() => r'fileReferencesProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -6,159 +6,95 @@ part of 'link_preview.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$linkPreviewHash() => r'5130593d3066155cb958d20714ee577df1f940d7';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _$LinkPreview
|
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<SnScrappedLink?> {
|
|
||||||
late final String url;
|
|
||||||
|
|
||||||
FutureOr<SnScrappedLink?> build(String url);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [LinkPreview].
|
|
||||||
@ProviderFor(LinkPreview)
|
@ProviderFor(LinkPreview)
|
||||||
const linkPreviewProvider = LinkPreviewFamily();
|
const linkPreviewProvider = LinkPreviewFamily._();
|
||||||
|
|
||||||
/// See also [LinkPreview].
|
final class LinkPreviewProvider
|
||||||
class LinkPreviewFamily extends Family<AsyncValue<SnScrappedLink?>> {
|
extends $AsyncNotifierProvider<LinkPreview, SnScrappedLink?> {
|
||||||
/// See also [LinkPreview].
|
const LinkPreviewProvider._({
|
||||||
const LinkPreviewFamily();
|
required LinkPreviewFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'linkPreviewProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [LinkPreview].
|
@override
|
||||||
LinkPreviewProvider call(String url) {
|
String debugGetCreateSourceHash() => _$linkPreviewHash();
|
||||||
return LinkPreviewProvider(url);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'linkPreviewProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
LinkPreviewProvider getProviderOverride(
|
LinkPreview create() => LinkPreview();
|
||||||
covariant LinkPreviewProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'linkPreviewProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [LinkPreview].
|
|
||||||
class LinkPreviewProvider
|
|
||||||
extends AutoDisposeAsyncNotifierProviderImpl<LinkPreview, SnScrappedLink?> {
|
|
||||||
/// See also [LinkPreview].
|
|
||||||
LinkPreviewProvider(String url)
|
|
||||||
: this._internal(
|
|
||||||
() => LinkPreview()..url = url,
|
|
||||||
from: linkPreviewProvider,
|
|
||||||
name: r'linkPreviewProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$linkPreviewHash,
|
|
||||||
dependencies: LinkPreviewFamily._dependencies,
|
|
||||||
allTransitiveDependencies: LinkPreviewFamily._allTransitiveDependencies,
|
|
||||||
url: url,
|
|
||||||
);
|
|
||||||
|
|
||||||
LinkPreviewProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.url,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String url;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<SnScrappedLink?> runNotifierBuild(covariant LinkPreview notifier) {
|
|
||||||
return notifier.build(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(LinkPreview Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: LinkPreviewProvider._internal(
|
|
||||||
() => create()..url = url,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
url: url,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<LinkPreview, SnScrappedLink?>
|
|
||||||
createElement() {
|
|
||||||
return _LinkPreviewProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is LinkPreviewProvider && other.url == url;
|
return other is LinkPreviewProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, url.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$linkPreviewHash() => r'5130593d3066155cb958d20714ee577df1f940d7';
|
||||||
// ignore: unused_element
|
|
||||||
mixin LinkPreviewRef on AutoDisposeAsyncNotifierProviderRef<SnScrappedLink?> {
|
|
||||||
/// The parameter `url` of this provider.
|
|
||||||
String get url;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _LinkPreviewProviderElement
|
final class LinkPreviewFamily extends $Family
|
||||||
extends
|
with
|
||||||
AutoDisposeAsyncNotifierProviderElement<LinkPreview, SnScrappedLink?>
|
$ClassFamilyOverride<
|
||||||
with LinkPreviewRef {
|
LinkPreview,
|
||||||
_LinkPreviewProviderElement(super.provider);
|
AsyncValue<SnScrappedLink?>,
|
||||||
|
SnScrappedLink?,
|
||||||
|
FutureOr<SnScrappedLink?>,
|
||||||
|
String
|
||||||
|
> {
|
||||||
|
const LinkPreviewFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'linkPreviewProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
LinkPreviewProvider call(String url) =>
|
||||||
|
LinkPreviewProvider._(argument: url, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get url => (origin as LinkPreviewProvider).url;
|
String toString() => r'linkPreviewProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
abstract class _$LinkPreview extends $AsyncNotifier<SnScrappedLink?> {
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
late final _$args = ref.$arg as String;
|
||||||
|
String get url => _$args;
|
||||||
|
|
||||||
|
FutureOr<SnScrappedLink?> build(String url);
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final created = build(_$args);
|
||||||
|
final ref = this.ref as $Ref<AsyncValue<SnScrappedLink?>, SnScrappedLink?>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AsyncValue<SnScrappedLink?>, SnScrappedLink?>,
|
||||||
|
AsyncValue<SnScrappedLink?>,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleValue(ref, created);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
79
lib/pods/paging.dart
Normal file
79
lib/pods/paging.dart
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
abstract class PaginationController<T> {
|
||||||
|
int? get totalCount;
|
||||||
|
int get fetchedCount;
|
||||||
|
|
||||||
|
bool get fetchedAll;
|
||||||
|
|
||||||
|
FutureOr<List<T>> fetch();
|
||||||
|
|
||||||
|
Future<void> refresh();
|
||||||
|
|
||||||
|
Future<void> fetchFurther();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class PaginationFiltered<F> {
|
||||||
|
late F currentFilter;
|
||||||
|
|
||||||
|
Future<void> applyFilter(F filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin AsyncPaginationController<T> on AsyncNotifier<List<T>>
|
||||||
|
implements PaginationController<T> {
|
||||||
|
@override
|
||||||
|
int? totalCount;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get fetchedCount => state.value?.length ?? 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get fetchedAll => totalCount != null && fetchedCount >= totalCount!;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<T>> build() async => fetch();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> refresh() async {
|
||||||
|
totalCount = null;
|
||||||
|
state = AsyncData<List<T>>([]);
|
||||||
|
|
||||||
|
final newState = await AsyncValue.guard<List<T>>(() async {
|
||||||
|
return await fetch();
|
||||||
|
});
|
||||||
|
state = newState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> fetchFurther() async {
|
||||||
|
if (fetchedAll) return;
|
||||||
|
|
||||||
|
state = AsyncLoading<List<T>>();
|
||||||
|
|
||||||
|
final newState = await AsyncValue.guard<List<T>>(() async {
|
||||||
|
final elements = await fetch();
|
||||||
|
return [...?state.value, ...elements];
|
||||||
|
});
|
||||||
|
|
||||||
|
state = newState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin AsyncPaginationFilter<F, T> on AsyncPaginationController<T>
|
||||||
|
implements PaginationFiltered<F> {
|
||||||
|
@override
|
||||||
|
Future<void> applyFilter(F filter) async {
|
||||||
|
if (currentFilter == filter) return;
|
||||||
|
// Reset the data
|
||||||
|
totalCount = null;
|
||||||
|
state = AsyncData<List<T>>([]);
|
||||||
|
currentFilter = filter;
|
||||||
|
|
||||||
|
final newState = await AsyncValue.guard<List<T>>(() async {
|
||||||
|
return await fetch();
|
||||||
|
});
|
||||||
|
state = newState;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -55,16 +55,12 @@ Future<String> siteFileContentRaw(
|
|||||||
return resp.data is String ? resp.data : resp.data['content'] as String;
|
return resp.data is String ? resp.data : resp.data['content'] as String;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SiteFilesNotifier
|
class SiteFilesNotifier extends AsyncNotifier<List<SnSiteFileEntry>> {
|
||||||
extends
|
final ({String siteId, String? path}) arg;
|
||||||
AutoDisposeFamilyAsyncNotifier<
|
SiteFilesNotifier(this.arg);
|
||||||
List<SnSiteFileEntry>,
|
|
||||||
({String siteId, String? path})
|
|
||||||
> {
|
|
||||||
@override
|
@override
|
||||||
Future<List<SnSiteFileEntry>> build(
|
Future<List<SnSiteFileEntry>> build() async {
|
||||||
({String siteId, String? path}) arg,
|
|
||||||
) async {
|
|
||||||
return fetchFiles();
|
return fetchFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,8 +148,6 @@ class SiteFilesNotifier
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final siteFilesNotifierProvider = AsyncNotifierProvider.autoDispose.family<
|
final siteFilesNotifierProvider = AsyncNotifierProvider.autoDispose.family(
|
||||||
SiteFilesNotifier,
|
SiteFilesNotifier.new,
|
||||||
List<SnSiteFileEntry>,
|
);
|
||||||
({String siteId, String? path})
|
|
||||||
>(SiteFilesNotifier.new);
|
|
||||||
|
|||||||
@@ -6,446 +6,257 @@ part of 'site_files.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$siteFilesHash() => r'd4029e6c160edcd454eb39ef1c19427b7f95a8d8';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [siteFiles].
|
|
||||||
@ProviderFor(siteFiles)
|
@ProviderFor(siteFiles)
|
||||||
const siteFilesProvider = SiteFilesFamily();
|
const siteFilesProvider = SiteFilesFamily._();
|
||||||
|
|
||||||
/// See also [siteFiles].
|
final class SiteFilesProvider
|
||||||
class SiteFilesFamily extends Family<AsyncValue<List<SnSiteFileEntry>>> {
|
extends
|
||||||
/// See also [siteFiles].
|
$FunctionalProvider<
|
||||||
const SiteFilesFamily();
|
AsyncValue<List<SnSiteFileEntry>>,
|
||||||
|
List<SnSiteFileEntry>,
|
||||||
|
FutureOr<List<SnSiteFileEntry>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnSiteFileEntry>>,
|
||||||
|
$FutureProvider<List<SnSiteFileEntry>> {
|
||||||
|
const SiteFilesProvider._({
|
||||||
|
required SiteFilesFamily super.from,
|
||||||
|
required ({String siteId, String? path}) super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'siteFilesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [siteFiles].
|
@override
|
||||||
SiteFilesProvider call({required String siteId, String? path}) {
|
String debugGetCreateSourceHash() => _$siteFilesHash();
|
||||||
return SiteFilesProvider(siteId: siteId, path: path);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'siteFilesProvider'
|
||||||
|
''
|
||||||
|
'$argument';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
SiteFilesProvider getProviderOverride(covariant SiteFilesProvider provider) {
|
$FutureProviderElement<List<SnSiteFileEntry>> $createElement(
|
||||||
return call(siteId: provider.siteId, path: provider.path);
|
$ProviderPointer pointer,
|
||||||
}
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<List<SnSiteFileEntry>> create(Ref ref) {
|
||||||
|
final argument = this.argument as ({String siteId, String? path});
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return siteFiles(ref, siteId: argument.siteId, path: argument.path);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'siteFilesProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [siteFiles].
|
|
||||||
class SiteFilesProvider
|
|
||||||
extends AutoDisposeFutureProvider<List<SnSiteFileEntry>> {
|
|
||||||
/// See also [siteFiles].
|
|
||||||
SiteFilesProvider({required String siteId, String? path})
|
|
||||||
: this._internal(
|
|
||||||
(ref) => siteFiles(ref as SiteFilesRef, siteId: siteId, path: path),
|
|
||||||
from: siteFilesProvider,
|
|
||||||
name: r'siteFilesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$siteFilesHash,
|
|
||||||
dependencies: SiteFilesFamily._dependencies,
|
|
||||||
allTransitiveDependencies: SiteFilesFamily._allTransitiveDependencies,
|
|
||||||
siteId: siteId,
|
|
||||||
path: path,
|
|
||||||
);
|
|
||||||
|
|
||||||
SiteFilesProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.siteId,
|
|
||||||
required this.path,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String siteId;
|
|
||||||
final String? path;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<List<SnSiteFileEntry>> Function(SiteFilesRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: SiteFilesProvider._internal(
|
|
||||||
(ref) => create(ref as SiteFilesRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
siteId: siteId,
|
|
||||||
path: path,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<List<SnSiteFileEntry>> createElement() {
|
|
||||||
return _SiteFilesProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is SiteFilesProvider &&
|
return other is SiteFilesProvider && other.argument == argument;
|
||||||
other.siteId == siteId &&
|
|
||||||
other.path == path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, siteId.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, path.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$siteFilesHash() => r'd4029e6c160edcd454eb39ef1c19427b7f95a8d8';
|
||||||
// ignore: unused_element
|
|
||||||
mixin SiteFilesRef on AutoDisposeFutureProviderRef<List<SnSiteFileEntry>> {
|
|
||||||
/// The parameter `siteId` of this provider.
|
|
||||||
String get siteId;
|
|
||||||
|
|
||||||
/// The parameter `path` of this provider.
|
final class SiteFilesFamily extends $Family
|
||||||
String? get path;
|
with
|
||||||
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<List<SnSiteFileEntry>>,
|
||||||
|
({String siteId, String? path})
|
||||||
|
> {
|
||||||
|
const SiteFilesFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'siteFilesProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
SiteFilesProvider call({required String siteId, String? path}) =>
|
||||||
|
SiteFilesProvider._(argument: (siteId: siteId, path: path), from: this);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => r'siteFilesProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SiteFilesProviderElement
|
@ProviderFor(siteFileContent)
|
||||||
extends AutoDisposeFutureProviderElement<List<SnSiteFileEntry>>
|
const siteFileContentProvider = SiteFileContentFamily._();
|
||||||
with SiteFilesRef {
|
|
||||||
_SiteFilesProviderElement(super.provider);
|
final class SiteFileContentProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<SnFileContent>,
|
||||||
|
SnFileContent,
|
||||||
|
FutureOr<SnFileContent>
|
||||||
|
>
|
||||||
|
with $FutureModifier<SnFileContent>, $FutureProvider<SnFileContent> {
|
||||||
|
const SiteFileContentProvider._({
|
||||||
|
required SiteFileContentFamily super.from,
|
||||||
|
required ({String siteId, String relativePath}) super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'siteFileContentProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get siteId => (origin as SiteFilesProvider).siteId;
|
String debugGetCreateSourceHash() => _$siteFileContentHash();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? get path => (origin as SiteFilesProvider).path;
|
String toString() {
|
||||||
|
return r'siteFileContentProvider'
|
||||||
|
''
|
||||||
|
'$argument';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<SnFileContent> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnFileContent> create(Ref ref) {
|
||||||
|
final argument = this.argument as ({String siteId, String relativePath});
|
||||||
|
return siteFileContent(
|
||||||
|
ref,
|
||||||
|
siteId: argument.siteId,
|
||||||
|
relativePath: argument.relativePath,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is SiteFileContentProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$siteFileContentHash() => r'b594ad4f8c54555e742ece94ee001092cb2f83d1';
|
String _$siteFileContentHash() => r'b594ad4f8c54555e742ece94ee001092cb2f83d1';
|
||||||
|
|
||||||
/// See also [siteFileContent].
|
final class SiteFileContentFamily extends $Family
|
||||||
@ProviderFor(siteFileContent)
|
with
|
||||||
const siteFileContentProvider = SiteFileContentFamily();
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<SnFileContent>,
|
||||||
|
({String siteId, String relativePath})
|
||||||
|
> {
|
||||||
|
const SiteFileContentFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'siteFileContentProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [siteFileContent].
|
|
||||||
class SiteFileContentFamily extends Family<AsyncValue<SnFileContent>> {
|
|
||||||
/// See also [siteFileContent].
|
|
||||||
const SiteFileContentFamily();
|
|
||||||
|
|
||||||
/// See also [siteFileContent].
|
|
||||||
SiteFileContentProvider call({
|
SiteFileContentProvider call({
|
||||||
required String siteId,
|
required String siteId,
|
||||||
required String relativePath,
|
required String relativePath,
|
||||||
}) {
|
}) => SiteFileContentProvider._(
|
||||||
return SiteFileContentProvider(siteId: siteId, relativePath: relativePath);
|
argument: (siteId: siteId, relativePath: relativePath),
|
||||||
}
|
from: this,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
SiteFileContentProvider getProviderOverride(
|
String toString() => r'siteFileContentProvider';
|
||||||
covariant SiteFileContentProvider provider,
|
|
||||||
) {
|
|
||||||
return call(siteId: provider.siteId, relativePath: provider.relativePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'siteFileContentProvider';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// See also [siteFileContent].
|
@ProviderFor(siteFileContentRaw)
|
||||||
class SiteFileContentProvider extends AutoDisposeFutureProvider<SnFileContent> {
|
const siteFileContentRawProvider = SiteFileContentRawFamily._();
|
||||||
/// See also [siteFileContent].
|
|
||||||
SiteFileContentProvider({
|
final class SiteFileContentRawProvider
|
||||||
required String siteId,
|
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
|
||||||
required String relativePath,
|
with $FutureModifier<String>, $FutureProvider<String> {
|
||||||
}) : this._internal(
|
const SiteFileContentRawProvider._({
|
||||||
(ref) => siteFileContent(
|
required SiteFileContentRawFamily super.from,
|
||||||
ref as SiteFileContentRef,
|
required ({String siteId, String relativePath}) super.argument,
|
||||||
siteId: siteId,
|
}) : super(
|
||||||
relativePath: relativePath,
|
retry: null,
|
||||||
),
|
name: r'siteFileContentRawProvider',
|
||||||
from: siteFileContentProvider,
|
isAutoDispose: true,
|
||||||
name: r'siteFileContentProvider',
|
dependencies: null,
|
||||||
debugGetCreateSourceHash:
|
$allTransitiveDependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$siteFileContentHash,
|
|
||||||
dependencies: SiteFileContentFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
SiteFileContentFamily._allTransitiveDependencies,
|
|
||||||
siteId: siteId,
|
|
||||||
relativePath: relativePath,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SiteFileContentProvider._internal(
|
@override
|
||||||
super._createNotifier, {
|
String debugGetCreateSourceHash() => _$siteFileContentRawHash();
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.siteId,
|
|
||||||
required this.relativePath,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String siteId;
|
|
||||||
final String relativePath;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() {
|
||||||
FutureOr<SnFileContent> Function(SiteFileContentRef provider) create,
|
return r'siteFileContentRawProvider'
|
||||||
) {
|
''
|
||||||
return ProviderOverride(
|
'$argument';
|
||||||
origin: this,
|
}
|
||||||
override: SiteFileContentProvider._internal(
|
|
||||||
(ref) => create(ref as SiteFileContentRef),
|
@$internal
|
||||||
from: from,
|
@override
|
||||||
name: null,
|
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
|
||||||
dependencies: null,
|
$FutureProviderElement(pointer);
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
@override
|
||||||
siteId: siteId,
|
FutureOr<String> create(Ref ref) {
|
||||||
relativePath: relativePath,
|
final argument = this.argument as ({String siteId, String relativePath});
|
||||||
),
|
return siteFileContentRaw(
|
||||||
|
ref,
|
||||||
|
siteId: argument.siteId,
|
||||||
|
relativePath: argument.relativePath,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnFileContent> createElement() {
|
|
||||||
return _SiteFileContentProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is SiteFileContentProvider &&
|
return other is SiteFileContentRawProvider && other.argument == argument;
|
||||||
other.siteId == siteId &&
|
|
||||||
other.relativePath == relativePath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, siteId.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, relativePath.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin SiteFileContentRef on AutoDisposeFutureProviderRef<SnFileContent> {
|
|
||||||
/// The parameter `siteId` of this provider.
|
|
||||||
String get siteId;
|
|
||||||
|
|
||||||
/// The parameter `relativePath` of this provider.
|
|
||||||
String get relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SiteFileContentProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnFileContent>
|
|
||||||
with SiteFileContentRef {
|
|
||||||
_SiteFileContentProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get siteId => (origin as SiteFileContentProvider).siteId;
|
|
||||||
@override
|
|
||||||
String get relativePath => (origin as SiteFileContentProvider).relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$siteFileContentRawHash() =>
|
String _$siteFileContentRawHash() =>
|
||||||
r'd0331c30698a9f4b90fe9b79273ff5914fa46616';
|
r'd0331c30698a9f4b90fe9b79273ff5914fa46616';
|
||||||
|
|
||||||
/// See also [siteFileContentRaw].
|
final class SiteFileContentRawFamily extends $Family
|
||||||
@ProviderFor(siteFileContentRaw)
|
with
|
||||||
const siteFileContentRawProvider = SiteFileContentRawFamily();
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<String>,
|
||||||
|
({String siteId, String relativePath})
|
||||||
|
> {
|
||||||
|
const SiteFileContentRawFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'siteFileContentRawProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [siteFileContentRaw].
|
|
||||||
class SiteFileContentRawFamily extends Family<AsyncValue<String>> {
|
|
||||||
/// See also [siteFileContentRaw].
|
|
||||||
const SiteFileContentRawFamily();
|
|
||||||
|
|
||||||
/// See also [siteFileContentRaw].
|
|
||||||
SiteFileContentRawProvider call({
|
SiteFileContentRawProvider call({
|
||||||
required String siteId,
|
required String siteId,
|
||||||
required String relativePath,
|
required String relativePath,
|
||||||
}) {
|
}) => SiteFileContentRawProvider._(
|
||||||
return SiteFileContentRawProvider(
|
argument: (siteId: siteId, relativePath: relativePath),
|
||||||
siteId: siteId,
|
from: this,
|
||||||
relativePath: relativePath,
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
SiteFileContentRawProvider getProviderOverride(
|
String toString() => r'siteFileContentRawProvider';
|
||||||
covariant SiteFileContentRawProvider provider,
|
|
||||||
) {
|
|
||||||
return call(siteId: provider.siteId, relativePath: provider.relativePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'siteFileContentRawProvider';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// See also [siteFileContentRaw].
|
|
||||||
class SiteFileContentRawProvider extends AutoDisposeFutureProvider<String> {
|
|
||||||
/// See also [siteFileContentRaw].
|
|
||||||
SiteFileContentRawProvider({
|
|
||||||
required String siteId,
|
|
||||||
required String relativePath,
|
|
||||||
}) : this._internal(
|
|
||||||
(ref) => siteFileContentRaw(
|
|
||||||
ref as SiteFileContentRawRef,
|
|
||||||
siteId: siteId,
|
|
||||||
relativePath: relativePath,
|
|
||||||
),
|
|
||||||
from: siteFileContentRawProvider,
|
|
||||||
name: r'siteFileContentRawProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$siteFileContentRawHash,
|
|
||||||
dependencies: SiteFileContentRawFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
SiteFileContentRawFamily._allTransitiveDependencies,
|
|
||||||
siteId: siteId,
|
|
||||||
relativePath: relativePath,
|
|
||||||
);
|
|
||||||
|
|
||||||
SiteFileContentRawProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.siteId,
|
|
||||||
required this.relativePath,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String siteId;
|
|
||||||
final String relativePath;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<String> Function(SiteFileContentRawRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: SiteFileContentRawProvider._internal(
|
|
||||||
(ref) => create(ref as SiteFileContentRawRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
siteId: siteId,
|
|
||||||
relativePath: relativePath,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<String> createElement() {
|
|
||||||
return _SiteFileContentRawProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is SiteFileContentRawProvider &&
|
|
||||||
other.siteId == siteId &&
|
|
||||||
other.relativePath == relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, siteId.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, relativePath.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin SiteFileContentRawRef on AutoDisposeFutureProviderRef<String> {
|
|
||||||
/// The parameter `siteId` of this provider.
|
|
||||||
String get siteId;
|
|
||||||
|
|
||||||
/// The parameter `relativePath` of this provider.
|
|
||||||
String get relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SiteFileContentRawProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<String>
|
|
||||||
with SiteFileContentRawRef {
|
|
||||||
_SiteFileContentRawProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get siteId => (origin as SiteFileContentRawProvider).siteId;
|
|
||||||
@override
|
|
||||||
String get relativePath =>
|
|
||||||
(origin as SiteFileContentRawProvider).relativePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -25,16 +25,12 @@ Future<SnPublicationPage> sitePage(Ref ref, String pageId) async {
|
|||||||
return SnPublicationPage.fromJson(resp.data);
|
return SnPublicationPage.fromJson(resp.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SitePagesNotifier
|
class SitePagesNotifier extends AsyncNotifier<List<SnPublicationPage>> {
|
||||||
extends
|
final ({String pubName, String siteSlug}) arg;
|
||||||
AutoDisposeFamilyAsyncNotifier<
|
SitePagesNotifier(this.arg);
|
||||||
List<SnPublicationPage>,
|
|
||||||
({String pubName, String siteSlug})
|
|
||||||
> {
|
|
||||||
@override
|
@override
|
||||||
Future<List<SnPublicationPage>> build(
|
Future<List<SnPublicationPage>> build() async {
|
||||||
({String pubName, String siteSlug}) arg,
|
|
||||||
) async {
|
|
||||||
return fetchPages();
|
return fetchPages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,275 +6,163 @@ part of 'site_pages.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$sitePagesHash() => r'5e084e9694ad665e9b238c6a747c6c6e99c5eb03';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [sitePages].
|
|
||||||
@ProviderFor(sitePages)
|
@ProviderFor(sitePages)
|
||||||
const sitePagesProvider = SitePagesFamily();
|
const sitePagesProvider = SitePagesFamily._();
|
||||||
|
|
||||||
/// See also [sitePages].
|
final class SitePagesProvider
|
||||||
class SitePagesFamily extends Family<AsyncValue<List<SnPublicationPage>>> {
|
extends
|
||||||
/// See also [sitePages].
|
$FunctionalProvider<
|
||||||
const SitePagesFamily();
|
AsyncValue<List<SnPublicationPage>>,
|
||||||
|
List<SnPublicationPage>,
|
||||||
|
FutureOr<List<SnPublicationPage>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnPublicationPage>>,
|
||||||
|
$FutureProvider<List<SnPublicationPage>> {
|
||||||
|
const SitePagesProvider._({
|
||||||
|
required SitePagesFamily super.from,
|
||||||
|
required (String, String) super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'sitePagesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [sitePages].
|
@override
|
||||||
SitePagesProvider call(String pubName, String siteSlug) {
|
String debugGetCreateSourceHash() => _$sitePagesHash();
|
||||||
return SitePagesProvider(pubName, siteSlug);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'sitePagesProvider'
|
||||||
|
''
|
||||||
|
'$argument';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
SitePagesProvider getProviderOverride(covariant SitePagesProvider provider) {
|
$FutureProviderElement<List<SnPublicationPage>> $createElement(
|
||||||
return call(provider.pubName, provider.siteSlug);
|
$ProviderPointer pointer,
|
||||||
}
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<List<SnPublicationPage>> create(Ref ref) {
|
||||||
|
final argument = this.argument as (String, String);
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return sitePages(ref, argument.$1, argument.$2);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'sitePagesProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [sitePages].
|
|
||||||
class SitePagesProvider
|
|
||||||
extends AutoDisposeFutureProvider<List<SnPublicationPage>> {
|
|
||||||
/// See also [sitePages].
|
|
||||||
SitePagesProvider(String pubName, String siteSlug)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => sitePages(ref as SitePagesRef, pubName, siteSlug),
|
|
||||||
from: sitePagesProvider,
|
|
||||||
name: r'sitePagesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$sitePagesHash,
|
|
||||||
dependencies: SitePagesFamily._dependencies,
|
|
||||||
allTransitiveDependencies: SitePagesFamily._allTransitiveDependencies,
|
|
||||||
pubName: pubName,
|
|
||||||
siteSlug: siteSlug,
|
|
||||||
);
|
|
||||||
|
|
||||||
SitePagesProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.pubName,
|
|
||||||
required this.siteSlug,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String pubName;
|
|
||||||
final String siteSlug;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<List<SnPublicationPage>> Function(SitePagesRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: SitePagesProvider._internal(
|
|
||||||
(ref) => create(ref as SitePagesRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
pubName: pubName,
|
|
||||||
siteSlug: siteSlug,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<List<SnPublicationPage>> createElement() {
|
|
||||||
return _SitePagesProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is SitePagesProvider &&
|
return other is SitePagesProvider && other.argument == argument;
|
||||||
other.pubName == pubName &&
|
|
||||||
other.siteSlug == siteSlug;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, pubName.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, siteSlug.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$sitePagesHash() => r'5e084e9694ad665e9b238c6a747c6c6e99c5eb03';
|
||||||
// ignore: unused_element
|
|
||||||
mixin SitePagesRef on AutoDisposeFutureProviderRef<List<SnPublicationPage>> {
|
|
||||||
/// The parameter `pubName` of this provider.
|
|
||||||
String get pubName;
|
|
||||||
|
|
||||||
/// The parameter `siteSlug` of this provider.
|
final class SitePagesFamily extends $Family
|
||||||
String get siteSlug;
|
with
|
||||||
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<List<SnPublicationPage>>,
|
||||||
|
(String, String)
|
||||||
|
> {
|
||||||
|
const SitePagesFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'sitePagesProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
SitePagesProvider call(String pubName, String siteSlug) =>
|
||||||
|
SitePagesProvider._(argument: (pubName, siteSlug), from: this);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => r'sitePagesProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SitePagesProviderElement
|
@ProviderFor(sitePage)
|
||||||
extends AutoDisposeFutureProviderElement<List<SnPublicationPage>>
|
const sitePageProvider = SitePageFamily._();
|
||||||
with SitePagesRef {
|
|
||||||
_SitePagesProviderElement(super.provider);
|
final class SitePageProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<SnPublicationPage>,
|
||||||
|
SnPublicationPage,
|
||||||
|
FutureOr<SnPublicationPage>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<SnPublicationPage>,
|
||||||
|
$FutureProvider<SnPublicationPage> {
|
||||||
|
const SitePageProvider._({
|
||||||
|
required SitePageFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'sitePageProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get pubName => (origin as SitePagesProvider).pubName;
|
String debugGetCreateSourceHash() => _$sitePageHash();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get siteSlug => (origin as SitePagesProvider).siteSlug;
|
String toString() {
|
||||||
|
return r'sitePageProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<SnPublicationPage> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnPublicationPage> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
|
return sitePage(ref, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is SitePageProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$sitePageHash() => r'542f70c5b103fe34d7cf7eb0821d52f017022efc';
|
String _$sitePageHash() => r'542f70c5b103fe34d7cf7eb0821d52f017022efc';
|
||||||
|
|
||||||
/// See also [sitePage].
|
final class SitePageFamily extends $Family
|
||||||
@ProviderFor(sitePage)
|
with $FunctionalFamilyOverride<FutureOr<SnPublicationPage>, String> {
|
||||||
const sitePageProvider = SitePageFamily();
|
const SitePageFamily._()
|
||||||
|
: super(
|
||||||
/// See also [sitePage].
|
retry: null,
|
||||||
class SitePageFamily extends Family<AsyncValue<SnPublicationPage>> {
|
|
||||||
/// See also [sitePage].
|
|
||||||
const SitePageFamily();
|
|
||||||
|
|
||||||
/// See also [sitePage].
|
|
||||||
SitePageProvider call(String pageId) {
|
|
||||||
return SitePageProvider(pageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
SitePageProvider getProviderOverride(covariant SitePageProvider provider) {
|
|
||||||
return call(provider.pageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'sitePageProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [sitePage].
|
|
||||||
class SitePageProvider extends AutoDisposeFutureProvider<SnPublicationPage> {
|
|
||||||
/// See also [sitePage].
|
|
||||||
SitePageProvider(String pageId)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => sitePage(ref as SitePageRef, pageId),
|
|
||||||
from: sitePageProvider,
|
|
||||||
name: r'sitePageProvider',
|
name: r'sitePageProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$sitePageHash,
|
|
||||||
dependencies: SitePageFamily._dependencies,
|
|
||||||
allTransitiveDependencies: SitePageFamily._allTransitiveDependencies,
|
|
||||||
pageId: pageId,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
SitePageProvider._internal(
|
SitePageProvider call(String pageId) =>
|
||||||
super._createNotifier, {
|
SitePageProvider._(argument: pageId, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.pageId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String pageId;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'sitePageProvider';
|
||||||
FutureOr<SnPublicationPage> Function(SitePageRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: SitePageProvider._internal(
|
|
||||||
(ref) => create(ref as SitePageRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
pageId: pageId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnPublicationPage> createElement() {
|
|
||||||
return _SitePageProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is SitePageProvider && other.pageId == pageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, pageId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin SitePageRef on AutoDisposeFutureProviderRef<SnPublicationPage> {
|
|
||||||
/// The parameter `pageId` of this provider.
|
|
||||||
String get pageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _SitePageProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnPublicationPage>
|
|
||||||
with SitePageRef {
|
|
||||||
_SitePageProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get pageId => (origin as SitePageProvider).pageId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -4,16 +4,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||||||
import 'package:island/models/publication_site.dart';
|
import 'package:island/models/publication_site.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
|
||||||
class SiteNotifier
|
class SiteNotifier extends AsyncNotifier<SnPublicationSite> {
|
||||||
extends
|
final ({String pubName, String? siteId}) arg;
|
||||||
AutoDisposeFamilyAsyncNotifier<
|
SiteNotifier(this.arg);
|
||||||
SnPublicationSite,
|
|
||||||
({String pubName, String? siteId})
|
|
||||||
> {
|
|
||||||
@override
|
@override
|
||||||
FutureOr<SnPublicationSite> build(
|
FutureOr<SnPublicationSite> build() async {
|
||||||
({String pubName, String? siteId}) arg,
|
|
||||||
) async {
|
|
||||||
if (arg.siteId == null || arg.siteId!.isEmpty) {
|
if (arg.siteId == null || arg.siteId!.isEmpty) {
|
||||||
return SnPublicationSite(
|
return SnPublicationSite(
|
||||||
id: '',
|
id: '',
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:island/pods/config.dart';
|
import 'package:island/pods/config.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|
||||||
part 'theme.g.dart';
|
part 'theme.g.dart';
|
||||||
|
|
||||||
@riverpod
|
@riverpod
|
||||||
ThemeSet theme(Ref ref) {
|
ThemeSet theme(Ref ref) {
|
||||||
final settings = ref.watch(appSettingsNotifierProvider);
|
final settings = ref.watch(appSettingsProvider);
|
||||||
return createAppThemeSet(settings);
|
return createAppThemeSet(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,21 +6,46 @@ part of 'theme.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$themeHash() => r'a12dbf8b83d75713b7ae4c68e9cdd1a1cc3a35f0';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [theme].
|
|
||||||
@ProviderFor(theme)
|
@ProviderFor(theme)
|
||||||
final themeProvider = AutoDisposeProvider<ThemeSet>.internal(
|
const themeProvider = ThemeProvider._();
|
||||||
theme,
|
|
||||||
name: r'themeProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$themeHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class ThemeProvider
|
||||||
// ignore: unused_element
|
extends $FunctionalProvider<ThemeSet, ThemeSet, ThemeSet>
|
||||||
typedef ThemeRef = AutoDisposeProviderRef<ThemeSet>;
|
with $Provider<ThemeSet> {
|
||||||
// ignore_for_file: type=lint
|
const ThemeProvider._()
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'themeProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$themeHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$ProviderElement<ThemeSet> $createElement($ProviderPointer pointer) =>
|
||||||
|
$ProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ThemeSet create(Ref ref) {
|
||||||
|
return theme(ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(ThemeSet value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<ThemeSet>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$themeHash() => r'5b41b68e2fc59431bb195ff75f63383982f7730f';
|
||||||
|
|||||||
62
lib/pods/timeline.dart
Normal file
62
lib/pods/timeline.dart
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:island/models/activity.dart';
|
||||||
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
|
|
||||||
|
final activityListProvider =
|
||||||
|
AsyncNotifierProvider<ActivityListNotifier, List<SnTimelineEvent>>(
|
||||||
|
ActivityListNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
|
class ActivityListNotifier extends AsyncNotifier<List<SnTimelineEvent>>
|
||||||
|
with
|
||||||
|
AsyncPaginationController<SnTimelineEvent>,
|
||||||
|
AsyncPaginationFilter<String?, SnTimelineEvent> {
|
||||||
|
static const int pageSize = 20;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String? currentFilter;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<List<SnTimelineEvent>> fetch() async {
|
||||||
|
final client = ref.read(apiClientProvider);
|
||||||
|
|
||||||
|
final cursor = state.value?.lastOrNull?.createdAt.toUtc().toIso8601String();
|
||||||
|
|
||||||
|
final queryParameters = {
|
||||||
|
if (cursor != null) 'cursor': cursor,
|
||||||
|
'take': pageSize,
|
||||||
|
if (currentFilter != null) 'filter': currentFilter,
|
||||||
|
if (kDebugMode)
|
||||||
|
'debugInclude': 'realms,publishers,articles,shuffledPosts',
|
||||||
|
};
|
||||||
|
|
||||||
|
final response = await client.get(
|
||||||
|
'/sphere/timeline',
|
||||||
|
queryParameters: queryParameters,
|
||||||
|
);
|
||||||
|
|
||||||
|
final List<SnTimelineEvent> items =
|
||||||
|
(response.data as List)
|
||||||
|
.map((e) => SnTimelineEvent.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
final hasMore = (items.firstOrNull?.type ?? 'empty') != 'empty';
|
||||||
|
|
||||||
|
totalCount =
|
||||||
|
(state.value?.length ?? 0) + items.length + (hasMore ? pageSize : 0);
|
||||||
|
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateOne(int index, SnTimelineEvent activity) {
|
||||||
|
final currentState = state.value;
|
||||||
|
if (currentState == null) return;
|
||||||
|
|
||||||
|
final updatedItems = [...currentState];
|
||||||
|
updatedItems[index] = activity;
|
||||||
|
|
||||||
|
state = AsyncData(updatedItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -6,269 +6,152 @@ part of 'translate.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$translateStringHash() => r'51d638cf07cbf3ffa9469298f5bd9c667bc0ccb7';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [translateString].
|
|
||||||
@ProviderFor(translateString)
|
@ProviderFor(translateString)
|
||||||
const translateStringProvider = TranslateStringFamily();
|
const translateStringProvider = TranslateStringFamily._();
|
||||||
|
|
||||||
/// See also [translateString].
|
final class TranslateStringProvider
|
||||||
class TranslateStringFamily extends Family<AsyncValue<String>> {
|
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
|
||||||
/// See also [translateString].
|
with $FutureModifier<String>, $FutureProvider<String> {
|
||||||
const TranslateStringFamily();
|
const TranslateStringProvider._({
|
||||||
|
required TranslateStringFamily super.from,
|
||||||
|
required TranslateQuery super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'translateStringProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [translateString].
|
@override
|
||||||
TranslateStringProvider call(TranslateQuery query) {
|
String debugGetCreateSourceHash() => _$translateStringHash();
|
||||||
return TranslateStringProvider(query);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'translateStringProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
TranslateStringProvider getProviderOverride(
|
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
|
||||||
covariant TranslateStringProvider provider,
|
$FutureProviderElement(pointer);
|
||||||
) {
|
|
||||||
return call(provider.query);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<String> create(Ref ref) {
|
||||||
|
final argument = this.argument as TranslateQuery;
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return translateString(ref, argument);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'translateStringProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [translateString].
|
|
||||||
class TranslateStringProvider extends AutoDisposeFutureProvider<String> {
|
|
||||||
/// See also [translateString].
|
|
||||||
TranslateStringProvider(TranslateQuery query)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => translateString(ref as TranslateStringRef, query),
|
|
||||||
from: translateStringProvider,
|
|
||||||
name: r'translateStringProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$translateStringHash,
|
|
||||||
dependencies: TranslateStringFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
TranslateStringFamily._allTransitiveDependencies,
|
|
||||||
query: query,
|
|
||||||
);
|
|
||||||
|
|
||||||
TranslateStringProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.query,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final TranslateQuery query;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<String> Function(TranslateStringRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: TranslateStringProvider._internal(
|
|
||||||
(ref) => create(ref as TranslateStringRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
query: query,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<String> createElement() {
|
|
||||||
return _TranslateStringProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is TranslateStringProvider && other.query == query;
|
return other is TranslateStringProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, query.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$translateStringHash() => r'51d638cf07cbf3ffa9469298f5bd9c667bc0ccb7';
|
||||||
// ignore: unused_element
|
|
||||||
mixin TranslateStringRef on AutoDisposeFutureProviderRef<String> {
|
|
||||||
/// The parameter `query` of this provider.
|
|
||||||
TranslateQuery get query;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _TranslateStringProviderElement
|
final class TranslateStringFamily extends $Family
|
||||||
extends AutoDisposeFutureProviderElement<String>
|
with $FunctionalFamilyOverride<FutureOr<String>, TranslateQuery> {
|
||||||
with TranslateStringRef {
|
const TranslateStringFamily._()
|
||||||
_TranslateStringProviderElement(super.provider);
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'translateStringProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
TranslateStringProvider call(TranslateQuery query) =>
|
||||||
|
TranslateStringProvider._(argument: query, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
TranslateQuery get query => (origin as TranslateStringProvider).query;
|
String toString() => r'translateStringProvider';
|
||||||
|
}
|
||||||
|
|
||||||
|
@ProviderFor(detectStringLanguage)
|
||||||
|
const detectStringLanguageProvider = DetectStringLanguageFamily._();
|
||||||
|
|
||||||
|
final class DetectStringLanguageProvider
|
||||||
|
extends $FunctionalProvider<String?, String?, String?>
|
||||||
|
with $Provider<String?> {
|
||||||
|
const DetectStringLanguageProvider._({
|
||||||
|
required DetectStringLanguageFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'detectStringLanguageProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$detectStringLanguageHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'detectStringLanguageProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$ProviderElement<String?> $createElement($ProviderPointer pointer) =>
|
||||||
|
$ProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String? create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
|
return detectStringLanguage(ref, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(String? value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<String?>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is DetectStringLanguageProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$detectStringLanguageHash() =>
|
String _$detectStringLanguageHash() =>
|
||||||
r'24fbf52edbbffcc8dc4f09f7206f82d69728e703';
|
r'24fbf52edbbffcc8dc4f09f7206f82d69728e703';
|
||||||
|
|
||||||
/// See also [detectStringLanguage].
|
final class DetectStringLanguageFamily extends $Family
|
||||||
@ProviderFor(detectStringLanguage)
|
with $FunctionalFamilyOverride<String?, String> {
|
||||||
const detectStringLanguageProvider = DetectStringLanguageFamily();
|
const DetectStringLanguageFamily._()
|
||||||
|
: super(
|
||||||
/// See also [detectStringLanguage].
|
retry: null,
|
||||||
class DetectStringLanguageFamily extends Family<String?> {
|
|
||||||
/// See also [detectStringLanguage].
|
|
||||||
const DetectStringLanguageFamily();
|
|
||||||
|
|
||||||
/// See also [detectStringLanguage].
|
|
||||||
DetectStringLanguageProvider call(String text) {
|
|
||||||
return DetectStringLanguageProvider(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
DetectStringLanguageProvider getProviderOverride(
|
|
||||||
covariant DetectStringLanguageProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.text);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'detectStringLanguageProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [detectStringLanguage].
|
|
||||||
class DetectStringLanguageProvider extends AutoDisposeProvider<String?> {
|
|
||||||
/// See also [detectStringLanguage].
|
|
||||||
DetectStringLanguageProvider(String text)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => detectStringLanguage(ref as DetectStringLanguageRef, text),
|
|
||||||
from: detectStringLanguageProvider,
|
|
||||||
name: r'detectStringLanguageProvider',
|
name: r'detectStringLanguageProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$detectStringLanguageHash,
|
|
||||||
dependencies: DetectStringLanguageFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
DetectStringLanguageFamily._allTransitiveDependencies,
|
|
||||||
text: text,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
DetectStringLanguageProvider._internal(
|
DetectStringLanguageProvider call(String text) =>
|
||||||
super._createNotifier, {
|
DetectStringLanguageProvider._(argument: text, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.text,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String text;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'detectStringLanguageProvider';
|
||||||
String? Function(DetectStringLanguageRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: DetectStringLanguageProvider._internal(
|
|
||||||
(ref) => create(ref as DetectStringLanguageRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
text: text,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeProviderElement<String?> createElement() {
|
|
||||||
return _DetectStringLanguageProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is DetectStringLanguageProvider && other.text == text;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, text.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin DetectStringLanguageRef on AutoDisposeProviderRef<String?> {
|
|
||||||
/// The parameter `text` of this provider.
|
|
||||||
String get text;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DetectStringLanguageProviderElement
|
|
||||||
extends AutoDisposeProviderElement<String?>
|
|
||||||
with DetectStringLanguageRef {
|
|
||||||
_DetectStringLanguageProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get text => (origin as DetectStringLanguageProvider).text;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -9,18 +9,16 @@ import 'package:island/pods/websocket.dart';
|
|||||||
import 'package:island/services/file_uploader.dart';
|
import 'package:island/services/file_uploader.dart';
|
||||||
import 'package:island/talker.dart';
|
import 'package:island/talker.dart';
|
||||||
|
|
||||||
final uploadTasksProvider =
|
final uploadTasksProvider = NotifierProvider(UploadTasksNotifier.new);
|
||||||
StateNotifierProvider<UploadTasksNotifier, List<DriveTask>>(
|
|
||||||
(ref) => UploadTasksNotifier(ref),
|
|
||||||
);
|
|
||||||
|
|
||||||
class UploadTasksNotifier extends StateNotifier<List<DriveTask>> {
|
class UploadTasksNotifier extends Notifier<List<DriveTask>> {
|
||||||
final Ref ref;
|
|
||||||
StreamSubscription? _websocketSubscription;
|
StreamSubscription? _websocketSubscription;
|
||||||
final Map<String, Map<String, dynamic>> _pendingUploads = {};
|
final Map<String, Map<String, dynamic>> _pendingUploads = {};
|
||||||
|
|
||||||
UploadTasksNotifier(this.ref) : super([]) {
|
@override
|
||||||
|
List<DriveTask> build() {
|
||||||
_listenToWebSocket();
|
_listenToWebSocket();
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
void _listenToWebSocket() {
|
void _listenToWebSocket() {
|
||||||
@@ -334,10 +332,8 @@ class UploadTasksNotifier extends StateNotifier<List<DriveTask>> {
|
|||||||
return taskId;
|
return taskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_websocketSubscription?.cancel();
|
_websocketSubscription?.cancel();
|
||||||
super.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,26 +14,27 @@ import 'package:island/pods/config.dart';
|
|||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/talker.dart';
|
import 'package:island/talker.dart';
|
||||||
|
|
||||||
class UserInfoNotifier extends StateNotifier<AsyncValue<SnAccount?>> {
|
class UserInfoNotifier extends AsyncNotifier<SnAccount?> {
|
||||||
final Ref _ref;
|
@override
|
||||||
|
Future<SnAccount?> build() async {
|
||||||
UserInfoNotifier(this._ref) : super(const AsyncValue.data(null));
|
final token = ref.watch(tokenProvider);
|
||||||
|
|
||||||
Future<void> fetchUser() async {
|
|
||||||
final token = _ref.watch(tokenProvider);
|
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
talker.info('[UserInfo] No token found, not going to fetch...');
|
talker.info('[UserInfo] No token found, not going to fetch...');
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
return _fetchUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<SnAccount?> _fetchUser() async {
|
||||||
try {
|
try {
|
||||||
final client = _ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
final response = await client.get('/pass/accounts/me');
|
final response = await client.get('/pass/accounts/me');
|
||||||
final user = SnAccount.fromJson(response.data);
|
final user = SnAccount.fromJson(response.data);
|
||||||
state = AsyncValue.data(user);
|
|
||||||
|
|
||||||
if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) {
|
if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) {
|
||||||
FirebaseAnalytics.instance.setUserId(id: user.id);
|
FirebaseAnalytics.instance.setUserId(id: user.id);
|
||||||
}
|
}
|
||||||
|
return user;
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
if (!kIsWeb) {
|
if (!kIsWeb) {
|
||||||
if (error is DioException) {
|
if (error is DioException) {
|
||||||
@@ -69,58 +70,63 @@ class UserInfoNotifier extends StateNotifier<AsyncValue<SnAccount?>> {
|
|||||||
),
|
),
|
||||||
).then((value) {
|
).then((value) {
|
||||||
if (value == true) {
|
if (value == true) {
|
||||||
fetchUser();
|
ref.invalidateSelf();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
showOverlayDialog<bool>(
|
||||||
|
builder:
|
||||||
|
(context, close) => AlertDialog(
|
||||||
|
title: Text('failedToLoadUserInfo'.tr()),
|
||||||
|
content: Text(
|
||||||
|
[
|
||||||
|
'failedToLoadUserInfoNetwork'.tr(),
|
||||||
|
error.toString(),
|
||||||
|
].join('\n\n').trim(),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => close(false),
|
||||||
|
child: Text('okay'.tr()),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => close(true),
|
||||||
|
child: Text('retry'.tr()),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
).then((value) {
|
||||||
|
if (value == true) {
|
||||||
|
ref.invalidateSelf();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
showOverlayDialog<bool>(
|
|
||||||
builder:
|
|
||||||
(context, close) => AlertDialog(
|
|
||||||
title: Text('failedToLoadUserInfo'.tr()),
|
|
||||||
content: Text(
|
|
||||||
[
|
|
||||||
'failedToLoadUserInfoNetwork'.tr(),
|
|
||||||
error.toString(),
|
|
||||||
].join('\n\n').trim(),
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => close(false),
|
|
||||||
child: Text('okay'.tr()),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => close(true),
|
|
||||||
child: Text('retry'.tr()),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
).then((value) {
|
|
||||||
if (value == true) {
|
|
||||||
fetchUser();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
talker.error(
|
talker.error(
|
||||||
"[UserInfo] Failed to fetch user info...",
|
"[UserInfo] Failed to fetch user info...",
|
||||||
error,
|
error,
|
||||||
stackTrace,
|
stackTrace,
|
||||||
);
|
);
|
||||||
state = AsyncValue.data(null);
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> fetchUser() async {
|
||||||
|
ref.invalidateSelf();
|
||||||
|
await future;
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> logOut() async {
|
Future<void> logOut() async {
|
||||||
state = const AsyncValue.data(null);
|
state = const AsyncValue.data(null);
|
||||||
final prefs = _ref.read(sharedPreferencesProvider);
|
final prefs = ref.read(sharedPreferencesProvider);
|
||||||
await prefs.remove(kTokenPairStoreKey);
|
await prefs.remove(kTokenPairStoreKey);
|
||||||
_ref.invalidate(tokenProvider);
|
ref.invalidate(tokenProvider);
|
||||||
if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) {
|
if (kIsWeb || !(Platform.isLinux || Platform.isWindows)) {
|
||||||
FirebaseAnalytics.instance.setUserId(id: null);
|
FirebaseAnalytics.instance.setUserId(id: null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final userInfoProvider =
|
final userInfoProvider = AsyncNotifierProvider<UserInfoNotifier, SnAccount?>(
|
||||||
StateNotifierProvider<UserInfoNotifier, AsyncValue<SnAccount?>>(
|
UserInfoNotifier.new,
|
||||||
(ref) => UserInfoNotifier(ref),
|
);
|
||||||
);
|
|
||||||
|
|||||||
56
lib/pods/web_auth/web_auth_providers.dart
Normal file
56
lib/pods/web_auth/web_auth_providers.dart
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'web_auth_server.dart';
|
||||||
|
|
||||||
|
class WebAuthServerState {
|
||||||
|
final bool isRunning;
|
||||||
|
final int? port;
|
||||||
|
final Object? error;
|
||||||
|
|
||||||
|
WebAuthServerState({this.isRunning = false, this.port, this.error});
|
||||||
|
|
||||||
|
WebAuthServerState copyWith({
|
||||||
|
bool? isRunning,
|
||||||
|
int? port,
|
||||||
|
Object? error,
|
||||||
|
bool clearError = false,
|
||||||
|
}) {
|
||||||
|
return WebAuthServerState(
|
||||||
|
isRunning: isRunning ?? this.isRunning,
|
||||||
|
port: port ?? this.port,
|
||||||
|
error: clearError ? null : error ?? this.error,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class WebAuthServerNotifier extends Notifier<WebAuthServerState> {
|
||||||
|
late final WebAuthServer _server;
|
||||||
|
|
||||||
|
@override
|
||||||
|
WebAuthServerState build() {
|
||||||
|
_server = ref.watch(webAuthServerProvider);
|
||||||
|
return WebAuthServerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> start() async {
|
||||||
|
try {
|
||||||
|
final port = await _server.start();
|
||||||
|
state = state.copyWith(isRunning: true, port: port, clearError: true);
|
||||||
|
} catch (e) {
|
||||||
|
state = state.copyWith(isRunning: false, error: e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void stop() {
|
||||||
|
_server.stop();
|
||||||
|
state = state.copyWith(isRunning: false, port: null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final webAuthServerProvider = Provider<WebAuthServer>((ref) {
|
||||||
|
return WebAuthServer(ref);
|
||||||
|
});
|
||||||
|
|
||||||
|
final webAuthServerStateProvider =
|
||||||
|
NotifierProvider<WebAuthServerNotifier, WebAuthServerState>(
|
||||||
|
WebAuthServerNotifier.new,
|
||||||
|
);
|
||||||
186
lib/pods/web_auth/web_auth_server.dart
Normal file
186
lib/pods/web_auth/web_auth_server.dart
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:math';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/talker.dart';
|
||||||
|
|
||||||
|
class WebAuthServer {
|
||||||
|
final Ref _ref;
|
||||||
|
HttpServer? _server;
|
||||||
|
String? _challenge;
|
||||||
|
DateTime? _challengeTimestamp;
|
||||||
|
|
||||||
|
final _challengeTtl = const Duration(seconds: 30);
|
||||||
|
|
||||||
|
WebAuthServer(this._ref);
|
||||||
|
|
||||||
|
Future<int> start() async {
|
||||||
|
if (_server != null) {
|
||||||
|
talker.warning('Web auth server already running.');
|
||||||
|
return _server!.port;
|
||||||
|
}
|
||||||
|
|
||||||
|
final port = await _findUnusedPort(40000, 41000);
|
||||||
|
_server = await HttpServer.bind(InternetAddress.loopbackIPv4, port);
|
||||||
|
talker.info('Web auth server started on http://127.0.0.1:$port');
|
||||||
|
|
||||||
|
_server!.listen(_handleRequest);
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
void stop() {
|
||||||
|
_server?.close(force: true);
|
||||||
|
_server = null;
|
||||||
|
talker.info('Web auth server stopped.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> _findUnusedPort(int start, int end) async {
|
||||||
|
for (var port = start; port <= end; port++) {
|
||||||
|
try {
|
||||||
|
var socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, port);
|
||||||
|
await socket.close();
|
||||||
|
return port;
|
||||||
|
} catch (e) {
|
||||||
|
// Port is in use, try next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw Exception('No unused port found in range $start-$end');
|
||||||
|
}
|
||||||
|
|
||||||
|
String _generateChallenge() {
|
||||||
|
final random = Random.secure();
|
||||||
|
final values = List<int>.generate(32, (i) => random.nextInt(256));
|
||||||
|
return base64Url.encode(values);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _addCorsHeaders(HttpResponse response) {
|
||||||
|
const webUrl = 'https://app.solian.fr';
|
||||||
|
|
||||||
|
response.headers.add('Access-Control-Allow-Origin', webUrl);
|
||||||
|
response.headers.add('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
|
||||||
|
response.headers.add('Access-Control-Allow-Headers', '*');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _handleRequest(HttpRequest request) async {
|
||||||
|
try {
|
||||||
|
_addCorsHeaders(request.response);
|
||||||
|
|
||||||
|
if (request.method == 'OPTIONS') {
|
||||||
|
request.response.statusCode = HttpStatus.noContent;
|
||||||
|
await request.response.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
talker.info('Web auth request: ${request.method} ${request.uri.path}');
|
||||||
|
|
||||||
|
if (request.method == 'GET' && request.uri.path == '/alive') {
|
||||||
|
await _handleAlive(request);
|
||||||
|
} else if (request.method == 'POST' && request.uri.path == '/exchange') {
|
||||||
|
await _handleExchange(request);
|
||||||
|
} else {
|
||||||
|
request.response.statusCode = HttpStatus.notFound;
|
||||||
|
request.response.write(jsonEncode({'error': 'Not Found'}));
|
||||||
|
await request.response.close();
|
||||||
|
}
|
||||||
|
} catch (e, st) {
|
||||||
|
talker.handle(e, st, 'Error handling web auth request');
|
||||||
|
try {
|
||||||
|
request.response.statusCode = HttpStatus.internalServerError;
|
||||||
|
request.response.write(jsonEncode({'error': 'Internal Server Error'}));
|
||||||
|
await request.response.close();
|
||||||
|
} catch (e2) {
|
||||||
|
talker.error('Failed to send error response: $e2');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _handleAlive(HttpRequest request) async {
|
||||||
|
_challenge = _generateChallenge();
|
||||||
|
_challengeTimestamp = DateTime.now();
|
||||||
|
|
||||||
|
final response = {
|
||||||
|
'status': 'ok',
|
||||||
|
'challenge': _challenge,
|
||||||
|
};
|
||||||
|
|
||||||
|
request.response.statusCode = HttpStatus.ok;
|
||||||
|
request.response.headers.contentType = ContentType.json;
|
||||||
|
request.response.write(jsonEncode(response));
|
||||||
|
await request.response.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _handleExchange(HttpRequest request) async {
|
||||||
|
if (_challenge == null ||
|
||||||
|
_challengeTimestamp == null ||
|
||||||
|
DateTime.now().difference(_challengeTimestamp!) > _challengeTtl) {
|
||||||
|
request.response.statusCode = HttpStatus.badRequest;
|
||||||
|
request.response.write(jsonEncode({
|
||||||
|
'error': 'Invalid or expired challenge. Please call /alive first.'
|
||||||
|
}));
|
||||||
|
await request.response.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final requestBody = await utf8.decodeStream(request);
|
||||||
|
final Map<String, dynamic> data;
|
||||||
|
try {
|
||||||
|
data = jsonDecode(requestBody);
|
||||||
|
} catch (e) {
|
||||||
|
request.response.statusCode = HttpStatus.badRequest;
|
||||||
|
request.response.write(jsonEncode({'error': 'Invalid JSON body'}));
|
||||||
|
await request.response.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String? signedChallenge = data['signedChallenge'];
|
||||||
|
final Map<String, dynamic>? deviceInfo = data['deviceInfo'];
|
||||||
|
|
||||||
|
if (signedChallenge == null) {
|
||||||
|
request.response.statusCode = HttpStatus.badRequest;
|
||||||
|
request.response.write(jsonEncode({'error': 'Missing signedChallenge'}));
|
||||||
|
await request.response.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final currentChallenge = _challenge!;
|
||||||
|
_challenge = null;
|
||||||
|
_challengeTimestamp = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
final dio = _ref.read(apiClientProvider);
|
||||||
|
|
||||||
|
final response = await dio.post(
|
||||||
|
'/pass/auth/login/session',
|
||||||
|
data: {
|
||||||
|
'signedChallenge': signedChallenge,
|
||||||
|
'challenge': currentChallenge,
|
||||||
|
...?deviceInfo,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 200 && response.data != null) {
|
||||||
|
final webToken = response.data['token'];
|
||||||
|
request.response.statusCode = HttpStatus.ok;
|
||||||
|
request.response.write(jsonEncode({'token': webToken}));
|
||||||
|
} else {
|
||||||
|
throw Exception(
|
||||||
|
'Backend exchange failed with status ${response.statusCode}');
|
||||||
|
}
|
||||||
|
} on DioException catch (e) {
|
||||||
|
talker.error('Backend exchange failed: ${e.response?.data}');
|
||||||
|
request.response.statusCode =
|
||||||
|
e.response?.statusCode ?? HttpStatus.internalServerError;
|
||||||
|
request.response.write(
|
||||||
|
jsonEncode(e.response?.data ?? {'error': 'Backend communication failed'}));
|
||||||
|
} catch (e, st) {
|
||||||
|
talker.handle(e, st, 'Error during backend exchange');
|
||||||
|
request.response.statusCode = HttpStatus.internalServerError;
|
||||||
|
request.response
|
||||||
|
.write(jsonEncode({'error': 'An unexpected error occurred'}));
|
||||||
|
} finally {
|
||||||
|
await request.response.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,14 +16,12 @@ final webFeedListProvider = FutureProvider.family<List<SnWebFeed>, String>((
|
|||||||
.toList();
|
.toList();
|
||||||
});
|
});
|
||||||
|
|
||||||
class WebFeedNotifier
|
class WebFeedNotifier extends AsyncNotifier<SnWebFeed> {
|
||||||
extends
|
final ({String pubName, String? feedId}) arg;
|
||||||
AutoDisposeFamilyAsyncNotifier<
|
WebFeedNotifier(this.arg);
|
||||||
SnWebFeed,
|
|
||||||
({String pubName, String? feedId})
|
|
||||||
> {
|
|
||||||
@override
|
@override
|
||||||
FutureOr<SnWebFeed> build(({String pubName, String? feedId}) arg) async {
|
FutureOr<SnWebFeed> build() async {
|
||||||
if (arg.feedId == null || arg.feedId!.isEmpty) {
|
if (arg.feedId == null || arg.feedId!.isEmpty) {
|
||||||
return SnWebFeed(
|
return SnWebFeed(
|
||||||
id: '',
|
id: '',
|
||||||
|
|||||||
@@ -100,12 +100,16 @@ class WebSocketService {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDone: () {
|
onDone: () {
|
||||||
talker.info('[WebSocket] Connection closed, attempting to reconnect...');
|
talker.info(
|
||||||
|
'[WebSocket] Connection closed, attempting to reconnect...',
|
||||||
|
);
|
||||||
_scheduleReconnect();
|
_scheduleReconnect();
|
||||||
_statusStreamController.sink.add(WebSocketState.disconnected());
|
_statusStreamController.sink.add(WebSocketState.disconnected());
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
talker.error('[WebSocket] Error occurred: $error, attempting to reconnect...');
|
talker.error(
|
||||||
|
'[WebSocket] Error occurred: $error, attempting to reconnect...',
|
||||||
|
);
|
||||||
_scheduleReconnect();
|
_scheduleReconnect();
|
||||||
_statusStreamController.sink.add(
|
_statusStreamController.sink.add(
|
||||||
WebSocketState.error(error.toString()),
|
WebSocketState.error(error.toString()),
|
||||||
@@ -152,15 +156,20 @@ class WebSocketService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final websocketStateProvider =
|
final websocketStateProvider =
|
||||||
StateNotifierProvider<WebSocketStateNotifier, WebSocketState>(
|
NotifierProvider<WebSocketStateNotifier, WebSocketState>(
|
||||||
(ref) => WebSocketStateNotifier(ref),
|
WebSocketStateNotifier.new,
|
||||||
);
|
);
|
||||||
|
|
||||||
class WebSocketStateNotifier extends StateNotifier<WebSocketState> {
|
class WebSocketStateNotifier extends Notifier<WebSocketState> {
|
||||||
final Ref ref;
|
|
||||||
Timer? _reconnectTimer;
|
Timer? _reconnectTimer;
|
||||||
|
|
||||||
WebSocketStateNotifier(this.ref) : super(const WebSocketState.disconnected());
|
@override
|
||||||
|
WebSocketState build() {
|
||||||
|
ref.onDispose(() {
|
||||||
|
_reconnectTimer?.cancel();
|
||||||
|
});
|
||||||
|
return const WebSocketState.disconnected();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> connect() async {
|
Future<void> connect() async {
|
||||||
state = const WebSocketState.connecting();
|
state = const WebSocketState.connecting();
|
||||||
@@ -169,7 +178,7 @@ class WebSocketStateNotifier extends StateNotifier<WebSocketState> {
|
|||||||
await service.connect(ref);
|
await service.connect(ref);
|
||||||
state = const WebSocketState.connected();
|
state = const WebSocketState.connected();
|
||||||
service.statusStream.listen((event) {
|
service.statusStream.listen((event) {
|
||||||
if (mounted) state = event;
|
state = event;
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
state = WebSocketState.error('Failed to connect: $err');
|
state = WebSocketState.error('Failed to connect: $err');
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:island/pods/message.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/pods/userinfo.dart';
|
import 'package:island/pods/userinfo.dart';
|
||||||
|
import 'package:island/pods/websocket.dart';
|
||||||
import 'package:island/screens/notification.dart';
|
import 'package:island/screens/notification.dart';
|
||||||
import 'package:island/services/responsive.dart';
|
import 'package:island/services/responsive.dart';
|
||||||
import 'package:island/widgets/account/account_name.dart';
|
import 'package:island/widgets/account/account_name.dart';
|
||||||
@@ -55,9 +57,7 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final user = ref.watch(userInfoProvider);
|
final user = ref.watch(userInfoProvider);
|
||||||
final notificationUnreadCount = ref.watch(
|
final notificationUnreadCount = ref.watch(notificationUnreadCountProvider);
|
||||||
notificationUnreadCountNotifierProvider,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (user.value == null || user.value == null) {
|
if (user.value == null || user.value == null) {
|
||||||
return _UnauthorizedAccountScreen();
|
return _UnauthorizedAccountScreen();
|
||||||
@@ -176,6 +176,8 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
).padding(horizontal: 8),
|
).padding(horizontal: 8),
|
||||||
|
if (user.value?.activatedAt == null)
|
||||||
|
AccountUnactivatedCard().padding(horizontal: 12, bottom: 4),
|
||||||
Card(
|
Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -467,13 +469,16 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
title: Text('logout').tr(),
|
title: Text('logout').tr(),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
final ws = ref.watch(websocketStateProvider.notifier);
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
showLoadingModal(context);
|
showLoadingModal(context);
|
||||||
await apiClient.delete('/pass/accounts/me/sessions/current');
|
await apiClient.delete('/pass/accounts/me/sessions/current');
|
||||||
|
await resetDatabase(ref);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
hideLoadingModal(context);
|
hideLoadingModal(context);
|
||||||
final userNotifier = ref.read(userInfoProvider.notifier);
|
final userNotifier = ref.read(userInfoProvider.notifier);
|
||||||
userNotifier.logOut();
|
userNotifier.logOut();
|
||||||
|
ws.close();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -501,6 +506,7 @@ class _UnauthorizedAccountScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Card(
|
child: Card(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.pushNamed('createAccount');
|
context.pushNamed('createAccount');
|
||||||
},
|
},
|
||||||
@@ -523,6 +529,7 @@ class _UnauthorizedAccountScreen extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Card(
|
child: Card(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.pushNamed('login');
|
context.pushNamed('login');
|
||||||
},
|
},
|
||||||
@@ -544,26 +551,35 @@ class _UnauthorizedAccountScreen extends StatelessWidget {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pushNamed('about');
|
context.pushNamed('about');
|
||||||
},
|
},
|
||||||
child: Text('about').tr(),
|
iconSize: 18,
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
icon: const Icon(Icons.info, fill: 1),
|
||||||
|
tooltip: 'about'.tr(),
|
||||||
),
|
),
|
||||||
TextButton(
|
IconButton(
|
||||||
child: Text('debugOptions').tr(),
|
icon: const Icon(Icons.bug_report, fill: 1),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => DebugSheet(),
|
builder: (context) => DebugSheet(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
iconSize: 18,
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
tooltip: 'debugOptions'.tr(),
|
||||||
),
|
),
|
||||||
TextButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pushNamed('settings');
|
context.pushNamed('settings');
|
||||||
},
|
},
|
||||||
child: Text('appSettings').tr(),
|
icon: const Icon(Icons.settings, fill: 1),
|
||||||
|
iconSize: 18,
|
||||||
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
|
tooltip: 'appSettings'.tr(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ import 'package:gap/gap.dart';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/account.dart';
|
import 'package:island/models/account.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
|
import 'package:island/services/time.dart';
|
||||||
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'credits.g.dart';
|
part 'credits.g.dart';
|
||||||
@@ -21,40 +23,35 @@ Future<double> socialCredits(Ref ref) async {
|
|||||||
return response.data?.toDouble() ?? 0.0;
|
return response.data?.toDouble() ?? 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
final socialCreditHistoryNotifierProvider = AsyncNotifierProvider(
|
||||||
class SocialCreditHistoryNotifier extends _$SocialCreditHistoryNotifier
|
SocialCreditHistoryNotifier.new,
|
||||||
with CursorPagingNotifierMixin<SnSocialCreditRecord> {
|
);
|
||||||
static const int _pageSize = 20;
|
|
||||||
|
class SocialCreditHistoryNotifier
|
||||||
|
extends AsyncNotifier<List<SnSocialCreditRecord>>
|
||||||
|
with AsyncPaginationController<SnSocialCreditRecord> {
|
||||||
|
static const int pageSize = 20;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnSocialCreditRecord>> build() => fetch(cursor: null);
|
Future<List<SnSocialCreditRecord>> fetch() async {
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnSocialCreditRecord>> fetch({
|
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
final offset = cursor == null ? 0 : int.parse(cursor);
|
|
||||||
|
|
||||||
final queryParams = {'offset': offset, 'take': _pageSize};
|
final queryParams = {'offset': fetchedCount.toString(), 'take': pageSize};
|
||||||
|
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
'/pass/accounts/me/credits/history',
|
'/pass/accounts/me/credits/history',
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
);
|
);
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
|
||||||
final List<dynamic> data = response.data;
|
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
|
|
||||||
final records =
|
final records =
|
||||||
data.map((json) => SnSocialCreditRecord.fromJson(json)).toList();
|
response.data
|
||||||
|
.map((json) => SnSocialCreditRecord.fromJson(json))
|
||||||
|
.cast<SnSocialCreditRecord>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
final hasMore = offset + records.length < total;
|
return records;
|
||||||
final nextCursor = hasMore ? (offset + records.length).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
|
||||||
items: records,
|
|
||||||
hasMore: hasMore,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,38 +107,45 @@ class SocialCreditsTab extends HookConsumerWidget {
|
|||||||
.padding(horizontal: 20, vertical: 16),
|
.padding(horizontal: 20, vertical: 16),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: PagingHelperView(
|
child: PaginationList(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
provider: socialCreditHistoryNotifierProvider,
|
provider: socialCreditHistoryNotifierProvider,
|
||||||
futureRefreshable: socialCreditHistoryNotifierProvider.future,
|
notifier: socialCreditHistoryNotifierProvider.notifier,
|
||||||
notifierRefreshable: socialCreditHistoryNotifierProvider.notifier,
|
itemBuilder: (context, idx, record) {
|
||||||
contentBuilder:
|
final isExpired =
|
||||||
(data, widgetCount, endItemView) => ListView.builder(
|
record.expiredAt != null &&
|
||||||
padding: EdgeInsets.zero,
|
record.expiredAt!.isBefore(DateTime.now());
|
||||||
itemCount: widgetCount,
|
return ListTile(
|
||||||
itemBuilder: (context, index) {
|
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
if (index == widgetCount - 1) {
|
title: Text(
|
||||||
return endItemView;
|
record.reason,
|
||||||
}
|
style:
|
||||||
final record = data.items[index];
|
isExpired
|
||||||
return ListTile(
|
? TextStyle(
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
decoration: TextDecoration.lineThrough,
|
||||||
horizontal: 24,
|
color: Theme.of(
|
||||||
),
|
context,
|
||||||
title: Text(record.reason),
|
).colorScheme.onSurface.withOpacity(0.8),
|
||||||
subtitle: Text(
|
)
|
||||||
DateFormat.yMMMd().format(record.createdAt),
|
: null,
|
||||||
),
|
|
||||||
trailing: Text(
|
|
||||||
record.delta > 0
|
|
||||||
? '+${record.delta}'
|
|
||||||
: '${record.delta}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: record.delta > 0 ? Colors.green : Colors.red,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
subtitle: Row(
|
||||||
|
spacing: 4,
|
||||||
|
children: [
|
||||||
|
Text(record.createdAt.formatSystem()),
|
||||||
|
Text('to'),
|
||||||
|
if (record.expiredAt != null)
|
||||||
|
Text(record.expiredAt!.formatSystem()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: Text(
|
||||||
|
record.delta > 0 ? '+${record.delta}' : '${record.delta}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: record.delta > 0 ? Colors.green : Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,44 +6,38 @@ part of 'credits.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$socialCreditsHash() => r'a0284583e94bc97285c689ac2bc018536932da69';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [socialCredits].
|
|
||||||
@ProviderFor(socialCredits)
|
@ProviderFor(socialCredits)
|
||||||
final socialCreditsProvider = AutoDisposeFutureProvider<double>.internal(
|
const socialCreditsProvider = SocialCreditsProvider._();
|
||||||
socialCredits,
|
|
||||||
name: r'socialCreditsProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$socialCreditsHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class SocialCreditsProvider
|
||||||
// ignore: unused_element
|
extends $FunctionalProvider<AsyncValue<double>, double, FutureOr<double>>
|
||||||
typedef SocialCreditsRef = AutoDisposeFutureProviderRef<double>;
|
with $FutureModifier<double>, $FutureProvider<double> {
|
||||||
String _$socialCreditHistoryNotifierHash() =>
|
const SocialCreditsProvider._()
|
||||||
r'3e87af246cc5dc72a1f3a87b81d1c87169bdfb5b';
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'socialCreditsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [SocialCreditHistoryNotifier].
|
@override
|
||||||
@ProviderFor(SocialCreditHistoryNotifier)
|
String debugGetCreateSourceHash() => _$socialCreditsHash();
|
||||||
final socialCreditHistoryNotifierProvider = AutoDisposeAsyncNotifierProvider<
|
|
||||||
SocialCreditHistoryNotifier,
|
|
||||||
CursorPagingData<SnSocialCreditRecord>
|
|
||||||
>.internal(
|
|
||||||
SocialCreditHistoryNotifier.new,
|
|
||||||
name: r'socialCreditHistoryNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$socialCreditHistoryNotifierHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$SocialCreditHistoryNotifier =
|
@$internal
|
||||||
AutoDisposeAsyncNotifier<CursorPagingData<SnSocialCreditRecord>>;
|
@override
|
||||||
// ignore_for_file: type=lint
|
$FutureProviderElement<double> $createElement($ProviderPointer pointer) =>
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
$FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<double> create(Ref ref) {
|
||||||
|
return socialCredits(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$socialCreditsHash() => r'a0284583e94bc97285c689ac2bc018536932da69';
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:gap/gap.dart';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/account.dart';
|
import 'package:island/models/account.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:island/pods/userinfo.dart';
|
import 'package:island/pods/userinfo.dart';
|
||||||
import 'package:island/screens/account/credits.dart';
|
import 'package:island/screens/account/credits.dart';
|
||||||
import 'package:island/services/time.dart';
|
import 'package:island/services/time.dart';
|
||||||
@@ -10,46 +11,37 @@ import 'package:island/widgets/account/leveling_progress.dart';
|
|||||||
import 'package:island/widgets/account/stellar_program_tab.dart';
|
import 'package:island/widgets/account/stellar_program_tab.dart';
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'leveling.g.dart';
|
final levelingHistoryNotifierProvider = AsyncNotifierProvider(
|
||||||
|
LevelingHistoryNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
@riverpod
|
class LevelingHistoryNotifier extends AsyncNotifier<List<SnExperienceRecord>>
|
||||||
class LevelingHistoryNotifier extends _$LevelingHistoryNotifier
|
with AsyncPaginationController<SnExperienceRecord> {
|
||||||
with CursorPagingNotifierMixin<SnExperienceRecord> {
|
static const int pageSize = 20;
|
||||||
static const int _pageSize = 20;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnExperienceRecord>> build() => fetch(cursor: null);
|
Future<List<SnExperienceRecord>> fetch() async {
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnExperienceRecord>> fetch({
|
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
final offset = cursor == null ? 0 : int.parse(cursor);
|
|
||||||
|
|
||||||
final queryParams = {'offset': offset, 'take': _pageSize};
|
final queryParams = {'offset': fetchedCount.toString(), 'take': pageSize};
|
||||||
|
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
'/pass/accounts/me/leveling',
|
'/pass/accounts/me/leveling',
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
);
|
);
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
|
||||||
final List<dynamic> data = response.data;
|
|
||||||
final records =
|
|
||||||
data.map((json) => SnExperienceRecord.fromJson(json)).toList();
|
|
||||||
|
|
||||||
final hasMore = offset + records.length < total;
|
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
final nextCursor = hasMore ? (offset + records.length).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
final List<SnExperienceRecord> records =
|
||||||
items: records,
|
response.data
|
||||||
hasMore: hasMore,
|
.map((json) => SnExperienceRecord.fromJson(json))
|
||||||
nextCursor: nextCursor,
|
.cast<SnExperienceRecord>()
|
||||||
);
|
.toList();
|
||||||
|
|
||||||
|
return records;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,52 +181,42 @@ class LevelingScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SliverGap(8),
|
const SliverGap(8),
|
||||||
PagingHelperSliverView(
|
PaginationList(
|
||||||
provider: levelingHistoryNotifierProvider,
|
provider: levelingHistoryNotifierProvider,
|
||||||
futureRefreshable: levelingHistoryNotifierProvider.future,
|
notifier: levelingHistoryNotifierProvider.notifier,
|
||||||
notifierRefreshable: levelingHistoryNotifierProvider.notifier,
|
isRefreshable: false,
|
||||||
contentBuilder:
|
isSliver: true,
|
||||||
(data, widgetCount, endItemView) => SliverList.builder(
|
itemBuilder:
|
||||||
itemCount: widgetCount,
|
(context, idx, record) => ListTile(
|
||||||
itemBuilder: (context, index) {
|
title: Column(
|
||||||
if (index == widgetCount - 1) {
|
mainAxisSize: MainAxisSize.min,
|
||||||
return endItemView;
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
}
|
children: [
|
||||||
final record = data.items[index];
|
Text(record.reason),
|
||||||
return ListTile(
|
Row(
|
||||||
title: Column(
|
spacing: 4,
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
Text(record.reason),
|
|
||||||
Row(
|
|
||||||
spacing: 4,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
record.createdAt.formatRelative(context),
|
|
||||||
).fontSize(13),
|
|
||||||
Text('·').fontSize(13).bold(),
|
|
||||||
Text(
|
|
||||||
record.createdAt.formatSystem(),
|
|
||||||
).fontSize(13),
|
|
||||||
],
|
|
||||||
).opacity(0.8),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
subtitle: Row(
|
|
||||||
spacing: 8,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${record.delta > 0 ? '+' : ''}${record.delta} EXP',
|
record.createdAt.formatRelative(context),
|
||||||
),
|
).fontSize(13),
|
||||||
if (record.bonusMultiplier != 1.0)
|
Text('·').fontSize(13).bold(),
|
||||||
Text('x${record.bonusMultiplier}'),
|
Text(record.createdAt.formatSystem()).fontSize(13),
|
||||||
],
|
],
|
||||||
|
).opacity(0.8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
subtitle: Row(
|
||||||
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${record.delta > 0 ? '+' : ''}${record.delta} EXP',
|
||||||
),
|
),
|
||||||
minTileHeight: 56,
|
if (record.bonusMultiplier != 1.0)
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 4),
|
Text('x${record.bonusMultiplier}'),
|
||||||
);
|
],
|
||||||
},
|
),
|
||||||
|
minTileHeight: 56,
|
||||||
|
contentPadding: EdgeInsets.symmetric(horizontal: 4),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'leveling.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// RiverpodGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
String _$levelingHistoryNotifierHash() =>
|
|
||||||
r'de51012e1590ac46388b6f3f2050b21cb96698d1';
|
|
||||||
|
|
||||||
/// See also [LevelingHistoryNotifier].
|
|
||||||
@ProviderFor(LevelingHistoryNotifier)
|
|
||||||
final levelingHistoryNotifierProvider = AutoDisposeAsyncNotifierProvider<
|
|
||||||
LevelingHistoryNotifier,
|
|
||||||
CursorPagingData<SnExperienceRecord>
|
|
||||||
>.internal(
|
|
||||||
LevelingHistoryNotifier.new,
|
|
||||||
name: r'levelingHistoryNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$levelingHistoryNotifierHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$LevelingHistoryNotifier =
|
|
||||||
AutoDisposeAsyncNotifier<CursorPagingData<SnExperienceRecord>>;
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
@@ -62,6 +62,7 @@ class AccountSettingsScreen extends HookConsumerWidget {
|
|||||||
final confirm = await showConfirmAlert(
|
final confirm = await showConfirmAlert(
|
||||||
'accountDeletionHint'.tr(),
|
'accountDeletionHint'.tr(),
|
||||||
'accountDeletion'.tr(),
|
'accountDeletion'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (!confirm || !context.mounted) return;
|
if (!confirm || !context.mounted) return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -6,64 +6,129 @@ part of 'account_settings.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(authFactors)
|
||||||
|
const authFactorsProvider = AuthFactorsProvider._();
|
||||||
|
|
||||||
|
final class AuthFactorsProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<List<SnAuthFactor>>,
|
||||||
|
List<SnAuthFactor>,
|
||||||
|
FutureOr<List<SnAuthFactor>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnAuthFactor>>,
|
||||||
|
$FutureProvider<List<SnAuthFactor>> {
|
||||||
|
const AuthFactorsProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'authFactorsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$authFactorsHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnAuthFactor>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<SnAuthFactor>> create(Ref ref) {
|
||||||
|
return authFactors(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$authFactorsHash() => r'ed87d7dbd421fef0a5620416727c3dc598c97ef5';
|
String _$authFactorsHash() => r'ed87d7dbd421fef0a5620416727c3dc598c97ef5';
|
||||||
|
|
||||||
/// See also [authFactors].
|
@ProviderFor(contactMethods)
|
||||||
@ProviderFor(authFactors)
|
const contactMethodsProvider = ContactMethodsProvider._();
|
||||||
final authFactorsProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnAuthFactor>>.internal(
|
final class ContactMethodsProvider
|
||||||
authFactors,
|
extends
|
||||||
name: r'authFactorsProvider',
|
$FunctionalProvider<
|
||||||
debugGetCreateSourceHash:
|
AsyncValue<List<SnContactMethod>>,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
List<SnContactMethod>,
|
||||||
? null
|
FutureOr<List<SnContactMethod>>
|
||||||
: _$authFactorsHash,
|
>
|
||||||
dependencies: null,
|
with
|
||||||
allTransitiveDependencies: null,
|
$FutureModifier<List<SnContactMethod>>,
|
||||||
);
|
$FutureProvider<List<SnContactMethod>> {
|
||||||
|
const ContactMethodsProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'contactMethodsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$contactMethodsHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnContactMethod>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<SnContactMethod>> create(Ref ref) {
|
||||||
|
return contactMethods(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef AuthFactorsRef = AutoDisposeFutureProviderRef<List<SnAuthFactor>>;
|
|
||||||
String _$contactMethodsHash() => r'1d3d03e9ffbf36126236558ead22cb7d88bb9cb2';
|
String _$contactMethodsHash() => r'1d3d03e9ffbf36126236558ead22cb7d88bb9cb2';
|
||||||
|
|
||||||
/// See also [contactMethods].
|
@ProviderFor(accountConnections)
|
||||||
@ProviderFor(contactMethods)
|
const accountConnectionsProvider = AccountConnectionsProvider._();
|
||||||
final contactMethodsProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnContactMethod>>.internal(
|
final class AccountConnectionsProvider
|
||||||
contactMethods,
|
extends
|
||||||
name: r'contactMethodsProvider',
|
$FunctionalProvider<
|
||||||
debugGetCreateSourceHash:
|
AsyncValue<List<SnAccountConnection>>,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
List<SnAccountConnection>,
|
||||||
? null
|
FutureOr<List<SnAccountConnection>>
|
||||||
: _$contactMethodsHash,
|
>
|
||||||
dependencies: null,
|
with
|
||||||
allTransitiveDependencies: null,
|
$FutureModifier<List<SnAccountConnection>>,
|
||||||
);
|
$FutureProvider<List<SnAccountConnection>> {
|
||||||
|
const AccountConnectionsProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'accountConnectionsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$accountConnectionsHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnAccountConnection>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<SnAccountConnection>> create(Ref ref) {
|
||||||
|
return accountConnections(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef ContactMethodsRef = AutoDisposeFutureProviderRef<List<SnContactMethod>>;
|
|
||||||
String _$accountConnectionsHash() =>
|
String _$accountConnectionsHash() =>
|
||||||
r'33c10b98962ede6c428d4028c0d5f2f12ff0eb22';
|
r'33c10b98962ede6c428d4028c0d5f2f12ff0eb22';
|
||||||
|
|
||||||
/// See also [accountConnections].
|
|
||||||
@ProviderFor(accountConnections)
|
|
||||||
final accountConnectionsProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnAccountConnection>>.internal(
|
|
||||||
accountConnections,
|
|
||||||
name: r'accountConnectionsProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$accountConnectionsHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef AccountConnectionsRef =
|
|
||||||
AutoDisposeFutureProviderRef<List<SnAccountConnection>>;
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class AuthFactorSheet extends HookConsumerWidget {
|
|||||||
final confirm = await showConfirmAlert(
|
final confirm = await showConfirmAlert(
|
||||||
'authFactorDeleteHint'.tr(),
|
'authFactorDeleteHint'.tr(),
|
||||||
'authFactorDelete'.tr(),
|
'authFactorDelete'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (!confirm || !context.mounted) return;
|
if (!confirm || !context.mounted) return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class AccountConnectionSheet extends HookConsumerWidget {
|
|||||||
final confirm = await showConfirmAlert(
|
final confirm = await showConfirmAlert(
|
||||||
'accountConnectionDeleteHint'.tr(),
|
'accountConnectionDeleteHint'.tr(),
|
||||||
'accountConnectionDelete'.tr(),
|
'accountConnectionDelete'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (!confirm || !context.mounted) return;
|
if (!confirm || !context.mounted) return;
|
||||||
try {
|
try {
|
||||||
@@ -332,6 +333,7 @@ class AccountConnectionsSheet extends HookConsumerWidget {
|
|||||||
final confirm = await showConfirmAlert(
|
final confirm = await showConfirmAlert(
|
||||||
'accountConnectionDeleteHint'.tr(),
|
'accountConnectionDeleteHint'.tr(),
|
||||||
'accountConnectionDelete'.tr(),
|
'accountConnectionDelete'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (confirm && context.mounted) {
|
if (confirm && context.mounted) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class ContactMethodSheet extends HookConsumerWidget {
|
|||||||
final confirm = await showConfirmAlert(
|
final confirm = await showConfirmAlert(
|
||||||
'contactMethodDeleteHint'.tr(),
|
'contactMethodDeleteHint'.tr(),
|
||||||
'contactMethodDelete'.tr(),
|
'contactMethodDelete'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (!confirm || !context.mounted) return;
|
if (!confirm || !context.mounted) return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,16 +3,17 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:island/pods/userinfo.dart';
|
import 'package:island/pods/userinfo.dart';
|
||||||
import 'package:island/widgets/account/account_pfc.dart';
|
import 'package:island/widgets/account/account_pfc.dart';
|
||||||
import 'package:island/widgets/account/account_picker.dart';
|
import 'package:island/widgets/account/account_picker.dart';
|
||||||
import 'package:island/widgets/alert.dart';
|
import 'package:island/widgets/alert.dart';
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:island/widgets/content/cloud_files.dart';
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:relative_time/relative_time.dart';
|
import 'package:relative_time/relative_time.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:island/models/relationship.dart';
|
import 'package:island/models/relationship.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
|
||||||
@@ -28,39 +29,31 @@ Future<List<SnRelationship>> sentFriendRequest(Ref ref) async {
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
final relationshipListNotifierProvider = AsyncNotifierProvider(
|
||||||
class RelationshipListNotifier extends _$RelationshipListNotifier
|
RelationshipListNotifier.new,
|
||||||
with CursorPagingNotifierMixin<SnRelationship> {
|
);
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnRelationship>> build() => fetch(cursor: null);
|
|
||||||
|
|
||||||
|
class RelationshipListNotifier extends AsyncNotifier<List<SnRelationship>>
|
||||||
|
with AsyncPaginationController<SnRelationship> {
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnRelationship>> fetch({
|
Future<List<SnRelationship>> fetch() async {
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
final offset = cursor == null ? 0 : int.parse(cursor);
|
|
||||||
final take = 20;
|
final take = 20;
|
||||||
|
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
'/pass/relationships',
|
'/pass/relationships',
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
queryParameters: {'offset': fetchedCount.toString(), 'take': take},
|
||||||
);
|
);
|
||||||
|
|
||||||
final List<SnRelationship> items =
|
final List<SnRelationship> items =
|
||||||
(response.data as List)
|
(response.data as List)
|
||||||
.map((e) => SnRelationship.fromJson(e as Map<String, dynamic>))
|
.map((e) => SnRelationship.fromJson(e as Map<String, dynamic>))
|
||||||
|
.cast<SnRelationship>()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
final total = int.tryParse(response.headers['x-total']?.first ?? '') ?? 0;
|
totalCount = int.tryParse(response.headers['x-total']?.first ?? '') ?? 0;
|
||||||
final hasMore = offset + items.length < total;
|
|
||||||
final nextCursor = hasMore ? (offset + items.length).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
return items;
|
||||||
items: items,
|
|
||||||
hasMore: hasMore,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +235,7 @@ class RelationshipScreen extends HookConsumerWidget {
|
|||||||
await client.post(
|
await client.post(
|
||||||
'/pass/relationships/${relationship.accountId}/friends/${isAccept ? 'accept' : 'decline'}',
|
'/pass/relationships/${relationship.accountId}/friends/${isAccept ? 'accept' : 'decline'}',
|
||||||
);
|
);
|
||||||
relationshipNotifier.forceRefresh();
|
relationshipNotifier.refresh();
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
if (isAccept) {
|
if (isAccept) {
|
||||||
showSnackBar(
|
showSnackBar(
|
||||||
@@ -270,7 +263,7 @@ class RelationshipScreen extends HookConsumerWidget {
|
|||||||
'/pass/relationships/${relationship.accountId}',
|
'/pass/relationships/${relationship.accountId}',
|
||||||
data: {'status': newStatus},
|
data: {'status': newStatus},
|
||||||
);
|
);
|
||||||
relationshipNotifier.forceRefresh();
|
relationshipNotifier.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
final user = ref.watch(userInfoProvider);
|
final user = ref.watch(userInfoProvider);
|
||||||
@@ -305,32 +298,20 @@ class RelationshipScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
const Divider(height: 1),
|
const Divider(height: 1),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: PagingHelperView(
|
child: PaginationList(
|
||||||
provider: relationshipListNotifierProvider,
|
provider: relationshipListNotifierProvider,
|
||||||
futureRefreshable: relationshipListNotifierProvider.future,
|
notifier: relationshipListNotifierProvider.notifier,
|
||||||
notifierRefreshable: relationshipListNotifierProvider.notifier,
|
itemBuilder: (context, index, relationship) {
|
||||||
contentBuilder:
|
return RelationshipListTile(
|
||||||
(data, widgetCount, endItemView) => ListView.builder(
|
relationship: relationship,
|
||||||
padding: EdgeInsets.zero,
|
submitting: submitting.value,
|
||||||
itemCount: widgetCount,
|
onAccept: () => handleFriendRequest(relationship, true),
|
||||||
itemBuilder: (context, index) {
|
onDecline: () => handleFriendRequest(relationship, false),
|
||||||
if (index == widgetCount - 1) {
|
currentUserId: user.value?.id,
|
||||||
return endItemView;
|
showRelatedAccount: false,
|
||||||
}
|
onUpdateStatus: updateRelationship,
|
||||||
|
);
|
||||||
final relationship = data.items[index];
|
},
|
||||||
return RelationshipListTile(
|
|
||||||
relationship: relationship,
|
|
||||||
submitting: submitting.value,
|
|
||||||
onAccept: () => handleFriendRequest(relationship, true),
|
|
||||||
onDecline:
|
|
||||||
() => handleFriendRequest(relationship, false),
|
|
||||||
currentUserId: user.value?.id,
|
|
||||||
showRelatedAccount: false,
|
|
||||||
onUpdateStatus: updateRelationship,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,46 +6,46 @@ part of 'relationship.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$sentFriendRequestHash() => r'0c52813eb6f86c05f6e0b1e4e840d0d9c350aa9e';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [sentFriendRequest].
|
|
||||||
@ProviderFor(sentFriendRequest)
|
@ProviderFor(sentFriendRequest)
|
||||||
final sentFriendRequestProvider =
|
const sentFriendRequestProvider = SentFriendRequestProvider._();
|
||||||
AutoDisposeFutureProvider<List<SnRelationship>>.internal(
|
|
||||||
sentFriendRequest,
|
|
||||||
name: r'sentFriendRequestProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$sentFriendRequestHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class SentFriendRequestProvider
|
||||||
// ignore: unused_element
|
extends
|
||||||
typedef SentFriendRequestRef =
|
$FunctionalProvider<
|
||||||
AutoDisposeFutureProviderRef<List<SnRelationship>>;
|
AsyncValue<List<SnRelationship>>,
|
||||||
String _$relationshipListNotifierHash() =>
|
List<SnRelationship>,
|
||||||
r'fc46920256f7c48445c00652165e879890f2c9a3';
|
FutureOr<List<SnRelationship>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnRelationship>>,
|
||||||
|
$FutureProvider<List<SnRelationship>> {
|
||||||
|
const SentFriendRequestProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'sentFriendRequestProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [RelationshipListNotifier].
|
@override
|
||||||
@ProviderFor(RelationshipListNotifier)
|
String debugGetCreateSourceHash() => _$sentFriendRequestHash();
|
||||||
final relationshipListNotifierProvider = AutoDisposeAsyncNotifierProvider<
|
|
||||||
RelationshipListNotifier,
|
|
||||||
CursorPagingData<SnRelationship>
|
|
||||||
>.internal(
|
|
||||||
RelationshipListNotifier.new,
|
|
||||||
name: r'relationshipListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$relationshipListNotifierHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$RelationshipListNotifier =
|
@$internal
|
||||||
AutoDisposeAsyncNotifier<CursorPagingData<SnRelationship>>;
|
@override
|
||||||
// ignore_for_file: type=lint
|
$FutureProviderElement<List<SnRelationship>> $createElement(
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<List<SnRelationship>> create(Ref ref) {
|
||||||
|
return sentFriendRequest(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$sentFriendRequestHash() => r'0c52813eb6f86c05f6e0b1e4e840d0d9c350aa9e';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -6,21 +6,38 @@ part of 'captcha.config.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$captchaUrlHash() => r'5d59de4f26a0544bf4fbd5209943f0b111959ce6';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [captchaUrl].
|
|
||||||
@ProviderFor(captchaUrl)
|
@ProviderFor(captchaUrl)
|
||||||
final captchaUrlProvider = AutoDisposeFutureProvider<String>.internal(
|
const captchaUrlProvider = CaptchaUrlProvider._();
|
||||||
captchaUrl,
|
|
||||||
name: r'captchaUrlProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$captchaUrlHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class CaptchaUrlProvider
|
||||||
// ignore: unused_element
|
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
|
||||||
typedef CaptchaUrlRef = AutoDisposeFutureProviderRef<String>;
|
with $FutureModifier<String>, $FutureProvider<String> {
|
||||||
// ignore_for_file: type=lint
|
const CaptchaUrlProvider._()
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'captchaUrlProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$captchaUrlHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
|
||||||
|
$FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<String> create(Ref ref) {
|
||||||
|
return captchaUrl(ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$captchaUrlHash() => r'5d59de4f26a0544bf4fbd5209943f0b111959ce6';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,20 @@ final Map<int, (String, String, IconData)> kFactorTypes = {
|
|||||||
4: ('authFactorPin', 'authFactorPinDescription', Symbols.nest_secure_alarm),
|
4: ('authFactorPin', 'authFactorPinDescription', Symbols.nest_secure_alarm),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Performs post-login tasks including fetching user info, subscribing to push
|
||||||
|
/// notifications, connecting websocket, and closing the login dialog.
|
||||||
|
Future<void> performPostLogin(BuildContext context, WidgetRef ref) async {
|
||||||
|
final userNotifier = ref.read(userInfoProvider.notifier);
|
||||||
|
await userNotifier.fetchUser();
|
||||||
|
final apiClient = ref.read(apiClientProvider);
|
||||||
|
subscribePushNotification(apiClient);
|
||||||
|
final wsNotifier = ref.read(websocketStateProvider.notifier);
|
||||||
|
wsNotifier.connect();
|
||||||
|
if (context.mounted && Navigator.canPop(context)) {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class _LoginCheckScreen extends HookConsumerWidget {
|
class _LoginCheckScreen extends HookConsumerWidget {
|
||||||
final SnAuthChallenge? challenge;
|
final SnAuthChallenge? challenge;
|
||||||
final SnAuthFactor? factor;
|
final SnAuthFactor? factor;
|
||||||
@@ -80,14 +94,7 @@ class _LoginCheckScreen extends HookConsumerWidget {
|
|||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
|
|
||||||
// Do post login tasks
|
// Do post login tasks
|
||||||
final userNotifier = ref.read(userInfoProvider.notifier);
|
await performPostLogin(context, ref);
|
||||||
userNotifier.fetchUser().then((_) {
|
|
||||||
final apiClient = ref.read(apiClientProvider);
|
|
||||||
subscribePushNotification(apiClient);
|
|
||||||
final wsNotifier = ref.read(websocketStateProvider.notifier);
|
|
||||||
wsNotifier.connect();
|
|
||||||
if (context.mounted) Navigator.pop(context, true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
@@ -628,17 +635,13 @@ class _LoginLookupScreen extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final challenge = SnAuthChallenge.fromJson(resp.data);
|
final token = resp.data['token'];
|
||||||
onChallenge(challenge);
|
setToken(ref.watch(sharedPreferencesProvider), token);
|
||||||
final factorResp = await client.get(
|
ref.invalidate(tokenProvider);
|
||||||
'/pass/auth/challenge/${challenge.id}/factors',
|
if (!context.mounted) return;
|
||||||
);
|
|
||||||
onFactor(
|
// Do post login tasks
|
||||||
List<SnAuthFactor>.from(
|
await performPostLogin(context, ref);
|
||||||
factorResp.data.map((ele) => SnAuthFactor.fromJson(ele)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
onNext();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err is SignInWithAppleAuthorizationException) return;
|
if (err is SignInWithAppleAuthorizationException) return;
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ class CallScreen extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final ongoingCall = ref.watch(ongoingCallProvider(room.id));
|
final ongoingCall = ref.watch(ongoingCallProvider(room.id));
|
||||||
final callState = ref.watch(callNotifierProvider);
|
final callState = ref.watch(callProvider);
|
||||||
final callNotifier = ref.watch(callNotifierProvider.notifier);
|
final callNotifier = ref.watch(callProvider.notifier);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
talker.info('[Call] Joining the call...');
|
talker.info('[Call] Joining the call...');
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
|
||||||
import 'package:dio/dio.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
@@ -8,10 +6,6 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
|||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/models/file.dart';
|
|
||||||
import 'package:island/models/account.dart';
|
|
||||||
import 'package:island/pods/database.dart';
|
|
||||||
import 'package:island/pods/chat/call.dart';
|
|
||||||
import 'package:island/pods/chat/chat_summary.dart';
|
import 'package:island/pods/chat/chat_summary.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/pods/userinfo.dart';
|
import 'package:island/pods/userinfo.dart';
|
||||||
@@ -26,10 +20,9 @@ import 'package:island/widgets/navigation/fab_menu.dart';
|
|||||||
import 'package:island/widgets/response.dart';
|
import 'package:island/widgets/response.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:relative_time/relative_time.dart';
|
import 'package:relative_time/relative_time.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||||
part 'chat.g.dart';
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
|
|
||||||
class ChatRoomListTile extends HookConsumerWidget {
|
class ChatRoomListTile extends HookConsumerWidget {
|
||||||
final SnChatRoom room;
|
final SnChatRoom room;
|
||||||
@@ -184,96 +177,6 @@ class ChatRoomListTile extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
|
||||||
Future<List<SnChatRoom>> chatroomsJoined(Ref ref) async {
|
|
||||||
final db = ref.watch(databaseProvider);
|
|
||||||
|
|
||||||
try {
|
|
||||||
final localRoomsData = await db.select(db.chatRooms).get();
|
|
||||||
if (localRoomsData.isNotEmpty) {
|
|
||||||
final localRooms = await Future.wait(
|
|
||||||
localRoomsData.map((row) async {
|
|
||||||
final membersRows =
|
|
||||||
await (db.select(db.chatMembers)
|
|
||||||
..where((m) => m.chatRoomId.equals(row.id))).get();
|
|
||||||
final members =
|
|
||||||
membersRows.map((mRow) {
|
|
||||||
final account = SnAccount.fromJson(mRow.account);
|
|
||||||
SnAccountStatus? status;
|
|
||||||
if (mRow.status != null) {
|
|
||||||
status = SnAccountStatus.fromJson(jsonDecode(mRow.status!));
|
|
||||||
}
|
|
||||||
return SnChatMember(
|
|
||||||
id: mRow.id,
|
|
||||||
chatRoomId: mRow.chatRoomId,
|
|
||||||
accountId: mRow.accountId,
|
|
||||||
account: account,
|
|
||||||
nick: mRow.nick,
|
|
||||||
role: mRow.role,
|
|
||||||
notify: mRow.notify,
|
|
||||||
joinedAt: mRow.joinedAt,
|
|
||||||
breakUntil: mRow.breakUntil,
|
|
||||||
timeoutUntil: mRow.timeoutUntil,
|
|
||||||
isBot: mRow.isBot,
|
|
||||||
status: status,
|
|
||||||
lastTyped: mRow.lastTyped,
|
|
||||||
createdAt: mRow.createdAt,
|
|
||||||
updatedAt: mRow.updatedAt,
|
|
||||||
deletedAt: mRow.deletedAt,
|
|
||||||
chatRoom: null,
|
|
||||||
);
|
|
||||||
}).toList();
|
|
||||||
return SnChatRoom(
|
|
||||||
id: row.id,
|
|
||||||
name: row.name,
|
|
||||||
description: row.description,
|
|
||||||
type: row.type,
|
|
||||||
isPublic: row.isPublic!,
|
|
||||||
isCommunity: row.isCommunity!,
|
|
||||||
picture:
|
|
||||||
row.picture != null ? SnCloudFile.fromJson(row.picture!) : null,
|
|
||||||
background:
|
|
||||||
row.background != null
|
|
||||||
? SnCloudFile.fromJson(row.background!)
|
|
||||||
: null,
|
|
||||||
realmId: row.realmId,
|
|
||||||
realm: null,
|
|
||||||
createdAt: row.createdAt,
|
|
||||||
updatedAt: row.updatedAt,
|
|
||||||
deletedAt: row.deletedAt,
|
|
||||||
members: members,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Background sync
|
|
||||||
Future(() async {
|
|
||||||
try {
|
|
||||||
final client = ref.read(apiClientProvider);
|
|
||||||
final resp = await client.get('/sphere/chat');
|
|
||||||
final remoteRooms =
|
|
||||||
resp.data
|
|
||||||
.map((e) => SnChatRoom.fromJson(e))
|
|
||||||
.cast<SnChatRoom>()
|
|
||||||
.toList();
|
|
||||||
await db.saveChatRooms(remoteRooms);
|
|
||||||
ref.invalidateSelf();
|
|
||||||
} catch (_) {}
|
|
||||||
}).ignore();
|
|
||||||
|
|
||||||
return localRooms;
|
|
||||||
}
|
|
||||||
} catch (_) {}
|
|
||||||
|
|
||||||
// Fallback to API
|
|
||||||
final client = ref.watch(apiClientProvider);
|
|
||||||
final resp = await client.get('/sphere/chat');
|
|
||||||
final rooms =
|
|
||||||
resp.data.map((e) => SnChatRoom.fromJson(e)).cast<SnChatRoom>().toList();
|
|
||||||
await db.saveChatRooms(rooms);
|
|
||||||
return rooms;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ChatListBodyWidget extends HookConsumerWidget {
|
class ChatListBodyWidget extends HookConsumerWidget {
|
||||||
final bool isFloating;
|
final bool isFloating;
|
||||||
final TabController tabController;
|
final TabController tabController;
|
||||||
@@ -288,8 +191,7 @@ class ChatListBodyWidget extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final chats = ref.watch(chatroomsJoinedProvider);
|
final chats = ref.watch(chatRoomJoinedProvider);
|
||||||
final callState = ref.watch(callNotifierProvider);
|
|
||||||
|
|
||||||
Widget bodyWidget = Column(
|
Widget bodyWidget = Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -312,12 +214,10 @@ class ChatListBodyWidget extends HookConsumerWidget {
|
|||||||
(items) => RefreshIndicator(
|
(items) => RefreshIndicator(
|
||||||
onRefresh:
|
onRefresh:
|
||||||
() => Future.sync(() {
|
() => Future.sync(() {
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
}),
|
}),
|
||||||
child: ListView.builder(
|
child: SuperListView.builder(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(bottom: 96),
|
||||||
bottom: callState.isConnected ? 96 : 0,
|
|
||||||
),
|
|
||||||
itemCount:
|
itemCount:
|
||||||
items
|
items
|
||||||
.where(
|
.where(
|
||||||
@@ -364,7 +264,7 @@ class ChatListBodyWidget extends HookConsumerWidget {
|
|||||||
(error, stack) => ResponseErrorWidget(
|
(error, stack) => ResponseErrorWidget(
|
||||||
error: error,
|
error: error,
|
||||||
onRetry: () {
|
onRetry: () {
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -441,7 +341,7 @@ class ChatListScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
// Listen for chat rooms refresh events
|
// Listen for chat rooms refresh events
|
||||||
final subscription = eventBus.on<ChatRoomsRefreshEvent>().listen((event) {
|
final subscription = eventBus.on<ChatRoomsRefreshEvent>().listen((event) {
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () {
|
return () {
|
||||||
@@ -453,13 +353,14 @@ class ChatListScreen extends HookConsumerWidget {
|
|||||||
// Set FAB type to chat
|
// Set FAB type to chat
|
||||||
final fabMenuNotifier = ref.read(fabMenuTypeProvider.notifier);
|
final fabMenuNotifier = ref.read(fabMenuTypeProvider.notifier);
|
||||||
Future(() {
|
Future(() {
|
||||||
fabMenuNotifier.state = FabMenuType.chat;
|
fabMenuNotifier.setMenuType(FabMenuType.chat);
|
||||||
});
|
});
|
||||||
return () {
|
return () {
|
||||||
// Clean up: reset FAB type to main
|
// Clean up: reset FAB type to main
|
||||||
|
final fabMenu = ref.read(fabMenuTypeProvider);
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (fabMenuNotifier.state == FabMenuType.chat) {
|
if (fabMenu == FabMenuType.chat) {
|
||||||
fabMenuNotifier.state = FabMenuType.main;
|
fabMenuNotifier.setMenuType(FabMenuType.main);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -609,46 +510,6 @@ class ChatListScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
|
||||||
Future<SnChatRoom?> chatroom(Ref ref, String? identifier) async {
|
|
||||||
if (identifier == null) return null;
|
|
||||||
try {
|
|
||||||
final client = ref.watch(apiClientProvider);
|
|
||||||
final resp = await client.get('/sphere/chat/$identifier');
|
|
||||||
return SnChatRoom.fromJson(resp.data);
|
|
||||||
} catch (err) {
|
|
||||||
if (err is DioException && err.response?.statusCode == 404) {
|
|
||||||
return null; // Chat room not found
|
|
||||||
}
|
|
||||||
rethrow; // Rethrow other errors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@riverpod
|
|
||||||
Future<SnChatMember?> chatroomIdentity(Ref ref, String? identifier) async {
|
|
||||||
if (identifier == null) return null;
|
|
||||||
try {
|
|
||||||
final client = ref.watch(apiClientProvider);
|
|
||||||
final resp = await client.get('/sphere/chat/$identifier/members/me');
|
|
||||||
return SnChatMember.fromJson(resp.data);
|
|
||||||
} catch (err) {
|
|
||||||
if (err is DioException && err.response?.statusCode == 404) {
|
|
||||||
return null; // Chat member not found
|
|
||||||
}
|
|
||||||
rethrow; // Rethrow other errors
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@riverpod
|
|
||||||
Future<List<SnChatMember>> chatroomInvites(Ref ref) async {
|
|
||||||
final client = ref.watch(apiClientProvider);
|
|
||||||
final resp = await client.get('/sphere/chat/invites');
|
|
||||||
return resp.data
|
|
||||||
.map((e) => SnChatMember.fromJson(e))
|
|
||||||
.cast<SnChatMember>()
|
|
||||||
.toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatInvitesSheet extends HookConsumerWidget {
|
class _ChatInvitesSheet extends HookConsumerWidget {
|
||||||
const _ChatInvitesSheet();
|
const _ChatInvitesSheet();
|
||||||
|
|
||||||
@@ -661,7 +522,7 @@ class _ChatInvitesSheet extends HookConsumerWidget {
|
|||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
await client.post('/sphere/chat/invites/${invite.chatRoom!.id}/accept');
|
await client.post('/sphere/chat/invites/${invite.chatRoom!.id}/accept');
|
||||||
ref.invalidate(chatroomInvitesProvider);
|
ref.invalidate(chatroomInvitesProvider);
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
}
|
}
|
||||||
@@ -712,16 +573,6 @@ class _ChatInvitesSheet extends HookConsumerWidget {
|
|||||||
subtitle: Row(
|
subtitle: Row(
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
|
||||||
child:
|
|
||||||
Text(
|
|
||||||
invite.role >= 100
|
|
||||||
? 'permissionOwner'
|
|
||||||
: invite.role >= 50
|
|
||||||
? 'permissionModerator'
|
|
||||||
: 'permissionMember',
|
|
||||||
).tr(),
|
|
||||||
),
|
|
||||||
if (invite.chatRoom!.type == 1)
|
if (invite.chatRoom!.type == 1)
|
||||||
Badge(
|
Badge(
|
||||||
label: const Text('directMessage').tr(),
|
label: const Text('directMessage').tr(),
|
||||||
|
|||||||
@@ -1,309 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'chat.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// RiverpodGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
String _$chatroomsJoinedHash() => r'9523efecd1869e7dd26adfc8ec87be48db19ee1c';
|
|
||||||
|
|
||||||
/// See also [chatroomsJoined].
|
|
||||||
@ProviderFor(chatroomsJoined)
|
|
||||||
final chatroomsJoinedProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnChatRoom>>.internal(
|
|
||||||
chatroomsJoined,
|
|
||||||
name: r'chatroomsJoinedProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatroomsJoinedHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef ChatroomsJoinedRef = AutoDisposeFutureProviderRef<List<SnChatRoom>>;
|
|
||||||
String _$chatroomHash() => r'2b17d94728026420d18d6c383d2400cf4a070913';
|
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [chatroom].
|
|
||||||
@ProviderFor(chatroom)
|
|
||||||
const chatroomProvider = ChatroomFamily();
|
|
||||||
|
|
||||||
/// See also [chatroom].
|
|
||||||
class ChatroomFamily extends Family<AsyncValue<SnChatRoom?>> {
|
|
||||||
/// See also [chatroom].
|
|
||||||
const ChatroomFamily();
|
|
||||||
|
|
||||||
/// See also [chatroom].
|
|
||||||
ChatroomProvider call(String? identifier) {
|
|
||||||
return ChatroomProvider(identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
ChatroomProvider getProviderOverride(covariant ChatroomProvider provider) {
|
|
||||||
return call(provider.identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'chatroomProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [chatroom].
|
|
||||||
class ChatroomProvider extends AutoDisposeFutureProvider<SnChatRoom?> {
|
|
||||||
/// See also [chatroom].
|
|
||||||
ChatroomProvider(String? identifier)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => chatroom(ref as ChatroomRef, identifier),
|
|
||||||
from: chatroomProvider,
|
|
||||||
name: r'chatroomProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatroomHash,
|
|
||||||
dependencies: ChatroomFamily._dependencies,
|
|
||||||
allTransitiveDependencies: ChatroomFamily._allTransitiveDependencies,
|
|
||||||
identifier: identifier,
|
|
||||||
);
|
|
||||||
|
|
||||||
ChatroomProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.identifier,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? identifier;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<SnChatRoom?> Function(ChatroomRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: ChatroomProvider._internal(
|
|
||||||
(ref) => create(ref as ChatroomRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
identifier: identifier,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnChatRoom?> createElement() {
|
|
||||||
return _ChatroomProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is ChatroomProvider && other.identifier == identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, identifier.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin ChatroomRef on AutoDisposeFutureProviderRef<SnChatRoom?> {
|
|
||||||
/// The parameter `identifier` of this provider.
|
|
||||||
String? get identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatroomProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnChatRoom?>
|
|
||||||
with ChatroomRef {
|
|
||||||
_ChatroomProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get identifier => (origin as ChatroomProvider).identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$chatroomIdentityHash() => r'35e19a5a3e31752c79b97ba0358a7ec8fb8f6e99';
|
|
||||||
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
@ProviderFor(chatroomIdentity)
|
|
||||||
const chatroomIdentityProvider = ChatroomIdentityFamily();
|
|
||||||
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
class ChatroomIdentityFamily extends Family<AsyncValue<SnChatMember?>> {
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
const ChatroomIdentityFamily();
|
|
||||||
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
ChatroomIdentityProvider call(String? identifier) {
|
|
||||||
return ChatroomIdentityProvider(identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
ChatroomIdentityProvider getProviderOverride(
|
|
||||||
covariant ChatroomIdentityProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'chatroomIdentityProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
class ChatroomIdentityProvider
|
|
||||||
extends AutoDisposeFutureProvider<SnChatMember?> {
|
|
||||||
/// See also [chatroomIdentity].
|
|
||||||
ChatroomIdentityProvider(String? identifier)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => chatroomIdentity(ref as ChatroomIdentityRef, identifier),
|
|
||||||
from: chatroomIdentityProvider,
|
|
||||||
name: r'chatroomIdentityProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatroomIdentityHash,
|
|
||||||
dependencies: ChatroomIdentityFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
ChatroomIdentityFamily._allTransitiveDependencies,
|
|
||||||
identifier: identifier,
|
|
||||||
);
|
|
||||||
|
|
||||||
ChatroomIdentityProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.identifier,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? identifier;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<SnChatMember?> Function(ChatroomIdentityRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: ChatroomIdentityProvider._internal(
|
|
||||||
(ref) => create(ref as ChatroomIdentityRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
identifier: identifier,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnChatMember?> createElement() {
|
|
||||||
return _ChatroomIdentityProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is ChatroomIdentityProvider && other.identifier == identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, identifier.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin ChatroomIdentityRef on AutoDisposeFutureProviderRef<SnChatMember?> {
|
|
||||||
/// The parameter `identifier` of this provider.
|
|
||||||
String? get identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatroomIdentityProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnChatMember?>
|
|
||||||
with ChatroomIdentityRef {
|
|
||||||
_ChatroomIdentityProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get identifier => (origin as ChatroomIdentityProvider).identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$chatroomInvitesHash() => r'5cd6391b09c5517ede19bacce43b45c8d71dd087';
|
|
||||||
|
|
||||||
/// See also [chatroomInvites].
|
|
||||||
@ProviderFor(chatroomInvites)
|
|
||||||
final chatroomInvitesProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnChatMember>>.internal(
|
|
||||||
chatroomInvites,
|
|
||||||
name: r'chatroomInvitesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatroomInvitesHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef ChatroomInvitesRef = AutoDisposeFutureProviderRef<List<SnChatMember>>;
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
@@ -10,8 +10,8 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/models/file.dart';
|
import 'package:island/models/file.dart';
|
||||||
import 'package:island/models/realm.dart';
|
import 'package:island/models/realm.dart';
|
||||||
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
|
||||||
import 'package:island/screens/realm/realms.dart';
|
import 'package:island/screens/realm/realms.dart';
|
||||||
import 'package:island/services/file.dart';
|
import 'package:island/services/file.dart';
|
||||||
import 'package:island/services/file_uploader.dart';
|
import 'package:island/services/file_uploader.dart';
|
||||||
@@ -47,7 +47,7 @@ class EditChatScreen extends HookConsumerWidget {
|
|||||||
final isPublic = useState(true);
|
final isPublic = useState(true);
|
||||||
final isCommunity = useState(false);
|
final isCommunity = useState(false);
|
||||||
|
|
||||||
final chat = ref.watch(chatroomProvider(id));
|
final chat = ref.watch(chatRoomProvider(id));
|
||||||
|
|
||||||
final joinedRealms = ref.watch(realmsJoinedProvider);
|
final joinedRealms = ref.watch(realmsJoinedProvider);
|
||||||
final currentRealm = useState<SnRealm?>(null);
|
final currentRealm = useState<SnRealm?>(null);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import "package:flutter_hooks/flutter_hooks.dart";
|
|||||||
import "package:gap/gap.dart";
|
import "package:gap/gap.dart";
|
||||||
import "package:hooks_riverpod/hooks_riverpod.dart";
|
import "package:hooks_riverpod/hooks_riverpod.dart";
|
||||||
import "package:island/database/message.dart";
|
import "package:island/database/message.dart";
|
||||||
import "package:island/screens/chat/chat.dart";
|
import "package:island/pods/chat/chat_room.dart";
|
||||||
import "package:island/widgets/content/cloud_files.dart";
|
import "package:island/widgets/content/cloud_files.dart";
|
||||||
import "package:super_sliver_list/super_sliver_list.dart";
|
import "package:super_sliver_list/super_sliver_list.dart";
|
||||||
import "package:easy_localization/easy_localization.dart";
|
import "package:easy_localization/easy_localization.dart";
|
||||||
@@ -27,8 +27,8 @@ class PublicRoomPreview extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final messages = ref.watch(messagesNotifierProvider(id));
|
final messages = ref.watch(messagesProvider(id));
|
||||||
final messagesNotifier = ref.read(messagesNotifierProvider(id).notifier);
|
final messagesNotifier = ref.read(messagesProvider(id).notifier);
|
||||||
final scrollController = useScrollController();
|
final scrollController = useScrollController();
|
||||||
|
|
||||||
final listController = useMemoized(() => ListController(), []);
|
final listController = useMemoized(() => ListController(), []);
|
||||||
@@ -203,7 +203,7 @@ class PublicRoomPreview extends HookConsumerWidget {
|
|||||||
showLoadingModal(context);
|
showLoadingModal(context);
|
||||||
final apiClient = ref.read(apiClientProvider);
|
final apiClient = ref.read(apiClientProvider);
|
||||||
await apiClient.post('/sphere/chat/${room.id}/members/me');
|
await apiClient.post('/sphere/chat/${room.id}/members/me');
|
||||||
ref.invalidate(chatroomIdentityProvider(id));
|
ref.invalidate(chatRoomIdentityProvider(id));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import "dart:async";
|
|||||||
import "dart:math" as math;
|
import "dart:math" as math;
|
||||||
import "package:easy_localization/easy_localization.dart";
|
import "package:easy_localization/easy_localization.dart";
|
||||||
import "package:file_picker/file_picker.dart";
|
import "package:file_picker/file_picker.dart";
|
||||||
|
import "package:google_fonts/google_fonts.dart";
|
||||||
import "package:image_picker/image_picker.dart";
|
import "package:image_picker/image_picker.dart";
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:go_router/go_router.dart";
|
import "package:go_router/go_router.dart";
|
||||||
@@ -13,15 +14,15 @@ import "package:island/models/chat.dart";
|
|||||||
import "package:island/models/file.dart";
|
import "package:island/models/file.dart";
|
||||||
import "package:island/models/poll.dart";
|
import "package:island/models/poll.dart";
|
||||||
import "package:island/models/wallet.dart";
|
import "package:island/models/wallet.dart";
|
||||||
import "package:island/pods/chat/chat_rooms.dart";
|
import "package:island/pods/chat/chat_room.dart";
|
||||||
import "package:island/pods/chat/chat_subscribe.dart";
|
import "package:island/pods/chat/chat_subscribe.dart";
|
||||||
import "package:island/pods/chat/messages_notifier.dart";
|
import "package:island/pods/chat/messages_notifier.dart";
|
||||||
import "package:island/pods/network.dart";
|
import "package:island/pods/network.dart";
|
||||||
import "package:island/pods/chat/chat_online_count.dart";
|
import "package:island/pods/chat/chat_online_count.dart";
|
||||||
import "package:island/pods/config.dart";
|
import "package:island/pods/config.dart";
|
||||||
|
import "package:island/pods/userinfo.dart";
|
||||||
import "package:island/screens/chat/search_messages.dart";
|
import "package:island/screens/chat/search_messages.dart";
|
||||||
import "package:island/services/file_uploader.dart";
|
import "package:island/services/file_uploader.dart";
|
||||||
import "package:island/screens/chat/chat.dart";
|
|
||||||
import "package:island/services/responsive.dart";
|
import "package:island/services/responsive.dart";
|
||||||
import "package:island/widgets/alert.dart";
|
import "package:island/widgets/alert.dart";
|
||||||
import "package:island/widgets/app_scaffold.dart";
|
import "package:island/widgets/app_scaffold.dart";
|
||||||
@@ -47,13 +48,11 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final chatRoom = ref.watch(chatroomProvider(id));
|
final chatRoom = ref.watch(chatRoomProvider(id));
|
||||||
final chatIdentity = ref.watch(chatroomIdentityProvider(id));
|
final chatIdentity = ref.watch(chatRoomIdentityProvider(id));
|
||||||
final isSyncing = ref.watch(isSyncingProvider);
|
final isSyncing = ref.watch(chatSyncingProvider);
|
||||||
final onlineCount = ref.watch(chatOnlineCountNotifierProvider(id));
|
final onlineCount = ref.watch(chatOnlineCountProvider(id));
|
||||||
final settings = ref.watch(appSettingsNotifierProvider);
|
final settings = ref.watch(appSettingsProvider);
|
||||||
|
|
||||||
final hasOnlineCount = onlineCount.hasValue;
|
|
||||||
|
|
||||||
if (chatIdentity.isLoading || chatRoom.isLoading) {
|
if (chatIdentity.isLoading || chatRoom.isLoading) {
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
@@ -101,7 +100,7 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
await apiClient.post(
|
await apiClient.post(
|
||||||
'/sphere/chat/${room.id}/members/me',
|
'/sphere/chat/${room.id}/members/me',
|
||||||
);
|
);
|
||||||
ref.invalidate(chatroomIdentityProvider(id));
|
ref.invalidate(chatRoomIdentityProvider(id));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -130,17 +129,15 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
appBar: AppBar(leading: const PageBackButton()),
|
appBar: AppBar(leading: const PageBackButton()),
|
||||||
body: ResponseErrorWidget(
|
body: ResponseErrorWidget(
|
||||||
error: error,
|
error: error,
|
||||||
onRetry: () => ref.refresh(chatroomProvider(id)),
|
onRetry: () => ref.refresh(chatRoomProvider(id)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final messages = ref.watch(messagesNotifierProvider(id));
|
final messages = ref.watch(messagesProvider(id));
|
||||||
final messagesNotifier = ref.read(messagesNotifierProvider(id).notifier);
|
final messagesNotifier = ref.read(messagesProvider(id).notifier);
|
||||||
final chatSubscribeNotifier = ref.read(
|
final chatSubscribeNotifier = ref.read(chatSubscribeProvider(id).notifier);
|
||||||
chatSubscribeNotifierProvider(id).notifier,
|
|
||||||
);
|
|
||||||
|
|
||||||
final messageController = useTextEditingController();
|
final messageController = useTextEditingController();
|
||||||
final scrollController = useScrollController();
|
final scrollController = useScrollController();
|
||||||
@@ -383,7 +380,7 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
// Convert selected message IDs to message data
|
// Convert selected message IDs to message data
|
||||||
final selectedMessageData =
|
final selectedMessageData =
|
||||||
messages.valueOrNull
|
messages.value
|
||||||
?.where((msg) => selectedMessages.value.contains(msg.id))
|
?.where((msg) => selectedMessages.value.contains(msg.id))
|
||||||
.map(
|
.map(
|
||||||
(msg) => {
|
(msg) => {
|
||||||
@@ -409,66 +406,58 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
final compactHeader = isWideScreen(context);
|
final compactHeader = isWideScreen(context);
|
||||||
|
|
||||||
Widget onlineIndicator() => Row(
|
final userInfo = ref.watch(userInfoProvider);
|
||||||
spacing: 8,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
List<SnChatMember> getValidMembers(List<SnChatMember> members) {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
return members
|
||||||
children: [
|
.where((member) => member.accountId != userInfo.value?.id)
|
||||||
Container(
|
.toList();
|
||||||
width: 8,
|
}
|
||||||
height: 8,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
color: (onlineCount as AsyncData).value > 1 ? Colors.green : null,
|
|
||||||
border:
|
|
||||||
(onlineCount as AsyncData).value <= 1
|
|
||||||
? Border.all(color: Colors.grey)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'${(onlineCount as AsyncData).value} online',
|
|
||||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
|
||||||
color: Theme.of(context).appBarTheme.foregroundColor!,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
Widget comfortHeaderWidget(SnChatRoom? room) => Column(
|
Widget comfortHeaderWidget(SnChatRoom? room) => Column(
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Badge(
|
||||||
height: 26,
|
isLabelVisible: (onlineCount.value ?? 0) > 1,
|
||||||
width: 26,
|
label: Text('${(onlineCount.value ?? 0)}'),
|
||||||
child:
|
textStyle: GoogleFonts.robotoMono(fontSize: 10),
|
||||||
(room!.type == 1 && room.picture?.id == null)
|
textColor: Colors.white,
|
||||||
? SplitAvatarWidget(
|
backgroundColor:
|
||||||
filesId:
|
(onlineCount.value ?? 0) > 1 ? Colors.green : Colors.grey,
|
||||||
room.members!
|
offset: Offset(6, 14),
|
||||||
.map((e) => e.account.profile.picture?.id)
|
child: SizedBox(
|
||||||
.toList(),
|
height: 26,
|
||||||
)
|
width: 26,
|
||||||
: room.picture?.id != null
|
child:
|
||||||
? ProfilePictureWidget(
|
(room!.type == 1 && room.picture?.id == null)
|
||||||
fileId: room.picture?.id,
|
? SplitAvatarWidget(
|
||||||
fallbackIcon: Symbols.chat,
|
filesId:
|
||||||
)
|
getValidMembers(
|
||||||
: CircleAvatar(
|
room.members!,
|
||||||
child: Text(
|
).map((e) => e.account.profile.picture?.id).toList(),
|
||||||
room.name![0].toUpperCase(),
|
)
|
||||||
style: const TextStyle(fontSize: 12),
|
: room.picture?.id != null
|
||||||
|
? ProfilePictureWidget(
|
||||||
|
fileId: room.picture?.id,
|
||||||
|
fallbackIcon: Symbols.chat,
|
||||||
|
)
|
||||||
|
: CircleAvatar(
|
||||||
|
child: Text(
|
||||||
|
room.name![0].toUpperCase(),
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
(room.type == 1 && room.name == null)
|
(room.type == 1 && room.name == null)
|
||||||
? room.members!.map((e) => e.account.nick).join(', ')
|
? getValidMembers(
|
||||||
|
room.members!,
|
||||||
|
).map((e) => e.account.nick).join(', ')
|
||||||
: room.name!,
|
: room.name!,
|
||||||
).fontSize(15),
|
).fontSize(15),
|
||||||
if (hasOnlineCount) onlineIndicator(),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -477,35 +466,45 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Badge(
|
||||||
height: 28,
|
isLabelVisible: (onlineCount.value ?? 0) > 1,
|
||||||
width: 28,
|
label: Text('${(onlineCount.value ?? 0)}'),
|
||||||
child:
|
textStyle: GoogleFonts.robotoMono(fontSize: 10),
|
||||||
(room!.type == 1 && room.picture?.id == null)
|
backgroundColor:
|
||||||
? SplitAvatarWidget(
|
(onlineCount.value ?? 0) > 1 ? Colors.green : Colors.grey,
|
||||||
filesId:
|
textColor: Colors.white,
|
||||||
room.members!
|
offset: Offset(6, 14),
|
||||||
.map((e) => e.account.profile.picture?.id)
|
child: SizedBox(
|
||||||
.toList(),
|
height: 28,
|
||||||
)
|
width: 28,
|
||||||
: room.picture?.id != null
|
child:
|
||||||
? ProfilePictureWidget(
|
(room!.type == 1 && room.picture?.id == null)
|
||||||
fileId: room.picture?.id,
|
? SplitAvatarWidget(
|
||||||
fallbackIcon: Symbols.chat,
|
filesId:
|
||||||
)
|
getValidMembers(
|
||||||
: CircleAvatar(
|
room.members!,
|
||||||
child: Text(
|
).map((e) => e.account.profile.picture?.id).toList(),
|
||||||
room.name![0].toUpperCase(),
|
)
|
||||||
style: const TextStyle(fontSize: 12),
|
: room.picture?.id != null
|
||||||
|
? ProfilePictureWidget(
|
||||||
|
fileId: room.picture?.id,
|
||||||
|
fallbackIcon: Symbols.chat,
|
||||||
|
)
|
||||||
|
: CircleAvatar(
|
||||||
|
child: Text(
|
||||||
|
room.name![0].toUpperCase(),
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
(room.type == 1 && room.name == null)
|
(room.type == 1 && room.name == null)
|
||||||
? room.members!.map((e) => e.account.nick).join(', ')
|
? getValidMembers(
|
||||||
|
room.members!,
|
||||||
|
).map((e) => e.account.nick).join(', ')
|
||||||
: room.name!,
|
: room.name!,
|
||||||
).fontSize(19),
|
).fontSize(19),
|
||||||
if (hasOnlineCount) onlineIndicator().padding(left: 4, top: 6),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -654,76 +653,96 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget chatMessageListWidget(
|
Widget chatMessageListWidget(List<LocalChatMessage> messageList) =>
|
||||||
List<LocalChatMessage> messageList,
|
ValueListenableBuilder<double>(
|
||||||
) => AnimatedPadding(
|
valueListenable: inputHeight,
|
||||||
duration: const Duration(milliseconds: 200),
|
builder: (context, height, child) {
|
||||||
curve: Curves.easeOut,
|
return TweenAnimationBuilder<EdgeInsets>(
|
||||||
padding: EdgeInsets.only(
|
duration: const Duration(milliseconds: 200),
|
||||||
bottom: MediaQuery.of(context).padding.bottom + 8 + inputHeight.value,
|
curve: Curves.easeOut,
|
||||||
),
|
tween: EdgeInsetsTween(
|
||||||
child: SuperListView.builder(
|
begin: EdgeInsets.only(
|
||||||
listController: listController,
|
top: MediaQuery.of(context).padding.top,
|
||||||
controller: scrollController,
|
bottom: MediaQuery.of(context).padding.bottom + 8 + height,
|
||||||
reverse: true, // Show newest messages at the bottom
|
|
||||||
itemCount: messageList.length,
|
|
||||||
findChildIndexCallback: (key) {
|
|
||||||
if (key is! ValueKey<String>) return null;
|
|
||||||
final messageId = key.value.substring(messageKeyPrefix.length);
|
|
||||||
final index = messageList.indexWhere(
|
|
||||||
(m) => (m.nonce ?? m.id) == messageId,
|
|
||||||
);
|
|
||||||
return index >= 0 ? index : null;
|
|
||||||
},
|
|
||||||
extentEstimation: (_, _) => 40,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final message = messageList[index];
|
|
||||||
final nextMessage =
|
|
||||||
index < messageList.length - 1 ? messageList[index + 1] : null;
|
|
||||||
final isLastInGroup =
|
|
||||||
nextMessage == null ||
|
|
||||||
nextMessage.senderId != message.senderId ||
|
|
||||||
nextMessage.createdAt
|
|
||||||
.difference(message.createdAt)
|
|
||||||
.inMinutes
|
|
||||||
.abs() >
|
|
||||||
3;
|
|
||||||
|
|
||||||
final key = Key('$messageKeyPrefix${message.nonce ?? message.id}');
|
|
||||||
|
|
||||||
return MessageItemWrapper(
|
|
||||||
key: key,
|
|
||||||
message: message,
|
|
||||||
index: index,
|
|
||||||
isLastInGroup: isLastInGroup,
|
|
||||||
isSelectionMode: isSelectionMode.value,
|
|
||||||
selectedMessages: selectedMessages.value,
|
|
||||||
chatIdentity: chatIdentity,
|
|
||||||
toggleSelectionMode: toggleSelectionMode,
|
|
||||||
toggleMessageSelection: toggleMessageSelection,
|
|
||||||
onMessageAction: onMessageAction,
|
|
||||||
onJump:
|
|
||||||
(messageId) => scrollToMessage(
|
|
||||||
messageId: messageId,
|
|
||||||
messageList: messageList,
|
|
||||||
messagesNotifier: messagesNotifier,
|
|
||||||
listController: listController,
|
|
||||||
scrollController: scrollController,
|
|
||||||
ref: ref,
|
|
||||||
),
|
),
|
||||||
attachmentProgress: attachmentProgress.value,
|
end: EdgeInsets.only(
|
||||||
disableAnimation: settings.disableAnimation,
|
top: MediaQuery.of(context).padding.top,
|
||||||
roomOpenTime: roomOpenTime,
|
bottom: MediaQuery.of(context).padding.bottom + 8 + height,
|
||||||
);
|
),
|
||||||
},
|
),
|
||||||
),
|
builder: (context, padding, child) {
|
||||||
);
|
return SuperListView.builder(
|
||||||
|
listController: listController,
|
||||||
|
controller: scrollController,
|
||||||
|
reverse: true, // Show newest messages at the bottom
|
||||||
|
padding: padding,
|
||||||
|
itemCount: messageList.length,
|
||||||
|
findChildIndexCallback: (key) {
|
||||||
|
if (key is! ValueKey<String>) return null;
|
||||||
|
final messageId = key.value.substring(
|
||||||
|
messageKeyPrefix.length,
|
||||||
|
);
|
||||||
|
final index = messageList.indexWhere(
|
||||||
|
(m) => (m.nonce ?? m.id) == messageId,
|
||||||
|
);
|
||||||
|
return index >= 0 ? index : null;
|
||||||
|
},
|
||||||
|
extentEstimation: (_, _) => 40,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final message = messageList[index];
|
||||||
|
final nextMessage =
|
||||||
|
index < messageList.length - 1
|
||||||
|
? messageList[index + 1]
|
||||||
|
: null;
|
||||||
|
final isLastInGroup =
|
||||||
|
nextMessage == null ||
|
||||||
|
nextMessage.senderId != message.senderId ||
|
||||||
|
nextMessage.createdAt
|
||||||
|
.difference(message.createdAt)
|
||||||
|
.inMinutes
|
||||||
|
.abs() >
|
||||||
|
3;
|
||||||
|
|
||||||
|
final key = Key(
|
||||||
|
'$messageKeyPrefix${message.nonce ?? message.id}',
|
||||||
|
);
|
||||||
|
|
||||||
|
return MessageItemWrapper(
|
||||||
|
key: key,
|
||||||
|
message: message,
|
||||||
|
index: index,
|
||||||
|
isLastInGroup: isLastInGroup,
|
||||||
|
isSelectionMode: isSelectionMode.value,
|
||||||
|
selectedMessages: selectedMessages.value,
|
||||||
|
chatIdentity: chatIdentity,
|
||||||
|
toggleSelectionMode: toggleSelectionMode,
|
||||||
|
toggleMessageSelection: toggleMessageSelection,
|
||||||
|
onMessageAction: onMessageAction,
|
||||||
|
onJump:
|
||||||
|
(messageId) => scrollToMessage(
|
||||||
|
messageId: messageId,
|
||||||
|
messageList: messageList,
|
||||||
|
messagesNotifier: messagesNotifier,
|
||||||
|
listController: listController,
|
||||||
|
scrollController: scrollController,
|
||||||
|
ref: ref,
|
||||||
|
),
|
||||||
|
attachmentProgress: attachmentProgress.value,
|
||||||
|
disableAnimation: settings.disableAnimation,
|
||||||
|
roomOpenTime: roomOpenTime,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: !compactHeader ? const Center(child: PageBackButton()) : null,
|
leading: !compactHeader ? const Center(child: PageBackButton()) : null,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
toolbarHeight: compactHeader ? null : 80,
|
toolbarHeight: compactHeader ? null : 74,
|
||||||
title: chatRoom.when(
|
title: chatRoom.when(
|
||||||
data:
|
data:
|
||||||
(room) =>
|
(room) =>
|
||||||
@@ -750,8 +769,7 @@ class ChatRoomScreen extends HookConsumerWidget {
|
|||||||
'chatDetail',
|
'chatDetail',
|
||||||
pathParameters: {'id': id},
|
pathParameters: {'id': id},
|
||||||
);
|
);
|
||||||
if (result is SearchMessagesResult &&
|
if (result is SearchMessagesResult && messages.value != null) {
|
||||||
messages.valueOrNull != null) {
|
|
||||||
final messageId = result.messageId;
|
final messageId = result.messageId;
|
||||||
|
|
||||||
// Jump to the message and trigger flash effect
|
// Jump to the message and trigger flash effect
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import 'package:dio/dio.dart';
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:island/widgets/account/account_pfc.dart';
|
import 'package:island/widgets/account/account_pfc.dart';
|
||||||
import 'package:island/widgets/account/account_picker.dart';
|
import 'package:island/widgets/account/account_picker.dart';
|
||||||
import 'package:island/widgets/account/status.dart';
|
import 'package:island/widgets/account/status.dart';
|
||||||
@@ -17,9 +16,9 @@ import 'package:island/widgets/app_scaffold.dart';
|
|||||||
import 'package:island/widgets/content/cloud_files.dart';
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
import 'package:island/widgets/content/sheet.dart';
|
import 'package:island/widgets/content/sheet.dart';
|
||||||
import 'package:island/screens/chat/chat_form.dart';
|
import 'package:island/screens/chat/chat_form.dart';
|
||||||
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:island/pods/database.dart';
|
import 'package:island/pods/database.dart';
|
||||||
import 'package:island/screens/chat/search_messages.dart';
|
import 'package:island/screens/chat/search_messages.dart';
|
||||||
@@ -39,8 +38,8 @@ class ChatDetailScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final roomState = ref.watch(chatroomProvider(id));
|
final roomState = ref.watch(chatRoomProvider(id));
|
||||||
final roomIdentity = ref.watch(chatroomIdentityProvider(id));
|
final roomIdentity = ref.watch(chatRoomIdentityProvider(id));
|
||||||
final totalMessages = ref.watch(totalMessagesCountProvider(id));
|
final totalMessages = ref.watch(totalMessagesCountProvider(id));
|
||||||
|
|
||||||
const kNotifyLevelText = [
|
const kNotifyLevelText = [
|
||||||
@@ -56,7 +55,7 @@ class ChatDetailScreen extends HookConsumerWidget {
|
|||||||
'/sphere/chat/$id/members/me/notify',
|
'/sphere/chat/$id/members/me/notify',
|
||||||
data: {'notify_level': level},
|
data: {'notify_level': level},
|
||||||
);
|
);
|
||||||
ref.invalidate(chatroomIdentityProvider(id));
|
ref.invalidate(chatRoomIdentityProvider(id));
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
showSnackBar(
|
showSnackBar(
|
||||||
'chatNotifyLevelUpdated'.tr(args: [kNotifyLevelText[level].tr()]),
|
'chatNotifyLevelUpdated'.tr(args: [kNotifyLevelText[level].tr()]),
|
||||||
@@ -74,7 +73,7 @@ class ChatDetailScreen extends HookConsumerWidget {
|
|||||||
'/sphere/chat/$id/members/me/notify',
|
'/sphere/chat/$id/members/me/notify',
|
||||||
data: {'break_until': until.toUtc().toIso8601String()},
|
data: {'break_until': until.toUtc().toIso8601String()},
|
||||||
);
|
);
|
||||||
ref.invalidate(chatroomProvider(id));
|
ref.invalidate(chatRoomIdentityProvider(id));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
}
|
}
|
||||||
@@ -439,13 +438,18 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final chatIdentity = ref.watch(chatroomIdentityProvider(id));
|
final chatIdentity = ref.watch(chatRoomIdentityProvider(id));
|
||||||
|
final chatRoom = ref.watch(chatRoomProvider(id));
|
||||||
|
|
||||||
|
final isManagable =
|
||||||
|
chatIdentity.value?.accountId == chatRoom.value?.accountId ||
|
||||||
|
chatRoom.value?.type == 1;
|
||||||
|
|
||||||
return PopupMenuButton(
|
return PopupMenuButton(
|
||||||
icon: Icon(Icons.more_vert, shadows: [iconShadow]),
|
icon: Icon(Icons.more_vert, shadows: [iconShadow]),
|
||||||
itemBuilder:
|
itemBuilder:
|
||||||
(context) => [
|
(context) => [
|
||||||
if ((chatIdentity.value?.role ?? 0) >= 50)
|
if (isManagable)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
@@ -456,7 +460,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
|
|||||||
).then((value) {
|
).then((value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
// Invalidate to refresh room data after edit
|
// Invalidate to refresh room data after edit
|
||||||
ref.invalidate(chatroomProvider(id));
|
ref.invalidate(chatMemberListProvider(id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -471,7 +475,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if ((chatIdentity.value?.role ?? 0) >= 100)
|
if (isManagable)
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -487,11 +491,12 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
|
|||||||
showConfirmAlert(
|
showConfirmAlert(
|
||||||
'deleteChatRoomHint'.tr(),
|
'deleteChatRoomHint'.tr(),
|
||||||
'deleteChatRoom'.tr(),
|
'deleteChatRoom'.tr(),
|
||||||
|
isDanger: true,
|
||||||
).then((confirm) async {
|
).then((confirm) async {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
final client = ref.watch(apiClientProvider);
|
final client = ref.watch(apiClientProvider);
|
||||||
await client.delete('/sphere/chat/$id');
|
await client.delete('/sphere/chat/$id');
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
@@ -524,7 +529,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget {
|
|||||||
if (confirm) {
|
if (confirm) {
|
||||||
final client = ref.watch(apiClientProvider);
|
final client = ref.watch(apiClientProvider);
|
||||||
await client.delete('/sphere/chat/$id/members/me');
|
await client.delete('/sphere/chat/$id/members/me');
|
||||||
ref.invalidate(chatroomsJoinedProvider);
|
ref.invalidate(chatRoomJoinedProvider);
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.pop();
|
context.pop();
|
||||||
}
|
}
|
||||||
@@ -547,86 +552,37 @@ sealed class ChatRoomMemberState with _$ChatRoomMemberState {
|
|||||||
}) = _ChatRoomMemberState;
|
}) = _ChatRoomMemberState;
|
||||||
}
|
}
|
||||||
|
|
||||||
final chatMemberStateProvider = StateNotifierProvider.family<
|
final chatMemberListProvider = AsyncNotifierProvider.autoDispose.family(
|
||||||
ChatMemberNotifier,
|
ChatMemberListNotifier.new,
|
||||||
ChatRoomMemberState,
|
);
|
||||||
String
|
|
||||||
>((ref, roomId) {
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
|
||||||
return ChatMemberNotifier(apiClient, roomId);
|
|
||||||
});
|
|
||||||
|
|
||||||
class ChatMemberNotifier extends StateNotifier<ChatRoomMemberState> {
|
class ChatMemberListNotifier extends AsyncNotifier<List<SnChatMember>>
|
||||||
final String roomId;
|
with AsyncPaginationController<SnChatMember> {
|
||||||
final Dio _apiClient;
|
static const pageSize = 20;
|
||||||
|
|
||||||
ChatMemberNotifier(this._apiClient, this.roomId)
|
final String arg;
|
||||||
: super(const ChatRoomMemberState(members: [], isLoading: false, total: 0));
|
ChatMemberListNotifier(this.arg);
|
||||||
|
|
||||||
Future<void> loadMore({int offset = 0, int take = 20}) async {
|
|
||||||
if (state.isLoading) return;
|
|
||||||
if (state.total > 0 && state.members.length >= state.total) return;
|
|
||||||
|
|
||||||
state = state.copyWith(isLoading: true, error: null);
|
|
||||||
|
|
||||||
try {
|
|
||||||
final response = await _apiClient.get(
|
|
||||||
'/sphere/chat/$roomId/members',
|
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
|
||||||
);
|
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
|
||||||
final List<dynamic> data = response.data;
|
|
||||||
final members = data.map((e) => SnChatMember.fromJson(e)).toList();
|
|
||||||
|
|
||||||
state = state.copyWith(
|
|
||||||
members: [...state.members, ...members],
|
|
||||||
total: total,
|
|
||||||
isLoading: false,
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
state = state.copyWith(error: e.toString(), isLoading: false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset() {
|
|
||||||
state = const ChatRoomMemberState(members: [], isLoading: false, total: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@riverpod
|
|
||||||
class ChatMemberListNotifier extends _$ChatMemberListNotifier
|
|
||||||
with CursorPagingNotifierMixin<SnChatMember> {
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnChatMember>> build(String roomId) {
|
|
||||||
return fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnChatMember>> fetch({String? cursor}) async {
|
Future<List<SnChatMember>> fetch() async {
|
||||||
final offset = cursor == null ? 0 : int.parse(cursor);
|
|
||||||
final take = 20;
|
|
||||||
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
final response = await apiClient.get(
|
final response = await apiClient.get(
|
||||||
'/sphere/chat/$roomId/members',
|
'/sphere/chat/$arg/members',
|
||||||
queryParameters: {'offset': offset, 'take': take, 'withStatus': true},
|
queryParameters: {
|
||||||
|
'offset': fetchedCount.toString(),
|
||||||
|
'take': pageSize,
|
||||||
|
'withStatus': true,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
final List<dynamic> data = response.data;
|
final members =
|
||||||
final members = data.map((e) => SnChatMember.fromJson(e)).toList();
|
response.data
|
||||||
|
.map((e) => SnChatMember.fromJson(e))
|
||||||
|
.cast<SnChatMember>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
// Calculate next cursor based on total count
|
return members;
|
||||||
final nextOffset = offset + members.length;
|
|
||||||
final String? nextCursor =
|
|
||||||
nextOffset < total ? nextOffset.toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
|
||||||
items: members,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
hasMore: members.length < total,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,20 +592,14 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final memberListProvider = chatMemberListNotifierProvider(roomId);
|
final memberNotifier = ref.read(chatMemberListProvider(roomId).notifier);
|
||||||
|
|
||||||
// For backward compatibility and to show total count in the header
|
final roomIdentity = ref.watch(chatRoomIdentityProvider(roomId));
|
||||||
final memberState = ref.watch(chatMemberStateProvider(roomId));
|
final chatRoom = ref.watch(chatRoomProvider(roomId));
|
||||||
final memberNotifier = ref.read(chatMemberStateProvider(roomId).notifier);
|
|
||||||
|
|
||||||
final roomIdentity = ref.watch(chatroomIdentityProvider(roomId));
|
final isManagable =
|
||||||
|
chatRoom.value?.accountId == roomIdentity.value?.accountId ||
|
||||||
useEffect(() {
|
chatRoom.value?.type == 1;
|
||||||
Future(() {
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
Future<void> invitePerson() async {
|
Future<void> invitePerson() async {
|
||||||
final result = await showModalBottomSheet(
|
final result = await showModalBottomSheet(
|
||||||
@@ -665,10 +615,7 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
'/sphere/chat/invites/$roomId',
|
'/sphere/chat/invites/$roomId',
|
||||||
data: {'related_user_id': result.id, 'role': 0},
|
data: {'related_user_id': result.id, 'role': 0},
|
||||||
);
|
);
|
||||||
// Refresh both providers
|
memberNotifier.refresh();
|
||||||
memberNotifier.reset();
|
|
||||||
await memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
}
|
}
|
||||||
@@ -685,7 +632,7 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'members'.plural(memberState.total),
|
'members'.plural(memberNotifier.totalCount ?? 0),
|
||||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
letterSpacing: -0.5,
|
letterSpacing: -0.5,
|
||||||
@@ -700,10 +647,7 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Symbols.refresh),
|
icon: const Icon(Symbols.refresh),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Refresh both providers
|
memberNotifier.refresh();
|
||||||
memberNotifier.reset();
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -716,109 +660,60 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
const Divider(height: 1),
|
const Divider(height: 1),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: PagingHelperView(
|
child: PaginationList(
|
||||||
provider: memberListProvider,
|
provider: chatMemberListProvider(roomId),
|
||||||
futureRefreshable: memberListProvider.future,
|
notifier: chatMemberListProvider(roomId).notifier,
|
||||||
notifierRefreshable: memberListProvider.notifier,
|
itemBuilder: (context, idx, member) {
|
||||||
contentBuilder: (data, widgetCount, endItemView) {
|
return ListTile(
|
||||||
return ListView.builder(
|
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
||||||
itemCount: widgetCount,
|
leading: AccountPfcGestureDetector(
|
||||||
itemBuilder: (context, index) {
|
uname: member.account.name,
|
||||||
if (index == data.items.length) {
|
child: ProfilePictureWidget(
|
||||||
return endItemView;
|
fileId: member.account.profile.picture?.id,
|
||||||
}
|
),
|
||||||
|
),
|
||||||
final member = data.items[index];
|
title: Row(
|
||||||
return ListTile(
|
spacing: 6,
|
||||||
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
children: [
|
||||||
leading: AccountPfcGestureDetector(
|
Flexible(child: Text(member.account.nick)),
|
||||||
uname: member.account.name,
|
if (member.status != null)
|
||||||
child: ProfilePictureWidget(
|
AccountStatusLabel(
|
||||||
fileId: member.account.profile.picture?.id,
|
status: member.status!,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
if (member.joinedAt == null)
|
||||||
title: Row(
|
const Icon(Symbols.pending_actions, size: 20),
|
||||||
spacing: 6,
|
],
|
||||||
children: [
|
),
|
||||||
Flexible(child: Text(member.account.nick)),
|
subtitle: Text("@${member.account.name}"),
|
||||||
if (member.status != null)
|
trailing: Row(
|
||||||
AccountStatusLabel(
|
mainAxisSize: MainAxisSize.min,
|
||||||
status: member.status!,
|
children: [
|
||||||
maxLines: 1,
|
if (isManagable)
|
||||||
overflow: TextOverflow.ellipsis,
|
IconButton(
|
||||||
),
|
icon: const Icon(Symbols.delete),
|
||||||
if (member.joinedAt == null)
|
onPressed: () {
|
||||||
const Icon(Symbols.pending_actions, size: 20),
|
showConfirmAlert(
|
||||||
],
|
'removeChatMemberHint'.tr(),
|
||||||
),
|
'removeChatMember'.tr(),
|
||||||
subtitle: Row(
|
).then((confirm) async {
|
||||||
children: [
|
if (confirm != true) return;
|
||||||
Text(
|
try {
|
||||||
member.role >= 100
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
? 'permissionOwner'
|
await apiClient.delete(
|
||||||
: member.role >= 50
|
'/sphere/chat/$roomId/members/${member.accountId}',
|
||||||
? 'permissionModerator'
|
);
|
||||||
: 'permissionMember',
|
// Refresh both providers
|
||||||
).tr(),
|
memberNotifier.refresh();
|
||||||
Text('·').bold().padding(horizontal: 6),
|
} catch (err) {
|
||||||
Expanded(child: Text("@${member.account.name}")),
|
showErrorAlert(err);
|
||||||
],
|
}
|
||||||
),
|
});
|
||||||
trailing: Row(
|
},
|
||||||
mainAxisSize: MainAxisSize.min,
|
),
|
||||||
children: [
|
],
|
||||||
if ((roomIdentity.value?.role ?? 0) >= 50)
|
),
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Symbols.edit),
|
|
||||||
onPressed: () {
|
|
||||||
showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
context: context,
|
|
||||||
builder:
|
|
||||||
(context) => _ChatMemberRoleSheet(
|
|
||||||
roomId: roomId,
|
|
||||||
member: member,
|
|
||||||
),
|
|
||||||
).then((value) {
|
|
||||||
if (value != null) {
|
|
||||||
// Refresh both providers
|
|
||||||
memberNotifier.reset();
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if ((roomIdentity.value?.role ?? 0) >= 50)
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Symbols.delete),
|
|
||||||
onPressed: () {
|
|
||||||
showConfirmAlert(
|
|
||||||
'removeChatMemberHint'.tr(),
|
|
||||||
'removeChatMember'.tr(),
|
|
||||||
).then((confirm) async {
|
|
||||||
if (confirm != true) return;
|
|
||||||
try {
|
|
||||||
final apiClient = ref.watch(
|
|
||||||
apiClientProvider,
|
|
||||||
);
|
|
||||||
await apiClient.delete(
|
|
||||||
'/sphere/chat/$roomId/members/${member.accountId}',
|
|
||||||
);
|
|
||||||
// Refresh both providers
|
|
||||||
memberNotifier.reset();
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
} catch (err) {
|
|
||||||
showErrorAlert(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -828,120 +723,3 @@ class _ChatMemberListSheet extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ChatMemberRoleSheet extends HookConsumerWidget {
|
|
||||||
final String roomId;
|
|
||||||
final SnChatMember member;
|
|
||||||
|
|
||||||
const _ChatMemberRoleSheet({required this.roomId, required this.member});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
|
||||||
final roleController = useTextEditingController(
|
|
||||||
text: member.role.toString(),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
bottom: MediaQuery.of(context).viewInsets.bottom,
|
|
||||||
),
|
|
||||||
child: SafeArea(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 16,
|
|
||||||
left: 20,
|
|
||||||
right: 16,
|
|
||||||
bottom: 12,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'memberRoleEdit'.tr(args: [member.account.name]),
|
|
||||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
letterSpacing: -0.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Symbols.close),
|
|
||||||
onPressed: () => Navigator.pop(context),
|
|
||||||
style: IconButton.styleFrom(
|
|
||||||
minimumSize: const Size(36, 36),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Divider(height: 1),
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
Autocomplete<int>(
|
|
||||||
optionsBuilder: (TextEditingValue textEditingValue) {
|
|
||||||
if (textEditingValue.text.isEmpty) {
|
|
||||||
return const [100, 50, 0];
|
|
||||||
}
|
|
||||||
final int? value = int.tryParse(textEditingValue.text);
|
|
||||||
if (value == null) return const [100, 50, 0];
|
|
||||||
return [100, 50, 0].where(
|
|
||||||
(option) =>
|
|
||||||
option.toString().contains(textEditingValue.text),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onSelected: (int selection) {
|
|
||||||
roleController.text = selection.toString();
|
|
||||||
},
|
|
||||||
fieldViewBuilder: (
|
|
||||||
context,
|
|
||||||
controller,
|
|
||||||
focusNode,
|
|
||||||
onFieldSubmitted,
|
|
||||||
) {
|
|
||||||
return TextField(
|
|
||||||
controller: controller,
|
|
||||||
focusNode: focusNode,
|
|
||||||
keyboardType: TextInputType.number,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: 'memberRole'.tr(),
|
|
||||||
helperText: 'memberRoleHint'.tr(),
|
|
||||||
),
|
|
||||||
onTapOutside: (event) => focusNode.unfocus(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const Gap(16),
|
|
||||||
FilledButton.icon(
|
|
||||||
onPressed: () async {
|
|
||||||
try {
|
|
||||||
final newRole = int.parse(roleController.text);
|
|
||||||
if (newRole < 0 || newRole > 100) {
|
|
||||||
throw 'roleValidationHint'.tr();
|
|
||||||
}
|
|
||||||
|
|
||||||
final apiClient = ref.read(apiClientProvider);
|
|
||||||
await apiClient.patch(
|
|
||||||
'/sphere/chat/$roomId/members/${member.accountId}/role',
|
|
||||||
data: newRole,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (context.mounted) Navigator.pop(context, true);
|
|
||||||
} catch (err) {
|
|
||||||
showErrorAlert(err);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: const Icon(Symbols.save),
|
|
||||||
label: const Text('saveChanges').tr(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
).padding(vertical: 16, horizontal: 24),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,297 +6,75 @@ part of 'room_detail.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(totalMessagesCount)
|
||||||
|
const totalMessagesCountProvider = TotalMessagesCountFamily._();
|
||||||
|
|
||||||
|
final class TotalMessagesCountProvider
|
||||||
|
extends $FunctionalProvider<AsyncValue<int>, int, FutureOr<int>>
|
||||||
|
with $FutureModifier<int>, $FutureProvider<int> {
|
||||||
|
const TotalMessagesCountProvider._({
|
||||||
|
required TotalMessagesCountFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'totalMessagesCountProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$totalMessagesCountHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'totalMessagesCountProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<int> $createElement($ProviderPointer pointer) =>
|
||||||
|
$FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<int> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
|
return totalMessagesCount(ref, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is TotalMessagesCountProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$totalMessagesCountHash() =>
|
String _$totalMessagesCountHash() =>
|
||||||
r'd55f1507aba2acdce5e468c1c2e15dba7640c571';
|
r'd55f1507aba2acdce5e468c1c2e15dba7640c571';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
final class TotalMessagesCountFamily extends $Family
|
||||||
class _SystemHash {
|
with $FunctionalFamilyOverride<FutureOr<int>, String> {
|
||||||
_SystemHash._();
|
const TotalMessagesCountFamily._()
|
||||||
|
: super(
|
||||||
static int combine(int hash, int value) {
|
retry: null,
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
@ProviderFor(totalMessagesCount)
|
|
||||||
const totalMessagesCountProvider = TotalMessagesCountFamily();
|
|
||||||
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
class TotalMessagesCountFamily extends Family<AsyncValue<int>> {
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
const TotalMessagesCountFamily();
|
|
||||||
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
TotalMessagesCountProvider call(String roomId) {
|
|
||||||
return TotalMessagesCountProvider(roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
TotalMessagesCountProvider getProviderOverride(
|
|
||||||
covariant TotalMessagesCountProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'totalMessagesCountProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
class TotalMessagesCountProvider extends AutoDisposeFutureProvider<int> {
|
|
||||||
/// See also [totalMessagesCount].
|
|
||||||
TotalMessagesCountProvider(String roomId)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => totalMessagesCount(ref as TotalMessagesCountRef, roomId),
|
|
||||||
from: totalMessagesCountProvider,
|
|
||||||
name: r'totalMessagesCountProvider',
|
name: r'totalMessagesCountProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$totalMessagesCountHash,
|
|
||||||
dependencies: TotalMessagesCountFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
TotalMessagesCountFamily._allTransitiveDependencies,
|
|
||||||
roomId: roomId,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TotalMessagesCountProvider._internal(
|
TotalMessagesCountProvider call(String roomId) =>
|
||||||
super._createNotifier, {
|
TotalMessagesCountProvider._(argument: roomId, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.roomId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String roomId;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'totalMessagesCountProvider';
|
||||||
FutureOr<int> Function(TotalMessagesCountRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: TotalMessagesCountProvider._internal(
|
|
||||||
(ref) => create(ref as TotalMessagesCountRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
roomId: roomId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<int> createElement() {
|
|
||||||
return _TotalMessagesCountProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is TotalMessagesCountProvider && other.roomId == roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, roomId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin TotalMessagesCountRef on AutoDisposeFutureProviderRef<int> {
|
|
||||||
/// The parameter `roomId` of this provider.
|
|
||||||
String get roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _TotalMessagesCountProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<int>
|
|
||||||
with TotalMessagesCountRef {
|
|
||||||
_TotalMessagesCountProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get roomId => (origin as TotalMessagesCountProvider).roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$chatMemberListNotifierHash() =>
|
|
||||||
r'3ea30150278523e9f6b23f9200ea9a9fbae9c973';
|
|
||||||
|
|
||||||
abstract class _$ChatMemberListNotifier
|
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnChatMember>> {
|
|
||||||
late final String roomId;
|
|
||||||
|
|
||||||
FutureOr<CursorPagingData<SnChatMember>> build(String roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
@ProviderFor(ChatMemberListNotifier)
|
|
||||||
const chatMemberListNotifierProvider = ChatMemberListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
class ChatMemberListNotifierFamily
|
|
||||||
extends Family<AsyncValue<CursorPagingData<SnChatMember>>> {
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
const ChatMemberListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
ChatMemberListNotifierProvider call(String roomId) {
|
|
||||||
return ChatMemberListNotifierProvider(roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
ChatMemberListNotifierProvider getProviderOverride(
|
|
||||||
covariant ChatMemberListNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'chatMemberListNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
class ChatMemberListNotifierProvider
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderImpl<
|
|
||||||
ChatMemberListNotifier,
|
|
||||||
CursorPagingData<SnChatMember>
|
|
||||||
> {
|
|
||||||
/// See also [ChatMemberListNotifier].
|
|
||||||
ChatMemberListNotifierProvider(String roomId)
|
|
||||||
: this._internal(
|
|
||||||
() => ChatMemberListNotifier()..roomId = roomId,
|
|
||||||
from: chatMemberListNotifierProvider,
|
|
||||||
name: r'chatMemberListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$chatMemberListNotifierHash,
|
|
||||||
dependencies: ChatMemberListNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
ChatMemberListNotifierFamily._allTransitiveDependencies,
|
|
||||||
roomId: roomId,
|
|
||||||
);
|
|
||||||
|
|
||||||
ChatMemberListNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.roomId,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String roomId;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<CursorPagingData<SnChatMember>> runNotifierBuild(
|
|
||||||
covariant ChatMemberListNotifier notifier,
|
|
||||||
) {
|
|
||||||
return notifier.build(roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(ChatMemberListNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: ChatMemberListNotifierProvider._internal(
|
|
||||||
() => create()..roomId = roomId,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
roomId: roomId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
ChatMemberListNotifier,
|
|
||||||
CursorPagingData<SnChatMember>
|
|
||||||
>
|
|
||||||
createElement() {
|
|
||||||
return _ChatMemberListNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is ChatMemberListNotifierProvider && other.roomId == roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, roomId.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin ChatMemberListNotifierRef
|
|
||||||
on AutoDisposeAsyncNotifierProviderRef<CursorPagingData<SnChatMember>> {
|
|
||||||
/// The parameter `roomId` of this provider.
|
|
||||||
String get roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ChatMemberListNotifierProviderElement
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
ChatMemberListNotifier,
|
|
||||||
CursorPagingData<SnChatMember>
|
|
||||||
>
|
|
||||||
with ChatMemberListNotifierRef {
|
|
||||||
_ChatMemberListNotifierProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get roomId => (origin as ChatMemberListNotifierProvider).roomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
import 'package:island/pods/chat/messages_notifier.dart';
|
import 'package:island/pods/chat/messages_notifier.dart';
|
||||||
import 'package:island/pods/chat/chat_rooms.dart';
|
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:island/widgets/chat/message_list_tile.dart';
|
import 'package:island/widgets/chat/message_list_tile.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
@@ -124,9 +124,7 @@ class SearchMessagesScreen extends HookConsumerWidget {
|
|||||||
// Debounce timer for search optimization
|
// Debounce timer for search optimization
|
||||||
final debounceTimer = useRef<Timer?>(null);
|
final debounceTimer = useRef<Timer?>(null);
|
||||||
|
|
||||||
final messagesNotifier = ref.read(
|
final messagesNotifier = ref.read(messagesProvider(roomId).notifier);
|
||||||
messagesNotifierProvider(roomId).notifier,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Optimized search function with debouncing
|
// Optimized search function with debouncing
|
||||||
void performSearch(String query) async {
|
void performSearch(String query) async {
|
||||||
@@ -180,7 +178,7 @@ class SearchMessagesScreen extends HookConsumerWidget {
|
|||||||
useEffect(() {
|
useEffect(() {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
// Clear flashing messages when entering search screen
|
// Clear flashing messages when entering search screen
|
||||||
ref.read(flashingMessagesProvider.notifier).state = {};
|
ref.read(flashingMessagesProvider.notifier).clear();
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -1,14 +1,28 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
import 'package:island/database/message.dart';
|
import 'package:island/database/message.dart';
|
||||||
import 'package:island/models/chat.dart';
|
import 'package:island/models/chat.dart';
|
||||||
import 'package:island/widgets/chat/message_item.dart';
|
import 'package:island/widgets/chat/message_item.dart';
|
||||||
|
|
||||||
// Provider to track animated messages to prevent replay
|
// Provider to track animated messages to prevent replay
|
||||||
final animatedMessagesProvider = StateProvider<Set<String>>((ref) => {});
|
final animatedMessagesProvider =
|
||||||
|
NotifierProvider<AnimatedMessagesNotifier, Set<String>>(
|
||||||
|
AnimatedMessagesNotifier.new,
|
||||||
|
);
|
||||||
|
|
||||||
class MessageItemWrapper extends HookConsumerWidget {
|
class AnimatedMessagesNotifier extends Notifier<Set<String>> {
|
||||||
|
@override
|
||||||
|
Set<String> build() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void addMessage(String messageId) {
|
||||||
|
state = {...state, messageId};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MessageItemWrapper extends ConsumerWidget {
|
||||||
final LocalChatMessage message;
|
final LocalChatMessage message;
|
||||||
final int index;
|
final int index;
|
||||||
final bool isLastInGroup;
|
final bool isLastInGroup;
|
||||||
@@ -78,9 +92,7 @@ class MessageItemWrapper extends HookConsumerWidget {
|
|||||||
onEnd: () {
|
onEnd: () {
|
||||||
// Mark as animated
|
// Mark as animated
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
ref
|
ref.read(animatedMessagesProvider.notifier).addMessage(message.id);
|
||||||
.read(animatedMessagesProvider.notifier)
|
|
||||||
.update((state) => {...state, message.id});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: child,
|
child: child,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:island/models/post.dart';
|
|||||||
import 'package:island/models/publisher.dart';
|
import 'package:island/models/publisher.dart';
|
||||||
import 'package:island/models/heatmap.dart';
|
import 'package:island/models/heatmap.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:island/screens/creators/publishers_form.dart';
|
import 'package:island/screens/creators/publishers_form.dart';
|
||||||
import 'package:island/services/responsive.dart';
|
import 'package:island/services/responsive.dart';
|
||||||
import 'package:island/utils/text.dart';
|
import 'package:island/utils/text.dart';
|
||||||
@@ -18,11 +19,11 @@ import 'package:island/widgets/alert.dart';
|
|||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:island/widgets/content/cloud_files.dart';
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
import 'package:island/widgets/content/sheet.dart';
|
import 'package:island/widgets/content/sheet.dart';
|
||||||
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:island/widgets/response.dart';
|
import 'package:island/widgets/response.dart';
|
||||||
import 'package:island/widgets/activity_heatmap.dart';
|
import 'package:island/widgets/activity_heatmap.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'hub.g.dart';
|
part 'hub.g.dart';
|
||||||
@@ -77,38 +78,33 @@ Future<List<SnPublisherMember>> publisherInvites(Ref ref) async {
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
final publisherMemberListNotifierProvider = AsyncNotifierProvider.family
|
||||||
class PublisherMemberListNotifier extends _$PublisherMemberListNotifier
|
.autoDispose(PublisherMemberListNotifier.new);
|
||||||
with CursorPagingNotifierMixin<SnPublisherMember> {
|
|
||||||
static const int _pageSize = 20;
|
class PublisherMemberListNotifier extends AsyncNotifier<List<SnPublisherMember>>
|
||||||
|
with AsyncPaginationController<SnPublisherMember> {
|
||||||
|
static const int pageSize = 20;
|
||||||
|
|
||||||
|
final String arg;
|
||||||
|
PublisherMemberListNotifier(this.arg);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnPublisherMember>> build(String uname) async {
|
Future<List<SnPublisherMember>> fetch() async {
|
||||||
return fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnPublisherMember>> fetch({String? cursor}) async {
|
|
||||||
final apiClient = ref.read(apiClientProvider);
|
final apiClient = ref.read(apiClientProvider);
|
||||||
final offset = cursor != null ? int.parse(cursor) : 0;
|
|
||||||
|
|
||||||
final response = await apiClient.get(
|
final response = await apiClient.get(
|
||||||
'/sphere/publishers/$uname/members',
|
'/sphere/publishers/$arg/members',
|
||||||
queryParameters: {'offset': offset, 'take': _pageSize},
|
queryParameters: {'offset': fetchedCount.toString(), 'take': pageSize},
|
||||||
);
|
);
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
final List<dynamic> data = response.data;
|
final members =
|
||||||
final members = data.map((e) => SnPublisherMember.fromJson(e)).toList();
|
response.data
|
||||||
|
.map((e) => SnPublisherMember.fromJson(e))
|
||||||
|
.cast<SnPublisherMember>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
final hasMore = offset + members.length < total;
|
return members;
|
||||||
final nextCursor = hasMore ? (offset + members.length).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
|
||||||
items: members,
|
|
||||||
hasMore: hasMore,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,16 +300,18 @@ class CreatorHubScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void deletePublisher() {
|
void deletePublisher() {
|
||||||
showConfirmAlert('deletePublisherHint'.tr(), 'deletePublisher'.tr()).then(
|
showConfirmAlert(
|
||||||
(confirm) {
|
'deletePublisherHint'.tr(),
|
||||||
if (confirm) {
|
'deletePublisher'.tr(),
|
||||||
final client = ref.watch(apiClientProvider);
|
isDanger: true,
|
||||||
client.delete('/sphere/publishers/${currentPublisher.value!.name}');
|
).then((confirm) {
|
||||||
ref.invalidate(publishersManagedProvider);
|
if (confirm) {
|
||||||
currentPublisher.value = null;
|
final client = ref.watch(apiClientProvider);
|
||||||
}
|
client.delete('/sphere/publishers/${currentPublisher.value!.name}');
|
||||||
},
|
ref.invalidate(publishersManagedProvider);
|
||||||
);
|
currentPublisher.value = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<DropdownMenuItem<SnPublisher>> publishersMenu = publishers.when(
|
final List<DropdownMenuItem<SnPublisher>> publishersMenu = publishers.when(
|
||||||
@@ -571,6 +569,7 @@ class CreatorHubScreen extends HookConsumerWidget {
|
|||||||
child: publisherStats.when(
|
child: publisherStats.when(
|
||||||
data:
|
data:
|
||||||
(stats) => SingleChildScrollView(
|
(stats) => SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 24),
|
||||||
child:
|
child:
|
||||||
currentPublisher.value == null
|
currentPublisher.value == null
|
||||||
? ConstrainedBox(
|
? ConstrainedBox(
|
||||||
@@ -600,7 +599,7 @@ class CreatorHubScreen extends HookConsumerWidget {
|
|||||||
).padding(horizontal: 12),
|
).padding(horizontal: 12),
|
||||||
buildNavigationWidget(true),
|
buildNavigationWidget(true),
|
||||||
],
|
],
|
||||||
).padding(vertical: 24)
|
)
|
||||||
: Column(
|
: Column(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
children: [
|
children: [
|
||||||
@@ -762,55 +761,6 @@ class PublisherMemberState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final publisherMemberStateProvider = StateNotifierProvider.family<
|
|
||||||
PublisherMemberNotifier,
|
|
||||||
PublisherMemberState,
|
|
||||||
String
|
|
||||||
>((ref, publisherUname) {
|
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
|
||||||
return PublisherMemberNotifier(apiClient, publisherUname);
|
|
||||||
});
|
|
||||||
|
|
||||||
class PublisherMemberNotifier extends StateNotifier<PublisherMemberState> {
|
|
||||||
final String publisherUname;
|
|
||||||
final Dio _apiClient;
|
|
||||||
|
|
||||||
PublisherMemberNotifier(this._apiClient, this.publisherUname)
|
|
||||||
: super(
|
|
||||||
const PublisherMemberState(members: [], isLoading: false, total: 0),
|
|
||||||
);
|
|
||||||
|
|
||||||
Future<void> loadMore({int offset = 0, int take = 20}) async {
|
|
||||||
if (state.isLoading) return;
|
|
||||||
if (state.total > 0 && state.members.length >= state.total) return;
|
|
||||||
|
|
||||||
state = state.copyWith(isLoading: true, error: null);
|
|
||||||
|
|
||||||
try {
|
|
||||||
final response = await _apiClient.get(
|
|
||||||
'/sphere/publishers/$publisherUname/members',
|
|
||||||
queryParameters: {'offset': offset, 'take': take},
|
|
||||||
);
|
|
||||||
|
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
|
||||||
final List<dynamic> data = response.data;
|
|
||||||
final members = data.map((e) => SnPublisherMember.fromJson(e)).toList();
|
|
||||||
|
|
||||||
state = state.copyWith(
|
|
||||||
members: [...state.members, ...members],
|
|
||||||
total: total,
|
|
||||||
isLoading: false,
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
state = state.copyWith(error: e.toString(), isLoading: false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset() {
|
|
||||||
state = const PublisherMemberState(members: [], isLoading: false, total: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherMemberListSheet extends HookConsumerWidget {
|
class _PublisherMemberListSheet extends HookConsumerWidget {
|
||||||
final String publisherUname;
|
final String publisherUname;
|
||||||
const _PublisherMemberListSheet({required this.publisherUname});
|
const _PublisherMemberListSheet({required this.publisherUname});
|
||||||
@@ -823,18 +773,10 @@ class _PublisherMemberListSheet extends HookConsumerWidget {
|
|||||||
final memberListProvider = publisherMemberListNotifierProvider(
|
final memberListProvider = publisherMemberListNotifierProvider(
|
||||||
publisherUname,
|
publisherUname,
|
||||||
);
|
);
|
||||||
final memberState = ref.watch(publisherMemberStateProvider(publisherUname));
|
|
||||||
final memberNotifier = ref.read(
|
final memberNotifier = ref.read(
|
||||||
publisherMemberStateProvider(publisherUname).notifier,
|
publisherMemberListNotifierProvider(publisherUname).notifier,
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() {
|
|
||||||
Future(() {
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
Future<void> invitePerson() async {
|
Future<void> invitePerson() async {
|
||||||
final result = await showModalBottomSheet(
|
final result = await showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
@@ -849,10 +791,7 @@ class _PublisherMemberListSheet extends HookConsumerWidget {
|
|||||||
'/sphere/publishers/invites/$publisherUname',
|
'/sphere/publishers/invites/$publisherUname',
|
||||||
data: {'related_user_id': result.id, 'role': 0},
|
data: {'related_user_id': result.id, 'role': 0},
|
||||||
);
|
);
|
||||||
// Refresh both providers
|
memberNotifier.refresh();
|
||||||
memberNotifier.reset();
|
|
||||||
await memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
}
|
}
|
||||||
@@ -869,7 +808,7 @@ class _PublisherMemberListSheet extends HookConsumerWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'members'.plural(memberState.total),
|
'members'.plural(memberNotifier.totalCount ?? 0),
|
||||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
letterSpacing: -0.5,
|
letterSpacing: -0.5,
|
||||||
@@ -884,9 +823,7 @@ class _PublisherMemberListSheet extends HookConsumerWidget {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Symbols.refresh),
|
icon: const Icon(Symbols.refresh),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
memberNotifier.reset();
|
memberNotifier.refresh();
|
||||||
memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -899,100 +836,81 @@ class _PublisherMemberListSheet extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
const Divider(height: 1),
|
const Divider(height: 1),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: PagingHelperView(
|
child: PaginationList(
|
||||||
provider: memberListProvider,
|
provider: memberListProvider,
|
||||||
futureRefreshable: memberListProvider.future,
|
notifier: memberListProvider.notifier,
|
||||||
notifierRefreshable: memberListProvider.notifier,
|
itemBuilder: (context, index, member) {
|
||||||
contentBuilder: (data, widgetCount, endItemView) {
|
return ListTile(
|
||||||
return ListView.builder(
|
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
||||||
itemCount: widgetCount,
|
leading: ProfilePictureWidget(
|
||||||
itemBuilder: (context, index) {
|
fileId: member.account!.profile.picture?.id,
|
||||||
if (index == data.items.length) {
|
),
|
||||||
return endItemView;
|
title: Row(
|
||||||
}
|
spacing: 6,
|
||||||
|
children: [
|
||||||
final member = data.items[index];
|
Flexible(child: Text(member.account!.nick)),
|
||||||
return ListTile(
|
if (member.joinedAt == null)
|
||||||
contentPadding: EdgeInsets.only(left: 16, right: 12),
|
const Icon(Symbols.pending_actions, size: 20),
|
||||||
leading: ProfilePictureWidget(
|
],
|
||||||
fileId: member.account!.profile.picture?.id,
|
),
|
||||||
),
|
subtitle: Row(
|
||||||
title: Row(
|
children: [
|
||||||
spacing: 6,
|
Text(
|
||||||
children: [
|
member.role >= 100
|
||||||
Flexible(child: Text(member.account!.nick)),
|
? 'permissionOwner'
|
||||||
if (member.joinedAt == null)
|
: member.role >= 50
|
||||||
const Icon(Symbols.pending_actions, size: 20),
|
? 'permissionModerator'
|
||||||
],
|
: 'permissionMember',
|
||||||
),
|
).tr(),
|
||||||
subtitle: Row(
|
Text('·').bold().padding(horizontal: 6),
|
||||||
children: [
|
Expanded(child: Text("@${member.account!.name}")),
|
||||||
Text(
|
],
|
||||||
member.role >= 100
|
),
|
||||||
? 'permissionOwner'
|
trailing: Row(
|
||||||
: member.role >= 50
|
mainAxisSize: MainAxisSize.min,
|
||||||
? 'permissionModerator'
|
children: [
|
||||||
: 'permissionMember',
|
if ((publisherIdentity.value?.role ?? 0) >= 50)
|
||||||
).tr(),
|
IconButton(
|
||||||
Text('·').bold().padding(horizontal: 6),
|
icon: const Icon(Symbols.edit),
|
||||||
Expanded(child: Text("@${member.account!.name}")),
|
onPressed: () {
|
||||||
],
|
showModalBottomSheet(
|
||||||
),
|
isScrollControlled: true,
|
||||||
trailing: Row(
|
context: context,
|
||||||
mainAxisSize: MainAxisSize.min,
|
builder:
|
||||||
children: [
|
(context) => _PublisherMemberRoleSheet(
|
||||||
if ((publisherIdentity.value?.role ?? 0) >= 50)
|
publisherUname: publisherUname,
|
||||||
IconButton(
|
member: member,
|
||||||
icon: const Icon(Symbols.edit),
|
),
|
||||||
onPressed: () {
|
).then((value) {
|
||||||
showModalBottomSheet(
|
if (value != null) {
|
||||||
isScrollControlled: true,
|
memberNotifier.refresh();
|
||||||
context: context,
|
}
|
||||||
builder:
|
});
|
||||||
(context) => _PublisherMemberRoleSheet(
|
},
|
||||||
publisherUname: publisherUname,
|
),
|
||||||
member: member,
|
if ((publisherIdentity.value?.role ?? 0) >= 50)
|
||||||
),
|
IconButton(
|
||||||
).then((value) {
|
icon: const Icon(Symbols.delete),
|
||||||
if (value != null) {
|
onPressed: () {
|
||||||
// Refresh both providers
|
showConfirmAlert(
|
||||||
memberNotifier.reset();
|
'removePublisherMemberHint'.tr(),
|
||||||
memberNotifier.loadMore();
|
'removePublisherMember'.tr(),
|
||||||
ref.invalidate(memberListProvider);
|
).then((confirm) async {
|
||||||
}
|
if (confirm != true) return;
|
||||||
});
|
try {
|
||||||
},
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
),
|
await apiClient.delete(
|
||||||
if ((publisherIdentity.value?.role ?? 0) >= 50)
|
'/sphere/publishers/$publisherUname/members/${member.accountId}',
|
||||||
IconButton(
|
);
|
||||||
icon: const Icon(Symbols.delete),
|
memberNotifier.refresh();
|
||||||
onPressed: () {
|
} catch (err) {
|
||||||
showConfirmAlert(
|
showErrorAlert(err);
|
||||||
'removePublisherMemberHint'.tr(),
|
}
|
||||||
'removePublisherMember'.tr(),
|
});
|
||||||
).then((confirm) async {
|
},
|
||||||
if (confirm != true) return;
|
),
|
||||||
try {
|
],
|
||||||
final apiClient = ref.watch(
|
),
|
||||||
apiClientProvider,
|
|
||||||
);
|
|
||||||
await apiClient.delete(
|
|
||||||
'/sphere/publishers/$publisherUname/members/${member.accountId}',
|
|
||||||
);
|
|
||||||
// Refresh both providers
|
|
||||||
memberNotifier.reset();
|
|
||||||
memberNotifier.loadMore();
|
|
||||||
ref.invalidate(memberListProvider);
|
|
||||||
} catch (err) {
|
|
||||||
showErrorAlert(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,686 +6,351 @@ part of 'hub.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$publisherStatsHash() => r'eea4ed98bf165cc785874f83b912bb7e23d1f7bc';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisherStats].
|
|
||||||
@ProviderFor(publisherStats)
|
@ProviderFor(publisherStats)
|
||||||
const publisherStatsProvider = PublisherStatsFamily();
|
const publisherStatsProvider = PublisherStatsFamily._();
|
||||||
|
|
||||||
/// See also [publisherStats].
|
final class PublisherStatsProvider
|
||||||
class PublisherStatsFamily extends Family<AsyncValue<SnPublisherStats?>> {
|
extends
|
||||||
/// See also [publisherStats].
|
$FunctionalProvider<
|
||||||
const PublisherStatsFamily();
|
AsyncValue<SnPublisherStats?>,
|
||||||
|
SnPublisherStats?,
|
||||||
|
FutureOr<SnPublisherStats?>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<SnPublisherStats?>,
|
||||||
|
$FutureProvider<SnPublisherStats?> {
|
||||||
|
const PublisherStatsProvider._({
|
||||||
|
required PublisherStatsFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherStatsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [publisherStats].
|
@override
|
||||||
PublisherStatsProvider call(String? uname) {
|
String debugGetCreateSourceHash() => _$publisherStatsHash();
|
||||||
return PublisherStatsProvider(uname);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publisherStatsProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
PublisherStatsProvider getProviderOverride(
|
$FutureProviderElement<SnPublisherStats?> $createElement(
|
||||||
covariant PublisherStatsProvider provider,
|
$ProviderPointer pointer,
|
||||||
) {
|
) => $FutureProviderElement(pointer);
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<SnPublisherStats?> create(Ref ref) {
|
||||||
|
final argument = this.argument as String?;
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return publisherStats(ref, argument);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherStatsProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisherStats].
|
|
||||||
class PublisherStatsProvider
|
|
||||||
extends AutoDisposeFutureProvider<SnPublisherStats?> {
|
|
||||||
/// See also [publisherStats].
|
|
||||||
PublisherStatsProvider(String? uname)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publisherStats(ref as PublisherStatsRef, uname),
|
|
||||||
from: publisherStatsProvider,
|
|
||||||
name: r'publisherStatsProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publisherStatsHash,
|
|
||||||
dependencies: PublisherStatsFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublisherStatsFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
|
||||||
|
|
||||||
PublisherStatsProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? uname;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<SnPublisherStats?> Function(PublisherStatsRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PublisherStatsProvider._internal(
|
|
||||||
(ref) => create(ref as PublisherStatsRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
uname: uname,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnPublisherStats?> createElement() {
|
|
||||||
return _PublisherStatsProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PublisherStatsProvider && other.uname == uname;
|
return other is PublisherStatsProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$publisherStatsHash() => r'eea4ed98bf165cc785874f83b912bb7e23d1f7bc';
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherStatsRef on AutoDisposeFutureProviderRef<SnPublisherStats?> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String? get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherStatsProviderElement
|
final class PublisherStatsFamily extends $Family
|
||||||
extends AutoDisposeFutureProviderElement<SnPublisherStats?>
|
with $FunctionalFamilyOverride<FutureOr<SnPublisherStats?>, String?> {
|
||||||
with PublisherStatsRef {
|
const PublisherStatsFamily._()
|
||||||
_PublisherStatsProviderElement(super.provider);
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherStatsProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
PublisherStatsProvider call(String? uname) =>
|
||||||
|
PublisherStatsProvider._(argument: uname, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? get uname => (origin as PublisherStatsProvider).uname;
|
String toString() => r'publisherStatsProvider';
|
||||||
|
}
|
||||||
|
|
||||||
|
@ProviderFor(publisherHeatmap)
|
||||||
|
const publisherHeatmapProvider = PublisherHeatmapFamily._();
|
||||||
|
|
||||||
|
final class PublisherHeatmapProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<SnHeatmap?>,
|
||||||
|
SnHeatmap?,
|
||||||
|
FutureOr<SnHeatmap?>
|
||||||
|
>
|
||||||
|
with $FutureModifier<SnHeatmap?>, $FutureProvider<SnHeatmap?> {
|
||||||
|
const PublisherHeatmapProvider._({
|
||||||
|
required PublisherHeatmapFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherHeatmapProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$publisherHeatmapHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publisherHeatmapProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<SnHeatmap?> $createElement($ProviderPointer pointer) =>
|
||||||
|
$FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnHeatmap?> create(Ref ref) {
|
||||||
|
final argument = this.argument as String?;
|
||||||
|
return publisherHeatmap(ref, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is PublisherHeatmapProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$publisherHeatmapHash() => r'5f70c55e14629ec8628445a317888e02fccd9af2';
|
String _$publisherHeatmapHash() => r'5f70c55e14629ec8628445a317888e02fccd9af2';
|
||||||
|
|
||||||
/// See also [publisherHeatmap].
|
final class PublisherHeatmapFamily extends $Family
|
||||||
@ProviderFor(publisherHeatmap)
|
with $FunctionalFamilyOverride<FutureOr<SnHeatmap?>, String?> {
|
||||||
const publisherHeatmapProvider = PublisherHeatmapFamily();
|
const PublisherHeatmapFamily._()
|
||||||
|
: super(
|
||||||
/// See also [publisherHeatmap].
|
retry: null,
|
||||||
class PublisherHeatmapFamily extends Family<AsyncValue<SnHeatmap?>> {
|
|
||||||
/// See also [publisherHeatmap].
|
|
||||||
const PublisherHeatmapFamily();
|
|
||||||
|
|
||||||
/// See also [publisherHeatmap].
|
|
||||||
PublisherHeatmapProvider call(String? uname) {
|
|
||||||
return PublisherHeatmapProvider(uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PublisherHeatmapProvider getProviderOverride(
|
|
||||||
covariant PublisherHeatmapProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherHeatmapProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisherHeatmap].
|
|
||||||
class PublisherHeatmapProvider extends AutoDisposeFutureProvider<SnHeatmap?> {
|
|
||||||
/// See also [publisherHeatmap].
|
|
||||||
PublisherHeatmapProvider(String? uname)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publisherHeatmap(ref as PublisherHeatmapRef, uname),
|
|
||||||
from: publisherHeatmapProvider,
|
|
||||||
name: r'publisherHeatmapProvider',
|
name: r'publisherHeatmapProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$publisherHeatmapHash,
|
|
||||||
dependencies: PublisherHeatmapFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublisherHeatmapFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
PublisherHeatmapProvider._internal(
|
PublisherHeatmapProvider call(String? uname) =>
|
||||||
super._createNotifier, {
|
PublisherHeatmapProvider._(argument: uname, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? uname;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'publisherHeatmapProvider';
|
||||||
FutureOr<SnHeatmap?> Function(PublisherHeatmapRef provider) create,
|
}
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
@ProviderFor(publisherIdentity)
|
||||||
origin: this,
|
const publisherIdentityProvider = PublisherIdentityFamily._();
|
||||||
override: PublisherHeatmapProvider._internal(
|
|
||||||
(ref) => create(ref as PublisherHeatmapRef),
|
final class PublisherIdentityProvider
|
||||||
from: from,
|
extends
|
||||||
name: null,
|
$FunctionalProvider<
|
||||||
dependencies: null,
|
AsyncValue<SnPublisherMember?>,
|
||||||
allTransitiveDependencies: null,
|
SnPublisherMember?,
|
||||||
debugGetCreateSourceHash: null,
|
FutureOr<SnPublisherMember?>
|
||||||
uname: uname,
|
>
|
||||||
),
|
with
|
||||||
);
|
$FutureModifier<SnPublisherMember?>,
|
||||||
|
$FutureProvider<SnPublisherMember?> {
|
||||||
|
const PublisherIdentityProvider._({
|
||||||
|
required PublisherIdentityFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherIdentityProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$publisherIdentityHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publisherIdentityProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
AutoDisposeFutureProviderElement<SnHeatmap?> createElement() {
|
$FutureProviderElement<SnPublisherMember?> $createElement(
|
||||||
return _PublisherHeatmapProviderElement(this);
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnPublisherMember?> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
|
return publisherIdentity(ref, argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PublisherHeatmapProvider && other.uname == uname;
|
return other is PublisherIdentityProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherHeatmapRef on AutoDisposeFutureProviderRef<SnHeatmap?> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String? get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherHeatmapProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnHeatmap?>
|
|
||||||
with PublisherHeatmapRef {
|
|
||||||
_PublisherHeatmapProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get uname => (origin as PublisherHeatmapProvider).uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$publisherIdentityHash() => r'299372f25fa4b2bf8e11a8ba2d645100fc38e76f';
|
String _$publisherIdentityHash() => r'299372f25fa4b2bf8e11a8ba2d645100fc38e76f';
|
||||||
|
|
||||||
/// See also [publisherIdentity].
|
final class PublisherIdentityFamily extends $Family
|
||||||
@ProviderFor(publisherIdentity)
|
with $FunctionalFamilyOverride<FutureOr<SnPublisherMember?>, String> {
|
||||||
const publisherIdentityProvider = PublisherIdentityFamily();
|
const PublisherIdentityFamily._()
|
||||||
|
: super(
|
||||||
/// See also [publisherIdentity].
|
retry: null,
|
||||||
class PublisherIdentityFamily extends Family<AsyncValue<SnPublisherMember?>> {
|
|
||||||
/// See also [publisherIdentity].
|
|
||||||
const PublisherIdentityFamily();
|
|
||||||
|
|
||||||
/// See also [publisherIdentity].
|
|
||||||
PublisherIdentityProvider call(String uname) {
|
|
||||||
return PublisherIdentityProvider(uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PublisherIdentityProvider getProviderOverride(
|
|
||||||
covariant PublisherIdentityProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherIdentityProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisherIdentity].
|
|
||||||
class PublisherIdentityProvider
|
|
||||||
extends AutoDisposeFutureProvider<SnPublisherMember?> {
|
|
||||||
/// See also [publisherIdentity].
|
|
||||||
PublisherIdentityProvider(String uname)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publisherIdentity(ref as PublisherIdentityRef, uname),
|
|
||||||
from: publisherIdentityProvider,
|
|
||||||
name: r'publisherIdentityProvider',
|
name: r'publisherIdentityProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$publisherIdentityHash,
|
|
||||||
dependencies: PublisherIdentityFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublisherIdentityFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
PublisherIdentityProvider._internal(
|
PublisherIdentityProvider call(String uname) =>
|
||||||
super._createNotifier, {
|
PublisherIdentityProvider._(argument: uname, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String uname;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'publisherIdentityProvider';
|
||||||
FutureOr<SnPublisherMember?> Function(PublisherIdentityRef provider) create,
|
}
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
@ProviderFor(publisherFeatures)
|
||||||
origin: this,
|
const publisherFeaturesProvider = PublisherFeaturesFamily._();
|
||||||
override: PublisherIdentityProvider._internal(
|
|
||||||
(ref) => create(ref as PublisherIdentityRef),
|
final class PublisherFeaturesProvider
|
||||||
from: from,
|
extends
|
||||||
name: null,
|
$FunctionalProvider<
|
||||||
dependencies: null,
|
AsyncValue<Map<String, bool>>,
|
||||||
allTransitiveDependencies: null,
|
Map<String, bool>,
|
||||||
debugGetCreateSourceHash: null,
|
FutureOr<Map<String, bool>>
|
||||||
uname: uname,
|
>
|
||||||
),
|
with
|
||||||
);
|
$FutureModifier<Map<String, bool>>,
|
||||||
|
$FutureProvider<Map<String, bool>> {
|
||||||
|
const PublisherFeaturesProvider._({
|
||||||
|
required PublisherFeaturesFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherFeaturesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$publisherFeaturesHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publisherFeaturesProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
AutoDisposeFutureProviderElement<SnPublisherMember?> createElement() {
|
$FutureProviderElement<Map<String, bool>> $createElement(
|
||||||
return _PublisherIdentityProviderElement(this);
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<Map<String, bool>> create(Ref ref) {
|
||||||
|
final argument = this.argument as String?;
|
||||||
|
return publisherFeatures(ref, argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PublisherIdentityProvider && other.uname == uname;
|
return other is PublisherFeaturesProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherIdentityRef on AutoDisposeFutureProviderRef<SnPublisherMember?> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherIdentityProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnPublisherMember?>
|
|
||||||
with PublisherIdentityRef {
|
|
||||||
_PublisherIdentityProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get uname => (origin as PublisherIdentityProvider).uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$publisherFeaturesHash() => r'08bace2d9a3da227ecec0cbf8709e55ee0646ca2';
|
String _$publisherFeaturesHash() => r'08bace2d9a3da227ecec0cbf8709e55ee0646ca2';
|
||||||
|
|
||||||
/// See also [publisherFeatures].
|
final class PublisherFeaturesFamily extends $Family
|
||||||
@ProviderFor(publisherFeatures)
|
with $FunctionalFamilyOverride<FutureOr<Map<String, bool>>, String?> {
|
||||||
const publisherFeaturesProvider = PublisherFeaturesFamily();
|
const PublisherFeaturesFamily._()
|
||||||
|
: super(
|
||||||
/// See also [publisherFeatures].
|
retry: null,
|
||||||
class PublisherFeaturesFamily extends Family<AsyncValue<Map<String, bool>>> {
|
|
||||||
/// See also [publisherFeatures].
|
|
||||||
const PublisherFeaturesFamily();
|
|
||||||
|
|
||||||
/// See also [publisherFeatures].
|
|
||||||
PublisherFeaturesProvider call(String? uname) {
|
|
||||||
return PublisherFeaturesProvider(uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PublisherFeaturesProvider getProviderOverride(
|
|
||||||
covariant PublisherFeaturesProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherFeaturesProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisherFeatures].
|
|
||||||
class PublisherFeaturesProvider
|
|
||||||
extends AutoDisposeFutureProvider<Map<String, bool>> {
|
|
||||||
/// See also [publisherFeatures].
|
|
||||||
PublisherFeaturesProvider(String? uname)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publisherFeatures(ref as PublisherFeaturesRef, uname),
|
|
||||||
from: publisherFeaturesProvider,
|
|
||||||
name: r'publisherFeaturesProvider',
|
name: r'publisherFeaturesProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$publisherFeaturesHash,
|
|
||||||
dependencies: PublisherFeaturesFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublisherFeaturesFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
PublisherFeaturesProvider._internal(
|
PublisherFeaturesProvider call(String? uname) =>
|
||||||
super._createNotifier, {
|
PublisherFeaturesProvider._(argument: uname, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? uname;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'publisherFeaturesProvider';
|
||||||
FutureOr<Map<String, bool>> Function(PublisherFeaturesRef provider) create,
|
}
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
@ProviderFor(publisherInvites)
|
||||||
origin: this,
|
const publisherInvitesProvider = PublisherInvitesProvider._();
|
||||||
override: PublisherFeaturesProvider._internal(
|
|
||||||
(ref) => create(ref as PublisherFeaturesRef),
|
final class PublisherInvitesProvider
|
||||||
from: from,
|
extends
|
||||||
name: null,
|
$FunctionalProvider<
|
||||||
|
AsyncValue<List<SnPublisherMember>>,
|
||||||
|
List<SnPublisherMember>,
|
||||||
|
FutureOr<List<SnPublisherMember>>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<List<SnPublisherMember>>,
|
||||||
|
$FutureProvider<List<SnPublisherMember>> {
|
||||||
|
const PublisherInvitesProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherInvitesProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
dependencies: null,
|
dependencies: null,
|
||||||
allTransitiveDependencies: null,
|
$allTransitiveDependencies: null,
|
||||||
debugGetCreateSourceHash: null,
|
);
|
||||||
uname: uname,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AutoDisposeFutureProviderElement<Map<String, bool>> createElement() {
|
String debugGetCreateSourceHash() => _$publisherInvitesHash();
|
||||||
return _PublisherFeaturesProviderElement(this);
|
|
||||||
}
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnPublisherMember>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
FutureOr<List<SnPublisherMember>> create(Ref ref) {
|
||||||
return other is PublisherFeaturesProvider && other.uname == uname;
|
return publisherInvites(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherFeaturesRef on AutoDisposeFutureProviderRef<Map<String, bool>> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String? get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherFeaturesProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<Map<String, bool>>
|
|
||||||
with PublisherFeaturesRef {
|
|
||||||
_PublisherFeaturesProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get uname => (origin as PublisherFeaturesProvider).uname;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$publisherInvitesHash() => r'93aafc2f02af0a7a055ec1770b3999363dfaabdc';
|
String _$publisherInvitesHash() => r'93aafc2f02af0a7a055ec1770b3999363dfaabdc';
|
||||||
|
|
||||||
/// See also [publisherInvites].
|
|
||||||
@ProviderFor(publisherInvites)
|
|
||||||
final publisherInvitesProvider =
|
|
||||||
AutoDisposeFutureProvider<List<SnPublisherMember>>.internal(
|
|
||||||
publisherInvites,
|
|
||||||
name: r'publisherInvitesProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publisherInvitesHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
typedef PublisherInvitesRef =
|
|
||||||
AutoDisposeFutureProviderRef<List<SnPublisherMember>>;
|
|
||||||
String _$publisherMemberListNotifierHash() =>
|
|
||||||
r'b4afd5d591a6f3d29f1b45fb1b6d17cb34f3f11b';
|
|
||||||
|
|
||||||
abstract class _$PublisherMemberListNotifier
|
|
||||||
extends
|
|
||||||
BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnPublisherMember>> {
|
|
||||||
late final String uname;
|
|
||||||
|
|
||||||
FutureOr<CursorPagingData<SnPublisherMember>> build(String uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
@ProviderFor(PublisherMemberListNotifier)
|
|
||||||
const publisherMemberListNotifierProvider = PublisherMemberListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
class PublisherMemberListNotifierFamily
|
|
||||||
extends Family<AsyncValue<CursorPagingData<SnPublisherMember>>> {
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
const PublisherMemberListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
PublisherMemberListNotifierProvider call(String uname) {
|
|
||||||
return PublisherMemberListNotifierProvider(uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PublisherMemberListNotifierProvider getProviderOverride(
|
|
||||||
covariant PublisherMemberListNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherMemberListNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
class PublisherMemberListNotifierProvider
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderImpl<
|
|
||||||
PublisherMemberListNotifier,
|
|
||||||
CursorPagingData<SnPublisherMember>
|
|
||||||
> {
|
|
||||||
/// See also [PublisherMemberListNotifier].
|
|
||||||
PublisherMemberListNotifierProvider(String uname)
|
|
||||||
: this._internal(
|
|
||||||
() => PublisherMemberListNotifier()..uname = uname,
|
|
||||||
from: publisherMemberListNotifierProvider,
|
|
||||||
name: r'publisherMemberListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publisherMemberListNotifierHash,
|
|
||||||
dependencies: PublisherMemberListNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublisherMemberListNotifierFamily._allTransitiveDependencies,
|
|
||||||
uname: uname,
|
|
||||||
);
|
|
||||||
|
|
||||||
PublisherMemberListNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.uname,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String uname;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<CursorPagingData<SnPublisherMember>> runNotifierBuild(
|
|
||||||
covariant PublisherMemberListNotifier notifier,
|
|
||||||
) {
|
|
||||||
return notifier.build(uname);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(PublisherMemberListNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PublisherMemberListNotifierProvider._internal(
|
|
||||||
() => create()..uname = uname,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
uname: uname,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
PublisherMemberListNotifier,
|
|
||||||
CursorPagingData<SnPublisherMember>
|
|
||||||
>
|
|
||||||
createElement() {
|
|
||||||
return _PublisherMemberListNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is PublisherMemberListNotifierProvider && other.uname == uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherMemberListNotifierRef
|
|
||||||
on
|
|
||||||
AutoDisposeAsyncNotifierProviderRef<
|
|
||||||
CursorPagingData<SnPublisherMember>
|
|
||||||
> {
|
|
||||||
/// The parameter `uname` of this provider.
|
|
||||||
String get uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherMemberListNotifierProviderElement
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
PublisherMemberListNotifier,
|
|
||||||
CursorPagingData<SnPublisherMember>
|
|
||||||
>
|
|
||||||
with PublisherMemberListNotifierRef {
|
|
||||||
_PublisherMemberListNotifierProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get uname => (origin as PublisherMemberListNotifierProvider).uname;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -4,60 +4,53 @@ import 'package:gap/gap.dart';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/poll.dart';
|
import 'package:island/models/poll.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
|
import 'package:island/pods/paging.dart';
|
||||||
import 'package:island/screens/poll/poll_editor.dart';
|
import 'package:island/screens/poll/poll_editor.dart';
|
||||||
import 'package:island/widgets/alert.dart';
|
import 'package:island/widgets/alert.dart';
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
|
import 'package:island/widgets/paging/pagination_list.dart';
|
||||||
import 'package:island/widgets/poll/poll_feedback.dart';
|
import 'package:island/widgets/poll/poll_feedback.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:riverpod_paging_utils/riverpod_paging_utils.dart';
|
|
||||||
import 'package:island/widgets/extended_refresh_indicator.dart';
|
import 'package:island/widgets/extended_refresh_indicator.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
||||||
part 'poll_list.g.dart';
|
part 'poll_list.g.dart';
|
||||||
|
|
||||||
@riverpod
|
final pollListNotifierProvider = AsyncNotifierProvider.family.autoDispose(
|
||||||
class PollListNotifier extends _$PollListNotifier
|
PollListNotifier.new,
|
||||||
with CursorPagingNotifierMixin<SnPollWithStats> {
|
);
|
||||||
static const int _pageSize = 20;
|
|
||||||
|
class PollListNotifier extends AsyncNotifier<List<SnPollWithStats>>
|
||||||
|
with AsyncPaginationController<SnPollWithStats> {
|
||||||
|
static const int pageSize = 20;
|
||||||
|
|
||||||
|
final String? arg;
|
||||||
|
PollListNotifier(this.arg);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CursorPagingData<SnPollWithStats>> build(String? pubName) {
|
Future<List<SnPollWithStats>> fetch() async {
|
||||||
// immediately load first page
|
|
||||||
return fetch(cursor: null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<CursorPagingData<SnPollWithStats>> fetch({
|
|
||||||
required String? cursor,
|
|
||||||
}) async {
|
|
||||||
final client = ref.read(apiClientProvider);
|
final client = ref.read(apiClientProvider);
|
||||||
final offset = cursor == null ? 0 : int.parse(cursor);
|
|
||||||
|
|
||||||
// read the current family argument passed to provider
|
// read the current family argument passed to provider
|
||||||
final currentPub = pubName;
|
|
||||||
final queryParams = {
|
final queryParams = {
|
||||||
'offset': offset,
|
'offset': fetchedCount.toString(),
|
||||||
'take': _pageSize,
|
'take': pageSize,
|
||||||
if (currentPub != null) 'pub': currentPub,
|
if (arg != null) 'pub': arg,
|
||||||
};
|
};
|
||||||
|
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
'/sphere/polls/me',
|
'/sphere/polls/me',
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
);
|
);
|
||||||
final total = int.parse(response.headers.value('X-Total') ?? '0');
|
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||||
final List<dynamic> data = response.data;
|
final items =
|
||||||
final items = data.map((json) => SnPollWithStats.fromJson(json)).toList();
|
response.data
|
||||||
|
.map((json) => SnPollWithStats.fromJson(json))
|
||||||
|
.cast<SnPollWithStats>()
|
||||||
|
.toList();
|
||||||
|
|
||||||
final hasMore = offset + items.length < total;
|
return items;
|
||||||
final nextCursor = hasMore ? (offset + items.length).toString() : null;
|
|
||||||
|
|
||||||
return CursorPagingData(
|
|
||||||
items: items,
|
|
||||||
hasMore: hasMore,
|
|
||||||
nextCursor: nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,31 +90,19 @@ class CreatorPollListScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
body: ExtendedRefreshIndicator(
|
body: ExtendedRefreshIndicator(
|
||||||
onRefresh: () => ref.refresh(pollListNotifierProvider(pubName).future),
|
onRefresh: () => ref.refresh(pollListNotifierProvider(pubName).future),
|
||||||
child: CustomScrollView(
|
child: PaginationList(
|
||||||
slivers: [
|
provider: pollListNotifierProvider(pubName),
|
||||||
PagingHelperSliverView(
|
notifier: pollListNotifierProvider(pubName).notifier,
|
||||||
provider: pollListNotifierProvider(pubName),
|
padding: const EdgeInsets.only(top: 12),
|
||||||
futureRefreshable: pollListNotifierProvider(pubName).future,
|
itemBuilder: (context, index, pollWithStats) {
|
||||||
notifierRefreshable: pollListNotifierProvider(pubName).notifier,
|
return ConstrainedBox(
|
||||||
contentBuilder:
|
constraints: BoxConstraints(maxWidth: 640),
|
||||||
(data, widgetCount, endItemView) => SliverList.builder(
|
child: _CreatorPollItem(
|
||||||
itemCount: widgetCount,
|
pollWithStats: pollWithStats,
|
||||||
itemBuilder: (context, index) {
|
pubName: pubName,
|
||||||
if (index == widgetCount - 1) {
|
),
|
||||||
return endItemView;
|
).center();
|
||||||
}
|
},
|
||||||
final pollWithStats = data.items[index];
|
|
||||||
return ConstrainedBox(
|
|
||||||
constraints: BoxConstraints(maxWidth: 640),
|
|
||||||
child: _CreatorPollItem(
|
|
||||||
pollWithStats: pollWithStats,
|
|
||||||
pubName: pubName,
|
|
||||||
),
|
|
||||||
).center();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,296 +6,80 @@ part of 'poll_list.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(pollWithStats)
|
||||||
|
const pollWithStatsProvider = PollWithStatsFamily._();
|
||||||
|
|
||||||
|
final class PollWithStatsProvider
|
||||||
|
extends
|
||||||
|
$FunctionalProvider<
|
||||||
|
AsyncValue<SnPollWithStats>,
|
||||||
|
SnPollWithStats,
|
||||||
|
FutureOr<SnPollWithStats>
|
||||||
|
>
|
||||||
|
with $FutureModifier<SnPollWithStats>, $FutureProvider<SnPollWithStats> {
|
||||||
|
const PollWithStatsProvider._({
|
||||||
|
required PollWithStatsFamily super.from,
|
||||||
|
required String super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'pollWithStatsProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$pollWithStatsHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'pollWithStatsProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<SnPollWithStats> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnPollWithStats> create(Ref ref) {
|
||||||
|
final argument = this.argument as String;
|
||||||
|
return pollWithStats(ref, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return other is PollWithStatsProvider && other.argument == argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
return argument.hashCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String _$pollWithStatsHash() => r'6bb910046ce1e09368f9922dbec52fdc2cc86740';
|
String _$pollWithStatsHash() => r'6bb910046ce1e09368f9922dbec52fdc2cc86740';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
final class PollWithStatsFamily extends $Family
|
||||||
class _SystemHash {
|
with $FunctionalFamilyOverride<FutureOr<SnPollWithStats>, String> {
|
||||||
_SystemHash._();
|
const PollWithStatsFamily._()
|
||||||
|
: super(
|
||||||
static int combine(int hash, int value) {
|
retry: null,
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
@ProviderFor(pollWithStats)
|
|
||||||
const pollWithStatsProvider = PollWithStatsFamily();
|
|
||||||
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
class PollWithStatsFamily extends Family<AsyncValue<SnPollWithStats>> {
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
const PollWithStatsFamily();
|
|
||||||
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
PollWithStatsProvider call(String id) {
|
|
||||||
return PollWithStatsProvider(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PollWithStatsProvider getProviderOverride(
|
|
||||||
covariant PollWithStatsProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'pollWithStatsProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
class PollWithStatsProvider extends AutoDisposeFutureProvider<SnPollWithStats> {
|
|
||||||
/// See also [pollWithStats].
|
|
||||||
PollWithStatsProvider(String id)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => pollWithStats(ref as PollWithStatsRef, id),
|
|
||||||
from: pollWithStatsProvider,
|
|
||||||
name: r'pollWithStatsProvider',
|
name: r'pollWithStatsProvider',
|
||||||
debugGetCreateSourceHash:
|
dependencies: null,
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
$allTransitiveDependencies: null,
|
||||||
? null
|
isAutoDispose: true,
|
||||||
: _$pollWithStatsHash,
|
|
||||||
dependencies: PollWithStatsFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PollWithStatsFamily._allTransitiveDependencies,
|
|
||||||
id: id,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
PollWithStatsProvider._internal(
|
PollWithStatsProvider call(String id) =>
|
||||||
super._createNotifier, {
|
PollWithStatsProvider._(argument: id, from: this);
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.id,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String id;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
String toString() => r'pollWithStatsProvider';
|
||||||
FutureOr<SnPollWithStats> Function(PollWithStatsRef provider) create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PollWithStatsProvider._internal(
|
|
||||||
(ref) => create(ref as PollWithStatsRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
id: id,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnPollWithStats> createElement() {
|
|
||||||
return _PollWithStatsProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is PollWithStatsProvider && other.id == id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, id.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PollWithStatsRef on AutoDisposeFutureProviderRef<SnPollWithStats> {
|
|
||||||
/// The parameter `id` of this provider.
|
|
||||||
String get id;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PollWithStatsProviderElement
|
|
||||||
extends AutoDisposeFutureProviderElement<SnPollWithStats>
|
|
||||||
with PollWithStatsRef {
|
|
||||||
_PollWithStatsProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get id => (origin as PollWithStatsProvider).id;
|
|
||||||
}
|
|
||||||
|
|
||||||
String _$pollListNotifierHash() => r'd5b822e737788be8982f5cb3b501d460441930c1';
|
|
||||||
|
|
||||||
abstract class _$PollListNotifier
|
|
||||||
extends
|
|
||||||
BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnPollWithStats>> {
|
|
||||||
late final String? pubName;
|
|
||||||
|
|
||||||
FutureOr<CursorPagingData<SnPollWithStats>> build(String? pubName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
@ProviderFor(PollListNotifier)
|
|
||||||
const pollListNotifierProvider = PollListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
class PollListNotifierFamily
|
|
||||||
extends Family<AsyncValue<CursorPagingData<SnPollWithStats>>> {
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
const PollListNotifierFamily();
|
|
||||||
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
PollListNotifierProvider call(String? pubName) {
|
|
||||||
return PollListNotifierProvider(pubName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PollListNotifierProvider getProviderOverride(
|
|
||||||
covariant PollListNotifierProvider provider,
|
|
||||||
) {
|
|
||||||
return call(provider.pubName);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'pollListNotifierProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
class PollListNotifierProvider
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderImpl<
|
|
||||||
PollListNotifier,
|
|
||||||
CursorPagingData<SnPollWithStats>
|
|
||||||
> {
|
|
||||||
/// See also [PollListNotifier].
|
|
||||||
PollListNotifierProvider(String? pubName)
|
|
||||||
: this._internal(
|
|
||||||
() => PollListNotifier()..pubName = pubName,
|
|
||||||
from: pollListNotifierProvider,
|
|
||||||
name: r'pollListNotifierProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$pollListNotifierHash,
|
|
||||||
dependencies: PollListNotifierFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PollListNotifierFamily._allTransitiveDependencies,
|
|
||||||
pubName: pubName,
|
|
||||||
);
|
|
||||||
|
|
||||||
PollListNotifierProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.pubName,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? pubName;
|
|
||||||
|
|
||||||
@override
|
|
||||||
FutureOr<CursorPagingData<SnPollWithStats>> runNotifierBuild(
|
|
||||||
covariant PollListNotifier notifier,
|
|
||||||
) {
|
|
||||||
return notifier.build(pubName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(PollListNotifier Function() create) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PollListNotifierProvider._internal(
|
|
||||||
() => create()..pubName = pubName,
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
pubName: pubName,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
PollListNotifier,
|
|
||||||
CursorPagingData<SnPollWithStats>
|
|
||||||
>
|
|
||||||
createElement() {
|
|
||||||
return _PollListNotifierProviderElement(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return other is PollListNotifierProvider && other.pubName == pubName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, pubName.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
|
||||||
// ignore: unused_element
|
|
||||||
mixin PollListNotifierRef
|
|
||||||
on AutoDisposeAsyncNotifierProviderRef<CursorPagingData<SnPollWithStats>> {
|
|
||||||
/// The parameter `pubName` of this provider.
|
|
||||||
String? get pubName;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PollListNotifierProviderElement
|
|
||||||
extends
|
|
||||||
AutoDisposeAsyncNotifierProviderElement<
|
|
||||||
PollListNotifier,
|
|
||||||
CursorPagingData<SnPollWithStats>
|
|
||||||
>
|
|
||||||
with PollListNotifierRef {
|
|
||||||
_PollListNotifierProviderElement(super.provider);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get pubName => (origin as PollListNotifierProvider).pubName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -6,163 +6,121 @@ part of 'publishers_form.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$publishersManagedHash() => r'ea83759fed9bd5119738b4d09f12b4476959e0a3';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [publishersManaged].
|
|
||||||
@ProviderFor(publishersManaged)
|
@ProviderFor(publishersManaged)
|
||||||
final publishersManagedProvider =
|
const publishersManagedProvider = PublishersManagedProvider._();
|
||||||
AutoDisposeFutureProvider<List<SnPublisher>>.internal(
|
|
||||||
publishersManaged,
|
|
||||||
name: r'publishersManagedProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publishersManagedHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class PublishersManagedProvider
|
||||||
// ignore: unused_element
|
extends
|
||||||
typedef PublishersManagedRef = AutoDisposeFutureProviderRef<List<SnPublisher>>;
|
$FunctionalProvider<
|
||||||
String _$publisherHash() => r'18fb5c6b3d79dd8af4fbee108dec1a0e8a034038';
|
AsyncValue<List<SnPublisher>>,
|
||||||
|
List<SnPublisher>,
|
||||||
/// Copied from Dart SDK
|
FutureOr<List<SnPublisher>>
|
||||||
class _SystemHash {
|
>
|
||||||
_SystemHash._();
|
with
|
||||||
|
$FutureModifier<List<SnPublisher>>,
|
||||||
static int combine(int hash, int value) {
|
$FutureProvider<List<SnPublisher>> {
|
||||||
// ignore: parameter_assignments
|
const PublishersManagedProvider._()
|
||||||
hash = 0x1fffffff & (hash + value);
|
: super(
|
||||||
// ignore: parameter_assignments
|
from: null,
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
argument: null,
|
||||||
return hash ^ (hash >> 6);
|
retry: null,
|
||||||
}
|
name: r'publishersManagedProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
static int finish(int hash) {
|
dependencies: null,
|
||||||
// ignore: parameter_assignments
|
$allTransitiveDependencies: null,
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisher].
|
|
||||||
@ProviderFor(publisher)
|
|
||||||
const publisherProvider = PublisherFamily();
|
|
||||||
|
|
||||||
/// See also [publisher].
|
|
||||||
class PublisherFamily extends Family<AsyncValue<SnPublisher?>> {
|
|
||||||
/// See also [publisher].
|
|
||||||
const PublisherFamily();
|
|
||||||
|
|
||||||
/// See also [publisher].
|
|
||||||
PublisherProvider call(String? identifier) {
|
|
||||||
return PublisherProvider(identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
PublisherProvider getProviderOverride(covariant PublisherProvider provider) {
|
|
||||||
return call(provider.identifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publisherProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publisher].
|
|
||||||
class PublisherProvider extends AutoDisposeFutureProvider<SnPublisher?> {
|
|
||||||
/// See also [publisher].
|
|
||||||
PublisherProvider(String? identifier)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publisher(ref as PublisherRef, identifier),
|
|
||||||
from: publisherProvider,
|
|
||||||
name: r'publisherProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publisherHash,
|
|
||||||
dependencies: PublisherFamily._dependencies,
|
|
||||||
allTransitiveDependencies: PublisherFamily._allTransitiveDependencies,
|
|
||||||
identifier: identifier,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
PublisherProvider._internal(
|
@override
|
||||||
super._createNotifier, {
|
String debugGetCreateSourceHash() => _$publishersManagedHash();
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.identifier,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String? identifier;
|
@$internal
|
||||||
|
@override
|
||||||
|
$FutureProviderElement<List<SnPublisher>> $createElement(
|
||||||
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Override overrideWith(
|
FutureOr<List<SnPublisher>> create(Ref ref) {
|
||||||
FutureOr<SnPublisher?> Function(PublisherRef provider) create,
|
return publishersManaged(ref);
|
||||||
) {
|
}
|
||||||
return ProviderOverride(
|
}
|
||||||
origin: this,
|
|
||||||
override: PublisherProvider._internal(
|
String _$publishersManagedHash() => r'ea83759fed9bd5119738b4d09f12b4476959e0a3';
|
||||||
(ref) => create(ref as PublisherRef),
|
|
||||||
from: from,
|
@ProviderFor(publisher)
|
||||||
name: null,
|
const publisherProvider = PublisherFamily._();
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
final class PublisherProvider
|
||||||
debugGetCreateSourceHash: null,
|
extends
|
||||||
identifier: identifier,
|
$FunctionalProvider<
|
||||||
),
|
AsyncValue<SnPublisher?>,
|
||||||
);
|
SnPublisher?,
|
||||||
|
FutureOr<SnPublisher?>
|
||||||
|
>
|
||||||
|
with $FutureModifier<SnPublisher?>, $FutureProvider<SnPublisher?> {
|
||||||
|
const PublisherProvider._({
|
||||||
|
required PublisherFamily super.from,
|
||||||
|
required String? super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$publisherHash();
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publisherProvider'
|
||||||
|
''
|
||||||
|
'($argument)';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
AutoDisposeFutureProviderElement<SnPublisher?> createElement() {
|
$FutureProviderElement<SnPublisher?> $createElement(
|
||||||
return _PublisherProviderElement(this);
|
$ProviderPointer pointer,
|
||||||
|
) => $FutureProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<SnPublisher?> create(Ref ref) {
|
||||||
|
final argument = this.argument as String?;
|
||||||
|
return publisher(ref, argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PublisherProvider && other.identifier == identifier;
|
return other is PublisherProvider && other.argument == argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, identifier.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$publisherHash() => r'18fb5c6b3d79dd8af4fbee108dec1a0e8a034038';
|
||||||
// ignore: unused_element
|
|
||||||
mixin PublisherRef on AutoDisposeFutureProviderRef<SnPublisher?> {
|
|
||||||
/// The parameter `identifier` of this provider.
|
|
||||||
String? get identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PublisherProviderElement
|
final class PublisherFamily extends $Family
|
||||||
extends AutoDisposeFutureProviderElement<SnPublisher?>
|
with $FunctionalFamilyOverride<FutureOr<SnPublisher?>, String?> {
|
||||||
with PublisherRef {
|
const PublisherFamily._()
|
||||||
_PublisherProviderElement(super.provider);
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publisherProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
PublisherProvider call(String? identifier) =>
|
||||||
|
PublisherProvider._(argument: identifier, from: this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? get identifier => (origin as PublisherProvider).identifier;
|
String toString() => r'publisherProvider';
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -8,18 +8,16 @@ import 'package:island/pods/site_pages.dart';
|
|||||||
import 'package:island/widgets/sites/page_form.dart';
|
import 'package:island/widgets/sites/page_form.dart';
|
||||||
import 'package:island/widgets/sites/site_action_menu.dart';
|
import 'package:island/widgets/sites/site_action_menu.dart';
|
||||||
import 'package:island/widgets/sites/site_detail_content.dart';
|
import 'package:island/widgets/sites/site_detail_content.dart';
|
||||||
|
import 'package:island/widgets/sites/site_info_card.dart';
|
||||||
import 'package:island/widgets/app_scaffold.dart';
|
import 'package:island/widgets/app_scaffold.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:island/widgets/sites/info_row.dart';
|
|
||||||
import 'package:island/widgets/sites/pages_section.dart';
|
import 'package:island/widgets/sites/pages_section.dart';
|
||||||
import 'package:island/widgets/sites/file_management_section.dart';
|
import 'package:island/widgets/sites/file_management_section.dart';
|
||||||
import 'package:island/widgets/sites/file_management_action_section.dart';
|
import 'package:island/widgets/sites/file_management_action_section.dart';
|
||||||
import 'package:island/services/responsive.dart';
|
import 'package:island/services/responsive.dart';
|
||||||
import 'package:island/services/time.dart';
|
|
||||||
import 'package:island/widgets/extended_refresh_indicator.dart';
|
import 'package:island/widgets/extended_refresh_indicator.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
|
||||||
|
|
||||||
part 'site_detail.g.dart';
|
part 'site_detail.g.dart';
|
||||||
|
|
||||||
@@ -67,7 +65,6 @@ class PublicationSiteDetailScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
body: siteAsync.when(
|
body: siteAsync.when(
|
||||||
data: (site) {
|
data: (site) {
|
||||||
final theme = Theme.of(context);
|
|
||||||
if (isWideScreen(context)) {
|
if (isWideScreen(context)) {
|
||||||
return ExtendedRefreshIndicator(
|
return ExtendedRefreshIndicator(
|
||||||
onRefresh:
|
onRefresh:
|
||||||
@@ -99,76 +96,7 @@ class PublicationSiteDetailScreen extends HookConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Card(
|
SiteInfoCard(site: site),
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'siteInformation'.tr(),
|
|
||||||
style: theme.textTheme.titleMedium
|
|
||||||
?.copyWith(fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
const Gap(16),
|
|
||||||
InfoRow(
|
|
||||||
label: 'name'.tr(),
|
|
||||||
value: site.name,
|
|
||||||
icon: Symbols.title,
|
|
||||||
),
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'slug'.tr(),
|
|
||||||
value: site.slug,
|
|
||||||
icon: Symbols.tag,
|
|
||||||
monospace: true,
|
|
||||||
),
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'siteDomain'.tr(),
|
|
||||||
value: '${site.slug}.solian.page',
|
|
||||||
icon: Symbols.globe,
|
|
||||||
monospace: true,
|
|
||||||
onTap: () {
|
|
||||||
final url =
|
|
||||||
'https://${site.slug}.solian.page';
|
|
||||||
launchUrlString(url);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'siteMode'.tr(),
|
|
||||||
value:
|
|
||||||
site.mode == 0
|
|
||||||
? 'siteModeFullyManaged'.tr()
|
|
||||||
: 'siteModeSelfManaged'.tr(),
|
|
||||||
icon: Symbols.settings,
|
|
||||||
),
|
|
||||||
if (site.description != null &&
|
|
||||||
site.description!.isNotEmpty) ...[
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'description'.tr(),
|
|
||||||
value: site.description!,
|
|
||||||
icon: Symbols.description,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'siteCreated'.tr(),
|
|
||||||
value: site.createdAt.formatSystem(),
|
|
||||||
icon: Symbols.calendar_add_on,
|
|
||||||
),
|
|
||||||
const Gap(8),
|
|
||||||
InfoRow(
|
|
||||||
label: 'siteUpdated'.tr(),
|
|
||||||
value: site.updatedAt.formatSystem(),
|
|
||||||
icon: Symbols.update,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
if (site.mode == 1) // Self-Managed only
|
if (site.mode == 1) // Self-Managed only
|
||||||
FileManagementActionSection(
|
FileManagementActionSection(
|
||||||
|
|||||||
@@ -6,168 +6,90 @@ part of 'site_detail.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$publicationSiteDetailHash() =>
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
r'e5d259ea39c4ba47e92d37e644fc3d84984927a9';
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
|
||||||
class _SystemHash {
|
|
||||||
_SystemHash._();
|
|
||||||
|
|
||||||
static int combine(int hash, int value) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + value);
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
|
||||||
return hash ^ (hash >> 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int finish(int hash) {
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
|
||||||
// ignore: parameter_assignments
|
|
||||||
hash = hash ^ (hash >> 11);
|
|
||||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publicationSiteDetail].
|
|
||||||
@ProviderFor(publicationSiteDetail)
|
@ProviderFor(publicationSiteDetail)
|
||||||
const publicationSiteDetailProvider = PublicationSiteDetailFamily();
|
const publicationSiteDetailProvider = PublicationSiteDetailFamily._();
|
||||||
|
|
||||||
/// See also [publicationSiteDetail].
|
final class PublicationSiteDetailProvider
|
||||||
class PublicationSiteDetailFamily
|
extends
|
||||||
extends Family<AsyncValue<SnPublicationSite>> {
|
$FunctionalProvider<
|
||||||
/// See also [publicationSiteDetail].
|
AsyncValue<SnPublicationSite>,
|
||||||
const PublicationSiteDetailFamily();
|
SnPublicationSite,
|
||||||
|
FutureOr<SnPublicationSite>
|
||||||
|
>
|
||||||
|
with
|
||||||
|
$FutureModifier<SnPublicationSite>,
|
||||||
|
$FutureProvider<SnPublicationSite> {
|
||||||
|
const PublicationSiteDetailProvider._({
|
||||||
|
required PublicationSiteDetailFamily super.from,
|
||||||
|
required (String, String) super.argument,
|
||||||
|
}) : super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publicationSiteDetailProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
/// See also [publicationSiteDetail].
|
@override
|
||||||
PublicationSiteDetailProvider call(String pubName, String siteSlug) {
|
String debugGetCreateSourceHash() => _$publicationSiteDetailHash();
|
||||||
return PublicationSiteDetailProvider(pubName, siteSlug);
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return r'publicationSiteDetailProvider'
|
||||||
|
''
|
||||||
|
'$argument';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@$internal
|
||||||
@override
|
@override
|
||||||
PublicationSiteDetailProvider getProviderOverride(
|
$FutureProviderElement<SnPublicationSite> $createElement(
|
||||||
covariant PublicationSiteDetailProvider provider,
|
$ProviderPointer pointer,
|
||||||
) {
|
) => $FutureProviderElement(pointer);
|
||||||
return call(provider.pubName, provider.siteSlug);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
FutureOr<SnPublicationSite> create(Ref ref) {
|
||||||
|
final argument = this.argument as (String, String);
|
||||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
return publicationSiteDetail(ref, argument.$1, argument.$2);
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
|
||||||
_allTransitiveDependencies;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String? get name => r'publicationSiteDetailProvider';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// See also [publicationSiteDetail].
|
|
||||||
class PublicationSiteDetailProvider
|
|
||||||
extends AutoDisposeFutureProvider<SnPublicationSite> {
|
|
||||||
/// See also [publicationSiteDetail].
|
|
||||||
PublicationSiteDetailProvider(String pubName, String siteSlug)
|
|
||||||
: this._internal(
|
|
||||||
(ref) => publicationSiteDetail(
|
|
||||||
ref as PublicationSiteDetailRef,
|
|
||||||
pubName,
|
|
||||||
siteSlug,
|
|
||||||
),
|
|
||||||
from: publicationSiteDetailProvider,
|
|
||||||
name: r'publicationSiteDetailProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$publicationSiteDetailHash,
|
|
||||||
dependencies: PublicationSiteDetailFamily._dependencies,
|
|
||||||
allTransitiveDependencies:
|
|
||||||
PublicationSiteDetailFamily._allTransitiveDependencies,
|
|
||||||
pubName: pubName,
|
|
||||||
siteSlug: siteSlug,
|
|
||||||
);
|
|
||||||
|
|
||||||
PublicationSiteDetailProvider._internal(
|
|
||||||
super._createNotifier, {
|
|
||||||
required super.name,
|
|
||||||
required super.dependencies,
|
|
||||||
required super.allTransitiveDependencies,
|
|
||||||
required super.debugGetCreateSourceHash,
|
|
||||||
required super.from,
|
|
||||||
required this.pubName,
|
|
||||||
required this.siteSlug,
|
|
||||||
}) : super.internal();
|
|
||||||
|
|
||||||
final String pubName;
|
|
||||||
final String siteSlug;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Override overrideWith(
|
|
||||||
FutureOr<SnPublicationSite> Function(PublicationSiteDetailRef provider)
|
|
||||||
create,
|
|
||||||
) {
|
|
||||||
return ProviderOverride(
|
|
||||||
origin: this,
|
|
||||||
override: PublicationSiteDetailProvider._internal(
|
|
||||||
(ref) => create(ref as PublicationSiteDetailRef),
|
|
||||||
from: from,
|
|
||||||
name: null,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
debugGetCreateSourceHash: null,
|
|
||||||
pubName: pubName,
|
|
||||||
siteSlug: siteSlug,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
AutoDisposeFutureProviderElement<SnPublicationSite> createElement() {
|
|
||||||
return _PublicationSiteDetailProviderElement(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
return other is PublicationSiteDetailProvider &&
|
return other is PublicationSiteDetailProvider && other.argument == argument;
|
||||||
other.pubName == pubName &&
|
|
||||||
other.siteSlug == siteSlug;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
return argument.hashCode;
|
||||||
hash = _SystemHash.combine(hash, pubName.hashCode);
|
|
||||||
hash = _SystemHash.combine(hash, siteSlug.hashCode);
|
|
||||||
|
|
||||||
return _SystemHash.finish(hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
String _$publicationSiteDetailHash() =>
|
||||||
// ignore: unused_element
|
r'e5d259ea39c4ba47e92d37e644fc3d84984927a9';
|
||||||
mixin PublicationSiteDetailRef
|
|
||||||
on AutoDisposeFutureProviderRef<SnPublicationSite> {
|
|
||||||
/// The parameter `pubName` of this provider.
|
|
||||||
String get pubName;
|
|
||||||
|
|
||||||
/// The parameter `siteSlug` of this provider.
|
final class PublicationSiteDetailFamily extends $Family
|
||||||
String get siteSlug;
|
with
|
||||||
}
|
$FunctionalFamilyOverride<
|
||||||
|
FutureOr<SnPublicationSite>,
|
||||||
|
(String, String)
|
||||||
|
> {
|
||||||
|
const PublicationSiteDetailFamily._()
|
||||||
|
: super(
|
||||||
|
retry: null,
|
||||||
|
name: r'publicationSiteDetailProvider',
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
isAutoDispose: true,
|
||||||
|
);
|
||||||
|
|
||||||
class _PublicationSiteDetailProviderElement
|
PublicationSiteDetailProvider call(String pubName, String siteSlug) =>
|
||||||
extends AutoDisposeFutureProviderElement<SnPublicationSite>
|
PublicationSiteDetailProvider._(
|
||||||
with PublicationSiteDetailRef {
|
argument: (pubName, siteSlug),
|
||||||
_PublicationSiteDetailProviderElement(super.provider);
|
from: this,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get pubName => (origin as PublicationSiteDetailProvider).pubName;
|
String toString() => r'publicationSiteDetailProvider';
|
||||||
@override
|
|
||||||
String get siteSlug => (origin as PublicationSiteDetailProvider).siteSlug;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ class SiteForm extends HookConsumerWidget {
|
|||||||
final confirmed = await showConfirmAlert(
|
final confirmed = await showConfirmAlert(
|
||||||
'publicationSiteDeleteConfirm'.tr(),
|
'publicationSiteDeleteConfirm'.tr(),
|
||||||
'deletePublicationSite'.tr(),
|
'deletePublicationSite'.tr(),
|
||||||
|
isDanger: true,
|
||||||
);
|
);
|
||||||
if (confirmed != true) return;
|
if (confirmed != true) return;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user