-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
78 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
packages/mirai/lib/src/parsers/mirai_mirai_spacer/mirai_mirai_spacer.dart
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
packages/mirai/lib/src/parsers/mirai_mirai_spacer/mirai_mirai_spacer_parser.dart
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
packages/mirai/lib/src/parsers/mirai_spacer/mirai_spacer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
export 'package:mirai/src/parsers/mirai_spacer/mirai_spacer_parser.dart'; | ||
|
||
part 'mirai_spacer.freezed.dart'; | ||
part 'mirai_spacer.g.dart'; | ||
|
||
@freezed | ||
class MiraiSpacer with _$MiraiSpacer { | ||
const factory MiraiSpacer({ | ||
@Default(1) int flex, | ||
}) = _MiraiSpacer; | ||
|
||
factory MiraiSpacer.fromJson(Map<String, dynamic> json) => | ||
_$MiraiSpacerFromJson(json); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
...ai_mirai_spacer/mirai_mirai_spacer.g.dart → .../parsers/mirai_spacer/mirai_spacer.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
packages/mirai/lib/src/parsers/mirai_spacer/mirai_spacer_parser.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mirai/src/parsers/mirai_spacer/mirai_spacer.dart'; | ||
import 'package:mirai/src/utils/widget_type.dart'; | ||
import 'package:mirai_framework/mirai_framework.dart'; | ||
|
||
class MiraiSpacerParser extends MiraiParser<MiraiSpacer> { | ||
const MiraiSpacerParser(); | ||
|
||
@override | ||
MiraiSpacer getModel(Map<String, dynamic> json) => MiraiSpacer.fromJson(json); | ||
|
||
@override | ||
String get type => WidgetType.spacer.name; | ||
|
||
@override | ||
Widget parse(BuildContext context, MiraiSpacer model) { | ||
return Spacer(flex: model.flex); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters