D1APP-48 category model name changed
This commit is contained in:
parent
a0bb03f101
commit
a67e252667
|
|
@ -1,10 +1,10 @@
|
||||||
class Category {
|
class CategoryData {
|
||||||
final int id;
|
final int id;
|
||||||
final String label;
|
final String label;
|
||||||
|
|
||||||
const Category({required this.id, required this.label});
|
const CategoryData({required this.id, required this.label});
|
||||||
|
|
||||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
factory CategoryData.fromJson(Map<String, dynamic> json) => CategoryData(
|
||||||
id: json['id'],
|
id: json['id'],
|
||||||
label: json['label'],
|
label: json['label'],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class RadarDetailsData {
|
||||||
int comments;
|
int comments;
|
||||||
final List<Tag> tags;
|
final List<Tag> tags;
|
||||||
final List<Content> contents;
|
final List<Content> contents;
|
||||||
final List<Category> categories;
|
final List<CategoryData> categories;
|
||||||
final int order;
|
final int order;
|
||||||
final List<OverviewData> relatedContents = [];
|
final List<OverviewData> relatedContents = [];
|
||||||
|
|
||||||
|
|
@ -54,9 +54,9 @@ class RadarDetailsData {
|
||||||
(content) => Content.fromJson(content),
|
(content) => Content.fromJson(content),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
categories: List<Category>.from(
|
categories: List<CategoryData>.from(
|
||||||
json['categories'].map(
|
json['categories'].map(
|
||||||
(cat) => Category.fromJson(cat),
|
(cat) => CategoryData.fromJson(cat),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import 'category.dart';
|
||||||
|
|
||||||
class RadarOverviewData extends OverviewData {
|
class RadarOverviewData extends OverviewData {
|
||||||
final bool forManagers;
|
final bool forManagers;
|
||||||
final List<Category> categories;
|
final List<CategoryData> categories;
|
||||||
final int timeToRead;
|
final int timeToRead;
|
||||||
int comments;
|
int comments;
|
||||||
bool marked;
|
bool marked;
|
||||||
|
|
@ -40,9 +40,9 @@ class RadarOverviewData extends OverviewData {
|
||||||
forManagers: json['forManagers'],
|
forManagers: json['forManagers'],
|
||||||
marked: json['marked'],
|
marked: json['marked'],
|
||||||
comments: json['comments'],
|
comments: json['comments'],
|
||||||
categories: List<Category>.from(
|
categories: List<CategoryData>.from(
|
||||||
json['categories'].map(
|
json['categories'].map(
|
||||||
(category) => Category.fromJson(category),
|
(category) => CategoryData.fromJson(category),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class FloatingNavigationBar extends StatefulWidget {
|
||||||
final int comments;
|
final int comments;
|
||||||
final int id;
|
final int id;
|
||||||
final String title;
|
final String title;
|
||||||
final List<Category>? categories;
|
final List<CategoryData>? categories;
|
||||||
final void Function(bool value) onMarkChanged;
|
final void Function(bool value) onMarkChanged;
|
||||||
|
|
||||||
const FloatingNavigationBar({
|
const FloatingNavigationBar({
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class RadarOverview extends StatelessWidget {
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
DidvanText(
|
DidvanText(
|
||||||
'${DateTimeUtils.momentGenerator(radar.createdAt)} | خواندن ${radar.timeToRead} دقیقه',
|
'${DateTimeUtils.momentGenerator(radar.createdAt)} | خواندن در ${radar.timeToRead} دقیقه',
|
||||||
style: Theme.of(context).textTheme.overline,
|
style: Theme.of(context).textTheme.overline,
|
||||||
color: Theme.of(context).colorScheme.caption,
|
color: Theme.of(context).colorScheme.caption,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue