Models for CardData and HomeData

This commit is contained in:
nikbel2004@outlook.com 2024-11-28 22:23:01 +04:00
parent ae25411672
commit 217c914e42
4 changed files with 23 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class MyApp extends StatelessWidget {
colorScheme: ColorScheme.fromSeed(seedColor: Colors.orangeAccent),
useMaterial3: true,
),
home: const MyHomePage(title: 'My Flutter Demo'),
home: const MyHomePage(title: 'CourseWork: CandyStore'),
);
}
}

10
lib/models/card_data.dart Normal file
View File

@ -0,0 +1,10 @@
class CardData {
final String flavorName;
final String imageUrl;
final String description;
final String groupName;
final int? beanId;
const CardData(
{ required this.flavorName, required this.imageUrl, required this.description, required this.groupName, required this.beanId });
}

12
lib/models/home_data.dart Normal file
View File

@ -0,0 +1,12 @@
import 'package:candystore/models/card_data.dart';
class HomeData {
final List<CardData>? data;
final int? nextPage;
final int? currentPage;
final int? totalPages;
HomeData({this.data, this.nextPage, this.currentPage, this.totalPages});
}