Skip to content

Commit

Permalink
feat: theme history UI (#4)
Browse files Browse the repository at this point in the history
* feat: gallery and app bar UI fixes
* feat: theme history ui
* feat: history integration + home ui fixes
  • Loading branch information
JothishKamal authored Feb 21, 2025
1 parent f7f19ad commit eed2e87
Show file tree
Hide file tree
Showing 14 changed files with 653 additions and 246 deletions.
Binary file added gdsc_art/images/swirl1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gdsc_art/images/swirl2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gdsc_art/images/swirl3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gdsc_art/images/swirl4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions gdsc_art/lib/Model/history_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
class HistoryModel {
final String src;
final Artist artist;
final Art art;
final String id;

HistoryModel({
required this.src,
required this.artist,
required this.art,
required this.id,
});

factory HistoryModel.fromJson(Map<String, dynamic> json) {
return HistoryModel(
src: json['src'],
artist: Artist.fromJson(json['artist']),
art: Art.fromJson(json['art']),
id: json['_id'],
);
}

Map<String, dynamic> toJson() {
return {
'src': src,
'artist': artist.toJson(),
'art': art.toJson(),
'_id': id,
};
}
}

class Artist {
final String name;
final String period;

Artist({
required this.name,
required this.period,
});

factory Artist.fromJson(Map<String, dynamic> json) {
return Artist(
name: json['name'],
period: json['period'],
);
}

Map<String, dynamic> toJson() {
return {
'name': name,
'period': period,
};
}
}

class Art {
final String year;

Art({
required this.year,
});

factory Art.fromJson(Map<String, dynamic> json) {
return Art(
year: json['year'],
);
}

Map<String, dynamic> toJson() {
return {
'year': year,
};
}
}
9 changes: 8 additions & 1 deletion gdsc_art/lib/Model/theme_model.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:gdsc_artwork/Model/history_model.dart';

class ThemeModel {
final String id;
final String title;
Expand All @@ -8,6 +10,7 @@ class ThemeModel {
final String workTitle;
final List<String> workImages;
final String workDescription;
final List<HistoryModel> history;

ThemeModel({
required this.id,
Expand All @@ -19,6 +22,7 @@ class ThemeModel {
required this.workTitle,
required this.workImages,
required this.workDescription,
required this.history,
});

factory ThemeModel.fromJson(Map<String, dynamic> json) {
Expand All @@ -32,6 +36,9 @@ class ThemeModel {
workTitle: json['work_title'],
workImages: List<String>.from(json['work_images']),
workDescription: json['work_description'],
history: (json['history'] as List)
.map((history) => HistoryModel.fromJson(history))
.toList(),
);
}
}
}
Loading

0 comments on commit eed2e87

Please sign in to comment.