Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: applied dart fix suggestions #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions best_flutter_ui_templates/lib/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 7 additions & 7 deletions best_flutter_ui_templates/lib/fitness_app/fitness_app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _CalendarPopupViewState extends State<CalendarPopupView>
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: <BoxShadow>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class _FiltersScreenState extends State<FiltersScreen> {
@override
Widget build(BuildContext context) {
return Container(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
child: Scaffold(
backgroundColor: Colors.transparent,
body: Column(
Expand Down Expand Up @@ -366,7 +366,7 @@ class _FiltersScreenState extends State<FiltersScreen> {
Widget getAppBarUI() {
return Container(
decoration: BoxDecoration(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
Expand Down
31 changes: 14 additions & 17 deletions best_flutter_ui_templates/lib/hotel_booking/hotel_app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}

Expand All @@ -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)),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
},
body: Container(
color:
HotelAppTheme.buildLightTheme().backgroundColor,
HotelAppTheme.buildLightTheme().colorScheme.background,
child: ListView.builder(
itemCount: hotelList.length,
padding: const EdgeInsets.only(top: 8),
Expand Down Expand Up @@ -126,7 +126,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
Widget getListUI() {
return Container(
decoration: BoxDecoration(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
Expand Down Expand Up @@ -329,7 +329,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
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),
),
Expand Down Expand Up @@ -384,7 +384,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
padding: const EdgeInsets.all(16.0),
child: Icon(FontAwesomeIcons.magnifyingGlass,
size: 20,
color: HotelAppTheme.buildLightTheme().backgroundColor),
color: HotelAppTheme.buildLightTheme().colorScheme.background),
),
),
),
Expand All @@ -404,7 +404,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
child: Container(
height: 24,
decoration: BoxDecoration(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
Expand All @@ -415,7 +415,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
),
),
Container(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
child: Padding(
padding:
const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 4),
Expand Down Expand Up @@ -513,7 +513,7 @@ class _HotelHomeScreenState extends State<HotelHomeScreen>
Widget getAppBarUI() {
return Container(
decoration: BoxDecoration(
color: HotelAppTheme.buildLightTheme().backgroundColor,
color: HotelAppTheme.buildLightTheme().colorScheme.background,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.withOpacity(0.2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class HotelListView extends StatelessWidget {
),
Container(
color: HotelAppTheme.buildLightTheme()
.backgroundColor,
.colorScheme.background,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
Loading