From c1f33f077f621bc0b6a619aa36e53cd076891e71 Mon Sep 17 00:00:00 2001 From: Erick Howard Date: Fri, 10 May 2024 18:53:42 +0800 Subject: [PATCH 1/2] Upgrade to Dart 3 (Flutter 3?) and packages to latest major versions - Fixed problems with DropdownButton2 in `lib/components/button.dart` - Tried to match behaviour off old version, might not be 100% correct - Update generated linux bindings Signed-off-by: Erick Howard --- lib/components/button.dart | 135 ++++++----- linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + pubspec.lock | 224 ++++++++++--------- pubspec.yaml | 14 +- 5 files changed, 212 insertions(+), 166 deletions(-) diff --git a/lib/components/button.dart b/lib/components/button.dart index 56949ca..22bdc20 100644 --- a/lib/components/button.dart +++ b/lib/components/button.dart @@ -246,7 +246,7 @@ class _MLongDropdownButtonState extends State { final String? selectedValue = widget.value; return DropdownButtonHideUnderline( child: DropdownButton2( - searchInnerWidgetHeight: 20, + isExpanded: true, customButton: RawMaterialButton( onPressed: null, @@ -316,32 +316,45 @@ class _MLongDropdownButtonState extends State { value: selectedValue, onChanged: (value) { setState(() { - widget.onChanged(context, value); + widget.onChanged(context, value as String?); }); }, - buttonHeight: 40, - dropdownElevation: 0, - itemHeight: 40, - dropdownMaxHeight: 360, - dropdownDecoration: BoxDecoration( - color: MColors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: MColors.grey.shade200), - boxShadow: const [ - BoxShadow( - color: Color(0x19101828), - offset: Offset(0, 4), - blurRadius: 8, - spreadRadius: -2, - ), - BoxShadow( - color: Color(0x10101828), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: -2, - ), - ], + buttonStyleData: const ButtonStyleData(height: 40), + onMenuStateChange: (isOpen) { + if (!isOpen) { + textEditingController.clear(); + } + }, + dropdownStyleData: DropdownStyleData( + elevation: 0, + maxHeight: 360, + padding: const EdgeInsets.only(bottom: 6), + + decoration: BoxDecoration( + color: MColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: MColors.grey.shade200), + boxShadow: const [ + BoxShadow( + color: Color(0x19101828), + offset: Offset(0, 4), + blurRadius: 8, + spreadRadius: -2, + ), + BoxShadow( + color: Color(0x10101828), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: -2, + ), + ], + ), ), + menuItemStyleData: const MenuItemStyleData(height: 40), + + + dropdownSearchData: DropdownSearchData( + searchInnerWidgetHeight: 20, searchController: textEditingController, searchInnerWidget: Padding( padding: const EdgeInsets.only( @@ -374,12 +387,8 @@ class _MLongDropdownButtonState extends State { .toLowerCase() .contains(searchValue.toLowerCase()); }, - dropdownPadding: const EdgeInsets.only(bottom: 6), - onMenuStateChange: (isOpen) { - if (!isOpen) { - textEditingController.clear(); - } - }, + + ) ), ); } @@ -425,7 +434,9 @@ class _MLongComboDropdownButtonState extends State { return DropdownButtonHideUnderline( child: DropdownButton2( isExpanded: true, - scrollbarAlwaysShow: true, + // FIXME: Fix this: + // scrollbarAlwaysShow: true, + customButton: RawMaterialButton( onPressed: null, constraints: const BoxConstraints(), @@ -519,33 +530,47 @@ class _MLongComboDropdownButtonState extends State { ) .toList(), value: selectedValue.isEmpty ? null : selectedValue.last, - selectedItemHighlightColor: MColors.transparent, + // FIXME: Fix this + // selectedItemHighlightColor: MColors.transparent, onChanged: (value) {}, - buttonHeight: 40, - dropdownElevation: 0, - itemHeight: 40, - dropdownMaxHeight: 360, - dropdownDecoration: BoxDecoration( - color: MColors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: MColors.grey.shade200), - boxShadow: const [ - BoxShadow( - color: Color(0x19101828), - offset: Offset(0, 4), - blurRadius: 8, - spreadRadius: -2, - ), - BoxShadow( - color: Color(0x10101828), - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: -2, - ), + buttonStyleData: const ButtonStyleData( + height: 40, + ), + dropdownStyleData: DropdownStyleData( + scrollbarTheme: ScrollbarThemeData( + // I think this does the right thing... + thumbVisibility: MaterialStateProperty.all(true) + ), + elevation: 0, + padding: const EdgeInsets.only(bottom: 6), + maxHeight: 360, + decoration: BoxDecoration( + color: MColors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: MColors.grey.shade200), + boxShadow: const [ + BoxShadow( + color: Color(0x19101828), + offset: Offset(0, 4), + blurRadius: 8, + spreadRadius: -2, + ), + BoxShadow( + color: Color(0x10101828), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: -2, + ), ], ), - itemPadding: EdgeInsets.zero, - dropdownPadding: const EdgeInsets.only(bottom: 6), + ), + menuItemStyleData: const MenuItemStyleData( + height: 40, + padding: EdgeInsets.zero + ), + + + onMenuStateChange: (isOpen) {}, ), ); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 0cacc75..69e5ff8 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,11 +6,15 @@ #include "generated_plugin_registrant.h" +#include #include #include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) rive_common_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "RivePlugin"); + rive_plugin_register_with_registrar(rive_common_registrar); g_autoptr(FlPluginRegistrar) screen_retriever_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index df03fdc..ddb023b 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + rive_common screen_retriever url_launcher_linux window_manager diff --git a/pubspec.lock b/pubspec.lock index 50824d4..56cd877 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32" + url: "https://pub.dev" + source: hosted + version: "0.3.4+1" crypto: dependency: transitive description: @@ -69,18 +77,18 @@ packages: dependency: "direct main" description: name: dio - sha256: "3e5c4a94d112540d0c9a6b7f3969832e1604eb8cde0f88d0808382f9f632100b" + sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5" url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "5.4.3+1" dropdown_button2: dependency: "direct main" description: name: dropdown_button2 - sha256: "604b87283e251e0e4a0cb1d0fdfa91fd527702b06e80999c4054cecc603e10e7" + sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1 url: "https://pub.dev" source: hosted - version: "1.9.4" + version: "2.3.9" fake_async: dependency: transitive description: @@ -101,18 +109,18 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" file_picker: dependency: "direct main" description: name: file_picker - sha256: be325344c1f3070354a1d84a231a1ba75ea85d413774ec4bdf444c023342e030 + sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "8.0.3" fixnum: dependency: transitive description: @@ -146,26 +154,26 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 + sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "4.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: c224ac897bed083dabf11f238dd11a239809b446740be0c2044608c50029ffdf + sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f" url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.0.19" flutter_svg: dependency: "direct main" description: name: flutter_svg - sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2" + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "2.0.10+1" flutter_test: dependency: "direct dev" description: flutter @@ -180,10 +188,10 @@ packages: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.1" highlight: dependency: transitive description: @@ -236,42 +244,42 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.0" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "2.0.1" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.0.1" lints: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "4.0.0" markdown: dependency: transitive description: name: markdown - sha256: "1b134d9f8ff2da15cb298efe6cd8b7d2a78958c1b00384ebcbdf13fe340a6c90" + sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 url: "https://pub.dev" source: hosted - version: "7.2.1" + version: "7.2.2" markdown_widget: dependency: "direct main" description: @@ -300,10 +308,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.11.0" nested: dependency: transitive description: @@ -316,18 +324,18 @@ packages: dependency: "direct main" description: name: once - sha256: "5835a4d29bb3e732f65bd7cc7270f3ac3b2925854dd96e967f4ad2297dbb779b" + sha256: c4def051c2b7b25056348797a363b0998f7e383d67509b64ed79f6d8ea898909 url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "1.6.2" package_info_plus: dependency: transitive description: name: package_info_plus - sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + sha256: cb44f49b6e690fa766f023d5b22cac6b9affe741dd792b6ac7ad4fabe0d7b097 url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "6.0.0" package_info_plus_platform_interface: dependency: transitive description: @@ -344,14 +352,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 - url: "https://pub.dev" - source: hosted - version: "1.0.1" path_parsing: dependency: transitive description: @@ -364,26 +364,26 @@ packages: dependency: "direct main" description: name: path_provider - sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.4" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" path_provider_linux: dependency: transitive description: @@ -396,10 +396,10 @@ packages: dependency: transitive description: name: path_provider_platform_interface - sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: @@ -412,10 +412,10 @@ packages: dependency: "direct main" description: name: pdfrx - sha256: "9217ddf6c86bd758e933cb615e1e5eca4c182684ff1d89fcedbf10111f15eccf" + sha256: "84065d3d3dfa776aa47d0ff4bcc8e64e3088995803242cb6e15c1c090857e8cf" url: "https://pub.dev" source: hosted - version: "1.0.11" + version: "1.0.62" petitparser: dependency: transitive description: @@ -428,50 +428,42 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "2.1.8" provider: dependency: "direct main" description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.2" rive: dependency: "direct main" description: name: rive - sha256: f2117a96a189758bc79bf7933865625c7a44a420ae537d2a8f6c492900136a71 + sha256: "255ab7892a77494458846cecee1376a017e64fd6b4130b51ec21424d12ffa6fe" url: "https://pub.dev" source: hosted - version: "0.11.17" + version: "0.13.4" rive_common: dependency: transitive description: name: rive_common - sha256: e41f12917cb58e0c9376836490ebaa431e12744da0c67e19dad8d4bee9fedd46 + sha256: "3a0d95f529d52caef535d8ff32d75629ca37f7ab4707b13c83e9552a322557bc" url: "https://pub.dev" source: hosted - version: "0.2.7" + version: "0.4.8" rxdart: dependency: transitive description: @@ -484,10 +476,10 @@ packages: dependency: transitive description: name: screen_retriever - sha256: "4931f226ca158123ccd765325e9fbf360bfed0af9b460a10f960f9bb13d58323" + sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "0.1.9" scroll_to_index: dependency: transitive description: @@ -500,26 +492,26 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" + sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.3" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" + sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" + sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" url: "https://pub.dev" source: hosted - version: "2.3.5" + version: "2.4.0" shared_preferences_linux: dependency: transitive description: @@ -532,10 +524,10 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" shared_preferences_web: dependency: transitive description: @@ -617,34 +609,34 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.6.1" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + 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 - sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" + sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e" url: "https://pub.dev" source: hosted - version: "6.2.5" + version: "6.2.6" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" + sha256: "360a6ed2027f18b73c8d98e159dda67a61b7f2e0f6ec26e86c3ada33b0621775" url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.1" url_launcher_ios: dependency: transitive description: @@ -673,18 +665,18 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4aca1e060978e19b2998ee28503f40b5ba6226819c2b5e3e4d1821e8ccd92198" + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d" + sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" url_launcher_windows: dependency: transitive description: @@ -697,10 +689,34 @@ packages: dependency: "direct main" description: name: uuid - sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" url: "https://pub.dev" source: hosted - version: "4.3.3" + version: "4.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" vector_math: dependency: transitive description: @@ -721,42 +737,42 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "13.0.0" web: dependency: transitive description: name: web - sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad" + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.5.1" win32: dependency: transitive description: name: win32 - sha256: "7dacfda1edcca378031db9905ad7d7bd56b29fd1a90b0908b71a52a12c41e36b" + sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "5.5.0" window_manager: dependency: "direct main" description: name: window_manager - sha256: d812d3189d23465d2e94baa2505a4462b46dde4939012ff370711c6897d747ae + sha256: b3c895bdf936c77b83c5254bec2e6b3f066710c1f89c38b20b8acc382b525494 url: "https://pub.dev" source: hosted - version: "0.2.9" + version: "0.3.8" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" xml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 11077e1..ed388b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,23 +6,23 @@ publish_to: "none" version: 0.2.3+90 environment: - sdk: ">=2.18.2 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: sdk: flutter - window_manager: ^0.2.8 + window_manager: ^0.3.8 ionicons: ^0.2.1 - flutter_svg: ^1.1.6 + flutter_svg: ^2.0.10+1 provider: ^6.0.5 flutter_feather_icons: ^2.0.0 - rive: ^0.11.17 - dropdown_button2: ^1.9.4 + rive: ^0.13.4 + dropdown_button2: ^2.3.9 path_provider: ^2.0.11 shared_preferences: ^2.0.16 uuid: ^4.3.3 - file_picker: ^5.0.1 + file_picker: ^8.0.3 dio: ^5.0.3 url_launcher: ^6.1.5 @@ -35,7 +35,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.1 + flutter_lints: ^4.0.0 flutter: uses-material-design: true From a72381263a4e05ab195bb19c4ba324eee7771644 Mon Sep 17 00:00:00 2001 From: Erick Howard Date: Sun, 23 Jun 2024 22:14:32 +0200 Subject: [PATCH 2/2] Update more core to Dart 3 ( mostly switching to Iterable.indexed ) Signed-off-by: Erick Howard --- lib/components/button.dart | 6 +++--- lib/pages/checkout.dart | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/components/button.dart b/lib/components/button.dart index 22bdc20..96bb05d 100644 --- a/lib/components/button.dart +++ b/lib/components/button.dart @@ -81,7 +81,7 @@ class _MButtonGroupState extends State { selected = widget.selected; return Row( children: [ - for (var i = 0; i < widget.titles.length; i++) + for (final (i, title) in widget.titles.indexed) RawMaterialButton( onPressed: () { setState(() { @@ -131,7 +131,7 @@ class _MButtonGroupState extends State { ), ), child: Text( - widget.titles[i], + title, style: TextStyle( color: selected == i ? MColors.white : MColors.grey.shade700, fontSize: 14, @@ -539,7 +539,7 @@ class _MLongComboDropdownButtonState extends State { dropdownStyleData: DropdownStyleData( scrollbarTheme: ScrollbarThemeData( // I think this does the right thing... - thumbVisibility: MaterialStateProperty.all(true) + thumbVisibility: WidgetStateProperty.all(true) ), elevation: 0, padding: const EdgeInsets.only(bottom: 6), diff --git a/lib/pages/checkout.dart b/lib/pages/checkout.dart index 3538cd5..f494d7e 100644 --- a/lib/pages/checkout.dart +++ b/lib/pages/checkout.dart @@ -16,13 +16,14 @@ class CheckoutPage extends StatelessWidget { @override Widget build(BuildContext context) { + var checkoutItems = context.watch().items; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - context.watch().items.isEmpty + checkoutItems.isEmpty ? 'Checkout' - : "Checkout - ${context.watch().items.length} item${context.read().items.length == 1 ? '' : 's'}", + : "Checkout - ${checkoutItems.length} item${context.read().items.length == 1 ? '' : 's'}", style: MTextStyles.dsmMdGrey900, ), const SizedBox(height: 24), @@ -38,7 +39,7 @@ class CheckoutPage extends StatelessWidget { } }, title: (context.watch().selected.length == - context.watch().items.length) + checkoutItems.length) ? "Select None" : "Select All", ), @@ -52,7 +53,7 @@ class CheckoutPage extends StatelessWidget { const Spacer(), MButton( onPressed: () { - if (context.read().downloadPath == '') { + if (context.read().downloadPath.isEmpty) { // show alertdialog showDialog( context: context, @@ -92,21 +93,20 @@ class CheckoutPage extends StatelessWidget { child: Column( children: [ const CheckoutTableHeader(), - if (context.watch().items.isEmpty) + if (checkoutItems.isEmpty) const NoCheckoutPlaceholder(), - for (var i = 0, l = context.watch().items; - i < l.length; - i++) ...[ + for (final (i, item) in checkoutItems.indexed)...[ CheckoutEntryRow( - item: l.elementAt(i), + item: item, documentType: "Document", isSelected: context .watch() .selected - .contains(l.elementAt(i)), - isLast: i == l.length - 1, + .contains(item), + isLast: i == checkoutItems.length - 1, ), - ], + ] + , ], ), ),