diff --git a/example/lib/profil.dart b/example/lib/profil.dart index 232bf4a..56764f0 100644 --- a/example/lib/profil.dart +++ b/example/lib/profil.dart @@ -14,22 +14,36 @@ class Profile extends StatelessWidget { @override Widget build(BuildContext context) { - Widget _wrapper(AppState state, { required Widget child }) { - switch(state.currentContainer) { + Widget _wrapper(AppState state, {required Widget child}) { + switch (state.currentContainer) { case CurrentContainer.defaultContainer: - return FB5Container(child: child,); + return FB5Container( + child: child, + ); case CurrentContainer.sm: - return FB5Container.sm(child: child,); + return FB5Container.sm( + child: child, + ); case CurrentContainer.md: - return FB5Container.md(child: child,); + return FB5Container.md( + child: child, + ); case CurrentContainer.lg: - return FB5Container.lg(child: child,); + return FB5Container.lg( + child: child, + ); case CurrentContainer.xl: - return FB5Container.xl(child: child,); + return FB5Container.xl( + child: child, + ); case CurrentContainer.xxl: - return FB5Container.xxl(child: child,); + return FB5Container.xxl( + child: child, + ); case CurrentContainer.fluid: - return FB5Container.fluid(child: child,); + return FB5Container.fluid( + child: child, + ); } } @@ -51,6 +65,7 @@ class Profile extends StatelessWidget { classNames: 'col-12 mt-5', child: const Containers(), ), + FB5Col( classNames: 'mt-5', child: const TestingArea(), diff --git a/example/lib/widgets/getting_started.dart b/example/lib/widgets/getting_started.dart index 8efedc8..c3f1733 100644 --- a/example/lib/widgets/getting_started.dart +++ b/example/lib/widgets/getting_started.dart @@ -55,7 +55,7 @@ class GettingStarted extends StatelessWidget { ), Text( 'Notice. Changing the font size also affects all other relative values (e.g. margin and padding), as these are calculated in "rem". For example, the top slider has a padding of p-5, which means that it should use 5 times the default font size as padding.', - style: Theme.of(context).textTheme.caption, + style: Theme.of(context).textTheme.headlineMedium, ), ], ); diff --git a/example/lib/widgets/grid_area.dart b/example/lib/widgets/grid_area.dart index 309423c..7200969 100644 --- a/example/lib/widgets/grid_area.dart +++ b/example/lib/widgets/grid_area.dart @@ -46,7 +46,7 @@ class _GridAreaState extends State { ), Text( 'You can change the classes of the cols by clicking on the text, changing it and confirming with Enter.', - style: Theme.of(context).textTheme.caption, + style: Theme.of(context).textTheme.headlineMedium, ), const SizedBox( height: 16.0, diff --git a/example/lib/widgets/testing_area.dart b/example/lib/widgets/testing_area.dart index 4f7926f..13b9d70 100644 --- a/example/lib/widgets/testing_area.dart +++ b/example/lib/widgets/testing_area.dart @@ -45,7 +45,7 @@ class _TestingAreaState extends State { ), Text( 'You can change the classes of the cols by clicking on the text, changing it and confirming with Enter.', - style: Theme.of(context).textTheme.caption, + style: Theme.of(context).textTheme.headlineMedium, ), const SizedBox( height: 16.0, diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 4618f38..a1cdfd0 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,7 +5,7 @@ import FlutterMacOS import Foundation -import path_provider_macos +import path_provider_foundation import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { diff --git a/example/pubspec.lock b/example/pubspec.lock index e8fc4fb..6c2cf83 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,93 +5,90 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" bloc: dependency: transitive description: name: bloc - url: "https://pub.dartlang.org" + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" source: hosted - version: "8.0.3" + version: "8.1.4" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.8" equatable: dependency: "direct main" description: name: equatable - url: "https://pub.dartlang.org" + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "2.1.2" flutter: dependency: "direct main" description: flutter @@ -101,23 +98,25 @@ packages: dependency: "direct main" description: name: flutter_bloc - url: "https://pub.dartlang.org" + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" source: hosted - version: "8.0.1" + version: "8.1.6" flutter_bootstrap5: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.0.0" + version: "1.1.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "4.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -132,156 +131,178 @@ packages: dependency: "direct main" description: name: google_fonts - url: "https://pub.dartlang.org" + sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "6.2.1" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "1.2.2" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" intersperse: dependency: transitive description: name: intersperse - url: "https://pub.dartlang.org" + sha256: "2f8a905c96f6cbba978644a3d5b31b8d86ddc44917662df7d27a61f3df66a576" + url: "https://pub.dev" source: hosted version: "2.0.0" - js: + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: dependency: transitive description: - name: js - url: "https://pub.dartlang.org" + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "4.0.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.8.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.12.0" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.0" path_provider: dependency: transitive description: name: path_provider - url: "https://pub.dartlang.org" + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + url: "https://pub.dev" source: hosted - version: "2.0.11" + version: "2.1.4" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "490539678396d4c3c0b06efdaab75ae60675c3e0c66f72bc04c2e2c1e0e2abeb" + url: "https://pub.dev" source: hosted - version: "2.0.16" - path_provider_ios: + version: "2.2.9" + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + url: "https://pub.dev" source: hosted - version: "2.0.10" + version: "2.4.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" source: hosted - version: "2.1.7" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "2.1.8" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c + url: "https://pub.dev" source: hosted - version: "6.0.3" + version: "6.1.2" sky_engine: dependency: transitive description: flutter @@ -291,128 +312,154 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.7.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + url: "https://pub.dev" source: hosted - version: "6.1.5" + version: "6.3.0" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9" + url: "https://pub.dev" source: hosted - version: "6.0.17" + version: "6.3.8" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + url: "https://pub.dev" source: hosted - version: "6.0.17" + version: "6.3.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: a36e2d7981122fa185006b216eb6b5b97ede3f9a54b7a511bc966971ab98d049 + url: "https://pub.dev" source: hosted - version: "2.0.12" + version: "2.3.2" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" - win32: + version: "2.1.4" + vm_service: dependency: transitive description: - name: win32 - url: "https://pub.dartlang.org" + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "14.2.1" + web: + dependency: transitive + description: + name: web + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + url: "https://pub.dev" + source: hosted + version: "1.0.0" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" source: hosted - version: "0.2.0+1" + version: "1.0.4" sdks: - dart: ">=2.17.3 <3.0.0" - flutter: ">=3.0.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fb14212..d9ad823 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -37,7 +37,7 @@ dependencies: flutter_bloc: ^8.0.1 equatable: ^2.0.3 url_launcher: ^6.1.5 - google_fonts: ^3.0.1 + google_fonts: ^6.2.1 flutter_bootstrap5: path: ../ @@ -50,7 +50,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^4.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/src/layout/bootstrap_theme.dart b/lib/src/layout/bootstrap_theme.dart index a961f23..253719a 100644 --- a/lib/src/layout/bootstrap_theme.dart +++ b/lib/src/layout/bootstrap_theme.dart @@ -18,8 +18,10 @@ class BootstrapTheme extends StatelessWidget { return data; } + @override Widget build(BuildContext context) { + return _InheritedBootstrapTheme( bootstrapTheme: this, child: Builder( @@ -27,6 +29,8 @@ class BootstrapTheme extends StatelessWidget { ), ); } + + } class _InheritedBootstrapTheme extends InheritedWidget { @@ -61,9 +65,9 @@ class ScreenData { static ScreenData fallBack() => ScreenData( breakPoints: const BreakPoints(), - currentBreakPoint: _BootstrapBreakPoints.xs, + currentBreakPoint: MediaQueryBuilder.BootStrapGetBreakPoint(), screenSize: Size.fromWidth( - _BootstrapBreakPoints.xs.maxWidth, + MediaQueryBuilder.BootStrapGetSize(), ), fontSize: defaultFontSize, containerBreakPoints: const ContainerBreakPoints(), diff --git a/lib/src/layout/breakpoints.dart b/lib/src/layout/breakpoints.dart index cde6c58..735d1e7 100644 --- a/lib/src/layout/breakpoints.dart +++ b/lib/src/layout/breakpoints.dart @@ -18,6 +18,14 @@ class _BootstrapContainerBreakPoints { static const double xl = 1140; static const double xxl = 1320; } +class BootstrapContainerBreakPoints { + static const double xs = double.infinity; + static const double sm = 540; + static const double md = 720; + static const double lg = 960; + static const double xl = 1140; + static const double xxl = 1320; +} class ContainerBreakPoints { final double xs; diff --git a/lib/src/layout/fb5_style/converter.dart b/lib/src/layout/fb5_style/converter.dart index c00df76..463d624 100644 --- a/lib/src/layout/fb5_style/converter.dart +++ b/lib/src/layout/fb5_style/converter.dart @@ -68,6 +68,8 @@ _WrapperStyle? _convertClassNamesToWrapperStyle(String? classNames) { // use prefix substring to include all possible classes // e.g m, mt, mb, etc. + + switch (prefix.substring(0, 1)) { case 'a': if (className.contains('align-items')) { diff --git a/lib/src/layout/fb5_style/fb5_col_size.dart b/lib/src/layout/fb5_style/fb5_col_size.dart index b6c1e64..de3dfe4 100644 --- a/lib/src/layout/fb5_style/fb5_col_size.dart +++ b/lib/src/layout/fb5_style/fb5_col_size.dart @@ -75,6 +75,7 @@ class _FB5Size { final colSize = _FB5ColSize._(numerator: size); + switch (breakPoint) { case 'xs': return _copyWith(xs: colSize); diff --git a/lib/src/layout/fb5_style/fb5_vertical_alignment.dart b/lib/src/layout/fb5_style/fb5_vertical_alignment.dart index a3fc976..679b326 100644 --- a/lib/src/layout/fb5_style/fb5_vertical_alignment.dart +++ b/lib/src/layout/fb5_style/fb5_vertical_alignment.dart @@ -53,10 +53,13 @@ class _FB5VerticalAlignment { } WrapCrossAlignment? _fromString(String alignment) { - switch(alignment) { - case 'start': return WrapCrossAlignment.start; - case 'center': return WrapCrossAlignment.center; - case 'end': return WrapCrossAlignment.end; + switch (alignment) { + case 'start': + return WrapCrossAlignment.start; + case 'center': + return WrapCrossAlignment.center; + case 'end': + return WrapCrossAlignment.end; } return null; } diff --git a/lib/src/layout/media_query_builder.dart b/lib/src/layout/media_query_builder.dart index 704bb39..84ff74c 100644 --- a/lib/src/layout/media_query_builder.dart +++ b/lib/src/layout/media_query_builder.dart @@ -1,27 +1,60 @@ part of flutter_bootstrap5; - typedef MediaQueryBuilderFunction = Widget Function( BuildContext context, BoxConstraints constraints, ScreenData data, ); - class MediaQueryBuilder extends StatelessWidget { const MediaQueryBuilder({ Key? key, required this.builder, }) : super(key: key); - final MediaQueryBuilderFunction builder; - + //INIT WIDTH + static double width = 576; @override - Widget build(BuildContext context) => - LayoutBuilder(builder: (context, constraints) { - final screenData = BootstrapTheme.of(context); - return builder( - context, - constraints, - screenData, - ); - }); + Widget build(BuildContext context) { + //GET WIDTH + width = MediaQuery.of(context).size.width; + return LayoutBuilder(builder: (context, constraints) { + final screenData = BootstrapTheme.of(context); + return builder( + context, + constraints, + screenData, + ); + }); + } + //ADDED FUNCS + static BootStrapGetBreakPoint() { + print("width=>$width"); + if (width >= 0 && width <= 576) { + return _BootstrapBreakPoints.xs; + } else if (width >= 576 && width <= 768) { + return _BootstrapBreakPoints.sm; + } else if (width >= 768 && width <= 992) { + return _BootstrapBreakPoints.md; + } else if (width >= 992 && width <= 1200) { + return _BootstrapBreakPoints.lg; + } else if (width >= 1200 && width <= 1400) { + return _BootstrapBreakPoints.xl; + } else if (width >= 1400 && width <= double.infinity) { + return _BootstrapBreakPoints.xxl; + } + } + static BootStrapGetSize() { + if (width >= 0 && width <= 576) { + return _BootstrapBreakPoints.xs.maxWidth; + } else if (width >= 576 && width <= 768) { + return _BootstrapBreakPoints.sm.maxWidth; + } else if (width >= 768 && width <= 992) { + return _BootstrapBreakPoints.md.maxWidth; + } else if (width >= 992 && width <= 1200) { + return _BootstrapBreakPoints.lg.maxWidth; + } else if (width >= 1200 && width <= 1400) { + return _BootstrapBreakPoints.xl.maxWidth; + } else if (width >= 1400 && width <= double.infinity) { + return _BootstrapBreakPoints.xxl.maxWidth; + } + } } diff --git a/lib/src/widgets/layout/div.dart b/lib/src/widgets/layout/div.dart index 1752e4a..34e3ceb 100644 --- a/lib/src/widgets/layout/div.dart +++ b/lib/src/widgets/layout/div.dart @@ -1,3 +1,4 @@ +/* part of flutter_bootstrap5; class Div extends StatelessWidget { @@ -25,3 +26,4 @@ class Div extends StatelessWidget { }); } } +*/ diff --git a/lib/src/widgets/layout/fb5_col.dart b/lib/src/widgets/layout/fb5_col.dart index 9c435c2..b2ed98a 100644 --- a/lib/src/widgets/layout/fb5_col.dart +++ b/lib/src/widgets/layout/fb5_col.dart @@ -39,7 +39,6 @@ class FB5Col extends _FB5OrderWidget { ); } - @override // ignore: library_private_types_in_public_api final _WrapperStyle? style; @@ -87,6 +86,7 @@ class FB5Col extends _FB5OrderWidget { if (!isVisible) return const SizedBox.shrink(); + final width = screenData.breakPoints._currentWidth( constraints.maxWidth, screenData.currentBreakPoint, diff --git a/pubspec.yaml b/pubspec.yaml index 1f635d2..4f5ce68 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: ^4.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec