From 37c95be61dc02f4478b74bdf910d8b8319c04420 Mon Sep 17 00:00:00 2001 From: Adrian Samoticha <86920182+Adrian-Samoticha@users.noreply.github.com> Date: Fri, 3 May 2024 17:40:03 +0200 Subject: [PATCH] Issue #505 (#509) * Update radio_button.dart * Update CHANGELOG.md * automatic changes * install equatable * make `MacosTypography` extend `Equatable` * make `MacosThemeData` extend `Equatable` * bump version to 2.0.6 * add changelog entry for version 2.0.6 * automatic changes * organize imports * automatic changes * migrate to `onKeyEvent` in three cases * automatic changes --------- Co-authored-by: Abbas Hussein --- CHANGELOG.md | 4 + example/macos/Podfile.lock | 2 +- .../macos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/pubspec.lock | 190 ++++++++++-------- lib/src/buttons/popup_button.dart | 2 +- lib/src/buttons/pulldown_button.dart | 2 +- .../toolbar/toolbar_overflow_menu_item.dart | 2 +- lib/src/theme/macos_theme.dart | 24 ++- lib/src/theme/typography.dart | 18 +- pubspec.lock | 140 ++++++++----- pubspec.yaml | 3 +- test/src/theme/macos_theme_test.dart | 49 +++++ test/src/theme/typography_test.dart | 82 ++++++++ 14 files changed, 372 insertions(+), 150 deletions(-) create mode 100644 test/src/theme/macos_theme_test.dart create mode 100644 test/src/theme/typography_test.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c9e7321..d8cacfe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.0.6] +### 🛠️ Updated 🛠️ +* Implemented value equality for `MacosThemeData`. + ## [2.0.5] ### 🛠️ Fixed 🛠️ * Fixed `MacosRadioButton` check null value issue. diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 92146f31..2f92e758 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -39,7 +39,7 @@ SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 macos_ui: 6229a8922cd97bafb7d9636c8eb8dfb0744183ca macos_window_utils: 933f91f64805e2eb91a5bd057cf97cd097276663 - path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 + path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 PODFILE CHECKSUM: ff0a9a3ce75ee73f200ca7e2f47745698c917ef9 diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 428da703..717c51d9 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -202,7 +202,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 83d88728..5b055a3a 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =3.1.0-185.0.dev <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/lib/src/buttons/popup_button.dart b/lib/src/buttons/popup_button.dart index 37c6559b..8082f78c 100644 --- a/lib/src/buttons/popup_button.dart +++ b/lib/src/buttons/popup_button.dart @@ -99,7 +99,7 @@ class _MacosPopupMenuItemButtonState child: GestureDetector( onTap: _handleOnTap, child: Focus( - onKey: (FocusNode node, RawKeyEvent event) { + onKeyEvent: (FocusNode node, KeyEvent event) { if (event.logicalKey == LogicalKeyboardKey.enter) { _handleOnTap(); return KeyEventResult.handled; diff --git a/lib/src/buttons/pulldown_button.dart b/lib/src/buttons/pulldown_button.dart index 91de97a7..37c0e7d1 100644 --- a/lib/src/buttons/pulldown_button.dart +++ b/lib/src/buttons/pulldown_button.dart @@ -94,7 +94,7 @@ class _MacosPulldownMenuItemButtonState child: GestureDetector( onTap: _handleOnTap, child: Focus( - onKey: (FocusNode node, RawKeyEvent event) { + onKeyEvent: (FocusNode node, KeyEvent event) { if (event.logicalKey == LogicalKeyboardKey.enter) { _handleOnTap(); return KeyEventResult.handled; diff --git a/lib/src/layout/toolbar/toolbar_overflow_menu_item.dart b/lib/src/layout/toolbar/toolbar_overflow_menu_item.dart index e92c57c2..952420f9 100644 --- a/lib/src/layout/toolbar/toolbar_overflow_menu_item.dart +++ b/lib/src/layout/toolbar/toolbar_overflow_menu_item.dart @@ -89,7 +89,7 @@ class _ToolbarOverflowMenuItemState extends State { child: GestureDetector( onTap: _handleOnTap, child: Focus( - onKey: (FocusNode node, RawKeyEvent event) { + onKeyEvent: (FocusNode node, KeyEvent event) { if (event.logicalKey == LogicalKeyboardKey.enter) { _handleOnTap(); return KeyEventResult.handled; diff --git a/lib/src/theme/macos_theme.dart b/lib/src/theme/macos_theme.dart index 0bda4d11..59776de6 100644 --- a/lib/src/theme/macos_theme.dart +++ b/lib/src/theme/macos_theme.dart @@ -1,3 +1,4 @@ +import 'package:equatable/equatable.dart'; import 'package:flutter/foundation.dart'; import 'package:macos_ui/macos_ui.dart'; import 'package:macos_ui/src/library.dart'; @@ -178,7 +179,7 @@ class _InheritedMacosTheme extends InheritedWidget { /// See also: /// /// * [MacosTheme], in which this [MacosThemeData] is inserted. -class MacosThemeData with Diagnosticable { +class MacosThemeData extends Equatable with Diagnosticable { /// Creates a [MacosThemeData] that's used to configure [MacosTheme]. /// /// The [typography] [TextStyle] colors are black if the [brightness] @@ -682,6 +683,27 @@ class MacosThemeData with Diagnosticable { ), ); } + + @override + List get props => [ + brightness, + primaryColor, + canvasColor, + typography, + pushButtonTheme, + dividerColor, + helpButtonTheme, + tooltipTheme, + visualDensity, + scrollbarTheme, + iconButtonTheme, + iconTheme, + popupButtonTheme, + pulldownButtonTheme, + datePickerTheme, + timePickerTheme, + searchFieldTheme, + ]; } /// Brightness extensions diff --git a/lib/src/theme/typography.dart b/lib/src/theme/typography.dart index 7b2f72a7..462e332e 100644 --- a/lib/src/theme/typography.dart +++ b/lib/src/theme/typography.dart @@ -1,3 +1,4 @@ +import 'package:equatable/equatable.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:macos_ui/src/theme/macos_colors.dart'; @@ -15,7 +16,7 @@ const _kDefaultFontFamily = '.AppleSystemUIFont'; /// * [MacosTheme], for aspects of a macos application that can be globally /// adjusted, such as the primary color. /// * -class MacosTypography with Diagnosticable { +class MacosTypography extends Equatable with Diagnosticable { /// Creates a typography that uses the given values. /// /// Rather than creating a new typography, consider using [MacosTypography.darkOpaque] @@ -297,6 +298,21 @@ class MacosTypography with Diagnosticable { defaultValue: defaultStyle.caption2, )); } + + @override + List get props => [ + body, + callout, + caption1, + caption2, + footnote, + headline, + largeTitle, + subheadline, + title1, + title2, + title3, + ]; } /// The thickness of the glyphs used to draw the text. diff --git a/pubspec.lock b/pubspec.lock index b2e287b4..40925f5d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.4.1" appkit_ui_element_colors: dependency: "direct main" description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.5.0" async: dependency: transitive description: @@ -69,10 +69,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" url: "https://pub.dev" source: hosted - version: "1.6.3" + version: "1.7.2" crypto: dependency: transitive description: @@ -98,7 +98,7 @@ packages: source: hosted version: "3.0.3" equatable: - dependency: transitive + dependency: "direct main" description: name: equatable sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -130,10 +130,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" flutter_test: dependency: "direct dev" description: flutter @@ -151,10 +151,10 @@ packages: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" gradient_borders: dependency: "direct main" description: @@ -195,62 +195,86 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: name: lints - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" macos_window_utils: dependency: "direct main" description: name: macos_window_utils - sha256: "43a90473f8786f00f07203e6819dab67e032f8896dafa4a6f85fbc71fba32c0b" + sha256: "230be594d26f6dee92c5a1544f4242d25138a5bfb9f185b27f14de3949ef0be8" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.5.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" mocktail: dependency: "direct dev" description: @@ -279,18 +303,18 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.8" pool: dependency: transitive description: @@ -364,26 +388,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -404,26 +428,26 @@ packages: dependency: transitive description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.9" typed_data: dependency: transitive description: @@ -444,10 +468,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f3743ca475e0c9ef71df4ba15eb2d7684eecd5c8ba20a462462e4e8b561b2e11 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "11.6.0" + version: "13.0.0" watcher: dependency: transitive description: @@ -456,22 +480,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.5" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" yaml: dependency: transitive description: @@ -481,5 +513,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.3.0 <4.0.0" flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0cfba245..63220838 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: macos_ui description: Flutter widgets and themes implementing the current macOS design language. -version: 2.0.5 +version: 2.0.6 homepage: "https://macosui.dev" repository: "https://github.com/GroovinChip/macos_ui" @@ -14,6 +14,7 @@ dependencies: macos_window_utils: ^1.2.0 gradient_borders: ^1.0.0 appkit_ui_element_colors: ^1.0.0 + equatable: ^2.0.5 dev_dependencies: flutter_test: diff --git a/test/src/theme/macos_theme_test.dart b/test/src/theme/macos_theme_test.dart new file mode 100644 index 00000000..92df987c --- /dev/null +++ b/test/src/theme/macos_theme_test.dart @@ -0,0 +1,49 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:macos_ui/src/library.dart'; +import 'package:macos_ui/src/theme/help_button_theme.dart'; +import 'package:macos_ui/src/theme/macos_colors.dart'; +import 'package:macos_ui/src/theme/macos_theme.dart'; + +void main() { + testWidgets('macos theme MacosThemeData equality 1', (tester) async { + final macosThemeData1 = MacosThemeData(); + final macosThemeData2 = MacosThemeData(); + + expect(macosThemeData1, equals(macosThemeData2)); + }); + + testWidgets('macos theme MacosThemeData equality 2', (tester) async { + final macosThemeData1 = MacosThemeData(brightness: Brightness.dark); + final macosThemeData2 = MacosThemeData(brightness: Brightness.light); + + expect(macosThemeData1, isNot(equals(macosThemeData2))); + }); + + testWidgets('macos theme MacosThemeData equality 3', (tester) async { + final macosThemeData1 = MacosThemeData( + helpButtonTheme: const HelpButtonThemeData( + color: MacosColors.appleRed, + )); + + final macosThemeData2 = MacosThemeData( + helpButtonTheme: const HelpButtonThemeData( + color: MacosColors.appleGreen, + )); + + expect(macosThemeData1, isNot(equals(macosThemeData2))); + }); + + testWidgets('macos theme MacosThemeData equality 4', (tester) async { + final macosThemeData1 = MacosThemeData( + helpButtonTheme: const HelpButtonThemeData( + color: MacosColors.appleRed, + )); + + final macosThemeData2 = MacosThemeData( + helpButtonTheme: const HelpButtonThemeData( + color: MacosColors.appleRed, + )); + + expect(macosThemeData1, equals(macosThemeData2)); + }); +} diff --git a/test/src/theme/typography_test.dart b/test/src/theme/typography_test.dart new file mode 100644 index 00000000..9524a6d2 --- /dev/null +++ b/test/src/theme/typography_test.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('typography equality 1', (tester) async { + final typography1 = Typography(); + final typography2 = Typography(); + + expect(typography1, equals(typography2)); + }); + + testWidgets('typography equality 2', (tester) async { + final typography1 = Typography( + black: const TextTheme(bodyLarge: TextStyle(fontSize: 10)), + ); + final typography2 = Typography( + black: const TextTheme(bodyLarge: TextStyle(fontSize: 12)), + ); + + expect(typography1, isNot(equals(typography2))); + }); + + testWidgets('typography equality 3', (tester) async { + final typography1 = Typography( + englishLike: const TextTheme( + bodyLarge: TextStyle(fontSize: 10), + ), + ); + final typography2 = Typography( + englishLike: const TextTheme( + bodyLarge: TextStyle(fontSize: 10), + ), + ); + + expect(typography1, equals(typography2)); + }); + + testWidgets('typography equality 4', (tester) async { + final typography1 = Typography( + englishLike: const TextTheme( + bodyLarge: TextStyle(fontSize: 10), + ), + ); + final typography2 = Typography( + englishLike: const TextTheme( + bodyLarge: TextStyle(fontSize: 12), + ), + ); + + expect(typography1, isNot(equals(typography2))); + }); + + testWidgets('typography equality 5', (tester) async { + final typography1 = Typography( + englishLike: const TextTheme( + headlineLarge: TextStyle(fontSize: 10), + ), + ); + final typography2 = Typography( + englishLike: const TextTheme( + headlineLarge: TextStyle(fontSize: 12), + ), + ); + + expect(typography1, isNot(equals(typography2))); + }); + + testWidgets('typography equality 6', (tester) async { + final typography1 = Typography( + englishLike: const TextTheme( + headlineLarge: TextStyle(fontSize: 10), + ), + ); + final typography2 = Typography( + englishLike: const TextTheme( + headlineLarge: TextStyle(fontSize: 10), + ), + ); + + expect(typography1, equals(typography2)); + }); +}