store_update 0.3.0
store_update: ^0.3.0 copied to clipboard
In-app updates for Flutter: Google Play's immediate and flexible updates with download progress, an App Store prompt on iOS, and a ready-made English and Arabic UI.
0.3.0 #
- Force an update from your own backend:
StoreUpdateGate(forceUpdate: true)orStoreUpdateController.forceUpdate(). A prompt over the whole app offers Update now and Exit until the app restarts. On Google Play, Play's full-screen update starts at once (closing it counts as Exit), a running background download is waited for and installed, and Update now falls back to the store page. - The prompt survives navigation, the wrapped screen being replaced and
MaterialAppbeing rebuilt. It holds the keyboard focus, shows even while the gate is disabled and withoutnavigatorKey, and carries over to a new controller. The system back button still works beneath it (see the README). - Exit runs the controller's
onUpdateCancel, by defaultStoreUpdateController.exitApp(exit(0), after finishing the activity on Android). Give your own to do something else. - Every part of the forced prompt can change:
forcedPromptBuildergets aForcedUpdatePromptmodel (labels,onUpdate,onUpdateCancel,busy,failed,progress), the built-inForcedUpdateDialogtakes anicon, extracontent, button styles,backgroundColor,shape,insetPaddingandmaxWidth, andforcedBarrierColorsets the colour over the app. AnonUpdateCancelthat throws is reported, not thrown. - New screenshots: the forced prompt in English and Arabic, and one of your own design.
- Breaking:
StoreUpdateLabelshas new required texts:forcedTitle,forcedBody,forcedFailedandexit.StoreUpdateLabels.en,.arand.offill them in; only code that calls the constructor directly needs to pass them. - Breaking:
UpdatePhasehas a new value,forced. Aswitchover every phase needs a case for it. - Once forced,
retryImmediate()(the required page's Update now) follows the forced rules, so closing Play's update screen runsonUpdateCancel. - The example app has an item that simulates the backend flag.
0.2.0 #
- Breaking:
offerSheetBuilderis nowofferBuilder, and it receives anUpdateOfferwithonUpdateandonLatercallbacks instead of poppingtrueorfalse.onLateris null when the update is required.UpdateOfferSheettakes theofferinstead oflabels,storeVersionandrequired. offerPresenterdecides how the offer is shown. The default,showUpdateOfferSheet, is the existing bottom sheet;showUpdateOfferDialogshows a dialog instead.UpdateOfferSheettakes an optionalicon, extracontentunder the text, andupdateButtonStyleandlaterButtonStyle, so the built-in prompt can be changed without rebuilding it.- Back can't close a required offer, even in a custom prompt. A presenter that throws is reported and counts as "Later".
- The example app switches between the offer prompt styles: the built-in sheet, a dialog, the sheet with an icon, release notes and button colour, and a prompt of its own. Its simulated store offers again at once, so each style can be tried.
0.1.0 #
- First release.
- Android: Google Play In-App Updates. A required release (priority 4-5, configurable) opens Play's full-screen update, then a page that waits. Other releases are offered at most once a day as a background download with real progress and "Restart to update".
- iOS: checks the App Store version (storefront configurable) at most once a day, and shows the App Store page inside the app.
StoreUpdateGateworks around one screen or inMaterialApp.builder(withnavigatorKey) over every screen. The required-update page is a route on the root navigator, so it covers pushed screens and back can't leave it.enableddelays the checks until the app is ready.- Ready-made UI in English and Arabic (right to left), styled from the app's theme. The text can be changed and each part replaced.
- A failed check, no network, or a build not installed from the store shows nothing.
