Skip to content

Commit 3d4c69b

Browse files
feat: add a base class for all i18n classes
1 parent d36214f commit 3d4c69b

File tree

11 files changed

+522
-474
lines changed

11 files changed

+522
-474
lines changed

lib/src/models/dashboard_showcase.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import 'package:dart_mappable/dart_mappable.dart';
2+
import 'package:market_client/src/models/market_i18n.dart';
23

34
part 'dashboard_showcase.mapper.dart';
45

5-
/// Localized text for a [DashboardItem]
6-
@MappableRecord()
7-
typedef DashboardI18n = ({String title, String? description});
8-
96
/// {@template dashboard_showcase}
107
/// Items to be shown in a showcase
118
/// {@endtemplate}

lib/src/models/dashboard_showcase.mapper.dart

Lines changed: 4 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/models/item.dart

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,8 @@
11
import 'package:dart_mappable/dart_mappable.dart';
2+
import 'package:market_client/src/models/market_i18n.dart';
23

34
part 'item.mapper.dart';
45

5-
/// {@template item_i18n}
6-
/// Localized text for an item
7-
/// {@endtemplate}
8-
@MappableClass()
9-
class ItemI18n with ItemI18nMappable {
10-
/// {@macro item_i18n}
11-
const ItemI18n({
12-
required this.name,
13-
this.description,
14-
this.wikiLink,
15-
required this.icon,
16-
required this.thumb,
17-
this.subIcon,
18-
});
19-
20-
/// [ItemI18n] from json string
21-
factory ItemI18n.fromJson(String json) => ItemI18nMapper.fromJson(json);
22-
23-
/// Localized item name.
24-
final String name;
25-
26-
/// Localized item description.
27-
final String? description;
28-
29-
/// Wikia item link
30-
final String? wikiLink;
31-
32-
/// Icon for item
33-
final String icon;
34-
35-
/// Thumbnail for item
36-
final String thumb;
37-
38-
/// Sub Icon?
39-
final String? subIcon;
40-
}
41-
426
/// {@template item}
437
/// Common fields for [ItemShort] and [ItemFull]
448
/// {@endtemplate}

lib/src/models/item.mapper.dart

Lines changed: 0 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)