spring_boot_starter_flutter 0.6.1
spring_boot_starter_flutter: ^0.6.1 copied to clipboard
Spring Boot for Flutter apps: SpringApplicationWidget, beans in widgets, state beans that rebuild widgets, lifecycle, platform profiles, themes from properties.
0.6.1 #
Changes #
- The desktop window from properties (0.6.1):
spring.flutter.desktop.window.title-bar(default,transparent,hidden),title(the window's title; blank is none),initial-size,min-sizeandmax-size(1280x800, logical pixels; min <= initial <= max, else the start stops naming the values;max-sizeis macOScontentMaxSize, WindowsptMaxTrackSizeand GTKGDK_HINT_MAX_SIZE).SpringApplicationWidgetreads them when the environment is ready and makes one call to the new platform code, before the first frame is shown (the frame is held back until the window is set, at most five seconds). A malformed value, or sizes that contradict each other, stops the start; phones and the web ignore the keys.DesktopWindow/DesktopWindowInsetsgive the space the window buttons take,WindowDragAreamoves the window and maximizes it on a double click. The starter becomes a Flutter plugin for macOS (Swift:NSWindow), Windows (C++: DWM,WM_GETMINMAXINFO,WM_NCCALCSIZE) and Linux (GTK): its own code, no third-party package; it needs Flutter 3.47.
0.6.0 #
Changes #
- Where a SQLite database lives: with a SQL database in the properties (
spring.datasource.url, orspring.datasources.<name>.url),SpringApplicationWidgetreads the app's directories frompath_providerbefore the application starts and, once the configuration files are read, setsspring.datasource.sqlite.base-directoryto the directory ofspring.datasource.sqlite.location(support, the default;cache;documents; any other value stops the start) andspring.datasource.sqlite.isolate=true, with the lowest precedence (the app's own properties win), for the primary data source and each named one.supportis Android'sdatabases/directory, iOS's and macOS's Application Support, Windows'%LOCALAPPDATA%\<company>\<product>(not the roaming directory) and Linux's$XDG_DATA_HOME/<app id>. The directory is created when it is missing. Nothing is set on the web or in a widget test (nopath_providerplugin). The starter depends onpath_provider(flutter.dev) and its platform interface, and only sets properties: it does not depend on the data starter. BeanReadsPointcut.annotationTypesandNotifyListenersPointcut.annotationTypeslist the annotations the pointcuts match (@ChangeNotifierComponent,@NotifyListeners); the generator reads them to give a proxy class only to the beans that carry one (smaller generated code; regenerate the.spring.dartfiles).
0.5.0 #
Changes #
SpringApplicationWidgetcloses the application context when a check fails after the start, and a hot reload's restart that fails closes both contexts, so runners and scheduled tasks no longer run behind the failure screen, and each retry no longer leaves another context running.
0.4.3 #
- Flutter security (#15)
- feat(security): spring_boot_starter_flutter_security — app login on e… (#13)
- feat: single sign-on with OAuth 2.0 / OpenID Connect (spring_boot_sta… (#11)
- docs: the READMEs and docs/ rewritten: what it is, why and when you need it, an example, then Spring (#10)
0.4.2 #
- Docs (#9)
0.4.1 #
- feat: guides replace the examples; optional parameters from Dart nullability; coloured logs
0.4.0 #
- feat: spring_security_core, spring_boot_starter_security and a CI quality gate
0.3.2 #
- feat: hot reload on the Dart VM, flutter_notes example, fixes for example resources and workspace builds
0.3.1 #
- The example is a Spring Boot application written by the generator: a
@ChangeNotifierComponentcounter and Spring widgets. spring_auto_configuration.dartre-exports the logging starter's (and through itspring_boot_dart's) auto-configuration, so a test namingspringBootAutoConfiguration(ApplicationContextRunner) needs no other dependency.
0.3.0 #
- Reading is free: a
SpringStatelessWidgetorSpringStatelistens to a@ChangeNotifierComponentor@NotifyListenersbean of its record only when itsbuildread the bean's state (a getter, a field, through the proxy); calling its methods (onPressed: counter.increment) no longer rebuilds the widget. A read outside the widget's build (an item builder, aBuilderbelow it, a callback) keeps it listening; aChangeNotifierbean without either annotation is listened to always, as before. - The
flutter_counterexample uses Spring widgets for every widget that takes beans (CounterPage,AboutPage). - Breaking:
spring.flutter.app.theme-modeis gone (the theme shown isspring.flutter.theme.active), and so areFlutterAppSettings.themeMode,color,theme,darkThemeandcupertinoTheme(the theme comes fromSpringThemes;ThemeDatabeanstheme/darkThemeand aCupertinoThemeDatabean still replace the made ones). - Themes from properties (
spring.flutter.theme.*): a shared part, the standardlight/darkthemes and named custom ones (themes.<name>,extends), the fullColorScheme(seed, variant, contrast, any role), the 15TextThemestyles pluscode, the Material 3 shape scale, elevations, density, splash, page transitions, motion, spacing, 19 components and the app's own tokens; checked at the start (values and the keys themselves: a misspelled key fails too), each made once into aSpringThemeData, a MaterialThemeDataand aCupertinoThemeData.ThemeSelection(active,system-light,system-dark,select) switches at run time;SpringThemes.loadYamladds themes from a server;SpringTheme.of(context)for the app's own widgets;ThemeCustomizer/CupertinoThemeCustomizerbeans;ThemeDatabeanstheme/darkThemestill replace the made ones. Replacesspring.flutter.app.theme-mode(nowspring.flutter.theme.active). - Fonts from the assets: every
.ttf/.otfunderflutter: assets:, in any directory, is loaded before the first frame in the family its file names (spring.flutter.fonts.auto-load,spring.flutter.fonts.exclude); a family the theme names but nothing provides is logged.
0.2.3 #
SpringApplicationWidget(home: ...)builds the app widget from the configuration (SpringApp):spring.flutter.app.type(widgetsby default,material,cupertino),title,debug-banner,theme-mode,locales(by default the languages of the messages files), theThemeDatabeanstheme/darkThemeand aCupertinoThemeDatabean,NavigatorObserverbeans,FlutterAppCustomizerbeans; Flutter's localization delegates come with the starter (flutter_localizations).child:keeps working for an app's ownMaterialApp.- An example (
example/): the counter app in one runnable file, and the way with the generator step by step.
0.2.2 #
- Breaking:
SpringStatelessWidget.buildtakes only theBuildContext; the widget reads its beans asbeans, like aSpringState(inbuildand the callbacks made there). Tests build it with fakes throughbuildWith(context, beans). - README: the generator's check of
@Value('asset:...').
0.2.1 #
- First version:
SpringApplicationWidget(starts the application, splash and failure screens, restarts the context on a hot reload when the generated code changed, switched off withspring.devtools.restart.enabled=false, closes the context when removed),SpringScope,context.bean<T>(), getters generated for@BuildContextAccessbeans,SpringStatelessWidget<(...)>andSpringStatefulWidget<(...)>withSpringState<W, (...)>, beans checked at startup,AppLifecycleStateEventwith the context paused in the background and restarted in the foreground (spring.flutter.lifecycle.pause-in-background), platform profiles (android,ios,web,macos,windows,linux,mobile,desktop), the OS environment off unlessspring.flutter.scan-os-environment,context.messagein the app's locale. @ChangeNotifierComponent(exclude: [...]): a stereotype for a plain class whose proxy mixesChangeNotifierin and notifies after every public method and setter;listenableOf(bean).SpringStatelessWidgetandSpringStaterebuild when aListenablebean of their record notifies.@NotifyListeners(exclude: [...])on aChangeNotifierbean (or some of its methods):notifyListeners()after each call through the AOP proxy, after a returnedFuturecompletes, also after an error.asset:resources:@Value('asset:assets/intro.mp4') Resource videoinjects anAssetResourceof the app's asset bundle (keyfor Flutter's APIs,exists()from the asset manifest), likeclasspath:forlib/resources/.- Brings
spring_boot_starter_logging, switched on (console output in Boot's format,logging.*,LogBuffer). - Exports
spring_core_dart,spring_boot_dartandspring_boot_starter_logging(withoutBannerandSize, which clash with Flutter's; the constraint isSizeConstraint), so an app depends only onspring_boot_starter_flutter.