Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Mirai Circle Avatar Widget #253

Merged
merged 5 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/mirai_gallery/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extensions:
46 changes: 23 additions & 23 deletions examples/mirai_gallery/lib/app/example/example_screen.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'example_screen.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

ExampleScreen _$ExampleScreenFromJson(Map<String, dynamic> json) {
return _ExampleScreen.fromJson(json);
Expand Down Expand Up @@ -62,30 +62,30 @@ class _$ExampleScreenCopyWithImpl<$Res, $Val extends ExampleScreen>
}

/// @nodoc
abstract class _$$_ExampleScreenCopyWith<$Res>
abstract class _$$ExampleScreenImplCopyWith<$Res>
implements $ExampleScreenCopyWith<$Res> {
factory _$$_ExampleScreenCopyWith(
_$_ExampleScreen value, $Res Function(_$_ExampleScreen) then) =
__$$_ExampleScreenCopyWithImpl<$Res>;
factory _$$ExampleScreenImplCopyWith(
_$ExampleScreenImpl value, $Res Function(_$ExampleScreenImpl) then) =
__$$ExampleScreenImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String assetPath});
}

/// @nodoc
class __$$_ExampleScreenCopyWithImpl<$Res>
extends _$ExampleScreenCopyWithImpl<$Res, _$_ExampleScreen>
implements _$$_ExampleScreenCopyWith<$Res> {
__$$_ExampleScreenCopyWithImpl(
_$_ExampleScreen _value, $Res Function(_$_ExampleScreen) _then)
class __$$ExampleScreenImplCopyWithImpl<$Res>
extends _$ExampleScreenCopyWithImpl<$Res, _$ExampleScreenImpl>
implements _$$ExampleScreenImplCopyWith<$Res> {
__$$ExampleScreenImplCopyWithImpl(
_$ExampleScreenImpl _value, $Res Function(_$ExampleScreenImpl) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? assetPath = null,
}) {
return _then(_$_ExampleScreen(
return _then(_$ExampleScreenImpl(
assetPath: null == assetPath
? _value.assetPath
: assetPath // ignore: cast_nullable_to_non_nullable
Expand All @@ -96,11 +96,11 @@ class __$$_ExampleScreenCopyWithImpl<$Res>

/// @nodoc
@JsonSerializable()
class _$_ExampleScreen implements _ExampleScreen {
const _$_ExampleScreen({required this.assetPath});
class _$ExampleScreenImpl implements _ExampleScreen {
const _$ExampleScreenImpl({required this.assetPath});

factory _$_ExampleScreen.fromJson(Map<String, dynamic> json) =>
_$$_ExampleScreenFromJson(json);
factory _$ExampleScreenImpl.fromJson(Map<String, dynamic> json) =>
_$$ExampleScreenImplFromJson(json);

@override
final String assetPath;
Expand All @@ -111,10 +111,10 @@ class _$_ExampleScreen implements _ExampleScreen {
}

@override
bool operator ==(dynamic other) {
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$_ExampleScreen &&
other is _$ExampleScreenImpl &&
(identical(other.assetPath, assetPath) ||
other.assetPath == assetPath));
}
Expand All @@ -126,28 +126,28 @@ class _$_ExampleScreen implements _ExampleScreen {
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$_ExampleScreenCopyWith<_$_ExampleScreen> get copyWith =>
__$$_ExampleScreenCopyWithImpl<_$_ExampleScreen>(this, _$identity);
_$$ExampleScreenImplCopyWith<_$ExampleScreenImpl> get copyWith =>
__$$ExampleScreenImplCopyWithImpl<_$ExampleScreenImpl>(this, _$identity);

@override
Map<String, dynamic> toJson() {
return _$$_ExampleScreenToJson(
return _$$ExampleScreenImplToJson(
this,
);
}
}

abstract class _ExampleScreen implements ExampleScreen {
const factory _ExampleScreen({required final String assetPath}) =
_$_ExampleScreen;
_$ExampleScreenImpl;

factory _ExampleScreen.fromJson(Map<String, dynamic> json) =
_$_ExampleScreen.fromJson;
_$ExampleScreenImpl.fromJson;

@override
String get assetPath;
@override
@JsonKey(ignore: true)
_$$_ExampleScreenCopyWith<_$_ExampleScreen> get copyWith =>
_$$ExampleScreenImplCopyWith<_$ExampleScreenImpl> get copyWith =>
throw _privateConstructorUsedError;
}
6 changes: 3 additions & 3 deletions examples/mirai_gallery/lib/app/example/example_screen.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/mirai_gallery/macos/Runner/DebugProfile.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
2 changes: 2 additions & 0 deletions examples/mirai_gallery/macos/Runner/Release.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions packages/mirai/lib/src/framework/mirai.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Mirai {
const MiraiPageViewParser(),
const MiraiRefreshIndicatorParser(),
const MiraiNetworkWidgetParser(),
const MiraiCircleAvatarParser(),
];

static final _actionParsers = <MiraiActionParser>[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:freezed_annotation/freezed_annotation.dart';

export 'mirai_circle_avatar_parser.dart';

part 'mirai_circle_avatar.freezed.dart';
part 'mirai_circle_avatar.g.dart';

@freezed
class MiraiCircleAvatar with _$MiraiCircleAvatar {
const factory MiraiCircleAvatar({
Map<String, dynamic>? child,
String? backgroundColor,
String? backgroundImage,
String? foregroundImage,
Map<String, dynamic>? onBackgroundImageError,
Map<String, dynamic>? onForegroundImageError,
String? foregroundColor,
double? radius,
double? minRadius,
double? maxRadius,
}) = _MiraiCircleAvatar;

factory MiraiCircleAvatar.fromJson(Map<String, dynamic> json) =>
_$MiraiCircleAvatarFromJson(json);
}
Loading
Loading