bond_core 0.1.0
bond_core: ^0.1.0 copied to clipboard
Bond Core Foundational Library for the Flutter Bond framework.
Changelog #
0.1.0 #
Breaking #
- Requires Dart 3.13 and Flutter 3.47 or newer.
ThemeContextandScaffoldContextnow use the types ofpackage:material_ui(TextTheme,ColorScheme,ThemeData,SnackBar,ScaffoldMessenger) instead ofpackage:flutter/material.dart. Migrate app imports withdart fix --apply --code=migrate_design_widgets.- Removed the
ThemeContext.buttonThemegetter (legacyButtonThemeData). UseTheme.of(context).buttonThemeif you still need it.
Changed #
get_itrange widened to>=8.0.3 <10.0.0(get_it 9 is supported).- Added the
material_ui: ^1.6.0dependency. InsetsContextimportspackage:flutter/widgets.dartonly.
Fixed #
ThemeContext.textThemedoc example used the removedbodyText1; it now showsbodyLarge.
0.0.3 #
Changes #
- Dependency Update:
- Bumped
get_itfrom^7.6.4to^8.0.3.
- Bumped
Note: This update should be seamless if you aren’t using any breaking changes introduced in
get_it8.0. However, if you rely on advancedget_itfeatures, consult the officialget_itdocumentation to ensure compatibility with the new version.
0.0.2 #
Migration Guide #
-
Update Override of
responseConvert: If you previously overrode theresponseConvertmethod, update your implementation to use thefactoriesgetter instead.Before:
class MyServiceProvider with ResponseDecoding { @override T? responseConvert<T>(Map<String, dynamic> json) { if (T == MyModel) { return MyModel.fromJson(json) as T; } // Add other model conversions as needed... return null; } }After:
class MyServiceProvider with ResponseDecoding { @override Map<Type, JsonFactory> get factories => { MyModel: (json) => MyModel.fromJson(json), AnotherModel: (json) => AnotherModel.fromJson(json), // Add other model factories as needed... }; } -
Remove Direct Calls to
responseConvert: Ensure that you no longer directly call or overrideresponseConvert. Instead, rely on the default implementation provided by the mixin.
0.0.1+9 #
- add new extensions to map a
Futureresults.
0.0.1+8 #
- appKey now from type GlobalKey
0.0.1+7 #
- call WidgetsFlutterBinding.ensureInitialized method before init the service providers.
0.0.1+6 #
- take providers list as a method argument on run method.
0.0.1+5 #
- just format files using dart form command.
0.0.1+4 #
- add missing repository property at pubspec.yaml file.
0.0.1+3 #
Breaking Changes:
- Refactored
ServiceProvider.- Removed
responseConvert<T>method. - Added
ResponseDecodingmixin. Use itsconvertResponse<T>method for response conversion.
- Removed
How to Migrate:
- If you used
responseConvert<T>, replace it with theconvertResponse<T>method from the newResponseDecodingmixin.
// Old:
class MyServiceProvider extends ServiceProvider {
@override
T? responseConvert<T>(Map<String, dynamic> json) {
...
}
}
// New:
class MyServiceProvider extends ServiceProvider with ResponseDecoding {
@override
T? convertResponse<T>(Map<String, dynamic> json) {
...
}
}
Added
- Utils Extensions:
ThemeContext: Directly accesstextThemeandcolorScheme.ScaffoldContext: Convenient methods likeshowSnackBaradded.KeyboardContext: Methods to control and check the keyboard state.InsetsContext: Access media padding, status bar height, and bottom inset.LocalizationContext: Access the current locale of the context.MediaQueryContext: DeterminescreenHeight,screenWidth, and if the device orientation is landscape.DeviceTypeContext: Determine if the device is a phone, tablet, or desktop.TextScaleContext: Access text scale factors for accessibility settings.BrightnessContext: Check if the device is in dark mode or light mode.SafeAreaContext: Access the safe area insets.
Updated
- App Initialization:
- Introduced
RunTasksclass to streamline application start-up process. The usage has been refactored to userunwithRunTasksfor initialization logic, including registering service providers and other pre and post-run tasks.- Example:
void main() => run( () => const ProviderScope( child: BondApp(), ), RunAppTasks(providers), );
- Example:
- The
RunTasksclass now initializes service providers through a callable method. beforeRun,afterRun, andonErrormethods ofRunTasksare now optional.
- Introduced
0.0.1+2 #
- remove device_info package.
- remove device_utils.dart file.
- remove string_extension.dart file.
0.0.1+1 #
- fix package description.
0.0.1 #
- initial release.