Skip to content

Instantly share code, notes, and snippets.

@Bharathh-Raj
Created February 24, 2024 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bharathh-Raj/8aa4dd4fb9a01d92707945e1d6f900a7 to your computer and use it in GitHub Desktop.
Save Bharathh-Raj/8aa4dd4fb9a01d92707945e1d6f900a7 to your computer and use it in GitHub Desktop.
Insta Post Model and Mock Objects
class InstagramPost {
final String username;
final String userProfilePicUrl;
final String postId;
final String imageUrl;
final String caption;
final int likes;
final List<Comment> comments;
final DateTime timestamp;
InstagramPost({
required this.username,
required this.userProfilePicUrl,
required this.postId,
required this.imageUrl,
required this.caption,
required this.likes,
required this.comments,
required this.timestamp,
});
}
class Comment {
final String username;
final String commentText;
final String timestamp;
Comment({
required this.username,
required this.commentText,
required this.timestamp,
});
}
List<InstagramPost> homepagePosts = [
InstagramPost(
username: "user1",
userProfilePicUrl: "https://img.freepik.com/free-photo/portrait-serious-young-businessman-glasses_1262-3810.jpg?size=626&ext=jpg",
postId: "post1",
imageUrl: "https://resize.indiatvnews.com/en/resize/newbucket/1200_-/2023/06/nature-1686808887.jpg",
caption: "Beautiful sunset view! πŸŒ… #sunset #nature",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 256,
comments: [
Comment(
username: "user2",
commentText: "Wow, stunning!",
timestamp: "2024-02-22T12:00:00Z",
),
Comment(
username: "user3",
commentText: "I wish I was there!",
timestamp: "2024-02-22T12:15:00Z",
),
],
),
InstagramPost(
username: "user4",
userProfilePicUrl: "https://img.freepik.com/free-photo/fashionable-young-woman-standing-front-blue-backdrop_23-2148204718.jpg?size=626&ext=jpg",
postId: "post2",
imageUrl: "https://hips.hearstapps.com/hmg-prod/images/nature-quotes-landscape-1648265299.jpg",
caption: "Sunday brunch vibes! πŸ₯žβ˜•οΈ",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 102,
comments: [
Comment(
username: "user5",
commentText: "Yum! Where is this?",
timestamp: "2024-02-22T13:30:00Z",
),
],
),
InstagramPost(
username: "user6",
userProfilePicUrl: "https://img.freepik.com/free-photo/cheerful-indian-businessman-smiling-closeup-portrait-jobs-career-campaign_53876-129417.jpg?size=626&ext=jpg",
postId: "post3",
imageUrl: "https://webneel.com/wallpaper/sites/default/files/images/08-2018/3-nature-wallpaper-mountain.jpg",
caption: "Exploring new places 🌍 #travel",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 420,
comments: [],
),
InstagramPost(
username: "user7",
userProfilePicUrl: "https://img.freepik.com/free-photo/smiling-young-handsome-guy-wearing-black-t-shirt-glasses-isolated-white-wall_141793-82966.jpg?size=626&ext=jpg&ga=GA1.1.2002690449.1708739763&semt=ais",
postId: "post4",
imageUrl: "https://static.wixstatic.com/media/4a5235_68a4a3fd32d046b98f0b8904c64d7e3b~mv2.png/v1/fill/w_924,h_858,al_c,q_90,enc_auto/4a5235_68a4a3fd32d046b98f0b8904c64d7e3b~mv2.png",
caption: "Weekend getaway πŸ–οΈ #beach",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 312,
comments: [
Comment(
username: "user8",
commentText: "Looks like paradise!",
timestamp: "2024-02-22T14:45:00Z",
),
Comment(
username: "user9",
commentText: "Take me with you next time!",
timestamp: "2024-02-22T15:00:00Z",
),
],
),
InstagramPost(
username: "user10",
userProfilePicUrl: "https://img.freepik.com/free-photo/portrait-serious-young-businessman-glasses_1262-3810.jpg?size=626&ext=jpg",
postId: "post5",
imageUrl: "https://media.istockphoto.com/id/1457979959/photo/snack-junk-fast-food-on-table-in-restaurant-soup-sauce-ornament-grill-hamburger-french-fries.webp?b=1&s=170667a&w=0&k=20&c=A_MdmsSdkTspk9Mum_bDVB2ko0RKoyjB7ZXQUnSOHl0=",
caption: "New recipe success! 🍝 #cooking",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 180,
comments: [],
),
InstagramPost(
username: "user11",
userProfilePicUrl: "https://img.freepik.com/free-photo/fashionable-young-woman-standing-front-blue-backdrop_23-2148204718.jpg?size=626&ext=jpg",
postId: "post6",
imageUrl: "https://images.pexels.com/photos/1190298/pexels-photo-1190298.jpeg?cs=srgb&dl=pexels-wendy-wei-1190298.jpg&fm=jpg",
caption: "Saturday night vibes! πŸŽ‰ #party",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 510,
comments: [
Comment(
username: "user12",
commentText: "Wish I was there!",
timestamp: "2024-02-22T16:30:00Z",
),
],
),
InstagramPost(
username: "user13",
userProfilePicUrl: "https://img.freepik.com/free-photo/cheerful-indian-businessman-smiling-closeup-portrait-jobs-career-campaign_53876-129417.jpg?size=626&ext=jpg",
postId: "post7",
imageUrl: "https://www.streamlineart.com/media/catalog/product/cache/b1287e81dde340276dcae4c8aae7ab0b/D/2/D2702-3860_1.jpg",
caption: "Lazy Sunday afternoon πŸ’€",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 85,
comments: [],
),
InstagramPost(
username: "user14",
userProfilePicUrl: "https://img.freepik.com/free-photo/smiling-young-handsome-guy-wearing-black-t-shirt-glasses-isolated-white-wall_141793-82966.jpg?size=626&ext=jpg&ga=GA1.1.2002690449.1708739763&semt=ais",
postId: "post8",
imageUrl: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSlA-fxKL88fw1jJb-JZ2cbfslFjuhK8sJvjQ&usqp=CAU",
caption: "Sunday DIY project complete! πŸ”¨ #diy",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 72,
comments: [
Comment(
username: "user15",
commentText: "Looks great!",
timestamp: "2024-02-22T17:15:00Z",
),
],
),
InstagramPost(
username: "user16",
userProfilePicUrl: "https://img.freepik.com/free-photo/portrait-smiling-blonde-woman_23-2148316635.jpg?size=626&ext=jpg&ga=GA1.1.2002690449.1708739763&semt=ais",
postId: "post9",
imageUrl: "https://i0.wp.com/mountain-hiking.com/wp-content/uploads/2022/11/Plan-Sunrise-Hike-5272.jpg?resize=1600%2C1200&ssl=1",
caption: "Morning hike πŸŒ„ #hiking",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 198,
comments: [
Comment(
username: "user17",
commentText: "What a view!",
timestamp: "2024-02-22T18:00:00Z",
),
],
),
InstagramPost(
username: "user18",
userProfilePicUrl: "https://img.freepik.com/free-photo/portrait-smiling-blonde-woman_23-2148316635.jpg?size=626&ext=jpg&ga=GA1.1.2002690449.1708739763&semt=ais",
postId: "post10",
imageUrl: "https://img.freepik.com/premium-photo/child-reading-book-bed-kids-read-night-little-boy-with-fairy-tale-books-bedroom-education-young-children-bedtime-story-evening-cute-kid-blanket-dark-room-with-lamp_255667-20425.jpg",
caption: "Cozy night in with a book πŸ“š #reading",
timestamp: DateTime.parse("2024-02-20T12:00:00Z"),
likes: 124,
comments: [
Comment(
username: "user19",
commentText: "Perfect way to relax!",
timestamp: "2024-02-22T19:30:00Z",
),
],
),
];
final profileImages = [
'https://picsum.photos/451/601',
'https://picsum.photos/414/658',
'https://picsum.photos/448/615',
'https://picsum.photos/445/667',
'https://picsum.photos/456/600',
'https://picsum.photos/426/636',
'https://picsum.photos/429/607',
'https://picsum.photos/455/673',
'https://picsum.photos/402/623',
'https://picsum.photos/417/625',
'https://picsum.photos/453/655',
'https://picsum.photos/436/679',
'https://picsum.photos/414/661',
'https://picsum.photos/429/633',
'https://picsum.photos/419/601',
'https://picsum.photos/437/637',
'https://picsum.photos/426/669',
'https://picsum.photos/428/605',
'https://picsum.photos/423/638',
'https://picsum.photos/402/669',
'https://picsum.photos/437/664',
'https://picsum.photos/406/677',
'https://picsum.photos/439/654',
'https://picsum.photos/432/661',
'https://picsum.photos/426/641',
'https://picsum.photos/452/640',
'https://picsum.photos/423/617',
'https://picsum.photos/425/673',
'https://picsum.photos/430/639',
'https://picsum.photos/406/672',
'https://picsum.photos/411/662',
'https://picsum.photos/439/654',
'https://picsum.photos/402/627',
'https://picsum.photos/446/647',
'https://picsum.photos/432/663',
'https://picsum.photos/446/655',
'https://picsum.photos/424/635',
'https://picsum.photos/432/678',
'https://picsum.photos/459/659',
'https://picsum.photos/437/609',
'https://picsum.photos/427/677',
'https://picsum.photos/459/602',
'https://picsum.photos/425/649',
'https://picsum.photos/430/620',
'https://picsum.photos/446/664',
'https://picsum.photos/408/604',
'https://picsum.photos/458/666',
'https://picsum.photos/421/620',
'https://picsum.photos/436/679',
'https://picsum.photos/452/601',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment