Skip to content
Merged
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
169 changes: 60 additions & 109 deletions boring_to_beautiful/codelab_rebuild.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion boring_to_beautiful/final/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
android {
namespace = "com.example.myartist"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
ndkVersion = "27.0.12077973"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
138 changes: 69 additions & 69 deletions boring_to_beautiful/final/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions boring_to_beautiful/final/lib/src/shared/providers/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ class ThemeProvider extends InheritedWidget {

Color blend(Color targetColor) {
return Color(
// ignore: deprecated_member_use
Blend.harmonize(targetColor.value, settings.value.sourceColor.value),
Blend.harmonize(
targetColor.toARGB32(),
settings.value.sourceColor.toARGB32(),
),
);
}

Expand Down Expand Up @@ -208,7 +210,6 @@ Color randomColor() {
return Color(Random().nextInt(0xFFFFFFFF));
}

// Custom Colors
const linkColor = CustomColor(name: 'Link Color', color: Color(0xFF00B0FF));

class CustomColor {
Expand Down
8 changes: 0 additions & 8 deletions boring_to_beautiful/final/lib/src/shared/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class NavigationDestination {

final appRouter = GoRouter(
routes: [
// HomeScreen
GoRoute(
path: '/',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand All @@ -61,8 +60,6 @@ final appRouter = GoRouter(
),
),
),

// PlaylistHomeScreen
GoRoute(
path: '/playlists',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand Down Expand Up @@ -91,8 +88,6 @@ final appRouter = GoRouter(
),
],
),

// ArtistHomeScreen
GoRoute(
path: '/artists',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand All @@ -118,9 +113,6 @@ final appRouter = GoRouter(
),
),
),
// builder: (context, state) => ArtistScreen(
// id: state.params['aid']!,
// ),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class AdaptiveNavigation extends StatelessWidget {
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, dimens) {
// Tablet Layout
if (dimens.maxWidth >= 600) {
return Scaffold(
body: Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ImageTile extends StatelessWidget {
child: Text(
subtitle,
overflow: TextOverflow.ellipsis,
style: context.labelSmall,
style: context.labelSmall!.copyWith(fontSize: 10),
maxLines: 2,
textAlign: TextAlign.center,
),
Expand Down
90 changes: 45 additions & 45 deletions boring_to_beautiful/final/macos/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions boring_to_beautiful/final/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none'
version: 0.1.0

environment:
sdk: ^3.8.0
sdk: ^3.8.1

dependencies:
flutter:
Expand All @@ -29,7 +29,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
flutter_lints: ^6.0.0
build_runner: ^2.4.15
freezed: ^3.0.6

Expand Down
2 changes: 1 addition & 1 deletion boring_to_beautiful/step_01/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
android {
namespace = "com.example.myartist"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
ndkVersion = "27.0.12077973"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
138 changes: 69 additions & 69 deletions boring_to_beautiful/step_01/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HomeHighlight extends StatelessWidget {
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.all(2), // Modify this line
padding: const EdgeInsets.all(2),
child: Clickable(
child: SizedBox(
height: 275,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ class _HomeScreenState extends State<HomeScreen> {
final List<Artist> artists = artistsProvider.artists;
return LayoutBuilder(
builder: (context, constraints) {
// Add conditional mobile layout

return Scaffold(
body: SingleChildScrollView(
child: AdaptiveColumn(
children: [
AdaptiveContainer(
columnSpan: 12,
child: Padding(
padding: const EdgeInsets.all(2), // Modify this line
padding: const EdgeInsets.all(2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down Expand Up @@ -75,7 +73,7 @@ class _HomeScreenState extends State<HomeScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(2), // Modify this line
padding: const EdgeInsets.all(2),
child: Text(
'Recently played',
style: context.headlineSmall,
Expand All @@ -88,7 +86,7 @@ class _HomeScreenState extends State<HomeScreen> {
AdaptiveContainer(
columnSpan: 12,
child: Padding(
padding: const EdgeInsets.all(2), // Modify this line
padding: const EdgeInsets.all(2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -99,9 +97,7 @@ class _HomeScreenState extends State<HomeScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(
2,
), // Modify this line
padding: const EdgeInsets.all(2),
child: Text(
'Top Songs Today',
style: context.titleLarge,
Expand All @@ -117,17 +113,14 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
),
// Add spacer between tables
Flexible(
flex: 10,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(
2,
), // Modify this line
padding: const EdgeInsets.all(2),
child: Text(
'New Releases',
style: context.titleLarge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class PlaylistSongs extends StatelessWidget {
index: index,
cells: [
DataCell(
// Add HoverableSongPlayButton
Center(
child: Text((index + 1).toString(), textAlign: TextAlign.center),
),
Expand Down
9 changes: 1 addition & 8 deletions boring_to_beautiful/step_01/lib/src/shared/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ class MyApp extends StatefulWidget {

class _MyAppState extends State<MyApp> {
final settings = ValueNotifier(
ThemeSettings(
sourceColor: Colors.pink, // Replace this color
themeMode: ThemeMode.system,
),
ThemeSettings(sourceColor: Colors.pink, themeMode: ThemeMode.system),
);
@override
Widget build(BuildContext context) {
Expand All @@ -42,13 +39,9 @@ class _MyAppState extends State<MyApp> {
child: ValueListenableBuilder<ThemeSettings>(
valueListenable: settings,
builder: (context, value, _) {
// Create theme instance
return MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
// Add theme
// Add dark theme
// Add theme mode
routeInformationParser: appRouter.routeInformationParser,
routeInformationProvider: appRouter.routeInformationProvider,
routerDelegate: appRouter.routerDelegate,
Expand Down
3 changes: 1 addition & 2 deletions boring_to_beautiful/step_01/lib/src/shared/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
// Add Google Fonts Package import

extension TypographyUtils on BuildContext {
ThemeData get theme => Theme.of(this);
TextTheme get textTheme => theme.textTheme; // Modify this line
TextTheme get textTheme => theme.textTheme;
ColorScheme get colors => theme.colorScheme;
TextStyle? get displayLarge =>
textTheme.displayLarge?.copyWith(color: colors.onSurface);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ class ThemeProvider extends InheritedWidget {

Color blend(Color targetColor) {
return Color(
// ignore: deprecated_member_use
Blend.harmonize(targetColor.value, settings.value.sourceColor.value),
Blend.harmonize(
targetColor.toARGB32(),
settings.value.sourceColor.toARGB32(),
),
);
}

Expand Down Expand Up @@ -145,7 +147,6 @@ class ThemeProvider extends InheritedWidget {
ThemeData light([Color? targetColor]) {
final colorScheme = colors(Brightness.light, targetColor);
return ThemeData.light().copyWith(
// Add page transitions
colorScheme: colorScheme,
appBarTheme: appBarTheme(colorScheme),
cardTheme: cardTheme(),
Expand All @@ -162,7 +163,6 @@ class ThemeProvider extends InheritedWidget {
ThemeData dark([Color? targetColor]) {
final colorScheme = colors(Brightness.dark, targetColor);
return ThemeData.dark().copyWith(
// Add page transitions
colorScheme: colorScheme,
appBarTheme: appBarTheme(colorScheme),
cardTheme: cardTheme(),
Expand Down Expand Up @@ -208,7 +208,6 @@ Color randomColor() {
return Color(Random().nextInt(0xFFFFFFFF));
}

// Custom Colors
const linkColor = CustomColor(name: 'Link Color', color: Color(0xFF00B0FF));

class CustomColor {
Expand Down
14 changes: 3 additions & 11 deletions boring_to_beautiful/step_01/lib/src/shared/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ final playlistsProvider = PlaylistsProvider();
const List<NavigationDestination> destinations = [
NavigationDestination(
label: 'Home',
icon: Icon(Icons.arrow_right_rounded), // Modify this line
icon: Icon(Icons.arrow_right_rounded),
route: '/',
),
NavigationDestination(
label: 'Playlists',
icon: Icon(Icons.arrow_right_rounded), // Modify this line
icon: Icon(Icons.arrow_right_rounded),
route: '/playlists',
),
NavigationDestination(
label: 'Artists',
icon: Icon(Icons.arrow_right_rounded), // Modify this line
icon: Icon(Icons.arrow_right_rounded),
route: '/artists',
),
];
Expand All @@ -53,7 +53,6 @@ class NavigationDestination {

final appRouter = GoRouter(
routes: [
// HomeScreen
GoRoute(
path: '/',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand All @@ -65,8 +64,6 @@ final appRouter = GoRouter(
),
),
),

// PlaylistHomeScreen
GoRoute(
path: '/playlists',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand Down Expand Up @@ -95,8 +92,6 @@ final appRouter = GoRouter(
),
],
),

// ArtistHomeScreen
GoRoute(
path: '/artists',
pageBuilder: (context, state) => const MaterialPage<void>(
Expand All @@ -122,9 +117,6 @@ final appRouter = GoRouter(
),
),
),
// builder: (context, state) => ArtistScreen(
// id: state.params['aid']!,
// ),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class AdaptiveNavigation extends StatelessWidget {
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, dimens) {
// Tablet Layout
// Add maxWidth constraint check
return Scaffold(
body: Row(
children: [
Expand All @@ -45,9 +43,6 @@ class AdaptiveNavigation extends StatelessWidget {
],
),
);
// Add closing curly bracket

// Add return for mobile layout
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ImageTile extends StatelessWidget {
child: Text(
subtitle,
overflow: TextOverflow.ellipsis,
style: context.labelSmall,
style: context.labelSmall!.copyWith(fontSize: 10),
maxLines: 2,
textAlign: TextAlign.center,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ class _OutlinedCardState extends State<OutlinedCard> {
cursor: widget.clickable
? SystemMouseCursors.click
: SystemMouseCursors.basic,
child: Container(
// Add box decoration here
child: widget.child,
),
child: Container(child: widget.child),
);
}
}
Loading