Skip to content

Commit ba88db3

Browse files
committed
Updated UI in Card View
Also made misc fixes and comments
1 parent e8c4944 commit ba88db3

9 files changed

+25
-23
lines changed

lib/pages/calendar_page.dart

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class _CalendarPageState extends State<CalendarPage> {
127127

128128
// go through and sort the daily tracks by month and year
129129
List<List<DailyTrack>> dailyTracksByMonth = [];
130+
// ignore: unused_local_variable
130131
for (DateTime month in monthsBetweenFirstDailyTrackAndNow) {
131132
dailyTracksByMonth.add([]);
132133
}

lib/pages/setup_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SetupPage extends StatefulWidget {
2121

2222
class _SetupPageState extends State<SetupPage> {
2323
final List<Widget> stepWidgets = [
24-
SpotifyLogin(inSetup: true),
24+
const SpotifyLogin(inSetup: true),
2525
const GenreSelector(inSetup: true),
2626
const ArtistSelector(),
2727
const TrackSelector()

lib/widgets/card_view_widget.dart

+11-10
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,20 @@ class _CustomCardState extends State<CustomCard> {
151151
: Styles().unselectedElevation,
152152
shadowColor: Styles().shadowColor,
153153
child: Padding(
154-
padding: const EdgeInsets.all(5.0),
154+
padding: const EdgeInsets.all(8.0),
155155
child: Column(children: [
156156
widget.item.images != null && widget.item.images.isNotEmpty
157157
? AspectRatio(
158-
aspectRatio: widget.type == Artist ? 8 / 7 : 3 / 2,
159-
child: Image.network(
160-
(widget.item.images[1] as SpotifyImage).url,
161-
width: (widget.item.images[1] as SpotifyImage)
162-
.width
163-
.toDouble(),
164-
height: (widget.item.images[1] as SpotifyImage)
165-
.height
166-
.toDouble()),
158+
aspectRatio: 1,
159+
child: Container(
160+
decoration: BoxDecoration(
161+
image: DecorationImage(
162+
fit: BoxFit.fitWidth,
163+
alignment: FractionalOffset.topCenter,
164+
image: NetworkImage(
165+
(widget.item.images[1] as SpotifyImage).url),
166+
),
167+
)),
167168
)
168169
: const SizedBox.shrink(),
169170
Text(

lib/widgets/custom_scaffold.dart

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class _CustomScaffoldState extends State<CustomScaffold> {
4545

4646
Future<void> initConnectivity() async {
4747
late ConnectivityResult result;
48-
// Platform messages may fail, so we use a try/catch PlatformException.
4948
try {
5049
result = await _connectivity.checkConnectivity();
5150
} on PlatformException catch (e) {

lib/widgets/genre_selector.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class _GenreSelectorState extends State<GenreSelector> {
173173

174174
// ignore: must_be_immutable
175175
class GenreButton extends StatefulWidget {
176-
GenreButton({super.key, required this.genre});
176+
const GenreButton({super.key, required this.genre});
177177

178178
final String genre;
179179

lib/widgets/segmented_button_for_selectors_widget.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ import 'package:daily_spotify/styles.dart';
1313
/// If [type] is String, also pass in the parameters, [simpleWrapChildren],
1414
/// [allPossibleGenres], and [getGenreButtons].
1515
class SegmentedButtonForSelectors extends StatefulWidget {
16-
SegmentedButtonForSelectors(
16+
const SegmentedButtonForSelectors(
1717
{super.key,
1818
required this.recommendations,
1919
required this.type,
2020
this.simpleWrapChildren,
2121
this.allPossibleGenres,
2222
this.getGenreButtons});
23-
List<dynamic> recommendations;
24-
Type type;
23+
final List<dynamic> recommendations;
24+
final Type type;
2525
// parameters for genres (type String)
26-
Function(List<Widget>)? simpleWrapChildren;
27-
List<String>? allPossibleGenres;
28-
Function(List<String>)? getGenreButtons;
26+
final Function(List<Widget>)? simpleWrapChildren;
27+
final List<String>? allPossibleGenres;
28+
final Function(List<String>)? getGenreButtons;
2929

3030
@override
3131
State<SegmentedButtonForSelectors> createState() =>

lib/widgets/spotify_login.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import 'package:daily_spotify/styles.dart';
77
import 'package:daily_spotify/pages/home_page.dart';
88

99
class SpotifyLogin extends StatefulWidget {
10-
SpotifyLogin({super.key, required this.inSetup, this.authCode});
10+
const SpotifyLogin({super.key, required this.inSetup, this.authCode});
1111
final bool inSetup;
12-
String? authCode;
12+
final String? authCode;
1313

1414
@override
1515
State<SpotifyLogin> createState() => _SpotifyLoginState();

lib/widgets/track_view_widget.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ extension DateOnlyCompare on DateTime {
2121
}
2222

2323
/// Returns a widget of a stylized track view.
24-
/// Requires
24+
/// Requires [header], a widget, [dailyTrack], a [DailyTrack], [track], a
25+
/// [Track], and [averageColorOfImage], a Color.
2526
class TrackView extends StatelessWidget {
2627
TrackView(
2728
{super.key,

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1818
# In Windows, build-name is used as the major, minor, and patch parts
1919
# of the product and file versions while build-number is used as the build suffix.
20-
version: 0.0.4+4
20+
version: 0.0.5+5
2121

2222
environment:
2323
sdk: '>=2.19.0 <3.0.0'

0 commit comments

Comments
 (0)