From 581995aba22323f09c2d8f42419ef622439c4c29 Mon Sep 17 00:00:00 2001 From: Axel Amigo Date: Thu, 18 Jan 2024 10:31:43 +0100 Subject: [PATCH] chore: applied dart fix suggestions --- best_flutter_ui_templates/lib/app_theme.dart | 14 +-- .../design_course_app_theme.dart | 14 +-- .../bottom_bar_view.dart | 2 - .../lib/fitness_app/fitness_app_theme.dart | 14 +-- .../fitness_app/my_diary/meals_list_view.dart | 1 - .../lib/fitness_app/ui_view/title_view.dart | 4 +- .../hotel_booking/calendar_popup_view.dart | 2 +- .../lib/hotel_booking/filters_screen.dart | 4 +- .../lib/hotel_booking/hotel_app_theme.dart | 31 +++--- .../lib/hotel_booking/hotel_home_screen.dart | 14 +-- .../lib/hotel_booking/hotel_list_view.dart | 2 +- best_flutter_ui_templates/pubspec.lock | 104 +++++++++++------- 12 files changed, 115 insertions(+), 91 deletions(-) diff --git a/best_flutter_ui_templates/lib/app_theme.dart b/best_flutter_ui_templates/lib/app_theme.dart index 0946edc3..22423113 100644 --- a/best_flutter_ui_templates/lib/app_theme.dart +++ b/best_flutter_ui_templates/lib/app_theme.dart @@ -20,13 +20,13 @@ class AppTheme { static const String fontName = 'WorkSans'; static const TextTheme textTheme = TextTheme( - headline4: display1, - headline5: headline, - headline6: title, - subtitle2: subtitle, - bodyText2: body2, - bodyText1: body1, - caption: caption, + headlineMedium: display1, + headlineSmall: headline, + titleLarge: title, + titleSmall: subtitle, + bodyMedium: body2, + bodyLarge: body1, + bodySmall: caption, ); static const TextStyle display1 = TextStyle( // h4 -> display1 diff --git a/best_flutter_ui_templates/lib/design_course/design_course_app_theme.dart b/best_flutter_ui_templates/lib/design_course/design_course_app_theme.dart index 3604e505..db57ae17 100644 --- a/best_flutter_ui_templates/lib/design_course/design_course_app_theme.dart +++ b/best_flutter_ui_templates/lib/design_course/design_course_app_theme.dart @@ -19,13 +19,13 @@ class DesignCourseAppTheme { static const Color spacer = Color(0xFFF2F2F2); static const TextTheme textTheme = TextTheme( - headline4: display1, - headline5: headline, - headline6: title, - subtitle2: subtitle, - bodyText1: body2, - bodyText2: body1, - caption: caption, + headlineMedium: display1, + headlineSmall: headline, + titleLarge: title, + titleSmall: subtitle, + bodyLarge: body2, + bodyMedium: body1, + bodySmall: caption, ); static const TextStyle display1 = TextStyle( diff --git a/best_flutter_ui_templates/lib/fitness_app/bottom_navigation_view/bottom_bar_view.dart b/best_flutter_ui_templates/lib/fitness_app/bottom_navigation_view/bottom_bar_view.dart index e3d0c5ab..abd17b6b 100644 --- a/best_flutter_ui_templates/lib/fitness_app/bottom_navigation_view/bottom_bar_view.dart +++ b/best_flutter_ui_templates/lib/fitness_app/bottom_navigation_view/bottom_bar_view.dart @@ -4,8 +4,6 @@ import 'package:best_flutter_ui_templates/fitness_app/models/tabIcon_data.dart'; import 'package:best_flutter_ui_templates/main.dart'; import 'package:flutter/material.dart'; -import '../../main.dart'; -import '../models/tabIcon_data.dart'; class BottomBarView extends StatefulWidget { const BottomBarView( diff --git a/best_flutter_ui_templates/lib/fitness_app/fitness_app_theme.dart b/best_flutter_ui_templates/lib/fitness_app/fitness_app_theme.dart index 2c9a99d3..2114c4af 100644 --- a/best_flutter_ui_templates/lib/fitness_app/fitness_app_theme.dart +++ b/best_flutter_ui_templates/lib/fitness_app/fitness_app_theme.dart @@ -21,13 +21,13 @@ class FitnessAppTheme { static const String fontName = 'Roboto'; static const TextTheme textTheme = TextTheme( - headline4: display1, - headline5: headline, - headline6: title, - subtitle2: subtitle, - bodyText2: body2, - bodyText1: body1, - caption: caption, + headlineMedium: display1, + headlineSmall: headline, + titleLarge: title, + titleSmall: subtitle, + bodyMedium: body2, + bodyLarge: body1, + bodySmall: caption, ); static const TextStyle display1 = TextStyle( diff --git a/best_flutter_ui_templates/lib/fitness_app/my_diary/meals_list_view.dart b/best_flutter_ui_templates/lib/fitness_app/my_diary/meals_list_view.dart index 4d574fdf..c2528826 100644 --- a/best_flutter_ui_templates/lib/fitness_app/my_diary/meals_list_view.dart +++ b/best_flutter_ui_templates/lib/fitness_app/my_diary/meals_list_view.dart @@ -3,7 +3,6 @@ import 'package:best_flutter_ui_templates/fitness_app/models/meals_list_data.dar import 'package:best_flutter_ui_templates/main.dart'; import 'package:flutter/material.dart'; -import '../../main.dart'; class MealsListView extends StatefulWidget { const MealsListView( diff --git a/best_flutter_ui_templates/lib/fitness_app/ui_view/title_view.dart b/best_flutter_ui_templates/lib/fitness_app/ui_view/title_view.dart index c59a2895..41514557 100644 --- a/best_flutter_ui_templates/lib/fitness_app/ui_view/title_view.dart +++ b/best_flutter_ui_templates/lib/fitness_app/ui_view/title_view.dart @@ -9,8 +9,8 @@ class TitleView extends StatelessWidget { const TitleView( {Key? key, - this.titleTxt: "", - this.subTxt: "", + this.titleTxt = "", + this.subTxt = "", this.animationController, this.animation}) : super(key: key); diff --git a/best_flutter_ui_templates/lib/hotel_booking/calendar_popup_view.dart b/best_flutter_ui_templates/lib/hotel_booking/calendar_popup_view.dart index b93bbbda..58c39c54 100644 --- a/best_flutter_ui_templates/lib/hotel_booking/calendar_popup_view.dart +++ b/best_flutter_ui_templates/lib/hotel_booking/calendar_popup_view.dart @@ -80,7 +80,7 @@ class _CalendarPopupViewState extends State padding: const EdgeInsets.all(24.0), child: Container( decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, borderRadius: const BorderRadius.all(Radius.circular(24.0)), boxShadow: [ diff --git a/best_flutter_ui_templates/lib/hotel_booking/filters_screen.dart b/best_flutter_ui_templates/lib/hotel_booking/filters_screen.dart index f1a33ade..eb1259fa 100644 --- a/best_flutter_ui_templates/lib/hotel_booking/filters_screen.dart +++ b/best_flutter_ui_templates/lib/hotel_booking/filters_screen.dart @@ -22,7 +22,7 @@ class _FiltersScreenState extends State { @override Widget build(BuildContext context) { return Container( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, child: Scaffold( backgroundColor: Colors.transparent, body: Column( @@ -366,7 +366,7 @@ class _FiltersScreenState extends State { Widget getAppBarUI() { return Container( decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), diff --git a/best_flutter_ui_templates/lib/hotel_booking/hotel_app_theme.dart b/best_flutter_ui_templates/lib/hotel_booking/hotel_app_theme.dart index bf93f5b6..455f32ac 100644 --- a/best_flutter_ui_templates/lib/hotel_booking/hotel_app_theme.dart +++ b/best_flutter_ui_templates/lib/hotel_booking/hotel_app_theme.dart @@ -5,19 +5,19 @@ class HotelAppTheme { static TextTheme _buildTextTheme(TextTheme base) { const String fontName = 'WorkSans'; return base.copyWith( - headline1: base.headline1?.copyWith(fontFamily: fontName), - headline2: base.headline2?.copyWith(fontFamily: fontName), - headline3: base.headline3?.copyWith(fontFamily: fontName), - headline4: base.headline4?.copyWith(fontFamily: fontName), - headline5: base.headline5?.copyWith(fontFamily: fontName), - headline6: base.headline6?.copyWith(fontFamily: fontName), - button: base.button?.copyWith(fontFamily: fontName), - caption: base.caption?.copyWith(fontFamily: fontName), - bodyText1: base.bodyText1?.copyWith(fontFamily: fontName), - bodyText2: base.bodyText2?.copyWith(fontFamily: fontName), - subtitle1: base.subtitle1?.copyWith(fontFamily: fontName), - subtitle2: base.subtitle2?.copyWith(fontFamily: fontName), - overline: base.overline?.copyWith(fontFamily: fontName), + displayLarge: base.displayLarge?.copyWith(fontFamily: fontName), + displayMedium: base.displayMedium?.copyWith(fontFamily: fontName), + displaySmall: base.displaySmall?.copyWith(fontFamily: fontName), + headlineMedium: base.headlineMedium?.copyWith(fontFamily: fontName), + headlineSmall: base.headlineSmall?.copyWith(fontFamily: fontName), + titleLarge: base.titleLarge?.copyWith(fontFamily: fontName), + labelLarge: base.labelLarge?.copyWith(fontFamily: fontName), + bodySmall: base.bodySmall?.copyWith(fontFamily: fontName), + bodyLarge: base.bodyLarge?.copyWith(fontFamily: fontName), + bodyMedium: base.bodyMedium?.copyWith(fontFamily: fontName), + titleMedium: base.titleMedium?.copyWith(fontFamily: fontName), + titleSmall: base.titleSmall?.copyWith(fontFamily: fontName), + labelSmall: base.labelSmall?.copyWith(fontFamily: fontName), ); } @@ -30,22 +30,19 @@ class HotelAppTheme { ); final ThemeData base = ThemeData.light(); return base.copyWith( - colorScheme: colorScheme, primaryColor: primaryColor, indicatorColor: Colors.white, splashColor: Colors.white24, splashFactory: InkRipple.splashFactory, canvasColor: Colors.white, - backgroundColor: const Color(0xFFFFFFFF), scaffoldBackgroundColor: const Color(0xFFF6F6F6), - errorColor: const Color(0xFFB00020), buttonTheme: ButtonThemeData( colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, ), textTheme: _buildTextTheme(base.textTheme), primaryTextTheme: _buildTextTheme(base.primaryTextTheme), - platform: TargetPlatform.iOS, + platform: TargetPlatform.iOS, colorScheme: colorScheme.copyWith(background: const Color(0xFFFFFFFF)).copyWith(error: const Color(0xFFB00020)), ); } } diff --git a/best_flutter_ui_templates/lib/hotel_booking/hotel_home_screen.dart b/best_flutter_ui_templates/lib/hotel_booking/hotel_home_screen.dart index b5ffdeab..a5559feb 100644 --- a/best_flutter_ui_templates/lib/hotel_booking/hotel_home_screen.dart +++ b/best_flutter_ui_templates/lib/hotel_booking/hotel_home_screen.dart @@ -86,7 +86,7 @@ class _HotelHomeScreenState extends State }, body: Container( color: - HotelAppTheme.buildLightTheme().backgroundColor, + HotelAppTheme.buildLightTheme().colorScheme.background, child: ListView.builder( itemCount: hotelList.length, padding: const EdgeInsets.only(top: 8), @@ -126,7 +126,7 @@ class _HotelHomeScreenState extends State Widget getListUI() { return Container( decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), @@ -329,7 +329,7 @@ class _HotelHomeScreenState extends State padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8), child: Container( decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, borderRadius: const BorderRadius.all( Radius.circular(38.0), ), @@ -384,7 +384,7 @@ class _HotelHomeScreenState extends State padding: const EdgeInsets.all(16.0), child: Icon(FontAwesomeIcons.magnifyingGlass, size: 20, - color: HotelAppTheme.buildLightTheme().backgroundColor), + color: HotelAppTheme.buildLightTheme().colorScheme.background), ), ), ), @@ -404,7 +404,7 @@ class _HotelHomeScreenState extends State child: Container( height: 24, decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), @@ -415,7 +415,7 @@ class _HotelHomeScreenState extends State ), ), Container( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, child: Padding( padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 4), @@ -513,7 +513,7 @@ class _HotelHomeScreenState extends State Widget getAppBarUI() { return Container( decoration: BoxDecoration( - color: HotelAppTheme.buildLightTheme().backgroundColor, + color: HotelAppTheme.buildLightTheme().colorScheme.background, boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), diff --git a/best_flutter_ui_templates/lib/hotel_booking/hotel_list_view.dart b/best_flutter_ui_templates/lib/hotel_booking/hotel_list_view.dart index 47f5bc2c..5fb65bfa 100644 --- a/best_flutter_ui_templates/lib/hotel_booking/hotel_list_view.dart +++ b/best_flutter_ui_templates/lib/hotel_booking/hotel_list_view.dart @@ -61,7 +61,7 @@ class HotelListView extends StatelessWidget { ), Container( color: HotelAppTheme.buildLightTheme() - .backgroundColor, + .colorScheme.background, child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/best_flutter_ui_templates/pubspec.lock b/best_flutter_ui_templates/pubspec.lock index 3e00a3e3..7d8b38fd 100644 --- a/best_flutter_ui_templates/pubspec.lock +++ b/best_flutter_ui_templates/pubspec.lock @@ -5,56 +5,64 @@ packages: dependency: "direct main" description: name: animations - url: "https://pub.dartlang.org" + sha256: "1a5baa987a926607a363522869781637b591735195573ab04006b3f825eef224" + url: "https://pub.dev" source: hosted version: "2.0.3" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" 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.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.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" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: caac504f942f41dfadcf45229ce8c47065b93919a12739f20d6173a883c5ec73 + url: "https://pub.dev" source: hosted version: "1.0.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" flutter: @@ -66,7 +74,8 @@ packages: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" source: hosted version: "4.0.1" flutter_test: @@ -78,44 +87,50 @@ packages: dependency: "direct main" description: name: font_awesome_flutter - url: "https://pub.dartlang.org" + sha256: "7811c8b4e7455d2f60ef30022a6a07376de2858b47aecbe2861965b348fe2016" + url: "https://pub.dev" source: hosted version: "10.1.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted version: "0.17.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.10.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -125,51 +140,66 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + 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.1" + 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.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.1" 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" + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" sdks: - dart: ">=2.17.5 <3.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.0.0"