From 6d8e9857b6e734f718769c580ca7f051618e059b Mon Sep 17 00:00:00 2001 From: leoafarias <435833+leoafarias@users.noreply.github.com> Date: Fri, 18 Jun 2021 19:13:18 -0400 Subject: [PATCH 1/3] Added trending and clean up package screen --- lib/generated/intl/messages_de.dart | 369 +++++++++++------- lib/generated/intl/messages_en.dart | 355 ++++++++++------- lib/generated/l10n.dart | 52 +-- lib/l10n/intl_de.arb | 2 - lib/l10n/intl_en.arb | 2 - .../modules/common/utils/dependencies.dart | 47 +-- lib/src/modules/common/utils/helpers.dart | 3 + .../components/package_github_info.dart | 54 --- .../components/package_list_item.dart | 166 ++++---- .../trending_package_list_item.dart | 87 +++++ lib/src/modules/packages/package.dto.dart | 9 +- .../modules/packages/packages.provider.dart | 69 ++-- lib/src/modules/packages/packages.screen.dart | 73 ++-- .../scenes/github_trending.scene.dart | 47 +++ .../packages/scenes/used_packages.scene.dart | 49 +++ .../packages/trending_package.dto.dart | 85 ++++ .../settings/scenes/fvm_settings.scene.dart | 10 - macos/Flutter/GeneratedPluginRegistrant.swift | 2 - macos/Podfile.lock | 6 - macos/Runner.xcodeproj/project.pbxproj | 2 - pubspec.lock | 56 +-- pubspec.yaml | 3 +- 22 files changed, 882 insertions(+), 666 deletions(-) delete mode 100644 lib/src/modules/packages/components/package_github_info.dart create mode 100644 lib/src/modules/packages/components/trending_package_list_item.dart create mode 100644 lib/src/modules/packages/scenes/github_trending.scene.dart create mode 100644 lib/src/modules/packages/scenes/used_packages.scene.dart create mode 100644 lib/src/modules/packages/trending_package.dto.dart diff --git a/lib/generated/intl/messages_de.dart b/lib/generated/intl/messages_de.dart index bb9c3a28..9fe6e29f 100644 --- a/lib/generated/intl/messages_de.dart +++ b/lib/generated/intl/messages_de.dart @@ -19,9 +19,11 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'de'; - static m0(updateInfoLatest) => "Eine neue Version von Sidekick ist verfügbar (${updateInfoLatest})."; + static m0(updateInfoLatest) => + "Eine neue Version von Sidekick ist verfügbar (${updateInfoLatest})."; - static m1(itemVersionName) => "Channel ${itemVersionName} wurde aktualisiert."; + static m1(itemVersionName) => + "Channel ${itemVersionName} wurde aktualisiert."; static m2(url) => "Konnte ${url} nicht öffnen"; @@ -35,153 +37,234 @@ class MessageLookup extends MessageLookupByLibrary { static m7(releases) => "${releases} Versionen"; - static m8(updateInfoLatest) => "Sidekick version ${updateInfoLatest} ist nun Verfügbar."; + static m8(updateInfoLatest) => + "Sidekick version ${updateInfoLatest} ist nun Verfügbar."; - static m9(itemname) => "Dadurch wird ${itemname} aus dem Cache von Ihrem System entfernt."; + static m9(itemname) => + "Dadurch wird ${itemname} aus dem Cache von Ihrem System entfernt."; - static m10(itemVersionName) => "Die Version ${itemVersionName} wurde installiert."; + static m10(itemVersionName) => + "Die Version ${itemVersionName} wurde installiert."; - static m11(itemVersionName) => "Die Version ${itemVersionName} wurde entfernt."; + static m11(itemVersionName) => + "Die Version ${itemVersionName} wurde entfernt."; - static m12(itemVersionName) => "Version ${itemVersionName} wurde als global festgelegt."; + static m12(itemVersionName) => + "Version ${itemVersionName} wurde als global festgelegt."; - static m13(itemVersionName) => "Version ${itemVersionName} hat das Setup beendet."; + static m13(itemVersionName) => + "Version ${itemVersionName} hat das Setup beendet."; - static m14(version, projectName) => "Version ${version} angeheftet an ${projectName}"; + static m14(version, projectName) => + "Version ${version} angeheftet an ${projectName}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "aNewVersionOfSidekickIsAvailableUpdateinfolatest" : m0, - "addProject" : MessageLookupByLibrary.simpleMessage("Projekt hinzufügen"), - "addYourFlutterProjectProjectsInformationWillBeDisplayedHere" : MessageLookupByLibrary.simpleMessage("Fügen Sie Ihr Flutter-Projekt hinzu Die Projektinformationen werden hier angezeigt."), - "advanced" : MessageLookupByLibrary.simpleMessage("Erweitert"), - "analyticsCrashReportSubtitle" : MessageLookupByLibrary.simpleMessage("Wenn ein Flutter-Befehl abstürzt, wird versucht, einen Absturzbericht an Google zu senden, damit Google im Laufe der Zeit Verbesserungen an Flutter beisteuern kann"), - "analyticsCrashReporting" : MessageLookupByLibrary.simpleMessage("Analytik & Crash-Berichterstattung"), - "appSettingsHaveBeenReset" : MessageLookupByLibrary.simpleMessage("Die App-Einstellungen wurden zurückgesetzt"), - "areYouSureYouWantToRemove" : MessageLookupByLibrary.simpleMessage("Sind Sie sicher, dass Sie entfernen möchten?"), - "areYouSureYouWantToResetSettings" : MessageLookupByLibrary.simpleMessage("Sind Sie sicher, dass Sie die Einstellungen zurücksetzen wollen?"), - "betaChannelDescription" : MessageLookupByLibrary.simpleMessage("Zweig, der für eine neue Betaversion am Monatsanfang, in der Regel am ersten Montag, von master erstellt wird. Dieser wird einen Zweig für Dart, die Engine und das Framework enthalten."), - "betaReleases" : MessageLookupByLibrary.simpleMessage("Beta Releases"), - "cacheLocation" : MessageLookupByLibrary.simpleMessage("Cache-Speicherort"), - "cancel" : MessageLookupByLibrary.simpleMessage("Abbrechen"), - "changeThePathTo" : MessageLookupByLibrary.simpleMessage("Ändere den Path zu\n"), - "changelog" : MessageLookupByLibrary.simpleMessage("Änderungsprotokoll"), - "channel" : MessageLookupByLibrary.simpleMessage("Channel"), - "channelItemversionnameHasBeenUpgraded" : m1, - "channels" : MessageLookupByLibrary.simpleMessage("Channels"), - "choose" : MessageLookupByLibrary.simpleMessage("Wählen Sie"), - "cleanUp" : MessageLookupByLibrary.simpleMessage("Säubern"), - "cleanUpTooltip" : MessageLookupByLibrary.simpleMessage("Nicht verwendete Versionen bereinigen."), - "cleanUpUnusedVersions" : MessageLookupByLibrary.simpleMessage("Nicht verwendete Versionen bereinigen"), - "clickHereToDownload" : MessageLookupByLibrary.simpleMessage("Klicken Sie hier zum Download."), - "close" : MessageLookupByLibrary.simpleMessage("Schließen"), - "confirm" : MessageLookupByLibrary.simpleMessage("Bestätigen"), - "copiedToClipboard" : MessageLookupByLibrary.simpleMessage("In die Zwischenablage kopiert"), - "couldNotLaunchUrl" : m2, - "couldNotSaveSettings" : MessageLookupByLibrary.simpleMessage("Einstellungen konnten nicht gespeichert werden"), - "countFound" : m3, - "createdDate" : MessageLookupByLibrary.simpleMessage("Erstelldatum"), - "dark" : MessageLookupByLibrary.simpleMessage("Dunkel"), - "dependenciesAfterANewVersionIsInstalled" : MessageLookupByLibrary.simpleMessage("Abhängigkeiten, nachdem eine neue Version installiert wurde."), - "details" : MessageLookupByLibrary.simpleMessage("Details"), - "devChannelDescription" : MessageLookupByLibrary.simpleMessage("Der letzte vollständig getestete Build. Normalerweise funktionstüchtig, aber unter \"Schlechte Builds\" finden Sie eine Liste bekannter \"schlechter\" Dev-Builds."), - "devReleases" : MessageLookupByLibrary.simpleMessage("Dev Releases"), - "doYouWantToRemoveThemToFreeUpSpace" : MessageLookupByLibrary.simpleMessage("Möchten Sie es entfernen, um Speicherplatz freizugeben?"), - "downloadZip" : MessageLookupByLibrary.simpleMessage("Zip herunterladen"), - "exploreFlutterReleases" : MessageLookupByLibrary.simpleMessage("Erkunde Flutter Releases"), - "flutterPathIsPointingTon" : MessageLookupByLibrary.simpleMessage("Flutter PATH verweist auf\n "), - "flutterSDKGlobalDescription" : MessageLookupByLibrary.simpleMessage("Eine Flutter-Sdk-Version muss als global eingestellt werden, um auf die Flutter-Einstellungen zugreifen zu können"), - "flutterSdkNotInstalled" : MessageLookupByLibrary.simpleMessage("Flutter SDK nicht installiert."), - "fvmOnly" : MessageLookupByLibrary.simpleMessage("Nur FVM"), - "general" : MessageLookupByLibrary.simpleMessage("Allgemein"), - "gitCache" : MessageLookupByLibrary.simpleMessage("Git Cache"), - "gitCacheSubtitle" : MessageLookupByLibrary.simpleMessage("Dadurch wird das Haupt-Repository von Flutter für schnellere und kleinere Installationen zwischengespeichert"), - "global" : MessageLookupByLibrary.simpleMessage("Global"), - "globalConfiguration" : MessageLookupByLibrary.simpleMessage("Globale Konfiguration"), - "hash" : MessageLookupByLibrary.simpleMessage("Hash"), - "howToUpdateYourPath" : MessageLookupByLibrary.simpleMessage("Wie soll man den Pfad aktualisieren?"), - "ifYouWantToFlutterSdkThroughFvm" : MessageLookupByLibrary.simpleMessage("wenn Sie Flutter SDK durch FVM"), - "inUse" : MessageLookupByLibrary.simpleMessage("Verwendet"), - "installedVersions" : MessageLookupByLibrary.simpleMessage("Installierte Versionen"), - "invalidChanel" : MessageLookupByLibrary.simpleMessage("Invalid chanel"), - "language" : MessageLookupByLibrary.simpleMessage("Sprache"), - "later" : MessageLookupByLibrary.simpleMessage("Später"), - "light" : MessageLookupByLibrary.simpleMessage("Hell"), - "likes" : MessageLookupByLibrary.simpleMessage("Likes"), - "localCacheInformation" : MessageLookupByLibrary.simpleMessage("Lokale Cache-Informationen"), - "master" : MessageLookupByLibrary.simpleMessage("Master"), - "masterChannelDescription" : MessageLookupByLibrary.simpleMessage("Der aktuelle Tip-of-Tree, der absolut neueste Cutting Edge Build. Normalerweise funktional, obwohl wir manchmal versehentlich Dinge kaputt machen."), - "mostUsedPackages" : MessageLookupByLibrary.simpleMessage("Meistgenutzte Pakete"), - "navButtonDashboard" : MessageLookupByLibrary.simpleMessage("Dashboard"), - "navButtonExplore" : MessageLookupByLibrary.simpleMessage("Erkunden"), - "navButtonPackages" : MessageLookupByLibrary.simpleMessage("Pakete"), - "navButtonProjects" : MessageLookupByLibrary.simpleMessage("Projekte"), - "noFlutterProjectsHaveBeenAddedYet" : MessageLookupByLibrary.simpleMessage("Es wurden noch keine Flutter-Projekte hinzugefügt."), - "noFlutterVersionInstalledMessage" : MessageLookupByLibrary.simpleMessage("Sie haben derzeit keine Flutter SDK Versionen installiert. Versionen oder Kanäle, die installiert wurden, werden hier angezeigt."), - "noPackagesFound" : MessageLookupByLibrary.simpleMessage("Keine Pakete gefunden"), - "noResults" : MessageLookupByLibrary.simpleMessage("No Results"), - "noUnusedFlutterSdkVersionsInstalled" : MessageLookupByLibrary.simpleMessage("Keine unbenutzten Flutter SDK Versionen installiert"), - "notAFlutterProject" : MessageLookupByLibrary.simpleMessage("Kein Flutter-Projekt"), - "notRunning" : MessageLookupByLibrary.simpleMessage("Läuft nicht"), - "nothingSelected" : MessageLookupByLibrary.simpleMessage("Nichts ausgewähl"), - "numberOfCachedVersions" : m4, - "ok" : MessageLookupByLibrary.simpleMessage("OK"), - "onlyDisplayProjectsThatHaveVersionsPinned" : MessageLookupByLibrary.simpleMessage("Nur Projekte anzeigen, die Versionen angeheftet haben"), - "open" : MessageLookupByLibrary.simpleMessage("öffnen"), - "openTerminalPlayground" : MessageLookupByLibrary.simpleMessage("Terminal Playground öffnen"), - "packageprojectscountProjects" : m5, - "platforms" : MessageLookupByLibrary.simpleMessage("Platformen"), - "playground" : MessageLookupByLibrary.simpleMessage("Playground"), - "popularity" : MessageLookupByLibrary.simpleMessage("Popularität"), - "projects" : MessageLookupByLibrary.simpleMessage("Projekte"), - "projectsProjects" : m6, - "projectsRefreshed" : MessageLookupByLibrary.simpleMessage("Projekte aktualisiert"), - "pubPoints" : MessageLookupByLibrary.simpleMessage("Pub Punkte"), - "refresh" : MessageLookupByLibrary.simpleMessage("Aktualisieren"), - "releaseDate" : MessageLookupByLibrary.simpleMessage("Freigabedatum"), - "releaseNotes" : MessageLookupByLibrary.simpleMessage("Freigabemitteilungen"), - "releases" : MessageLookupByLibrary.simpleMessage("Releases"), - "releasesVersions" : m7, - "remove" : MessageLookupByLibrary.simpleMessage("Löschen"), - "reset" : MessageLookupByLibrary.simpleMessage("Zurücksetzen"), - "resetToDefaultSettings" : MessageLookupByLibrary.simpleMessage("Zurücksetzen auf Standardeinstellungen"), - "sdkHasNotFinishedSetup" : MessageLookupByLibrary.simpleMessage("SDK hat das Setup nicht abgeschlossen"), - "search" : MessageLookupByLibrary.simpleMessage("Suche... "), - "selectAFlutterSdkVersion" : MessageLookupByLibrary.simpleMessage("Wählen Sie eine Flutter SDK Version"), - "selectAThemeOrSwitchAccordingToSystemSettings" : MessageLookupByLibrary.simpleMessage("Wählen Sie ein Thema oder schalten Sie entsprechend den Systemeinstellungen um."), - "setAsGlobal" : MessageLookupByLibrary.simpleMessage("Als global festlegen"), - "settingsHaveBeenSaved" : MessageLookupByLibrary.simpleMessage("Die Einstellungen wurden gespeichert"), - "sha256" : MessageLookupByLibrary.simpleMessage("Sha256"), - "sidekickVersionUpdateinfolatestIsNowAvailable" : m8, - "skipSetupFlutterOnInstall" : MessageLookupByLibrary.simpleMessage("Einrichtung von Flutter bei der Installation überspringen"), - "stableChannelDescription" : MessageLookupByLibrary.simpleMessage("Wir empfehlen, dass Sie diesen Kanal für alle Produktions-App-Veröffentlichungen verwenden. Ungefähr einmal im Quartal wird ein Zweig, der auf Beta stabilisiert wurde, unser nächster stabiler Zweig und wir erstellen eine stabile Version von diesem Zweig."), - "stableReleases" : MessageLookupByLibrary.simpleMessage("Stable Releases"), - "start" : MessageLookupByLibrary.simpleMessage("start"), - "system" : MessageLookupByLibrary.simpleMessage("System"), - "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional" : MessageLookupByLibrary.simpleMessage("Der aktuelle Tip-of-Tree, der absolut neueste Cutting Edge Build. Normalerweise funktional, obwohl wir manchmal versehentlich Dinge kaputt machen."), - "theme" : MessageLookupByLibrary.simpleMessage("Theme"), - "thereWasAnIsssueOpeningSidekick" : MessageLookupByLibrary.simpleMessage("Es gab ein Problem beim Öffnen von Sidekick"), - "thereWasAnIssueLoadingYourPackages" : MessageLookupByLibrary.simpleMessage("Es gab ein Problem beim Laden Ihrer Pakete."), - "theseVersionAreNotPinnedToAProject" : MessageLookupByLibrary.simpleMessage("Diese Versionen sind nicht an ein Projekt angeheftet "), - "thisWillOnlyCloneFlutterAndNotInstall" : MessageLookupByLibrary.simpleMessage("Dadurch wird Flutter nur geklont und nicht installiert "), - "thisWillOnlyResetSidekickSpecificPreferences" : MessageLookupByLibrary.simpleMessage("Dadurch werden nur Sidekick-spezifische Einstellungen zurückgesetzt"), - "thisWillRemoveItemnameCacheFromYourSystem" : m9, - "unused" : MessageLookupByLibrary.simpleMessage("Nicht verwendet"), - "updateAvailable" : MessageLookupByLibrary.simpleMessage("Update verfügbar."), - "updateNow" : MessageLookupByLibrary.simpleMessage("Jetzt aktualisieren"), - "upgrade" : MessageLookupByLibrary.simpleMessage("Upgrade"), - "version" : MessageLookupByLibrary.simpleMessage("Version"), - "versionIsInstalled" : MessageLookupByLibrary.simpleMessage("Version ist installiert"), - "versionItemversionnameHasBeenInstalled" : m10, - "versionItemversionnameHasBeenRemoved" : m11, - "versionItemversionnameHasBeenSetAsGlobal" : m12, - "versionItemversionnameHasFinishedSetup" : m13, - "versionNotInstalledClickToInstall" : MessageLookupByLibrary.simpleMessage("Version nicht installiert. Klicken Sie zum Installieren."), - "versionVersionPinnedToProjectname" : m14, - "versions" : MessageLookupByLibrary.simpleMessage("Versionen"), - "web" : MessageLookupByLibrary.simpleMessage("Web"), - "website" : MessageLookupByLibrary.simpleMessage("Website"), - "youNeedToAddAFlutterProjectFirstPackageInformation" : MessageLookupByLibrary.simpleMessage("Sie müssen zuerst ein Flutter-Projekt hinzufügen. Die Paketinformationen werden hier angezeigt."), - "zipFileWithAllReleaseDependencies" : MessageLookupByLibrary.simpleMessage("Zip-Datei mit allen Release-Abhängigkeiten.") - }; + static _notInlinedMessages(_) => { + "aNewVersionOfSidekickIsAvailableUpdateinfolatest": m0, + "addProject": + MessageLookupByLibrary.simpleMessage("Projekt hinzufügen"), + "addYourFlutterProjectProjectsInformationWillBeDisplayedHere": + MessageLookupByLibrary.simpleMessage( + "Fügen Sie Ihr Flutter-Projekt hinzu Die Projektinformationen werden hier angezeigt."), + "advanced": MessageLookupByLibrary.simpleMessage("Erweitert"), + "analyticsCrashReportSubtitle": MessageLookupByLibrary.simpleMessage( + "Wenn ein Flutter-Befehl abstürzt, wird versucht, einen Absturzbericht an Google zu senden, damit Google im Laufe der Zeit Verbesserungen an Flutter beisteuern kann"), + "analyticsCrashReporting": MessageLookupByLibrary.simpleMessage( + "Analytik & Crash-Berichterstattung"), + "appSettingsHaveBeenReset": MessageLookupByLibrary.simpleMessage( + "Die App-Einstellungen wurden zurückgesetzt"), + "areYouSureYouWantToRemove": MessageLookupByLibrary.simpleMessage( + "Sind Sie sicher, dass Sie entfernen möchten?"), + "areYouSureYouWantToResetSettings": MessageLookupByLibrary.simpleMessage( + "Sind Sie sicher, dass Sie die Einstellungen zurücksetzen wollen?"), + "betaChannelDescription": MessageLookupByLibrary.simpleMessage( + "Zweig, der für eine neue Betaversion am Monatsanfang, in der Regel am ersten Montag, von master erstellt wird. Dieser wird einen Zweig für Dart, die Engine und das Framework enthalten."), + "betaReleases": MessageLookupByLibrary.simpleMessage("Beta Releases"), + "cacheLocation": + MessageLookupByLibrary.simpleMessage("Cache-Speicherort"), + "cancel": MessageLookupByLibrary.simpleMessage("Abbrechen"), + "changeThePathTo": + MessageLookupByLibrary.simpleMessage("Ändere den Path zu\n"), + "changelog": MessageLookupByLibrary.simpleMessage("Änderungsprotokoll"), + "channel": MessageLookupByLibrary.simpleMessage("Channel"), + "channelItemversionnameHasBeenUpgraded": m1, + "channels": MessageLookupByLibrary.simpleMessage("Channels"), + "choose": MessageLookupByLibrary.simpleMessage("Wählen Sie"), + "cleanUp": MessageLookupByLibrary.simpleMessage("Säubern"), + "cleanUpTooltip": MessageLookupByLibrary.simpleMessage( + "Nicht verwendete Versionen bereinigen."), + "cleanUpUnusedVersions": MessageLookupByLibrary.simpleMessage( + "Nicht verwendete Versionen bereinigen"), + "clickHereToDownload": MessageLookupByLibrary.simpleMessage( + "Klicken Sie hier zum Download."), + "close": MessageLookupByLibrary.simpleMessage("Schließen"), + "confirm": MessageLookupByLibrary.simpleMessage("Bestätigen"), + "copiedToClipboard": MessageLookupByLibrary.simpleMessage( + "In die Zwischenablage kopiert"), + "couldNotLaunchUrl": m2, + "couldNotSaveSettings": MessageLookupByLibrary.simpleMessage( + "Einstellungen konnten nicht gespeichert werden"), + "countFound": m3, + "createdDate": MessageLookupByLibrary.simpleMessage("Erstelldatum"), + "dark": MessageLookupByLibrary.simpleMessage("Dunkel"), + "dependenciesAfterANewVersionIsInstalled": + MessageLookupByLibrary.simpleMessage( + "Abhängigkeiten, nachdem eine neue Version installiert wurde."), + "details": MessageLookupByLibrary.simpleMessage("Details"), + "devChannelDescription": MessageLookupByLibrary.simpleMessage( + "Der letzte vollständig getestete Build. Normalerweise funktionstüchtig, aber unter \"Schlechte Builds\" finden Sie eine Liste bekannter \"schlechter\" Dev-Builds."), + "devReleases": MessageLookupByLibrary.simpleMessage("Dev Releases"), + "doYouWantToRemoveThemToFreeUpSpace": + MessageLookupByLibrary.simpleMessage( + "Möchten Sie es entfernen, um Speicherplatz freizugeben?"), + "downloadZip": + MessageLookupByLibrary.simpleMessage("Zip herunterladen"), + "exploreFlutterReleases": + MessageLookupByLibrary.simpleMessage("Erkunde Flutter Releases"), + "flutterPathIsPointingTon": MessageLookupByLibrary.simpleMessage( + "Flutter PATH verweist auf\n "), + "flutterSDKGlobalDescription": MessageLookupByLibrary.simpleMessage( + "Eine Flutter-Sdk-Version muss als global eingestellt werden, um auf die Flutter-Einstellungen zugreifen zu können"), + "flutterSdkNotInstalled": MessageLookupByLibrary.simpleMessage( + "Flutter SDK nicht installiert."), + "fvmOnly": MessageLookupByLibrary.simpleMessage("Nur FVM"), + "general": MessageLookupByLibrary.simpleMessage("Allgemein"), + "global": MessageLookupByLibrary.simpleMessage("Global"), + "globalConfiguration": + MessageLookupByLibrary.simpleMessage("Globale Konfiguration"), + "hash": MessageLookupByLibrary.simpleMessage("Hash"), + "howToUpdateYourPath": MessageLookupByLibrary.simpleMessage( + "Wie soll man den Pfad aktualisieren?"), + "ifYouWantToFlutterSdkThroughFvm": MessageLookupByLibrary.simpleMessage( + "wenn Sie Flutter SDK durch FVM"), + "inUse": MessageLookupByLibrary.simpleMessage("Verwendet"), + "installedVersions": + MessageLookupByLibrary.simpleMessage("Installierte Versionen"), + "invalidChanel": MessageLookupByLibrary.simpleMessage("Invalid chanel"), + "language": MessageLookupByLibrary.simpleMessage("Sprache"), + "later": MessageLookupByLibrary.simpleMessage("Später"), + "light": MessageLookupByLibrary.simpleMessage("Hell"), + "likes": MessageLookupByLibrary.simpleMessage("Likes"), + "localCacheInformation": + MessageLookupByLibrary.simpleMessage("Lokale Cache-Informationen"), + "master": MessageLookupByLibrary.simpleMessage("Master"), + "masterChannelDescription": MessageLookupByLibrary.simpleMessage( + "Der aktuelle Tip-of-Tree, der absolut neueste Cutting Edge Build. Normalerweise funktional, obwohl wir manchmal versehentlich Dinge kaputt machen."), + "mostUsedPackages": + MessageLookupByLibrary.simpleMessage("Meistgenutzte Pakete"), + "navButtonDashboard": MessageLookupByLibrary.simpleMessage("Dashboard"), + "navButtonExplore": MessageLookupByLibrary.simpleMessage("Erkunden"), + "navButtonPackages": MessageLookupByLibrary.simpleMessage("Pakete"), + "navButtonProjects": MessageLookupByLibrary.simpleMessage("Projekte"), + "noFlutterProjectsHaveBeenAddedYet": + MessageLookupByLibrary.simpleMessage( + "Es wurden noch keine Flutter-Projekte hinzugefügt."), + "noFlutterVersionInstalledMessage": MessageLookupByLibrary.simpleMessage( + "Sie haben derzeit keine Flutter SDK Versionen installiert. Versionen oder Kanäle, die installiert wurden, werden hier angezeigt."), + "noPackagesFound": + MessageLookupByLibrary.simpleMessage("Keine Pakete gefunden"), + "noResults": MessageLookupByLibrary.simpleMessage("No Results"), + "noUnusedFlutterSdkVersionsInstalled": + MessageLookupByLibrary.simpleMessage( + "Keine unbenutzten Flutter SDK Versionen installiert"), + "notAFlutterProject": + MessageLookupByLibrary.simpleMessage("Kein Flutter-Projekt"), + "notRunning": MessageLookupByLibrary.simpleMessage("Läuft nicht"), + "nothingSelected": + MessageLookupByLibrary.simpleMessage("Nichts ausgewähl"), + "numberOfCachedVersions": m4, + "ok": MessageLookupByLibrary.simpleMessage("OK"), + "onlyDisplayProjectsThatHaveVersionsPinned": + MessageLookupByLibrary.simpleMessage( + "Nur Projekte anzeigen, die Versionen angeheftet haben"), + "open": MessageLookupByLibrary.simpleMessage("öffnen"), + "openTerminalPlayground": + MessageLookupByLibrary.simpleMessage("Terminal Playground öffnen"), + "packageprojectscountProjects": m5, + "platforms": MessageLookupByLibrary.simpleMessage("Platformen"), + "playground": MessageLookupByLibrary.simpleMessage("Playground"), + "popularity": MessageLookupByLibrary.simpleMessage("Popularität"), + "projects": MessageLookupByLibrary.simpleMessage("Projekte"), + "projectsProjects": m6, + "projectsRefreshed": + MessageLookupByLibrary.simpleMessage("Projekte aktualisiert"), + "pubPoints": MessageLookupByLibrary.simpleMessage("Pub Punkte"), + "refresh": MessageLookupByLibrary.simpleMessage("Aktualisieren"), + "releaseDate": MessageLookupByLibrary.simpleMessage("Freigabedatum"), + "releaseNotes": + MessageLookupByLibrary.simpleMessage("Freigabemitteilungen"), + "releases": MessageLookupByLibrary.simpleMessage("Releases"), + "releasesVersions": m7, + "remove": MessageLookupByLibrary.simpleMessage("Löschen"), + "reset": MessageLookupByLibrary.simpleMessage("Zurücksetzen"), + "resetToDefaultSettings": MessageLookupByLibrary.simpleMessage( + "Zurücksetzen auf Standardeinstellungen"), + "sdkHasNotFinishedSetup": MessageLookupByLibrary.simpleMessage( + "SDK hat das Setup nicht abgeschlossen"), + "search": MessageLookupByLibrary.simpleMessage("Suche... "), + "selectAFlutterSdkVersion": MessageLookupByLibrary.simpleMessage( + "Wählen Sie eine Flutter SDK Version"), + "selectAThemeOrSwitchAccordingToSystemSettings": + MessageLookupByLibrary.simpleMessage( + "Wählen Sie ein Thema oder schalten Sie entsprechend den Systemeinstellungen um."), + "setAsGlobal": + MessageLookupByLibrary.simpleMessage("Als global festlegen"), + "settingsHaveBeenSaved": MessageLookupByLibrary.simpleMessage( + "Die Einstellungen wurden gespeichert"), + "sha256": MessageLookupByLibrary.simpleMessage("Sha256"), + "sidekickVersionUpdateinfolatestIsNowAvailable": m8, + "skipSetupFlutterOnInstall": MessageLookupByLibrary.simpleMessage( + "Einrichtung von Flutter bei der Installation überspringen"), + "stableChannelDescription": MessageLookupByLibrary.simpleMessage( + "Wir empfehlen, dass Sie diesen Kanal für alle Produktions-App-Veröffentlichungen verwenden. Ungefähr einmal im Quartal wird ein Zweig, der auf Beta stabilisiert wurde, unser nächster stabiler Zweig und wir erstellen eine stabile Version von diesem Zweig."), + "stableReleases": + MessageLookupByLibrary.simpleMessage("Stable Releases"), + "start": MessageLookupByLibrary.simpleMessage("start"), + "system": MessageLookupByLibrary.simpleMessage("System"), + "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional": + MessageLookupByLibrary.simpleMessage( + "Der aktuelle Tip-of-Tree, der absolut neueste Cutting Edge Build. Normalerweise funktional, obwohl wir manchmal versehentlich Dinge kaputt machen."), + "theme": MessageLookupByLibrary.simpleMessage("Theme"), + "thereWasAnIsssueOpeningSidekick": MessageLookupByLibrary.simpleMessage( + "Es gab ein Problem beim Öffnen von Sidekick"), + "thereWasAnIssueLoadingYourPackages": + MessageLookupByLibrary.simpleMessage( + "Es gab ein Problem beim Laden Ihrer Pakete."), + "theseVersionAreNotPinnedToAProject": + MessageLookupByLibrary.simpleMessage( + "Diese Versionen sind nicht an ein Projekt angeheftet "), + "thisWillOnlyCloneFlutterAndNotInstall": + MessageLookupByLibrary.simpleMessage( + "Dadurch wird Flutter nur geklont und nicht installiert "), + "thisWillOnlyResetSidekickSpecificPreferences": + MessageLookupByLibrary.simpleMessage( + "Dadurch werden nur Sidekick-spezifische Einstellungen zurückgesetzt"), + "thisWillRemoveItemnameCacheFromYourSystem": m9, + "unused": MessageLookupByLibrary.simpleMessage("Nicht verwendet"), + "updateAvailable": + MessageLookupByLibrary.simpleMessage("Update verfügbar."), + "updateNow": + MessageLookupByLibrary.simpleMessage("Jetzt aktualisieren"), + "upgrade": MessageLookupByLibrary.simpleMessage("Upgrade"), + "version": MessageLookupByLibrary.simpleMessage("Version"), + "versionIsInstalled": + MessageLookupByLibrary.simpleMessage("Version ist installiert"), + "versionItemversionnameHasBeenInstalled": m10, + "versionItemversionnameHasBeenRemoved": m11, + "versionItemversionnameHasBeenSetAsGlobal": m12, + "versionItemversionnameHasFinishedSetup": m13, + "versionNotInstalledClickToInstall": + MessageLookupByLibrary.simpleMessage( + "Version nicht installiert. Klicken Sie zum Installieren."), + "versionVersionPinnedToProjectname": m14, + "versions": MessageLookupByLibrary.simpleMessage("Versionen"), + "web": MessageLookupByLibrary.simpleMessage("Web"), + "website": MessageLookupByLibrary.simpleMessage("Website"), + "youNeedToAddAFlutterProjectFirstPackageInformation": + MessageLookupByLibrary.simpleMessage( + "Sie müssen zuerst ein Flutter-Projekt hinzufügen. Die Paketinformationen werden hier angezeigt."), + "zipFileWithAllReleaseDependencies": + MessageLookupByLibrary.simpleMessage( + "Zip-Datei mit allen Release-Abhängigkeiten.") + }; } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index e70802f2..b470e14c 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -19,7 +19,8 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'en'; - static m0(updateInfoLatest) => "A new version of Sidekick is available (${updateInfoLatest})."; + static m0(updateInfoLatest) => + "A new version of Sidekick is available (${updateInfoLatest})."; static m1(itemVersionName) => "Channel ${itemVersionName} has been upgraded."; @@ -35,153 +36,227 @@ class MessageLookup extends MessageLookupByLibrary { static m7(releases) => "${releases} versions"; - static m8(updateInfoLatest) => "Sidekick version ${updateInfoLatest} is now available."; + static m8(updateInfoLatest) => + "Sidekick version ${updateInfoLatest} is now available."; static m9(itemname) => "This will remove ${itemname} cache from your system."; - static m10(itemVersionName) => "Version ${itemVersionName} has been installed."; + static m10(itemVersionName) => + "Version ${itemVersionName} has been installed."; static m11(itemVersionName) => "Version ${itemVersionName} has been removed."; - static m12(itemVersionName) => "Version ${itemVersionName} has been set as global."; + static m12(itemVersionName) => + "Version ${itemVersionName} has been set as global."; - static m13(itemVersionName) => "Version ${itemVersionName} has finished setup."; + static m13(itemVersionName) => + "Version ${itemVersionName} has finished setup."; - static m14(version, projectName) => "Version ${version} pinned to ${projectName}"; + static m14(version, projectName) => + "Version ${version} pinned to ${projectName}"; final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "aNewVersionOfSidekickIsAvailableUpdateinfolatest" : m0, - "addProject" : MessageLookupByLibrary.simpleMessage("Add Project"), - "addYourFlutterProjectProjectsInformationWillBeDisplayedHere" : MessageLookupByLibrary.simpleMessage("Add your Flutter project Projects information will be displayed here."), - "advanced" : MessageLookupByLibrary.simpleMessage("Advanced"), - "analyticsCrashReportSubtitle" : MessageLookupByLibrary.simpleMessage("When a flutter command crashes it attempts to send a crash report to Google in order to help Google contribute improvements to Flutter over time"), - "analyticsCrashReporting" : MessageLookupByLibrary.simpleMessage("Analytics & Crash Reporting"), - "appSettingsHaveBeenReset" : MessageLookupByLibrary.simpleMessage("App settings have been reset"), - "areYouSureYouWantToRemove" : MessageLookupByLibrary.simpleMessage("Are you sure you want to remove?"), - "areYouSureYouWantToResetSettings" : MessageLookupByLibrary.simpleMessage("Are you sure you want to reset settings?"), - "betaChannelDescription" : MessageLookupByLibrary.simpleMessage("Branch created from master for a new beta release at the beginning of the month, usually the first Monday. This will include a branch for Dart, the Engine and the Framework."), - "betaReleases" : MessageLookupByLibrary.simpleMessage("Beta Releases"), - "cacheLocation" : MessageLookupByLibrary.simpleMessage("Cache Location"), - "cancel" : MessageLookupByLibrary.simpleMessage("Cancel"), - "changeThePathTo" : MessageLookupByLibrary.simpleMessage("Change the path to\n"), - "changelog" : MessageLookupByLibrary.simpleMessage("Changelog"), - "channel" : MessageLookupByLibrary.simpleMessage("Channel"), - "channelItemversionnameHasBeenUpgraded" : m1, - "channels" : MessageLookupByLibrary.simpleMessage("Channels"), - "choose" : MessageLookupByLibrary.simpleMessage("Choose"), - "cleanUp" : MessageLookupByLibrary.simpleMessage("Clean up"), - "cleanUpTooltip" : MessageLookupByLibrary.simpleMessage("Clean up unused versions."), - "cleanUpUnusedVersions" : MessageLookupByLibrary.simpleMessage("Clean up unused versions"), - "clickHereToDownload" : MessageLookupByLibrary.simpleMessage("Click here to download."), - "close" : MessageLookupByLibrary.simpleMessage("Close"), - "confirm" : MessageLookupByLibrary.simpleMessage("Confirm"), - "copiedToClipboard" : MessageLookupByLibrary.simpleMessage("Copied to clipboard"), - "couldNotLaunchUrl" : m2, - "couldNotSaveSettings" : MessageLookupByLibrary.simpleMessage("Could not save settings"), - "countFound" : m3, - "createdDate" : MessageLookupByLibrary.simpleMessage("Created Date"), - "dark" : MessageLookupByLibrary.simpleMessage("Dark"), - "dependenciesAfterANewVersionIsInstalled" : MessageLookupByLibrary.simpleMessage("dependencies after a new version is installed."), - "details" : MessageLookupByLibrary.simpleMessage("Details"), - "devChannelDescription" : MessageLookupByLibrary.simpleMessage("The latest fully-tested build. Usually functional, but see Bad Builds for a list of known \"bad\" dev builds."), - "devReleases" : MessageLookupByLibrary.simpleMessage("Dev Releases"), - "doYouWantToRemoveThemToFreeUpSpace" : MessageLookupByLibrary.simpleMessage("Do you want to remove them to free up space?"), - "downloadZip" : MessageLookupByLibrary.simpleMessage("Download Zip"), - "exploreFlutterReleases" : MessageLookupByLibrary.simpleMessage("Explore Flutter Releases"), - "flutterPathIsPointingTon" : MessageLookupByLibrary.simpleMessage("Flutter PATH is pointing to\n "), - "flutterSDKGlobalDescription" : MessageLookupByLibrary.simpleMessage("A Flutter sdk version neeeds to be set as global in order to access Flutter settings"), - "flutterSdkNotInstalled" : MessageLookupByLibrary.simpleMessage("Flutter SDK not installed."), - "fvmOnly" : MessageLookupByLibrary.simpleMessage("FVM Only"), - "general" : MessageLookupByLibrary.simpleMessage("General"), - "gitCache" : MessageLookupByLibrary.simpleMessage("Git Cache"), - "gitCacheSubtitle" : MessageLookupByLibrary.simpleMessage("This will cache the main Flutter repository for faster and smaller installs"), - "global" : MessageLookupByLibrary.simpleMessage("Global"), - "globalConfiguration" : MessageLookupByLibrary.simpleMessage("Global configuration"), - "hash" : MessageLookupByLibrary.simpleMessage("Hash"), - "howToUpdateYourPath" : MessageLookupByLibrary.simpleMessage("How to update your path?"), - "ifYouWantToFlutterSdkThroughFvm" : MessageLookupByLibrary.simpleMessage("if you want to Flutter SDK through FVM"), - "inUse" : MessageLookupByLibrary.simpleMessage("In use"), - "installedVersions" : MessageLookupByLibrary.simpleMessage("Installed Versions"), - "invalidChanel" : MessageLookupByLibrary.simpleMessage("Invalid chanel"), - "language" : MessageLookupByLibrary.simpleMessage("Language"), - "later" : MessageLookupByLibrary.simpleMessage("Later"), - "light" : MessageLookupByLibrary.simpleMessage("Light"), - "likes" : MessageLookupByLibrary.simpleMessage("Likes"), - "localCacheInformation" : MessageLookupByLibrary.simpleMessage("Local Cache Information"), - "master" : MessageLookupByLibrary.simpleMessage("Master"), - "masterChannelDescription" : MessageLookupByLibrary.simpleMessage("The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things."), - "mostUsedPackages" : MessageLookupByLibrary.simpleMessage("Most Used Packages"), - "navButtonDashboard" : MessageLookupByLibrary.simpleMessage("Dashboard"), - "navButtonExplore" : MessageLookupByLibrary.simpleMessage("Explore"), - "navButtonPackages" : MessageLookupByLibrary.simpleMessage("Packages"), - "navButtonProjects" : MessageLookupByLibrary.simpleMessage("Projects"), - "noFlutterProjectsHaveBeenAddedYet" : MessageLookupByLibrary.simpleMessage("No Flutter Projects have been added yet."), - "noFlutterVersionInstalledMessage" : MessageLookupByLibrary.simpleMessage("You do not currently have any Flutter SDK versions installed. Versions or channels that have been installed will be displayed here."), - "noPackagesFound" : MessageLookupByLibrary.simpleMessage("No Packages Found"), - "noResults" : MessageLookupByLibrary.simpleMessage("No Results"), - "noUnusedFlutterSdkVersionsInstalled" : MessageLookupByLibrary.simpleMessage("No unused Flutter SDK versions installed"), - "notAFlutterProject" : MessageLookupByLibrary.simpleMessage("Not a Flutter project"), - "notRunning" : MessageLookupByLibrary.simpleMessage("Not running"), - "nothingSelected" : MessageLookupByLibrary.simpleMessage("Nothing selected"), - "numberOfCachedVersions" : m4, - "ok" : MessageLookupByLibrary.simpleMessage("OK"), - "onlyDisplayProjectsThatHaveVersionsPinned" : MessageLookupByLibrary.simpleMessage("Only display projects that have versions pinned"), - "open" : MessageLookupByLibrary.simpleMessage("open"), - "openTerminalPlayground" : MessageLookupByLibrary.simpleMessage("Open terminal playground"), - "packageprojectscountProjects" : m5, - "platforms" : MessageLookupByLibrary.simpleMessage("Platforms"), - "playground" : MessageLookupByLibrary.simpleMessage("Playground"), - "popularity" : MessageLookupByLibrary.simpleMessage("Popularity"), - "projects" : MessageLookupByLibrary.simpleMessage("Projects"), - "projectsProjects" : m6, - "projectsRefreshed" : MessageLookupByLibrary.simpleMessage("Projects Refreshed"), - "pubPoints" : MessageLookupByLibrary.simpleMessage("Pub Points"), - "refresh" : MessageLookupByLibrary.simpleMessage("Refresh"), - "releaseDate" : MessageLookupByLibrary.simpleMessage("Release Date"), - "releaseNotes" : MessageLookupByLibrary.simpleMessage("Release Notes"), - "releases" : MessageLookupByLibrary.simpleMessage("Releases"), - "releasesVersions" : m7, - "remove" : MessageLookupByLibrary.simpleMessage("Remove"), - "reset" : MessageLookupByLibrary.simpleMessage("Reset"), - "resetToDefaultSettings" : MessageLookupByLibrary.simpleMessage("Reset to default settings"), - "sdkHasNotFinishedSetup" : MessageLookupByLibrary.simpleMessage("SDK has not finished setup"), - "search" : MessageLookupByLibrary.simpleMessage("Search... "), - "selectAFlutterSdkVersion" : MessageLookupByLibrary.simpleMessage("Select a Flutter SDK Version"), - "selectAThemeOrSwitchAccordingToSystemSettings" : MessageLookupByLibrary.simpleMessage("Select a theme or switch according to system settings.."), - "setAsGlobal" : MessageLookupByLibrary.simpleMessage("Set as global"), - "settingsHaveBeenSaved" : MessageLookupByLibrary.simpleMessage("Settings have been saved"), - "sha256" : MessageLookupByLibrary.simpleMessage("Sha256"), - "sidekickVersionUpdateinfolatestIsNowAvailable" : m8, - "skipSetupFlutterOnInstall" : MessageLookupByLibrary.simpleMessage("Skip setup Flutter on install"), - "stableChannelDescription" : MessageLookupByLibrary.simpleMessage("We recommend that you use this channel for all production app releases. Roughly once a quarter, a branch that has been stabilized on beta will become our next stable branch and we will create a stable release from that branch."), - "stableReleases" : MessageLookupByLibrary.simpleMessage("Stable Releases"), - "start" : MessageLookupByLibrary.simpleMessage("start"), - "system" : MessageLookupByLibrary.simpleMessage("System"), - "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional" : MessageLookupByLibrary.simpleMessage("The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things."), - "theme" : MessageLookupByLibrary.simpleMessage("Theme"), - "thereWasAnIsssueOpeningSidekick" : MessageLookupByLibrary.simpleMessage("There was an isssue opening Sidekick"), - "thereWasAnIssueLoadingYourPackages" : MessageLookupByLibrary.simpleMessage("There was an issue loading your packages."), - "theseVersionAreNotPinnedToAProject" : MessageLookupByLibrary.simpleMessage("These version are not pinned to a project "), - "thisWillOnlyCloneFlutterAndNotInstall" : MessageLookupByLibrary.simpleMessage("This will only clone Flutter and not install"), - "thisWillOnlyResetSidekickSpecificPreferences" : MessageLookupByLibrary.simpleMessage("This will only reset Sidekick specific preferences"), - "thisWillRemoveItemnameCacheFromYourSystem" : m9, - "unused" : MessageLookupByLibrary.simpleMessage("Unused"), - "updateAvailable" : MessageLookupByLibrary.simpleMessage("Update available."), - "updateNow" : MessageLookupByLibrary.simpleMessage("Update Now"), - "upgrade" : MessageLookupByLibrary.simpleMessage("Upgrade"), - "version" : MessageLookupByLibrary.simpleMessage("Version"), - "versionIsInstalled" : MessageLookupByLibrary.simpleMessage("Version is installed"), - "versionItemversionnameHasBeenInstalled" : m10, - "versionItemversionnameHasBeenRemoved" : m11, - "versionItemversionnameHasBeenSetAsGlobal" : m12, - "versionItemversionnameHasFinishedSetup" : m13, - "versionNotInstalledClickToInstall" : MessageLookupByLibrary.simpleMessage("Version not installed. Click to install."), - "versionVersionPinnedToProjectname" : m14, - "versions" : MessageLookupByLibrary.simpleMessage("Versions"), - "web" : MessageLookupByLibrary.simpleMessage("Web"), - "website" : MessageLookupByLibrary.simpleMessage("Website"), - "youNeedToAddAFlutterProjectFirstPackageInformation" : MessageLookupByLibrary.simpleMessage("You need to add a Flutter project first. Package information will be displayed here."), - "zipFileWithAllReleaseDependencies" : MessageLookupByLibrary.simpleMessage("Zip file with all release dependencies.") - }; + static _notInlinedMessages(_) => { + "aNewVersionOfSidekickIsAvailableUpdateinfolatest": m0, + "addProject": MessageLookupByLibrary.simpleMessage("Add Project"), + "addYourFlutterProjectProjectsInformationWillBeDisplayedHere": + MessageLookupByLibrary.simpleMessage( + "Add your Flutter project Projects information will be displayed here."), + "advanced": MessageLookupByLibrary.simpleMessage("Advanced"), + "analyticsCrashReportSubtitle": MessageLookupByLibrary.simpleMessage( + "When a flutter command crashes it attempts to send a crash report to Google in order to help Google contribute improvements to Flutter over time"), + "analyticsCrashReporting": + MessageLookupByLibrary.simpleMessage("Analytics & Crash Reporting"), + "appSettingsHaveBeenReset": MessageLookupByLibrary.simpleMessage( + "App settings have been reset"), + "areYouSureYouWantToRemove": MessageLookupByLibrary.simpleMessage( + "Are you sure you want to remove?"), + "areYouSureYouWantToResetSettings": + MessageLookupByLibrary.simpleMessage( + "Are you sure you want to reset settings?"), + "betaChannelDescription": MessageLookupByLibrary.simpleMessage( + "Branch created from master for a new beta release at the beginning of the month, usually the first Monday. This will include a branch for Dart, the Engine and the Framework."), + "betaReleases": MessageLookupByLibrary.simpleMessage("Beta Releases"), + "cacheLocation": MessageLookupByLibrary.simpleMessage("Cache Location"), + "cancel": MessageLookupByLibrary.simpleMessage("Cancel"), + "changeThePathTo": + MessageLookupByLibrary.simpleMessage("Change the path to\n"), + "changelog": MessageLookupByLibrary.simpleMessage("Changelog"), + "channel": MessageLookupByLibrary.simpleMessage("Channel"), + "channelItemversionnameHasBeenUpgraded": m1, + "channels": MessageLookupByLibrary.simpleMessage("Channels"), + "choose": MessageLookupByLibrary.simpleMessage("Choose"), + "cleanUp": MessageLookupByLibrary.simpleMessage("Clean up"), + "cleanUpTooltip": + MessageLookupByLibrary.simpleMessage("Clean up unused versions."), + "cleanUpUnusedVersions": + MessageLookupByLibrary.simpleMessage("Clean up unused versions"), + "clickHereToDownload": + MessageLookupByLibrary.simpleMessage("Click here to download."), + "close": MessageLookupByLibrary.simpleMessage("Close"), + "confirm": MessageLookupByLibrary.simpleMessage("Confirm"), + "copiedToClipboard": + MessageLookupByLibrary.simpleMessage("Copied to clipboard"), + "couldNotLaunchUrl": m2, + "couldNotSaveSettings": + MessageLookupByLibrary.simpleMessage("Could not save settings"), + "countFound": m3, + "createdDate": MessageLookupByLibrary.simpleMessage("Created Date"), + "dark": MessageLookupByLibrary.simpleMessage("Dark"), + "dependenciesAfterANewVersionIsInstalled": + MessageLookupByLibrary.simpleMessage( + "dependencies after a new version is installed."), + "details": MessageLookupByLibrary.simpleMessage("Details"), + "devChannelDescription": MessageLookupByLibrary.simpleMessage( + "The latest fully-tested build. Usually functional, but see Bad Builds for a list of known \"bad\" dev builds."), + "devReleases": MessageLookupByLibrary.simpleMessage("Dev Releases"), + "doYouWantToRemoveThemToFreeUpSpace": + MessageLookupByLibrary.simpleMessage( + "Do you want to remove them to free up space?"), + "downloadZip": MessageLookupByLibrary.simpleMessage("Download Zip"), + "exploreFlutterReleases": + MessageLookupByLibrary.simpleMessage("Explore Flutter Releases"), + "flutterPathIsPointingTon": MessageLookupByLibrary.simpleMessage( + "Flutter PATH is pointing to\n "), + "flutterSDKGlobalDescription": MessageLookupByLibrary.simpleMessage( + "A Flutter sdk version neeeds to be set as global in order to access Flutter settings"), + "flutterSdkNotInstalled": + MessageLookupByLibrary.simpleMessage("Flutter SDK not installed."), + "fvmOnly": MessageLookupByLibrary.simpleMessage("FVM Only"), + "general": MessageLookupByLibrary.simpleMessage("General"), + "global": MessageLookupByLibrary.simpleMessage("Global"), + "globalConfiguration": + MessageLookupByLibrary.simpleMessage("Global configuration"), + "hash": MessageLookupByLibrary.simpleMessage("Hash"), + "howToUpdateYourPath": + MessageLookupByLibrary.simpleMessage("How to update your path?"), + "ifYouWantToFlutterSdkThroughFvm": MessageLookupByLibrary.simpleMessage( + "if you want to Flutter SDK through FVM"), + "inUse": MessageLookupByLibrary.simpleMessage("In use"), + "installedVersions": + MessageLookupByLibrary.simpleMessage("Installed Versions"), + "invalidChanel": MessageLookupByLibrary.simpleMessage("Invalid chanel"), + "language": MessageLookupByLibrary.simpleMessage("Language"), + "later": MessageLookupByLibrary.simpleMessage("Later"), + "light": MessageLookupByLibrary.simpleMessage("Light"), + "likes": MessageLookupByLibrary.simpleMessage("Likes"), + "localCacheInformation": + MessageLookupByLibrary.simpleMessage("Local Cache Information"), + "master": MessageLookupByLibrary.simpleMessage("Master"), + "masterChannelDescription": MessageLookupByLibrary.simpleMessage( + "The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things."), + "mostUsedPackages": + MessageLookupByLibrary.simpleMessage("Most Used Packages"), + "navButtonDashboard": MessageLookupByLibrary.simpleMessage("Dashboard"), + "navButtonExplore": MessageLookupByLibrary.simpleMessage("Explore"), + "navButtonPackages": MessageLookupByLibrary.simpleMessage("Packages"), + "navButtonProjects": MessageLookupByLibrary.simpleMessage("Projects"), + "noFlutterProjectsHaveBeenAddedYet": + MessageLookupByLibrary.simpleMessage( + "No Flutter Projects have been added yet."), + "noFlutterVersionInstalledMessage": MessageLookupByLibrary.simpleMessage( + "You do not currently have any Flutter SDK versions installed. Versions or channels that have been installed will be displayed here."), + "noPackagesFound": + MessageLookupByLibrary.simpleMessage("No Packages Found"), + "noResults": MessageLookupByLibrary.simpleMessage("No Results"), + "noUnusedFlutterSdkVersionsInstalled": + MessageLookupByLibrary.simpleMessage( + "No unused Flutter SDK versions installed"), + "notAFlutterProject": + MessageLookupByLibrary.simpleMessage("Not a Flutter project"), + "notRunning": MessageLookupByLibrary.simpleMessage("Not running"), + "nothingSelected": + MessageLookupByLibrary.simpleMessage("Nothing selected"), + "numberOfCachedVersions": m4, + "ok": MessageLookupByLibrary.simpleMessage("OK"), + "onlyDisplayProjectsThatHaveVersionsPinned": + MessageLookupByLibrary.simpleMessage( + "Only display projects that have versions pinned"), + "open": MessageLookupByLibrary.simpleMessage("open"), + "openTerminalPlayground": + MessageLookupByLibrary.simpleMessage("Open terminal playground"), + "packageprojectscountProjects": m5, + "platforms": MessageLookupByLibrary.simpleMessage("Platforms"), + "playground": MessageLookupByLibrary.simpleMessage("Playground"), + "popularity": MessageLookupByLibrary.simpleMessage("Popularity"), + "projects": MessageLookupByLibrary.simpleMessage("Projects"), + "projectsProjects": m6, + "projectsRefreshed": + MessageLookupByLibrary.simpleMessage("Projects Refreshed"), + "pubPoints": MessageLookupByLibrary.simpleMessage("Pub Points"), + "refresh": MessageLookupByLibrary.simpleMessage("Refresh"), + "releaseDate": MessageLookupByLibrary.simpleMessage("Release Date"), + "releaseNotes": MessageLookupByLibrary.simpleMessage("Release Notes"), + "releases": MessageLookupByLibrary.simpleMessage("Releases"), + "releasesVersions": m7, + "remove": MessageLookupByLibrary.simpleMessage("Remove"), + "reset": MessageLookupByLibrary.simpleMessage("Reset"), + "resetToDefaultSettings": + MessageLookupByLibrary.simpleMessage("Reset to default settings"), + "sdkHasNotFinishedSetup": + MessageLookupByLibrary.simpleMessage("SDK has not finished setup"), + "search": MessageLookupByLibrary.simpleMessage("Search... "), + "selectAFlutterSdkVersion": MessageLookupByLibrary.simpleMessage( + "Select a Flutter SDK Version"), + "selectAThemeOrSwitchAccordingToSystemSettings": + MessageLookupByLibrary.simpleMessage( + "Select a theme or switch according to system settings.."), + "setAsGlobal": MessageLookupByLibrary.simpleMessage("Set as global"), + "settingsHaveBeenSaved": + MessageLookupByLibrary.simpleMessage("Settings have been saved"), + "sha256": MessageLookupByLibrary.simpleMessage("Sha256"), + "sidekickVersionUpdateinfolatestIsNowAvailable": m8, + "skipSetupFlutterOnInstall": MessageLookupByLibrary.simpleMessage( + "Skip setup Flutter on install"), + "stableChannelDescription": MessageLookupByLibrary.simpleMessage( + "We recommend that you use this channel for all production app releases. Roughly once a quarter, a branch that has been stabilized on beta will become our next stable branch and we will create a stable release from that branch."), + "stableReleases": + MessageLookupByLibrary.simpleMessage("Stable Releases"), + "start": MessageLookupByLibrary.simpleMessage("start"), + "system": MessageLookupByLibrary.simpleMessage("System"), + "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional": + MessageLookupByLibrary.simpleMessage( + "The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things."), + "theme": MessageLookupByLibrary.simpleMessage("Theme"), + "thereWasAnIsssueOpeningSidekick": MessageLookupByLibrary.simpleMessage( + "There was an isssue opening Sidekick"), + "thereWasAnIssueLoadingYourPackages": + MessageLookupByLibrary.simpleMessage( + "There was an issue loading your packages."), + "theseVersionAreNotPinnedToAProject": + MessageLookupByLibrary.simpleMessage( + "These version are not pinned to a project "), + "thisWillOnlyCloneFlutterAndNotInstall": + MessageLookupByLibrary.simpleMessage( + "This will only clone Flutter and not install"), + "thisWillOnlyResetSidekickSpecificPreferences": + MessageLookupByLibrary.simpleMessage( + "This will only reset Sidekick specific preferences"), + "thisWillRemoveItemnameCacheFromYourSystem": m9, + "unused": MessageLookupByLibrary.simpleMessage("Unused"), + "updateAvailable": + MessageLookupByLibrary.simpleMessage("Update available."), + "updateNow": MessageLookupByLibrary.simpleMessage("Update Now"), + "upgrade": MessageLookupByLibrary.simpleMessage("Upgrade"), + "version": MessageLookupByLibrary.simpleMessage("Version"), + "versionIsInstalled": + MessageLookupByLibrary.simpleMessage("Version is installed"), + "versionItemversionnameHasBeenInstalled": m10, + "versionItemversionnameHasBeenRemoved": m11, + "versionItemversionnameHasBeenSetAsGlobal": m12, + "versionItemversionnameHasFinishedSetup": m13, + "versionNotInstalledClickToInstall": + MessageLookupByLibrary.simpleMessage( + "Version not installed. Click to install."), + "versionVersionPinnedToProjectname": m14, + "versions": MessageLookupByLibrary.simpleMessage("Versions"), + "web": MessageLookupByLibrary.simpleMessage("Web"), + "website": MessageLookupByLibrary.simpleMessage("Website"), + "youNeedToAddAFlutterProjectFirstPackageInformation": + MessageLookupByLibrary.simpleMessage( + "You need to add a Flutter project first. Package information will be displayed here."), + "zipFileWithAllReleaseDependencies": + MessageLookupByLibrary.simpleMessage( + "Zip file with all release dependencies.") + }; } diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 58f7f85a..49cf695d 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -1,6 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; + import 'intl/messages_all.dart'; // ************************************************************************** @@ -14,22 +15,23 @@ import 'intl/messages_all.dart'; class S { S(); - + static S current; - - static const AppLocalizationDelegate delegate = - AppLocalizationDelegate(); + + static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); static Future load(Locale locale) { - final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString(); - final localeName = Intl.canonicalizedLocale(name); + final name = (locale.countryCode?.isEmpty ?? false) + ? locale.languageCode + : locale.toString(); + final localeName = Intl.canonicalizedLocale(name); return initializeMessages(localeName).then((_) { Intl.defaultLocale = localeName; S.current = S(); - + return S.current; }); - } + } static S of(BuildContext context) { return Localizations.of(context, S); @@ -1206,7 +1208,8 @@ class S { } /// `Sidekick version {updateInfoLatest} is now available.` - String sidekickVersionUpdateinfolatestIsNowAvailable(Object updateInfoLatest) { + String sidekickVersionUpdateinfolatestIsNowAvailable( + Object updateInfoLatest) { return Intl.message( 'Sidekick version $updateInfoLatest is now available.', name: 'sidekickVersionUpdateinfolatestIsNowAvailable', @@ -1246,7 +1249,8 @@ class S { } /// `A new version of Sidekick is available ({updateInfoLatest}).` - String aNewVersionOfSidekickIsAvailableUpdateinfolatest(Object updateInfoLatest) { + String aNewVersionOfSidekickIsAvailableUpdateinfolatest( + Object updateInfoLatest) { return Intl.message( 'A new version of Sidekick is available ($updateInfoLatest).', name: 'aNewVersionOfSidekickIsAvailableUpdateinfolatest', @@ -1285,26 +1289,6 @@ class S { ); } - /// `This will cache the main Flutter repository for faster and smaller installs` - String get gitCacheSubtitle { - return Intl.message( - 'This will cache the main Flutter repository for faster and smaller installs', - name: 'gitCacheSubtitle', - desc: '', - args: [], - ); - } - - /// `Git Cache` - String get gitCache { - return Intl.message( - 'Git Cache', - name: 'gitCache', - desc: '', - args: [], - ); - } - /// `When a flutter command crashes it attempts to send a crash report to Google in order to help Google contribute improvements to Flutter over time` String get analyticsCrashReportSubtitle { return Intl.message( @@ -1326,10 +1310,12 @@ class S { } /// `The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.` - String get theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional { + String + get theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional { return Intl.message( 'The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.', - name: 'theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional', + name: + 'theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional', desc: '', args: [], ); @@ -1383,4 +1369,4 @@ class AppLocalizationDelegate extends LocalizationsDelegate { } return false; } -} \ No newline at end of file +} diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index e3c342c0..319ffb7b 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -124,8 +124,6 @@ "thereWasAnIsssueOpeningSidekick": "Es gab ein Problem beim Öffnen von Sidekick", "close": "Schließen", "language": "Sprache", - "gitCacheSubtitle": "Dadurch wird das Haupt-Repository von Flutter für schnellere und kleinere Installationen zwischengespeichert", - "gitCache": "Git Cache", "analyticsCrashReportSubtitle": "Wenn ein Flutter-Befehl abstürzt, wird versucht, einen Absturzbericht an Google zu senden, damit Google im Laufe der Zeit Verbesserungen an Flutter beisteuern kann", "flutterSDKGlobalDescription": "Eine Flutter-Sdk-Version muss als global eingestellt werden, um auf die Flutter-Einstellungen zugreifen zu können", "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional": "Der aktuelle Tip-of-Tree, der absolut neueste Cutting Edge Build. Normalerweise funktional, obwohl wir manchmal versehentlich Dinge kaputt machen.", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 5d98da42..1cbe4200 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -124,8 +124,6 @@ "thereWasAnIsssueOpeningSidekick": "There was an isssue opening Sidekick", "close": "Close", "language": "Language", - "gitCacheSubtitle": "This will cache the main Flutter repository for faster and smaller installs", - "gitCache": "Git Cache", "analyticsCrashReportSubtitle": "When a flutter command crashes it attempts to send a crash report to Google in order to help Google contribute improvements to Flutter over time", "flutterSDKGlobalDescription": "A Flutter sdk version neeeds to be set as global in order to access Flutter settings", "theCurrentTipoftreeAbsoluteLatestCuttingEdgeBuildUsuallyFunctional": "The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.", diff --git a/lib/src/modules/common/utils/dependencies.dart b/lib/src/modules/common/utils/dependencies.dart index 25a9a999..955faa26 100644 --- a/lib/src/modules/common/utils/dependencies.dart +++ b/lib/src/modules/common/utils/dependencies.dart @@ -1,14 +1,9 @@ -import 'package:github/github.dart'; import 'package:pub_api_client/pub_api_client.dart'; import '../../packages/package.dto.dart'; final client = PubClient(); -final github = GitHub( - auth: Authentication.anonymous(), -); - Map mapPackages; /// Fetches all packages info from pub.dev @@ -35,7 +30,7 @@ List _getTopValidPackages( List packages, Map packagesCount, ) { - const max = 10; + const max = 30; // Filter to only valid packages final validPackages = packages.where((dep) => dep.name != null).toList(); @@ -64,46 +59,9 @@ Future> _complementPackageInfo( return await Future.wait(packagesDetail); } -RepositorySlug _getRepoSlug(String homepage) { - String author; - String repo; - - if (homepage != null && homepage.contains('github.com')) { - final uri = Uri.parse(homepage); - final paths = uri.path.split('/'); - - // Some edge cases there wont be a repo attached to the url - if (paths.length < 3) { - author = null; - repo = null; - } else { - author = paths[1]; - repo = paths[2]; - } - } - - if (author != null && repo != null) { - return RepositorySlug(author, repo); - } else { - return null; - } -} - Future _assignInfo(PubPackage package, int count) async { final score = await client.packageScore(package.name); - final pubspec = package.latestPubspec; - Repository repo; - - final repoSlug = _getRepoSlug(pubspec.homepage); - try { - if (repoSlug != null) { - repo = await github.repositories.getRepository(repoSlug); - } else { - repo = null; - } - } on Exception { - repo = null; - } + return PackageDetail( name: package.name, description: package.description, @@ -113,6 +71,5 @@ Future _assignInfo(PubPackage package, int count) async { changelogUrl: package.changelogUrl, score: score, projectsCount: count, - repo: repo, ); } diff --git a/lib/src/modules/common/utils/helpers.dart b/lib/src/modules/common/utils/helpers.dart index e06d48be..03fb8db4 100644 --- a/lib/src/modules/common/utils/helpers.dart +++ b/lib/src/modules/common/utils/helpers.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:intl/intl.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; @@ -13,6 +14,8 @@ extension StringExtension on String { } } +final numberFormatter = NumberFormat('###,###,000'); + /// Iterable extension extension ExtendedIterable on Iterable { /// Like Iterable.map but callback have index as second argument diff --git a/lib/src/modules/packages/components/package_github_info.dart b/lib/src/modules/packages/components/package_github_info.dart deleted file mode 100644 index 6826da45..00000000 --- a/lib/src/modules/packages/components/package_github_info.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:github/github.dart'; -import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; - -import '../../../modules/common/utils/open_link.dart'; - -/// Github info for a package -class PackageGithubInfo extends StatelessWidget { - /// Constructor - const PackageGithubInfo( - this.repo, { - Key key, - }) : super(key: key); - - /// Package repository - final Repository repo; - @override - Widget build(BuildContext context) { - // Check if repo is null - if (repo == null) { - return Container(); - } - return Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(width: 10), - TextButton.icon( - onPressed: () { - openLink('${repo.htmlUrl}/stargazers'); - }, - icon: const Icon(Icons.star, size: 15), - label: Text(repo.stargazersCount.toString()), - ), - const SizedBox(width: 10), - TextButton.icon( - onPressed: () { - openLink('${repo.htmlUrl}/issues'); - }, - icon: const Icon(MdiIcons.alertCircleOutline, size: 15), - label: Text(repo.openIssuesCount.toString()), - ), - const SizedBox(width: 10), - TextButton.icon( - onPressed: () { - openLink('${repo.htmlUrl}/network/members'); - }, - icon: const Icon(MdiIcons.sourceFork, size: 15), - label: Text(repo.forksCount.toString()), - ), - ], - ); - } -} diff --git a/lib/src/modules/packages/components/package_list_item.dart b/lib/src/modules/packages/components/package_list_item.dart index c6d1469f..2e658163 100644 --- a/lib/src/modules/packages/components/package_list_item.dart +++ b/lib/src/modules/packages/components/package_list_item.dart @@ -7,7 +7,6 @@ import '../../../components/atoms/typography.dart'; import '../../../modules/common/utils/open_link.dart'; import '../../common/molecules/list_tile.dart'; import '../package.dto.dart'; -import 'package_github_info.dart'; import 'package_score_display.dart'; /// Package list item @@ -27,96 +26,91 @@ class PackageListItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Card( - child: Column( - children: [ - SkListTile( - leading: CircleAvatar( - backgroundColor: Colors.black26, - child: Text( - position.toString(), - style: TextStyle( - color: Theme.of(context).brightness == Brightness.light - ? Colors.black - : Colors.white, - ), + return Column( + children: [ + SkListTile( + leading: CircleAvatar( + backgroundColor: Colors.black26, + child: Text( + position.toString(), + style: TextStyle( + color: Theme.of(context).brightness == Brightness.light + ? Colors.black + : Colors.white, ), ), - title: Text(package.name), - subtitle: Text( - package.description, - maxLines: 2, - style: Theme.of(context).textTheme.caption, - ), - trailing: PackageScoreDisplay(score: package.score), ), - const Divider(thickness: 0.5), - Row( - children: [ - PackageGithubInfo(package.repo), - Expanded( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Caption(S.of(context).packageprojectscountProjects(package.projectsCount.toString())), - const SizedBox(width: 10), - const Text('·'), - const SizedBox(width: 10), - Caption(package.version), - const SizedBox(width: 10), - const Text('·'), - const SizedBox(width: 10), - Tooltip( - message: S.of(context).details, - child: IconButton( - iconSize: 20, - splashRadius: 20, - icon: const Icon(MdiIcons.informationOutline), - onPressed: () async { - await openLink(package.url); - }, - ), - ), - const SizedBox(width: 10), - const Text('·'), - const SizedBox(width: 10), - Tooltip( - message: S.of(context).changelog, - child: IconButton( - iconSize: 20, - splashRadius: 20, - icon: const Icon(MdiIcons.textBox), - onPressed: () async { - await openLink(package.changelogUrl); - }, - ), - ), - const SizedBox(width: 10), - const Text('·'), - const SizedBox(width: 10), - Tooltip( - message: S.of(context).website, - child: IconButton( - iconSize: 20, - splashRadius: 20, - icon: const Icon(MdiIcons.earth), - onPressed: () async { - await openLink(package.homepage); - }, - ), + title: Text(package.name), + subtitle: Text( + package.description, + maxLines: 2, + style: Theme.of(context).textTheme.caption, + ), + trailing: PackageScoreDisplay(score: package.score), + ), + Row( + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox(width: 20), + Caption( + S.of(context).packageprojectscountProjects( + package.projectsCount.toString(), ), - const SizedBox(width: 10), - ], + ), + const SizedBox(width: 10), + const Text('·'), + const SizedBox(width: 10), + Caption(package.version), + Spacer(), + Tooltip( + message: S.of(context).details, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.informationOutline), + onPressed: () async { + await openLink(package.url); + }, ), - ], - ), - ) - ], - ), - ], - ), + ), + const SizedBox(width: 10), + const Text('·'), + const SizedBox(width: 10), + Tooltip( + message: S.of(context).changelog, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.textBox), + onPressed: () async { + await openLink(package.changelogUrl); + }, + ), + ), + const SizedBox(width: 10), + const Text('·'), + const SizedBox(width: 10), + Tooltip( + message: S.of(context).website, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.earth), + onPressed: () async { + await openLink(package.homepage); + }, + ), + ), + const SizedBox(width: 10), + ], + ), + ) + ], + ), + ], ); } } diff --git a/lib/src/modules/packages/components/trending_package_list_item.dart b/lib/src/modules/packages/components/trending_package_list_item.dart new file mode 100644 index 00000000..d37ef4f1 --- /dev/null +++ b/lib/src/modules/packages/components/trending_package_list_item.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:sidekick/src/modules/common/utils/helpers.dart'; +import 'package:sidekick/src/modules/common/utils/open_link.dart'; +import 'package:sidekick/src/modules/packages/trending_package.dto.dart'; + +import '../../../components/atoms/typography.dart'; +import '../../common/molecules/list_tile.dart'; + +/// Trending package list item +class TrendingGithubRepoItem extends StatelessWidget { + /// Constructor + const TrendingGithubRepoItem( + this.package, { + Key key, + this.position, + }) : super(key: key); + + /// Detail of a package + final TrendingPackage package; + + /// Popular position of package + final int position; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + SkListTile( + title: Text('${package.owner}/${package.repoName}'), + trailing: OutlinedButton( + onPressed: () => openLink( + 'https://github.com/${package.owner}/${package.repoName}', + ), + child: const Text('View'), + ), + subtitle: Text( + package.description, + maxLines: 2, + style: Theme.of(context).textTheme.caption, + ), + ), + Container( + height: 55, + child: Row( + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 20), + Icon(MdiIcons.star, size: 15), + SizedBox(width: 5), + Caption(numberFormatter.format(package.totalStars)), + SizedBox(width: 20), + Icon(MdiIcons.sourceBranch, size: 15), + SizedBox(width: 5), + Caption(numberFormatter.format(package.totalForks)), + SizedBox(width: 20), + Caption('Built by '), + ...package.topContributors + .map( + (e) => Padding( + padding: const EdgeInsets.only(left: 5), + child: CircleAvatar( + radius: 10, + backgroundColor: Colors.white, + backgroundImage: NetworkImage(e.avatar), + ), + ), + ) + .toList(), + Spacer(), + Caption(package.starsSince), + SizedBox(width: 20) + ], + ), + ) + ], + ), + ), + ], + ); + } +} diff --git a/lib/src/modules/packages/package.dto.dart b/lib/src/modules/packages/package.dto.dart index 2d59947c..29f81a1e 100644 --- a/lib/src/modules/packages/package.dto.dart +++ b/lib/src/modules/packages/package.dto.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:github/github.dart'; import 'package:pub_api_client/pub_api_client.dart'; /// Package Detail @@ -14,7 +13,6 @@ class PackageDetail { this.changelogUrl, this.score, this.projectsCount, - this.repo, }); @required @@ -51,9 +49,6 @@ class PackageDetail { final int projectsCount; @required - /// Repository - final Repository repo; - /// Compare method int compareTo(PackageDetail other) { if (other.projectsCount > projectsCount) return -1; @@ -71,8 +66,7 @@ class PackageDetail { changelogUrl = json['changelogUrl'], score = json['score'] != null ? PackageScore.fromJson(json['score']) : 0, - projectsCount = json['count'], - repo = json['repo'] != null ? Repository.fromJson(json['repo']) : null; + projectsCount = json['count']; /// Turn package detail to json Map toJson() => { @@ -84,6 +78,5 @@ class PackageDetail { 'changelogUrl': changelogUrl, 'score': score, 'count': projectsCount, - 'repo': repo, }; } diff --git a/lib/src/modules/packages/packages.provider.dart b/lib/src/modules/packages/packages.provider.dart index 803a988a..4225feae 100644 --- a/lib/src/modules/packages/packages.provider.dart +++ b/lib/src/modules/packages/packages.provider.dart @@ -1,18 +1,30 @@ // ignore_for_file: top_level_function_literal_block import 'dart:convert'; -import 'package:flutter_cache/flutter_cache.dart' as cache; +import 'package:dio/dio.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:pub_api_client/pub_api_client.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; +import 'package:sidekick/src/modules/packages/trending_package.dto.dart'; import '../../modules/common/utils/dependencies.dart'; import '../projects/projects.provider.dart'; -import 'package.dto.dart'; -const cacheKey = 'dependencies_cache_key'; -// Used to invalidate the cache -const cacheRefKey = 'cache_ref_key'; +const trendingTodayUrl = + 'https://raw.githubusercontent.com/leoafarias/flutter_flat_data/main/trending-repository-today.json'; + +final githubTrendingProvider = FutureProvider>( + (ref) async { + final response = await Dio().get(trendingTodayUrl); + final data = jsonDecode(response.data); + final packages = []; + for (final item in data) { + packages.add(TrendingPackage.fromMap(item)); + } + + return packages; + }, +); /// Project packages final packagesProvider = FutureProvider((ref) async { @@ -25,37 +37,24 @@ final packagesProvider = FutureProvider((ref) async { } // Retrieve cache if exits - final cacheRes = await cache.load(cacheKey); - - // Return cache if it exists - if (cacheRes != null) { - final json = jsonDecode(cacheRes) as List; - return json.map((value) => PackageDetail.fromJson(value)).toList(); - } else { - // Get dependencies - final googleDeps = await getGooglePackages(); - for (final project in projects) { - final pubspec = project.pubspec; - final deps = pubspec.dependencies; - - for (final dep in deps.keys) { - // Get google deps - - if (deps[dep] is HostedDependency && - googleDeps.contains(dep) == false) { - // Increment count or set it to 1 if has not been set - packages.update(dep, (val) => ++val, ifAbsent: () => 1); - } + + // Get dependencies + final googleDeps = await getGooglePackages(); + for (final project in projects) { + final pubspec = project.pubspec; + final deps = pubspec.dependencies; + + for (final dep in deps.keys) { + // Get google deps + + if (deps[dep] is HostedDependency && googleDeps.contains(dep) == false) { + // Increment count or set it to 1 if has not been set + packages.update(dep, (val) => ++val, ifAbsent: () => 1); } } - - final packageList = await fetchPackages(packages); - // Set cache for 1 day - await cache.remember( - cacheKey, - jsonEncode(packageList), - Duration.secondsPerDay, - ); - return packageList; } + + final packageList = await fetchPackages(packages); + + return packageList; }); diff --git a/lib/src/modules/packages/packages.screen.dart b/lib/src/modules/packages/packages.screen.dart index 38fcb1a0..1dc155ca 100644 --- a/lib/src/modules/packages/packages.screen.dart +++ b/lib/src/modules/packages/packages.screen.dart @@ -1,57 +1,34 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:sidekick/generated/l10n.dart'; +import 'package:sidekick/src/modules/packages/scenes/github_trending.scene.dart'; +import 'package:sidekick/src/modules/packages/scenes/used_packages.scene.dart'; -import '../common/atoms/loading_indicator.dart'; -import '../common/organisms/screen.dart'; -import 'components/package_list_item.dart'; -import 'components/packages_empty.dart'; -import 'package.dto.dart'; -import 'packages.provider.dart'; - -/// Packages screen -class PackagesScreen extends HookWidget { - /// Constructor - const PackagesScreen({ - Key key, - }) : super(key: key); +class PackagesScreen extends StatelessWidget { + const PackagesScreen({Key key}) : super(key: key); @override Widget build(BuildContext context) { - final packages = useProvider(packagesProvider); - - return packages.when( - data: (data) { - if (data.isEmpty) { - return const EmptyPackages(); - } - return SkScreen( - title: S.of(context).mostUsedPackages, - child: CupertinoScrollbar( - child: ListView.builder( - // separatorBuilder: (_, __) => const Divider(), - itemCount: data.length, - itemBuilder: (context, index) { - final PackageDetail package = data[index]; - final position = ++index; - return Padding( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), - child: PackageListItem( - package, - position: position, - ), - ); - }, - ), + return DefaultTabController( + length: 2, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + titleSpacing: 0, + toolbarHeight: 48, + title: TabBar( + labelColor: Theme.of(context).textTheme.bodyText1.color, + labelPadding: EdgeInsets.zero, + indicatorColor: Theme.of(context).accentColor, + tabs: [ + Tab(text: '⚡ Trending'), + Tab(text: '📦 Most Used Packages'), + ], ), - ); - }, - loading: () => const SkLoadingIndicator(), - error: (_, __) => Container( - child: Text( - S.of(context).thereWasAnIssueLoadingYourPackages, + ), + body: TabBarView( + children: [ + const TrendingSection(), + const MostUsedScene(), + ], ), ), ); diff --git a/lib/src/modules/packages/scenes/github_trending.scene.dart b/lib/src/modules/packages/scenes/github_trending.scene.dart new file mode 100644 index 00000000..01c4322b --- /dev/null +++ b/lib/src/modules/packages/scenes/github_trending.scene.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:sidekick/src/modules/common/atoms/loading_indicator.dart'; +import 'package:sidekick/src/modules/packages/components/packages_empty.dart'; +import 'package:sidekick/src/modules/packages/components/trending_package_list_item.dart'; +import 'package:sidekick/src/modules/packages/packages.provider.dart'; + +class TrendingSection extends HookWidget { + const TrendingSection({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final packages = useProvider(githubTrendingProvider); + return packages.when( + data: (data) { + if (data.isEmpty) { + return const EmptyPackages(); + } + return Container( + child: Scrollbar( + child: ListView.separated( + // separatorBuilder: (_, __) => const Divider(), + itemCount: data.length, + separatorBuilder: (_, __) => Divider( + thickness: 1, + height: 0, + ), + itemBuilder: (context, index) { + final package = data[index]; + + return Padding( + padding: const EdgeInsets.all(10), + child: TrendingGithubRepoItem(package), + ); + }, + ), + ), + ); + }, + loading: () => const SkLoadingIndicator(), + error: (_, __) => Container( + child: const Text('There was an issue loading your packages.'), + ), + ); + } +} diff --git a/lib/src/modules/packages/scenes/used_packages.scene.dart b/lib/src/modules/packages/scenes/used_packages.scene.dart new file mode 100644 index 00000000..f2d80c1b --- /dev/null +++ b/lib/src/modules/packages/scenes/used_packages.scene.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:sidekick/src/modules/common/atoms/loading_indicator.dart'; +import 'package:sidekick/src/modules/packages/components/package_list_item.dart'; +import 'package:sidekick/src/modules/packages/components/packages_empty.dart'; +import 'package:sidekick/src/modules/packages/packages.provider.dart'; + +class MostUsedScene extends HookWidget { + const MostUsedScene({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final packages = useProvider(packagesProvider); + return packages.when( + data: (data) { + if (data.isEmpty) { + return const EmptyPackages(); + } + return Container( + child: Scrollbar( + child: ListView.separated( + separatorBuilder: (_, __) => Divider( + thickness: 1, + height: 0, + ), + itemCount: data.length, + itemBuilder: (context, index) { + final package = data[index]; + final position = ++index; + return Padding( + padding: const EdgeInsets.all(10), + child: PackageListItem( + package, + position: position, + ), + ); + }, + ), + ), + ); + }, + loading: () => const SkLoadingIndicator(), + error: (_, __) => Container( + child: const Text('There was an issue loading your packages.'), + ), + ); + } +} diff --git a/lib/src/modules/packages/trending_package.dto.dart b/lib/src/modules/packages/trending_package.dto.dart new file mode 100644 index 00000000..f88c51a9 --- /dev/null +++ b/lib/src/modules/packages/trending_package.dto.dart @@ -0,0 +1,85 @@ +// To parse this JSON data, do +// +// final trendingPackage = trendingPackageFromMap(jsonString); + +import 'dart:convert'; + +class TrendingPackage { + TrendingPackage({ + this.owner, + this.repoName, + this.description, + this.programmingLanguage, + this.programmingLanguageColor, + this.totalStars, + this.starsSince, + this.totalForks, + this.topContributors, + }); + + final String owner; + final String repoName; + final String description; + final String programmingLanguage; + final String programmingLanguageColor; + final int totalStars; + final String starsSince; + final int totalForks; + final List topContributors; + + factory TrendingPackage.fromJson(String str) => + TrendingPackage.fromMap(json.decode(str)); + + String toJson() => json.encode(toMap()); + + factory TrendingPackage.fromMap(Map json) => TrendingPackage( + owner: json['owner'], + repoName: json['repoName'], + description: json['description'], + programmingLanguage: json['programmingLanguage'], + programmingLanguageColor: json['programmingLanguageColor'], + totalStars: json['totalStars'], + starsSince: json['starsSince'], + totalForks: json['totalForks'], + topContributors: List.from( + json['topContributors'].map((x) => TopContributor.fromMap(x))), + ); + + Map toMap() => { + 'owner': owner, + 'repoName': repoName, + 'description': description, + 'programmingLanguage': programmingLanguage, + 'programmingLanguageColor': programmingLanguageColor, + 'totalStars': totalStars, + 'starsSince': starsSince, + 'totalForks': totalForks, + 'topContributors': + List.from(topContributors.map((x) => x.toMap())), + }; +} + +class TopContributor { + TopContributor({ + this.name, + this.avatar, + }); + + final String name; + final String avatar; + + factory TopContributor.fromJson(String str) => + TopContributor.fromMap(json.decode(str)); + + String toJson() => json.encode(toMap()); + + factory TopContributor.fromMap(Map json) => TopContributor( + name: json['name'], + avatar: json['avatar'], + ); + + Map toMap() => { + 'name': name, + 'avatar': avatar, + }; +} diff --git a/lib/src/modules/settings/scenes/fvm_settings.scene.dart b/lib/src/modules/settings/scenes/fvm_settings.scene.dart index 21cf8119..c4a498c1 100644 --- a/lib/src/modules/settings/scenes/fvm_settings.scene.dart +++ b/lib/src/modules/settings/scenes/fvm_settings.scene.dart @@ -26,16 +26,6 @@ class FvmSettingsScene extends StatelessWidget { children: [ Text('FVM', style: Theme.of(context).textTheme.headline6), const SizedBox(height: 20), - SwitchListTile( - title: Text(S.of(context).gitCache), - subtitle: Text(S.of(context).gitCacheSubtitle), - value: settings.fvm.gitCache ?? false, - onChanged: (value) { - settings.fvm.gitCache = value; - onSave(); - }, - ), - const Divider(), SwitchListTile( title: Text(S.of(context).skipSetupFlutterOnInstall), subtitle: Text(S.of(context).thisWillOnlyCloneFlutterAndNotInstall + diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 7b153281..d2deae34 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,14 +7,12 @@ import Foundation import file_selector_macos import path_provider_macos -import shared_preferences_macos import url_launcher_macos import window_size func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin")) } diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 5ef360db..83667355 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -4,8 +4,6 @@ PODS: - FlutterMacOS (1.0.0) - path_provider_macos (0.0.1): - FlutterMacOS - - shared_preferences_macos (0.0.1): - - FlutterMacOS - url_launcher_macos (0.0.1): - FlutterMacOS - window_size (0.0.2): @@ -15,7 +13,6 @@ DEPENDENCIES: - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - FlutterMacOS (from `Flutter/ephemeral`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) - - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`) @@ -26,8 +23,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral path_provider_macos: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos - shared_preferences_macos: - :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos window_size: @@ -37,7 +32,6 @@ SPEC CHECKSUMS: file_selector_macos: ff6dc948d4ddd34e8602a1f60b7d0b4cc6051a47 FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b - shared_preferences_macos: 480ce071d0666e37cef23fe6c702293a3d21799e url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 window_size: 339dafa0b27a95a62a843042038fa6c3c48de195 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 775441f5..50cb1a5b 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -262,7 +262,6 @@ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/file_selector_macos/file_selector_macos.framework", "${BUILT_PRODUCTS_DIR}/path_provider_macos/path_provider_macos.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences_macos/shared_preferences_macos.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_macos/url_launcher_macos.framework", "${BUILT_PRODUCTS_DIR}/window_size/window_size.framework", ); @@ -270,7 +269,6 @@ outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_selector_macos.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_macos.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_macos.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_macos.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/window_size.framework", ); diff --git a/pubspec.lock b/pubspec.lock index 30ea02fd..8564d829 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -218,6 +218,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + dio: + dependency: "direct main" + description: + name: dio + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" fake_async: dependency: transitive description: @@ -300,13 +307,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_cache: - dependency: "direct main" - description: - name: flutter_cache - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" flutter_hooks: dependency: "direct main" description: @@ -693,48 +693,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.14.0+3" - shared_preferences: - dependency: transitive - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" shelf: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0ae6e575..92953bc0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: date_time_format: ^2.0.1 filesize: ^2.0.1 - flutter_cache: ^0.1.0 + flutter_hooks: ^0.17.0 flutter_spinkit: ^5.0.0 github: ^8.1.0 @@ -48,6 +48,7 @@ dependencies: file_selector_linux: ^0.0.2 file_selector_macos: ^0.0.4 file_selector_windows: ^0.0.2 + dio: ^4.0.0 dev_dependencies: flutter_test: From 0149e3181a4402b376dad71ab13fcaedeb0042a7 Mon Sep 17 00:00:00 2001 From: leoafarias <435833+leoafarias@users.noreply.github.com> Date: Fri, 18 Jun 2021 19:33:46 -0400 Subject: [PATCH 2/3] Flutter favorites --- .../flutter_favorite_list_item.dart | 62 +++++++++++++++++++ .../packages/flutter_favorite.dto.dart | 62 +++++++++++++++++++ .../modules/packages/packages.provider.dart | 17 +++++ lib/src/modules/packages/packages.screen.dart | 5 +- .../scenes/flutter_favorite.scene.dart | 47 ++++++++++++++ 5 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 lib/src/modules/packages/components/flutter_favorite_list_item.dart create mode 100644 lib/src/modules/packages/flutter_favorite.dto.dart create mode 100644 lib/src/modules/packages/scenes/flutter_favorite.scene.dart diff --git a/lib/src/modules/packages/components/flutter_favorite_list_item.dart b/lib/src/modules/packages/components/flutter_favorite_list_item.dart new file mode 100644 index 00000000..6c588087 --- /dev/null +++ b/lib/src/modules/packages/components/flutter_favorite_list_item.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:sidekick/src/modules/common/utils/open_link.dart'; +import 'package:sidekick/src/modules/packages/flutter_favorite.dto.dart'; + +import '../../common/molecules/list_tile.dart'; + +/// Flutter favorite list item +class FlutterFavoriteListItem extends StatelessWidget { + /// Constructor + const FlutterFavoriteListItem( + this.package, { + Key key, + this.position, + }) : super(key: key); + + /// Detail of a package + final FlutterFavorite package; + + /// Popular position of package + final int position; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + SkListTile( + title: Text(package.name), + trailing: OutlinedButton( + onPressed: () => openLink(package.url), + child: const Text('View'), + ), + subtitle: Text( + package.description, + maxLines: 2, + style: Theme.of(context).textTheme.caption, + ), + ), + Container( + height: 55, + child: Row( + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 20), + Icon(MdiIcons.star, size: 15), + SizedBox(width: 5), + SizedBox(width: 20) + ], + ), + ) + ], + ), + ), + ], + ); + } +} diff --git a/lib/src/modules/packages/flutter_favorite.dto.dart b/lib/src/modules/packages/flutter_favorite.dto.dart new file mode 100644 index 00000000..eb5379a7 --- /dev/null +++ b/lib/src/modules/packages/flutter_favorite.dto.dart @@ -0,0 +1,62 @@ +// To parse this JSON data, do +// +// final flutterFavorite = flutterFavoriteFromMap(jsonString); + +import 'dart:convert'; + +class FlutterFavorite { + FlutterFavorite({ + this.name, + this.version, + this.description, + this.url, + this.changelogUrl, + this.grantedPoints, + this.maxPoints, + this.likeCount, + this.popularityScore, + this.lastUpdated, + }); + + final String name; + final String version; + final String description; + final String url; + final String changelogUrl; + final String grantedPoints; + final String maxPoints; + final String likeCount; + final String popularityScore; + final DateTime lastUpdated; + + factory FlutterFavorite.fromJson(String str) => + FlutterFavorite.fromMap(json.decode(str)); + + String toJson() => json.encode(toMap()); + + factory FlutterFavorite.fromMap(Map json) => FlutterFavorite( + name: json['name'], + version: json['version'], + description: json['description'], + url: json['url'], + changelogUrl: json['changelogUrl'], + grantedPoints: json['grantedPoints'], + maxPoints: json['maxPoints'], + likeCount: json['likeCount'], + popularityScore: json['popularityScore'], + lastUpdated: DateTime.parse(json['lastUpdated']), + ); + + Map toMap() => { + 'name': name, + 'version': version, + 'description': description, + 'url': url, + 'changelogUrl': changelogUrl, + 'grantedPoints': grantedPoints, + 'maxPoints': maxPoints, + 'likeCount': likeCount, + 'popularityScore': popularityScore, + 'lastUpdated': lastUpdated.toIso8601String(), + }; +} diff --git a/lib/src/modules/packages/packages.provider.dart b/lib/src/modules/packages/packages.provider.dart index 4225feae..02ccf1b2 100644 --- a/lib/src/modules/packages/packages.provider.dart +++ b/lib/src/modules/packages/packages.provider.dart @@ -5,6 +5,7 @@ import 'package:dio/dio.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:pub_api_client/pub_api_client.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; +import 'package:sidekick/src/modules/packages/flutter_favorite.dto.dart'; import 'package:sidekick/src/modules/packages/trending_package.dto.dart'; import '../../modules/common/utils/dependencies.dart'; @@ -26,6 +27,22 @@ final githubTrendingProvider = FutureProvider>( }, ); +const flutterFavoritesUrl = + 'https://raw.githubusercontent.com/leoafarias/flutter_flat_data/main/flutter-favorites.json'; + +final flutterFavoritesProvider = FutureProvider>( + (ref) async { + final response = await Dio().get(flutterFavoritesUrl); + final data = jsonDecode(response.data); + final favorites = []; + for (final item in data) { + favorites.add(FlutterFavorite.fromMap(item)); + } + + return favorites; + }, +); + /// Project packages final packagesProvider = FutureProvider((ref) async { final projects = ref.watch(projectsProvider); diff --git a/lib/src/modules/packages/packages.screen.dart b/lib/src/modules/packages/packages.screen.dart index 1dc155ca..24fd8e6c 100644 --- a/lib/src/modules/packages/packages.screen.dart +++ b/lib/src/modules/packages/packages.screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:sidekick/src/modules/packages/scenes/flutter_favorite.scene.dart'; import 'package:sidekick/src/modules/packages/scenes/github_trending.scene.dart'; import 'package:sidekick/src/modules/packages/scenes/used_packages.scene.dart'; @@ -8,7 +9,7 @@ class PackagesScreen extends StatelessWidget { @override Widget build(BuildContext context) { return DefaultTabController( - length: 2, + length: 3, child: Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, @@ -21,6 +22,7 @@ class PackagesScreen extends StatelessWidget { tabs: [ Tab(text: '⚡ Trending'), Tab(text: '📦 Most Used Packages'), + Tab(text: '📦 Flutter Favorites'), ], ), ), @@ -28,6 +30,7 @@ class PackagesScreen extends StatelessWidget { children: [ const TrendingSection(), const MostUsedScene(), + const FlutterFavoriteScene(), ], ), ), diff --git a/lib/src/modules/packages/scenes/flutter_favorite.scene.dart b/lib/src/modules/packages/scenes/flutter_favorite.scene.dart new file mode 100644 index 00000000..f39dc3d2 --- /dev/null +++ b/lib/src/modules/packages/scenes/flutter_favorite.scene.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:sidekick/src/modules/common/atoms/loading_indicator.dart'; +import 'package:sidekick/src/modules/packages/components/flutter_favorite_list_item.dart'; +import 'package:sidekick/src/modules/packages/components/packages_empty.dart'; +import 'package:sidekick/src/modules/packages/packages.provider.dart'; + +class FlutterFavoriteScene extends HookWidget { + const FlutterFavoriteScene({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final favorites = useProvider(flutterFavoritesProvider); + return favorites.when( + data: (data) { + if (data.isEmpty) { + return const EmptyPackages(); + } + return Container( + child: Scrollbar( + child: ListView.separated( + // separatorBuilder: (_, __) => const Divider(), + itemCount: data.length, + separatorBuilder: (_, __) => Divider( + thickness: 1, + height: 0, + ), + itemBuilder: (context, index) { + final package = data[index]; + + return Padding( + padding: const EdgeInsets.all(10), + child: FlutterFavoriteListItem(package), + ); + }, + ), + ), + ); + }, + loading: () => const SkLoadingIndicator(), + error: (_, __) => Container( + child: const Text('There was an issue loading your packages.'), + ), + ); + } +} From 426a5e4d3e653d40ad311b39dc7701c81d25b139 Mon Sep 17 00:00:00 2001 From: leoafarias <435833+leoafarias@users.noreply.github.com> Date: Sat, 19 Jun 2021 12:13:23 -0400 Subject: [PATCH 3/3] Added flutter favorites and github trending --- .../flutter_favorite_list_item.dart | 81 +++++++++++++------ .../packages/flutter_favorite.dto.dart | 35 ++++---- .../modules/packages/packages.provider.dart | 11 +-- lib/src/modules/packages/packages.screen.dart | 6 +- lib/src/version.dart | 2 +- pubspec.yaml | 2 +- 6 files changed, 84 insertions(+), 53 deletions(-) diff --git a/lib/src/modules/packages/components/flutter_favorite_list_item.dart b/lib/src/modules/packages/components/flutter_favorite_list_item.dart index 6c588087..f78f8fcf 100644 --- a/lib/src/modules/packages/components/flutter_favorite_list_item.dart +++ b/lib/src/modules/packages/components/flutter_favorite_list_item.dart @@ -1,10 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; -import 'package:sidekick/src/modules/common/utils/open_link.dart'; +import 'package:sidekick/generated/l10n.dart'; import 'package:sidekick/src/modules/packages/flutter_favorite.dto.dart'; +import '../../../components/atoms/typography.dart'; +import '../../../modules/common/utils/open_link.dart'; import '../../common/molecules/list_tile.dart'; +import 'package_score_display.dart'; /// Flutter favorite list item class FlutterFavoriteListItem extends StatelessWidget { @@ -27,34 +30,66 @@ class FlutterFavoriteListItem extends StatelessWidget { children: [ SkListTile( title: Text(package.name), - trailing: OutlinedButton( - onPressed: () => openLink(package.url), - child: const Text('View'), - ), subtitle: Text( package.description, maxLines: 2, style: Theme.of(context).textTheme.caption, ), + trailing: PackageScoreDisplay(score: package.score), ), - Container( - height: 55, - child: Row( - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 20), - Icon(MdiIcons.star, size: 15), - SizedBox(width: 5), - SizedBox(width: 20) - ], - ), - ) - ], - ), + Row( + children: [ + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox(width: 20), + Caption(package.version), + Spacer(), + Tooltip( + message: S.of(context).details, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.informationOutline), + onPressed: () async { + await openLink(package.url); + }, + ), + ), + const SizedBox(width: 10), + const Text('·'), + const SizedBox(width: 10), + Tooltip( + message: S.of(context).changelog, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.textBox), + onPressed: () async { + await openLink(package.changelogUrl); + }, + ), + ), + const SizedBox(width: 10), + const Text('·'), + const SizedBox(width: 10), + Tooltip( + message: S.of(context).website, + child: IconButton( + iconSize: 20, + splashRadius: 20, + icon: const Icon(MdiIcons.earth), + onPressed: () async { + await openLink(package.url); + }, + ), + ), + const SizedBox(width: 10), + ], + ), + ) + ], ), ], ); diff --git a/lib/src/modules/packages/flutter_favorite.dto.dart b/lib/src/modules/packages/flutter_favorite.dto.dart index eb5379a7..2f9b203c 100644 --- a/lib/src/modules/packages/flutter_favorite.dto.dart +++ b/lib/src/modules/packages/flutter_favorite.dto.dart @@ -4,6 +4,8 @@ import 'dart:convert'; +import 'package:pub_api_client/pub_api_client.dart'; + class FlutterFavorite { FlutterFavorite({ this.name, @@ -11,11 +13,7 @@ class FlutterFavorite { this.description, this.url, this.changelogUrl, - this.grantedPoints, - this.maxPoints, - this.likeCount, - this.popularityScore, - this.lastUpdated, + this.score, }); final String name; @@ -23,11 +21,8 @@ class FlutterFavorite { final String description; final String url; final String changelogUrl; - final String grantedPoints; - final String maxPoints; - final String likeCount; - final String popularityScore; - final DateTime lastUpdated; + + final PackageScore score; factory FlutterFavorite.fromJson(String str) => FlutterFavorite.fromMap(json.decode(str)); @@ -40,11 +35,15 @@ class FlutterFavorite { description: json['description'], url: json['url'], changelogUrl: json['changelogUrl'], - grantedPoints: json['grantedPoints'], - maxPoints: json['maxPoints'], - likeCount: json['likeCount'], - popularityScore: json['popularityScore'], - lastUpdated: DateTime.parse(json['lastUpdated']), + score: PackageScore( + grantedPoints: int.parse(json['grantedPoints']), + maxPoints: int.parse((json['maxPoints'])), + likeCount: int.parse((json['likeCount'])), + popularityScore: double.parse((json['popularityScore'])), + lastUpdated: DateTime.parse( + json['lastUpdated'], + ), + ), ); Map toMap() => { @@ -53,10 +52,6 @@ class FlutterFavorite { 'description': description, 'url': url, 'changelogUrl': changelogUrl, - 'grantedPoints': grantedPoints, - 'maxPoints': maxPoints, - 'likeCount': likeCount, - 'popularityScore': popularityScore, - 'lastUpdated': lastUpdated.toIso8601String(), + 'score': score.toJson() }; } diff --git a/lib/src/modules/packages/packages.provider.dart b/lib/src/modules/packages/packages.provider.dart index 02ccf1b2..b45918e6 100644 --- a/lib/src/modules/packages/packages.provider.dart +++ b/lib/src/modules/packages/packages.provider.dart @@ -6,6 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:pub_api_client/pub_api_client.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; import 'package:sidekick/src/modules/packages/flutter_favorite.dto.dart'; +import 'package:sidekick/src/modules/packages/package.dto.dart'; import 'package:sidekick/src/modules/packages/trending_package.dto.dart'; import '../../modules/common/utils/dependencies.dart'; @@ -36,7 +37,9 @@ final flutterFavoritesProvider = FutureProvider>( final data = jsonDecode(response.data); final favorites = []; for (final item in data) { - favorites.add(FlutterFavorite.fromMap(item)); + favorites.add( + FlutterFavorite.fromMap(item), + ); } return favorites; @@ -50,7 +53,7 @@ final packagesProvider = FutureProvider((ref) async { final packages = {}; if (projects.isEmpty) { - return []; + return []; } // Retrieve cache if exits @@ -71,7 +74,5 @@ final packagesProvider = FutureProvider((ref) async { } } - final packageList = await fetchPackages(packages); - - return packageList; + return fetchPackages(packages); }); diff --git a/lib/src/modules/packages/packages.screen.dart b/lib/src/modules/packages/packages.screen.dart index 24fd8e6c..3a10ec47 100644 --- a/lib/src/modules/packages/packages.screen.dart +++ b/lib/src/modules/packages/packages.screen.dart @@ -20,9 +20,9 @@ class PackagesScreen extends StatelessWidget { labelPadding: EdgeInsets.zero, indicatorColor: Theme.of(context).accentColor, tabs: [ - Tab(text: '⚡ Trending'), - Tab(text: '📦 Most Used Packages'), - Tab(text: '📦 Flutter Favorites'), + Tab(text: '⚡ Trending'), + Tab(text: '📦 Most Used Packages'), + Tab(text: '💙 Flutter Favorites'), ], ), ), diff --git a/lib/src/version.dart b/lib/src/version.dart index 99e44cce..5b6bfb4d 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '0.0.7'; +const packageVersion = '0.1.0'; diff --git a/pubspec.yaml b/pubspec.yaml index 92953bc0..98bcf3e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter Version Manager. publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 0.0.7 +version: 0.1.0 environment: sdk: ">=2.7.0 <3.0.0"