From 897c4861c36ac7cfe651ded7762d7ad9c84b656d Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Sat, 3 Apr 2021 19:22:18 -0400 Subject: [PATCH 1/5] Add metrics to configuration --- lib/src/layout/scaffold.dart | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/src/layout/scaffold.dart b/lib/src/layout/scaffold.dart index df5fc95f..4ba12870 100644 --- a/lib/src/layout/scaffold.dart +++ b/lib/src/layout/scaffold.dart @@ -21,27 +21,33 @@ class Scaffold extends StatelessWidget { }) : assert(splitOffset > 0.0 && splitOffset < 1.0), super(key: key); + /// Background color for the [body]. + final Color? backgroundColor; + /// Main content area. final Widget body; + /// Defines an area to which [sidebar] cannot be expanded or shrunk past on + /// the left and right. + final double resizeBoundary; + /// Secondary content area. final Widget? sidebar; - /// Background color for the [body]. - final Color? backgroundColor; - /// Background color for the [sidebar] final Color? sidebarBackgroundColor; - /// The color of the body/sidebar splitter - final Color? sidebarGripColor; - - /// Determines where the split between [body] and [sidebar] occurs. + /// Defines a breakpoint for showing and hiding the [sidebar]. /// - /// If specified, it must be a value greater than 0.0 and less than 1.0. + /// If the window is resized along its width to a value below this one, the + /// sidebar will be hidden. If resized back above this value, the sidebar + /// will be shown again. /// - /// Defaults to `0.25`, which is 1/4 of the available space from the left. - final double splitOffset; + /// Defaults to `0.0`, which means the sidebar will always be shown. + final double sidebarBreakpoint; + + /// The color of the body/sidebar splitter + final Color? sidebarGripColor; /// The width of the split between [body] and [sidebar]. /// @@ -49,18 +55,12 @@ class Scaffold extends StatelessWidget { /// (I eyeballed this so it's not perfect but it's very close). final double sidebarGripSize; - /// Defines an area to which [sidebar] cannot be expanded or shrunk past on - /// the left and right. - final double resizeBoundary; - - /// Defines a breakpoint for showing and hiding the [sidebar]. + /// Determines where the split between [body] and [sidebar] occurs. /// - /// If the window is resized along its width to a value below this one, the - /// sidebar will be hidden. If resized back above this value, the sidebar - /// will be shown again. + /// If specified, it must be a value greater than 0.0 and less than 1.0. /// - /// Defaults to `0.0`, which means the sidebar will always be shown. - final double sidebarBreakpoint; + /// Defaults to `0.25`, which is 1/4 of the available space from the left. + final double splitOffset; @override Widget build(BuildContext context) { From 9e38e1832691bd309e8619b6872ce2112c2dffbe Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Sat, 3 Apr 2021 19:22:33 -0400 Subject: [PATCH 2/5] Sort scaffold.dart public members --- analysis_options.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/analysis_options.yaml b/analysis_options.yaml index 1527c244..8751dd03 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -3,6 +3,10 @@ analyzer: - dart_code_metrics dart_code_metrics: + metrics: + cyclomatic-complexity: 20 + number-of-parameters: 4 + maximum-nesting-level: 5 metrics-exclude: - test/** - example/test/** From 135fd469a20f12f294db578477afb2b874ad0a52 Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Sat, 3 Apr 2021 19:28:34 -0400 Subject: [PATCH 3/5] Sort macos_app.dart public members --- lib/src/macos_app.dart | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/src/macos_app.dart b/lib/src/macos_app.dart index 0e900005..71265fa0 100644 --- a/lib/src/macos_app.dart +++ b/lib/src/macos_app.dart @@ -86,79 +86,79 @@ class MacosApp extends StatefulWidget { initialRoute = null, super(key: key); - final Style? style; - - final Style? darkStyle; + final Map>? actions; - final ThemeMode? themeMode; + final BackButtonDispatcher? backButtonDispatcher; - final GlobalKey? navigatorKey; + final TransitionBuilder? builder; - final RouteFactory? onGenerateRoute; + final bool checkerboardOffscreenLayers; - final InitialRouteListFactory? onGenerateInitialRoutes; + final bool checkerboardRasterCacheImages; - final PageRouteFactory? pageRouteBuilder; + final Style? darkStyle; - final RouteInformationParser? routeInformationParser; + static bool debugAllowBannerOverride = true; - final RouterDelegate? routerDelegate; + final bool debugShowCheckedModeBanner; - final BackButtonDispatcher? backButtonDispatcher; + final bool debugShowWidgetInspector; - final RouteInformationProvider? routeInformationProvider; + static bool debugShowWidgetInspectorOverride = false; final Widget? home; - final Map? routes; - - final RouteFactory? onUnknownRoute; - final String? initialRoute; - final List? navigatorObservers; + final InspectorSelectButtonBuilder? inspectorSelectButtonBuilder; - final TransitionBuilder? builder; + final Locale? locale; - final String title; + final LocaleListResolutionCallback? localeListResolutionCallback; - final GenerateAppTitle? onGenerateTitle; + final LocaleResolutionCallback? localeResolutionCallback; - final Color? primaryColor; + final Iterable>? localizationsDelegates; - final Locale? locale; + final GlobalKey? navigatorKey; - final Iterable>? localizationsDelegates; + final List? navigatorObservers; - final LocaleListResolutionCallback? localeListResolutionCallback; + final InitialRouteListFactory? onGenerateInitialRoutes; - final LocaleResolutionCallback? localeResolutionCallback; + final RouteFactory? onGenerateRoute; - final Iterable supportedLocales; + final GenerateAppTitle? onGenerateTitle; - final bool showPerformanceOverlay; + final RouteFactory? onUnknownRoute; - final bool checkerboardRasterCacheImages; + final PageRouteFactory? pageRouteBuilder; - final bool checkerboardOffscreenLayers; + final Color? primaryColor; - final bool showSemanticsDebugger; + final RouteInformationParser? routeInformationParser; - final bool debugShowWidgetInspector; + final RouteInformationProvider? routeInformationProvider; - final InspectorSelectButtonBuilder? inspectorSelectButtonBuilder; + final RouterDelegate? routerDelegate; - final bool debugShowCheckedModeBanner; + final Map? routes; final Map? shortcuts; - final Map>? actions; + final bool showPerformanceOverlay; static bool showPerformanceOverlayOverride = false; - static bool debugShowWidgetInspectorOverride = false; + final bool showSemanticsDebugger; - static bool debugAllowBannerOverride = true; + final Style? style; + + final Iterable supportedLocales; + + final ThemeMode? themeMode; + + final String title; @override _MacosAppState createState() => _MacosAppState(); From 2c806833daeb3eaa9081932d027502eb3922844a Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Sat, 3 Apr 2021 19:29:06 -0400 Subject: [PATCH 4/5] Sort theme.dart public members --- lib/src/styles/theme.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/styles/theme.dart b/lib/src/styles/theme.dart index 7f6aed46..4029595c 100644 --- a/lib/src/styles/theme.dart +++ b/lib/src/styles/theme.dart @@ -9,8 +9,8 @@ class MacosTheme extends InheritedWidget { required this.child, }) : super(key: key, child: child); - final Style style; final Widget child; + final Style style; static Style of(BuildContext context) { return context @@ -53,16 +53,16 @@ class Style with Diagnosticable { this.mediumAnimationDuration, }); - final Typography? typography; - - final Brightness? brightness; - final CupertinoDynamicColor? accentColor; final Curve? animationCurve; + final Brightness? brightness; + final Duration? mediumAnimationDuration; + final Typography? typography; + Style build() { final brightness = this.brightness ?? Brightness.light; final defaultStyle = Style( From 1ffc20b62525bf76ccdd78b4f83c9e5ba588087c Mon Sep 17 00:00:00 2001 From: Reuben Turner Date: Sat, 3 Apr 2021 19:30:22 -0400 Subject: [PATCH 5/5] Sort typography.dart public members --- lib/src/styles/typography.dart | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/src/styles/typography.dart b/lib/src/styles/typography.dart index 7fc1cd46..6ceeb70a 100644 --- a/lib/src/styles/typography.dart +++ b/lib/src/styles/typography.dart @@ -24,38 +24,38 @@ class Typography with Diagnosticable { this.caption2, }); - /// Style used for large titles. - final TextStyle? largeTitle; + /// Style used for body text. + final TextStyle? body; - /// Style used for first-level hierarchical headings. - final TextStyle? title1; + /// Style used for callouts. + final TextStyle? callout; - /// Style used for second-level hierarchical headings. - final TextStyle? title2; + /// Style used for standard captions. + final TextStyle? caption1; - /// Style used for third-level hierarchical headings. - final TextStyle? title3; + /// Style used for alternate captions. + final TextStyle? caption2; + + /// Style used in footnotes + final TextStyle? footnote; /// Style used for headings. final TextStyle? headline; + /// Style used for large titles. + final TextStyle? largeTitle; + /// Style used for subheadings. final TextStyle? subheadline; - /// Style used for body text. - final TextStyle? body; - - /// Style used for callouts. - final TextStyle? callout; - - /// Style used in footnotes - final TextStyle? footnote; + /// Style used for first-level hierarchical headings. + final TextStyle? title1; - /// Style used for standard captions. - final TextStyle? caption1; + /// Style used for second-level hierarchical headings. + final TextStyle? title2; - /// Style used for alternate captions. - final TextStyle? caption2; + /// Style used for third-level hierarchical headings. + final TextStyle? title3; /// Provides the default macOS Typography. ///