From 24ee3852dac79368f29d6880c1f25a0c5a3cec41 Mon Sep 17 00:00:00 2001 From: thelukewalton Date: Tue, 31 Dec 2024 12:25:32 +0000 Subject: [PATCH] deps!: Update to Flutter 3.27.0 fix: Use new Color / opacity values test: Update tests for color changes --- .fvmrc | 3 + .gitignore | 5 +- example/macos/Podfile.lock | 2 +- example/macos/Runner/AppDelegate.swift | 4 ++ lib/src/components/dial_pad/dial_pad.dart | 2 +- .../components/switch/material_switch.dart | 22 +++---- lib/src/theme/color_extensions.dart | 29 ++++++--- lib/src/theme/color_swatch.dart | 9 ++- test/src/components/badge/indicator_test.dart | 2 +- .../components/badge/priority_pill_test.dart | 3 +- test/src/components/tooltip/tooltip_test.dart | 20 +----- .../tooltip/tooltip_test.mocks.dart | 31 +++++++--- test/src/theme/color_swatch_test.dart | 46 +++++++------- test/src/utils/extensions_test.mocks.dart | 62 +++++++++++++------ test/src/utils/rounded_test.mocks.dart | 31 +++++++--- test/src/zeta_provider_test.mocks.dart | 29 ++++++--- 16 files changed, 181 insertions(+), 119 deletions(-) create mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..5b5166d2 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.27.0" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5b7845ae..8a46937b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,6 @@ doc/api/ *.js.deps *.js.map .env -.fvm/flutter_sdk .pub-cache/ .pub/ /coverage/**/ @@ -143,9 +142,9 @@ $RECYCLE.BIN/ *.msp *.lnk **/Generated.xcconfig -.fvmrc **/node_modules/ package-lock.json /appium /coverage -/.coverage \ No newline at end of file +/.coverage +.fvm/ \ No newline at end of file diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index fbd492e5..1aff447e 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -35,7 +35,7 @@ SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 - sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13 + sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift index 8e02df28..b3c17614 100644 --- a/example/macos/Runner/AppDelegate.swift +++ b/example/macos/Runner/AppDelegate.swift @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/lib/src/components/dial_pad/dial_pad.dart b/lib/src/components/dial_pad/dial_pad.dart index 812ab478..2a24a619 100644 --- a/lib/src/components/dial_pad/dial_pad.dart +++ b/lib/src/components/dial_pad/dial_pad.dart @@ -202,7 +202,7 @@ class ZetaDialPadButton extends StatelessWidget { decoration: ShapeDecoration( shape: const CircleBorder(), color: colors.warm.shade10, - shadows: [BoxShadow(color: Colors.black.withOpacity(0.15), blurRadius: 4, offset: const Offset(0, 2))], + shadows: [BoxShadow(color: Colors.black.withValues(alpha: 0.15), blurRadius: 4, offset: const Offset(0, 2))], ), child: Material( color: Colors.transparent, diff --git a/lib/src/components/switch/material_switch.dart b/lib/src/components/switch/material_switch.dart index 99e8da0d..c4084e3d 100644 --- a/lib/src/components/switch/material_switch.dart +++ b/lib/src/components/switch/material_switch.dart @@ -1011,9 +1011,9 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { if (states.contains(WidgetState.selected)) { - return _colors.surface.withOpacity(1); + return _colors.surface.withValues(alpha: 1); } - return _colors.onSurface.withOpacity(0.38); + return _colors.onSurface.withValues(alpha: 0.38); } if (states.contains(WidgetState.selected)) { if (states.contains(WidgetState.pressed)) { @@ -1045,9 +1045,9 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.disabled)) { if (states.contains(WidgetState.selected)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withValues(alpha: 0.12); } - return _colors.surfaceContainerHighest.withOpacity(0.12); + return _colors.surfaceContainerHighest.withValues(alpha: 0.12); } if (states.contains(WidgetState.selected)) { if (states.contains(WidgetState.pressed)) { @@ -1081,7 +1081,7 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return Colors.transparent; } if (states.contains(WidgetState.disabled)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withValues(alpha: 0.12); } return _colors.outline; }); @@ -1092,24 +1092,24 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return WidgetStateProperty.resolveWith((Set states) { if (states.contains(WidgetState.selected)) { if (states.contains(WidgetState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withValues(alpha: 0.12); } if (states.contains(WidgetState.hovered)) { - return _colors.primary.withOpacity(0.08); + return _colors.primary.withValues(alpha: 0.08); } if (states.contains(WidgetState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withValues(alpha: 0.12); } return null; } if (states.contains(WidgetState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withValues(alpha: 0.12); } if (states.contains(WidgetState.hovered)) { - return _colors.onSurface.withOpacity(0.08); + return _colors.onSurface.withValues(alpha: 0.08); } if (states.contains(WidgetState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withValues(alpha: 0.12); } return null; }); diff --git a/lib/src/theme/color_extensions.dart b/lib/src/theme/color_extensions.dart index 51f96968..c15df71d 100644 --- a/lib/src/theme/color_extensions.dart +++ b/lib/src/theme/color_extensions.dart @@ -36,13 +36,13 @@ extension ZetaColorExtensions on Color { Color brighten([int amount = 10]) { if (amount <= 0) return this; if (amount > 100) return Colors.white; - final Color color = Color.fromARGB( - alpha, - math.max(0, math.min(255, red - (255 * -(amount / 100)).round())), - math.max(0, math.min(255, green - (255 * -(amount / 100)).round())), - math.max(0, math.min(255, blue - (255 * -(amount / 100)).round())), + + return Color.fromARGB( + _intAlpha, + math.max(0, math.min(255, _intRed - (255 * -(amount / 100)).round())), + math.max(0, math.min(255, _intGreen - (255 * -(amount / 100)).round())), + math.max(0, math.min(255, _intBlue - (255 * -(amount / 100)).round())), ); - return color; } /// Lightens the color with the given integer percentage amount. @@ -169,7 +169,7 @@ extension ZetaColorExtensions on Color { /// Return uppercase Flutter style hex code string of the color. String get hexCode { - return value.toRadixString(16).toUpperCase().padLeft(8, '0'); + return intValue.toRadixString(16).toUpperCase().padLeft(8, '0'); } /// Applies lightness percentage to color. @@ -304,4 +304,19 @@ extension ZetaColorExtensions on Color { }) { return adjustContrast(on: on, target: standard.targetContrast); } + + int get _intAlpha => _floatToInt8(a); + int get _intRed => _floatToInt8(r); + int get _intGreen => _floatToInt8(g); + int get _intBlue => _floatToInt8(b); + + int _floatToInt8(double x) { + return (x * 255.0).round() & 0xff; + } + + /// Returns the integer value of the color. + int get intValue { + // TODO(UX-1353): Remove this method as int color values should be removed + return _intAlpha << 24 | _intRed << 16 | _intGreen << 8 | _intBlue; + } } diff --git a/lib/src/theme/color_swatch.dart b/lib/src/theme/color_swatch.dart index 529ecf8b..567053f0 100644 --- a/lib/src/theme/color_swatch.dart +++ b/lib/src/theme/color_swatch.dart @@ -52,7 +52,7 @@ class ZetaColorSwatch extends ColorSwatch with EquatableMixin { return ZetaColorSwatch( contrast: contrast, brightness: brightness, - primary: primary.value, + primary: primary.intValue, swatch: primary.generateSwatch(background: background), ).apply(brightness: brightness); } @@ -188,14 +188,13 @@ class ZetaColorSwatch extends ColorSwatch with EquatableMixin { return ZetaColorSwatch( contrast: contrast, brightness: brightness, - primary: swatch[primaryIndex]!.value, + primary: swatch[primaryIndex]!.intValue, swatch: swatch, ); } @override List get props => [ - super.value, brightness, contrast, shade10, @@ -256,7 +255,7 @@ class ZetaPureColorSwatch extends ColorSwatch with EquatableMixin { return ZetaPureColorSwatch( brightness: brightness, - primary: this[500]!.value, + primary: this[500]!.intValue, swatch: { 0: this[0]!, 500: this[500]!, @@ -266,5 +265,5 @@ class ZetaPureColorSwatch extends ColorSwatch with EquatableMixin { } @override - List get props => [super.value, shade0, shade500, shade1000]; + List get props => [shade0, shade500, shade1000]; } diff --git a/test/src/components/badge/indicator_test.dart b/test/src/components/badge/indicator_test.dart index ba73efff..74f35924 100644 --- a/test/src/components/badge/indicator_test.dart +++ b/test/src/components/badge/indicator_test.dart @@ -55,7 +55,7 @@ void main() { }); group('Content Tests', () { final debugFillProperties = { - 'color': 'MaterialColor(primary value: Color(0xffff9800))', + 'color': Colors.orange.toString(), 'icon': 'IconData(U+F04B6)', 'inverse': 'true', 'rounded': 'false', diff --git a/test/src/components/badge/priority_pill_test.dart b/test/src/components/badge/priority_pill_test.dart index 92c120bb..3c6ce309 100644 --- a/test/src/components/badge/priority_pill_test.dart +++ b/test/src/components/badge/priority_pill_test.dart @@ -21,8 +21,7 @@ void main() { 'rounded': 'false', 'isBadge': 'false', 'index': '"1"', - 'customColor': - 'ZetaColorSwatch(4278219750, Brightness.light, ZetaContrast.aa, Color(0xfff1f8ff), Color(0xffe2f1ff), Color(0xffb7dbff), Color(0xff7ebeff), Color(0xff599fe5), Color(0xff0073e6), Color(0xff0061c2), Color(0xff004d99), Color(0xff002c58), Color(0xff101b25))', + 'customColor': ZetaColorBase.blue.toString(), 'type': 'urgent', 'size': 'large', }; diff --git a/test/src/components/tooltip/tooltip_test.dart b/test/src/components/tooltip/tooltip_test.dart index 31453509..5b12cf97 100644 --- a/test/src/components/tooltip/tooltip_test.dart +++ b/test/src/components/tooltip/tooltip_test.dart @@ -30,7 +30,7 @@ void main() { final debugFillProperties = { 'rounded': 'null', 'padding': 'EdgeInsets.all(8.0)', - 'color': 'MaterialColor(primary value: Color(0xffffc107))', + 'color': Colors.amber.toString(), 'textStyle': 'TextStyle(inherit: true, size: 9.0)', 'arrowDirection': 'down', 'maxWidth': '170.0', @@ -46,24 +46,6 @@ void main() { debugFillProperties, ); - testWidgets('debugFillProperties works correctly', (WidgetTester tester) async { - final diagnostics = DiagnosticPropertiesBuilder(); - const ZetaTooltip( - padding: EdgeInsets.all(8), - color: Colors.amber, - textStyle: TextStyle(fontSize: 9), - maxWidth: 170, - child: Text('Rounded tooltip'), - ).debugFillProperties(diagnostics); - - expect(diagnostics.finder('rounded'), 'null'); - expect(diagnostics.finder('padding'), 'EdgeInsets.all(8.0)'); - expect(diagnostics.finder('color').toLowerCase(), contains(Colors.amber.hexCode.toLowerCase())); - expect(diagnostics.finder('textStyle'), contains('size: 9.0')); - expect(diagnostics.finder('arrowDirection'), 'down'); - expect(diagnostics.finder('maxWidth'), '170.0'); - }); - testWidgets('renders with default properties', (WidgetTester tester) async { await tester.pumpWidget( const TestApp( diff --git a/test/src/components/tooltip/tooltip_test.mocks.dart b/test/src/components/tooltip/tooltip_test.mocks.dart index 100599a8..4c02e6b7 100644 --- a/test/src/components/tooltip/tooltip_test.mocks.dart +++ b/test/src/components/tooltip/tooltip_test.mocks.dart @@ -44,7 +44,8 @@ class _FakeZetaColors_1 extends _i1.SmartFake implements _i2.ZetaColors { ); } -class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake implements _i2.ZetaRadiiSemantics { +class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake + implements _i2.ZetaRadiiSemantics { _FakeZetaRadiiSemantics_2( Object parent, Invocation parentInvocation, @@ -54,7 +55,8 @@ class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake implements _i2.ZetaRadiiSe ); } -class _FakeZetaSpacingSemantics_3 extends _i1.SmartFake implements _i2.ZetaSpacingSemantics { +class _FakeZetaSpacingSemantics_3 extends _i1.SmartFake + implements _i2.ZetaSpacingSemantics { _FakeZetaSpacingSemantics_3( Object parent, Invocation parentInvocation, @@ -74,10 +76,12 @@ class _FakeWidget_4 extends _i1.SmartFake implements _i3.Widget { ); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } -class _FakeInheritedElement_5 extends _i1.SmartFake implements _i3.InheritedElement { +class _FakeInheritedElement_5 extends _i1.SmartFake + implements _i3.InheritedElement { _FakeInheritedElement_5( Object parent, Invocation parentInvocation, @@ -87,10 +91,12 @@ class _FakeInheritedElement_5 extends _i1.SmartFake implements _i3.InheritedElem ); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } -class _FakeDiagnosticsNode_6 extends _i1.SmartFake implements _i4.DiagnosticsNode { +class _FakeDiagnosticsNode_6 extends _i1.SmartFake + implements _i4.DiagnosticsNode { _FakeDiagnosticsNode_6( Object parent, Invocation parentInvocation, @@ -205,7 +211,8 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as _i3.Widget); @override - bool updateShouldNotify(_i3.InheritedWidget? oldWidget) => (super.noSuchMethod( + bool updateShouldNotify(_i3.InheritedWidget? oldWidget) => + (super.noSuchMethod( Invocation.method( #updateShouldNotify, [oldWidget], @@ -215,7 +222,8 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as bool); @override - void debugFillProperties(_i4.DiagnosticPropertiesBuilder? properties) => super.noSuchMethod( + void debugFillProperties(_i4.DiagnosticPropertiesBuilder? properties) => + super.noSuchMethod( Invocation.method( #debugFillProperties, [properties], @@ -310,6 +318,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { String? prefixLineOne = r'', String? prefixOtherLines, _i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.debug, + int? wrapWidth = 65, }) => (super.noSuchMethod( Invocation.method( @@ -319,6 +328,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), returnValue: _i6.dummyValue( @@ -330,6 +340,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -342,6 +353,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -396,5 +408,6 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as List<_i4.DiagnosticsNode>); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } diff --git a/test/src/theme/color_swatch_test.dart b/test/src/theme/color_swatch_test.dart index 11eadba5..a7c21611 100644 --- a/test/src/theme/color_swatch_test.dart +++ b/test/src/theme/color_swatch_test.dart @@ -8,7 +8,7 @@ void main() { setUp(() { zetaColorSwatch = ZetaColorSwatch( - primary: Colors.blue.value, + primary: Colors.blue.intValue, swatch: { 10: Colors.blue.shade100, 20: Colors.blue.shade200, @@ -44,7 +44,7 @@ void main() { Colors.blue, ); - expect(swatch.value, Colors.blue.value); + expect(swatch.intValue, Colors.blue.intValue); expect(swatch.brightness, Brightness.light); expect(swatch.contrast, ZetaContrast.aa); }); @@ -71,7 +71,7 @@ void main() { test('equality operator works as expected', () { final identicalSwatch = ZetaColorSwatch( - primary: Colors.blue.value, + primary: Colors.blue.intValue, swatch: { 10: Colors.blue.shade100, 20: Colors.blue.shade200, @@ -92,7 +92,7 @@ void main() { test('hashCode method works as expected', () { final identicalSwatch = ZetaColorSwatch( - primary: Colors.blue.value, + primary: Colors.blue.intValue, swatch: { 10: Colors.blue.shade100, 20: Colors.blue.shade200, @@ -124,18 +124,18 @@ void main() { }); test('token getters works as expected', () { - expect(zetaColorSwatch.text.value, Colors.blue.value); - expect(zetaColorSwatch.icon.value, Colors.blue.value); - expect(zetaColorSwatch.hover.value, Colors.blue.shade700.value); - expect(zetaColorSwatch.selected.value, Colors.blue.shade800.value); - expect(zetaColorSwatch.focus.value, Colors.blue.shade800.value); - expect(zetaColorSwatch.border.value, Colors.blue.value); - expect(zetaColorSwatch.subtle.value, Colors.blue.shade400.value); - expect(zetaColorSwatch.surface.value, Colors.blue.shade100.value); + expect(zetaColorSwatch.text, isSameColorAs(Colors.blue)); + expect(zetaColorSwatch.icon, isSameColorAs(Colors.blue)); + expect(zetaColorSwatch.hover, isSameColorAs(Colors.blue.shade700)); + expect(zetaColorSwatch.selected, isSameColorAs(Colors.blue.shade800)); + expect(zetaColorSwatch.focus, isSameColorAs(Colors.blue.shade800)); + expect(zetaColorSwatch.border, isSameColorAs(Colors.blue)); + expect(zetaColorSwatch.subtle, isSameColorAs(Colors.blue.shade400)); + expect(zetaColorSwatch.surface, isSameColorAs(Colors.blue.shade100)); final aaaSwatch = ZetaColorSwatch( contrast: ZetaContrast.aaa, - primary: Colors.blue.value, + primary: Colors.blue.intValue, swatch: { 10: Colors.blue.shade100, 20: Colors.blue.shade200, @@ -150,14 +150,14 @@ void main() { }, ); - expect(aaaSwatch.text.value, Colors.blue.shade800.value); - expect(aaaSwatch.icon.value, Colors.blue.shade800.value); - expect(aaaSwatch.hover.value, Colors.blue.shade900.value); - expect(aaaSwatch.selected.value, Colors.blue.shade900.value); - expect(aaaSwatch.focus.value, Colors.blue.shade900.value); - expect(aaaSwatch.border.value, Colors.blue.shade800.value); - expect(aaaSwatch.subtle.value, Colors.blue.shade500.value); - expect(aaaSwatch.surface.value, Colors.blue.shade100.value); + expect(aaaSwatch.text, isSameColorAs(Colors.blue.shade800)); + expect(aaaSwatch.icon, isSameColorAs(Colors.blue.shade800)); + expect(aaaSwatch.hover, isSameColorAs(Colors.blue.shade900)); + expect(aaaSwatch.selected, isSameColorAs(Colors.blue.shade900)); + expect(aaaSwatch.focus, isSameColorAs(Colors.blue.shade900)); + expect(aaaSwatch.border, isSameColorAs(Colors.blue.shade800)); + expect(aaaSwatch.subtle, isSameColorAs(Colors.blue.shade500)); + expect(aaaSwatch.surface, isSameColorAs(Colors.blue.shade100)); }); }); @@ -176,7 +176,7 @@ void main() { final ZetaColors aa = ZetaColors(); final ZetaColors aaa = ZetaColors(brightness: Brightness.dark, contrast: ZetaContrast.aaa); - expect(aa.primary.value, aa.primary.shade60.value); - expect(aaa.primary.value, aaa.primary.shade80.value); + expect(aa.primary, isSameColorAs(aa.primary.shade60)); + expect(aaa.primary, isSameColorAs(aaa.primary.shade80)); }); } diff --git a/test/src/utils/extensions_test.mocks.dart b/test/src/utils/extensions_test.mocks.dart index f4c8d9a7..693a2d45 100644 --- a/test/src/utils/extensions_test.mocks.dart +++ b/test/src/utils/extensions_test.mocks.dart @@ -38,10 +38,12 @@ class _FakeWidget_0 extends _i1.SmartFake implements _i2.Widget { ); @override - String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => + super.toString(); } -class _FakeInheritedWidget_1 extends _i1.SmartFake implements _i2.InheritedWidget { +class _FakeInheritedWidget_1 extends _i1.SmartFake + implements _i2.InheritedWidget { _FakeInheritedWidget_1( Object parent, Invocation parentInvocation, @@ -51,10 +53,12 @@ class _FakeInheritedWidget_1 extends _i1.SmartFake implements _i2.InheritedWidge ); @override - String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => + super.toString(); } -class _FakeDiagnosticsNode_2 extends _i1.SmartFake implements _i3.DiagnosticsNode { +class _FakeDiagnosticsNode_2 extends _i1.SmartFake + implements _i3.DiagnosticsNode { _FakeDiagnosticsNode_2( Object parent, Invocation parentInvocation, @@ -71,7 +75,8 @@ class _FakeDiagnosticsNode_2 extends _i1.SmartFake implements _i3.DiagnosticsNod super.toString(); } -class _FakeZetaColorSwatch_3 extends _i1.SmartFake implements _i4.ZetaColorSwatch { +class _FakeZetaColorSwatch_3 extends _i1.SmartFake + implements _i4.ZetaColorSwatch { _FakeZetaColorSwatch_3( Object parent, Invocation parentInvocation, @@ -101,7 +106,8 @@ class _FakeZetaColors_5 extends _i1.SmartFake implements _i6.ZetaColors { ); } -class _FakeZetaColorScheme_6 extends _i1.SmartFake implements _i7.ZetaColorScheme { +class _FakeZetaColorScheme_6 extends _i1.SmartFake + implements _i7.ZetaColorScheme { _FakeZetaColorScheme_6( Object parent, Invocation parentInvocation, @@ -111,7 +117,8 @@ class _FakeZetaColorScheme_6 extends _i1.SmartFake implements _i7.ZetaColorSchem ); @override - String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => + super.toString(); } class _FakeZetaThemeData_7 extends _i1.SmartFake implements _i6.ZetaThemeData { @@ -124,7 +131,8 @@ class _FakeZetaThemeData_7 extends _i1.SmartFake implements _i6.ZetaThemeData { ); } -class _FakeZetaRadiiSemantics_8 extends _i1.SmartFake implements _i6.ZetaRadiiSemantics { +class _FakeZetaRadiiSemantics_8 extends _i1.SmartFake + implements _i6.ZetaRadiiSemantics { _FakeZetaRadiiSemantics_8( Object parent, Invocation parentInvocation, @@ -134,7 +142,8 @@ class _FakeZetaRadiiSemantics_8 extends _i1.SmartFake implements _i6.ZetaRadiiSe ); } -class _FakeZetaSpacingSemantics_9 extends _i1.SmartFake implements _i6.ZetaSpacingSemantics { +class _FakeZetaSpacingSemantics_9 extends _i1.SmartFake + implements _i6.ZetaSpacingSemantics { _FakeZetaSpacingSemantics_9( Object parent, Invocation parentInvocation, @@ -144,7 +153,8 @@ class _FakeZetaSpacingSemantics_9 extends _i1.SmartFake implements _i6.ZetaSpaci ); } -class _FakeInheritedElement_10 extends _i1.SmartFake implements _i2.InheritedElement { +class _FakeInheritedElement_10 extends _i1.SmartFake + implements _i2.InheritedElement { _FakeInheritedElement_10( Object parent, Invocation parentInvocation, @@ -154,7 +164,8 @@ class _FakeInheritedElement_10 extends _i1.SmartFake implements _i2.InheritedEle ); @override - String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => + super.toString(); } /// A class which mocks [BuildContext]. @@ -218,7 +229,8 @@ class MockBuildContext extends _i1.Mock implements _i2.BuildContext { ) as _i2.InheritedWidget); @override - void visitAncestorElements(_i2.ConditionalElementVisitor? visitor) => super.noSuchMethod( + void visitAncestorElements(_i2.ConditionalElementVisitor? visitor) => + super.noSuchMethod( Invocation.method( #visitAncestorElements, [visitor], @@ -236,7 +248,8 @@ class MockBuildContext extends _i1.Mock implements _i2.BuildContext { ); @override - void dispatchNotification(_i8.Notification? notification) => super.noSuchMethod( + void dispatchNotification(_i8.Notification? notification) => + super.noSuchMethod( Invocation.method( #dispatchNotification, [notification], @@ -303,7 +316,9 @@ class MockBuildContext extends _i1.Mock implements _i2.BuildContext { ) as _i3.DiagnosticsNode); @override - List<_i3.DiagnosticsNode> describeMissingAncestor({required Type? expectedAncestorType}) => (super.noSuchMethod( + List<_i3.DiagnosticsNode> describeMissingAncestor( + {required Type? expectedAncestorType}) => + (super.noSuchMethod( Invocation.method( #describeMissingAncestor, [], @@ -314,7 +329,8 @@ class MockBuildContext extends _i1.Mock implements _i2.BuildContext { ) as List<_i3.DiagnosticsNode>); @override - _i3.DiagnosticsNode describeOwnershipChain(String? name) => (super.noSuchMethod( + _i3.DiagnosticsNode describeOwnershipChain(String? name) => + (super.noSuchMethod( Invocation.method( #describeOwnershipChain, [name], @@ -1436,7 +1452,8 @@ class MockZetaColors extends _i1.Mock implements _i6.ZetaColors { ) as _i6.ZetaColors); @override - _i6.ZetaColors apply({required _i9.ZetaContrast? contrast}) => (super.noSuchMethod( + _i6.ZetaColors apply({required _i9.ZetaContrast? contrast}) => + (super.noSuchMethod( Invocation.method( #apply, [], @@ -1581,7 +1598,8 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { ) as _i2.Widget); @override - bool updateShouldNotify(_i2.InheritedWidget? oldWidget) => (super.noSuchMethod( + bool updateShouldNotify(_i2.InheritedWidget? oldWidget) => + (super.noSuchMethod( Invocation.method( #updateShouldNotify, [oldWidget], @@ -1591,7 +1609,8 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { ) as bool); @override - void debugFillProperties(_i3.DiagnosticPropertiesBuilder? properties) => super.noSuchMethod( + void debugFillProperties(_i3.DiagnosticPropertiesBuilder? properties) => + super.noSuchMethod( Invocation.method( #debugFillProperties, [properties], @@ -1686,6 +1705,7 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { String? prefixLineOne = r'', String? prefixOtherLines, _i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.debug, + int? wrapWidth = 65, }) => (super.noSuchMethod( Invocation.method( @@ -1695,6 +1715,7 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), returnValue: _i10.dummyValue( @@ -1706,6 +1727,7 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -1718,6 +1740,7 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -1772,5 +1795,6 @@ class MockZeta extends _i1.Mock implements _i6.Zeta { ) as List<_i3.DiagnosticsNode>); @override - String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => + super.toString(); } diff --git a/test/src/utils/rounded_test.mocks.dart b/test/src/utils/rounded_test.mocks.dart index 1ea97859..b22e9585 100644 --- a/test/src/utils/rounded_test.mocks.dart +++ b/test/src/utils/rounded_test.mocks.dart @@ -44,7 +44,8 @@ class _FakeZetaColors_1 extends _i1.SmartFake implements _i2.ZetaColors { ); } -class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake implements _i2.ZetaRadiiSemantics { +class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake + implements _i2.ZetaRadiiSemantics { _FakeZetaRadiiSemantics_2( Object parent, Invocation parentInvocation, @@ -54,7 +55,8 @@ class _FakeZetaRadiiSemantics_2 extends _i1.SmartFake implements _i2.ZetaRadiiSe ); } -class _FakeZetaSpacingSemantics_3 extends _i1.SmartFake implements _i2.ZetaSpacingSemantics { +class _FakeZetaSpacingSemantics_3 extends _i1.SmartFake + implements _i2.ZetaSpacingSemantics { _FakeZetaSpacingSemantics_3( Object parent, Invocation parentInvocation, @@ -74,10 +76,12 @@ class _FakeWidget_4 extends _i1.SmartFake implements _i3.Widget { ); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } -class _FakeInheritedElement_5 extends _i1.SmartFake implements _i3.InheritedElement { +class _FakeInheritedElement_5 extends _i1.SmartFake + implements _i3.InheritedElement { _FakeInheritedElement_5( Object parent, Invocation parentInvocation, @@ -87,10 +91,12 @@ class _FakeInheritedElement_5 extends _i1.SmartFake implements _i3.InheritedElem ); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } -class _FakeDiagnosticsNode_6 extends _i1.SmartFake implements _i4.DiagnosticsNode { +class _FakeDiagnosticsNode_6 extends _i1.SmartFake + implements _i4.DiagnosticsNode { _FakeDiagnosticsNode_6( Object parent, Invocation parentInvocation, @@ -205,7 +211,8 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as _i3.Widget); @override - bool updateShouldNotify(_i3.InheritedWidget? oldWidget) => (super.noSuchMethod( + bool updateShouldNotify(_i3.InheritedWidget? oldWidget) => + (super.noSuchMethod( Invocation.method( #updateShouldNotify, [oldWidget], @@ -215,7 +222,8 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as bool); @override - void debugFillProperties(_i4.DiagnosticPropertiesBuilder? properties) => super.noSuchMethod( + void debugFillProperties(_i4.DiagnosticPropertiesBuilder? properties) => + super.noSuchMethod( Invocation.method( #debugFillProperties, [properties], @@ -310,6 +318,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { String? prefixLineOne = r'', String? prefixOtherLines, _i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.debug, + int? wrapWidth = 65, }) => (super.noSuchMethod( Invocation.method( @@ -319,6 +328,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), returnValue: _i6.dummyValue( @@ -330,6 +340,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -342,6 +353,7 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { #prefixLineOne: prefixLineOne, #prefixOtherLines: prefixOtherLines, #minLevel: minLevel, + #wrapWidth: wrapWidth, }, ), ), @@ -396,5 +408,6 @@ class MockZeta extends _i1.Mock implements _i2.Zeta { ) as List<_i4.DiagnosticsNode>); @override - String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => super.toString(); + String toString({_i4.DiagnosticLevel? minLevel = _i4.DiagnosticLevel.info}) => + super.toString(); } diff --git a/test/src/zeta_provider_test.mocks.dart b/test/src/zeta_provider_test.mocks.dart index 04681f4b..dacd694b 100644 --- a/test/src/zeta_provider_test.mocks.dart +++ b/test/src/zeta_provider_test.mocks.dart @@ -29,15 +29,26 @@ import 'package:zeta_flutter/src/theme/theme_service.dart' as _i2; /// See the documentation for Mockito's code generation for more information. class MockZetaThemeService extends _i1.Mock implements _i2.ZetaThemeService { @override - _i3.Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)> loadTheme() => (super.noSuchMethod( - Invocation.method( - #loadTheme, - [], - ), - returnValue: _i3.Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)>.value((null, null, null)), - returnValueForMissingStub: - _i3.Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)>.value((null, null, null)), - ) as _i3.Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)>); + _i3.Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)> + loadTheme() => (super.noSuchMethod( + Invocation.method( + #loadTheme, + [], + ), + returnValue: _i3.Future< + ( + _i4.ZetaThemeData?, + _i5.ThemeMode?, + _i6.ZetaContrast? + )>.value((null, null, null)), + returnValueForMissingStub: _i3.Future< + ( + _i4.ZetaThemeData?, + _i5.ThemeMode?, + _i6.ZetaContrast? + )>.value((null, null, null)), + ) as _i3 + .Future<(_i4.ZetaThemeData?, _i5.ThemeMode?, _i6.ZetaContrast?)>); @override _i3.Future saveTheme({