Skip to content

Commit

Permalink
TE trailing commas, dartfmt edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef-GMS committed Sep 19, 2021
1 parent 5840998 commit a6704e4
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 36 deletions.
2 changes: 1 addition & 1 deletion 03-basic-widgets/projects/final/lib/author_card.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'fooderlich_theme.dart';

import 'circle_image.dart';
import 'fooderlich_theme.dart';

class AuthorCard extends StatelessWidget {
// 1
Expand Down
6 changes: 5 additions & 1 deletion 03-basic-widgets/projects/final/lib/card1.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import 'fooderlich_theme.dart';

class Card1 extends StatelessWidget {
Expand Down Expand Up @@ -53,7 +54,10 @@ class Card1 extends StatelessWidget {
// 1
padding: const EdgeInsets.all(16),
// 2
constraints: const BoxConstraints.expand(width: 350, height: 450),
constraints: const BoxConstraints.expand(
width: 350,
height: 450,
),
// 3
decoration: const BoxDecoration(
// 4
Expand Down
23 changes: 16 additions & 7 deletions 03-basic-widgets/projects/final/lib/card2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@ class Card2 extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: Container(
constraints: const BoxConstraints.expand(width: 350, height: 450),
constraints: const BoxConstraints.expand(
width: 350,
height: 450,
),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/mag5.png'), fit: BoxFit.cover),
borderRadius: BorderRadius.all(Radius.circular(10.0))),
image: DecorationImage(
image: AssetImage('assets/mag5.png'),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
child: Column(
children: [
// TODO 1: add author information
const AuthorCard(
authorName: 'Mike Katz',
title: 'Smoothie Connoisseur',
imageProvider: AssetImage('assets/author_katz.jpeg')),
authorName: 'Mike Katz',
title: 'Smoothie Connoisseur',
imageProvider: AssetImage('assets/author_katz.jpeg'),
),
// TODO 4: add Positioned text
// 1
Expanded(
Expand Down
6 changes: 5 additions & 1 deletion 03-basic-widgets/projects/final/lib/card3.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import 'fooderlich_theme.dart';

class Card3 extends StatelessWidget {
Expand All @@ -7,7 +8,10 @@ class Card3 extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: Container(
constraints: const BoxConstraints.expand(width: 350, height: 450),
constraints: const BoxConstraints.expand(
width: 350,
height: 450,
),
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/mag2.png'),
Expand Down
40 changes: 26 additions & 14 deletions 03-basic-widgets/projects/final/lib/fooderlich_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,24 @@ class FooderlichTheme {
static ThemeData light() {
return ThemeData(
brightness: Brightness.light,
checkboxTheme:
CheckboxThemeData(
fillColor: MaterialStateColor.resolveWith((states) {
return Colors.black;
})),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateColor.resolveWith(
(states) {
return Colors.black;
},
),
),
appBarTheme: const AppBarTheme(
foregroundColor: Colors.black, backgroundColor: Colors.white),
foregroundColor: Colors.black,
backgroundColor: Colors.white,
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
foregroundColor: Colors.white, backgroundColor: Colors.black),
bottomNavigationBarTheme:
const BottomNavigationBarThemeData(selectedItemColor: Colors.green),
foregroundColor: Colors.white,
backgroundColor: Colors.black,
),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
selectedItemColor: Colors.green,
),
textTheme: lightTextTheme,
);
}
Expand All @@ -80,12 +87,17 @@ class FooderlichTheme {
return ThemeData(
brightness: Brightness.dark,
appBarTheme: AppBarTheme(
foregroundColor: Colors.white, backgroundColor: Colors.grey[900]),
foregroundColor: Colors.white,
backgroundColor: Colors.grey[900],
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
foregroundColor: Colors.white, backgroundColor: Colors.green),
bottomNavigationBarTheme:
const BottomNavigationBarThemeData(selectedItemColor: Colors.green),
foregroundColor: Colors.white,
backgroundColor: Colors.green,
),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
selectedItemColor: Colors.green,
),
textTheme: darkTextTheme,
);
}
}
}
8 changes: 5 additions & 3 deletions 03-basic-widgets/projects/final/lib/home.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import 'card1.dart';
import 'card2.dart';
import 'card3.dart';
Expand Down Expand Up @@ -33,9 +34,10 @@ class _HomeState extends State<Home> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Fooderlich',
// 2
style: Theme.of(context).textTheme.headline6)),
title: Text('Fooderlich',
// 2
style: Theme.of(context).textTheme.headline6),
),
body: pages[_selectedIndex],
// 4
bottomNavigationBar: BottomNavigationBar(
Expand Down
1 change: 1 addition & 0 deletions 03-basic-widgets/projects/final/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';

import 'fooderlich_theme.dart';
import 'home.dart';

Expand Down
25 changes: 16 additions & 9 deletions 03-basic-widgets/projects/starter/lib/fooderlich_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ class FooderlichTheme {
static ThemeData light() {
return ThemeData(
brightness: Brightness.light,
checkboxTheme:
CheckboxThemeData(fillColor: MaterialStateColor.resolveWith((states) {
return Colors.black;
})),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateColor.resolveWith(
(states) {
return Colors.black;
},
),
),
appBarTheme: const AppBarTheme(
foregroundColor: Colors.black,
backgroundColor: Colors.white,
Expand All @@ -73,8 +76,9 @@ class FooderlichTheme {
foregroundColor: Colors.white,
backgroundColor: Colors.black,
),
bottomNavigationBarTheme:
const BottomNavigationBarThemeData(selectedItemColor: Colors.green),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
selectedItemColor: Colors.green,
),
textTheme: lightTextTheme,
);
}
Expand All @@ -83,13 +87,16 @@ class FooderlichTheme {
return ThemeData(
brightness: Brightness.dark,
appBarTheme: AppBarTheme(
foregroundColor: Colors.white, backgroundColor: Colors.grey[900]),
foregroundColor: Colors.white,
backgroundColor: Colors.grey[900],
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
foregroundColor: Colors.white,
backgroundColor: Colors.green,
),
bottomNavigationBarTheme:
const BottomNavigationBarThemeData(selectedItemColor: Colors.green),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
selectedItemColor: Colors.green,
),
textTheme: darkTextTheme,
);
}
Expand Down

0 comments on commit a6704e4

Please sign in to comment.