Skip to content

Commit

Permalink
Merge pull request #1264 from bannzai/fix/format/dart-apply
Browse files Browse the repository at this point in the history
fix/format/dart apply
  • Loading branch information
bannzai authored Nov 21, 2024
2 parents 46caed0 + ab7d852 commit 4341355
Show file tree
Hide file tree
Showing 69 changed files with 1,627 additions and 3,910 deletions.
24 changes: 12 additions & 12 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,43 @@ class App extends StatelessWidget {
headerBackgroundColor: PilllColors.primary,
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return PilllColors.secondary;
}
return null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return PilllColors.secondary;
}
return null;
}),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return PilllColors.secondary;
}

return null;
}),
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return PilllColors.secondary;
}
return null;
Expand Down
8 changes: 4 additions & 4 deletions lib/components/atoms/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class PrimaryButton extends HookWidget {
alignment: Alignment.center,
children: [
ElevatedButton(
style: ButtonStyle(backgroundColor: MaterialStateProperty.resolveWith((statuses) {
if (statuses.contains(MaterialState.disabled)) {
style: ButtonStyle(backgroundColor: WidgetStateProperty.resolveWith((statuses) {
if (statuses.contains(WidgetState.disabled)) {
return PilllColors.lightGray;
}
return PilllColors.primary;
Expand Down Expand Up @@ -80,8 +80,8 @@ class UndoButton extends HookWidget {
alignment: Alignment.center,
children: [
ElevatedButton(
style: ButtonStyle(backgroundColor: MaterialStateProperty.resolveWith((statuses) {
if (statuses.contains(MaterialState.disabled)) {
style: ButtonStyle(backgroundColor: WidgetStateProperty.resolveWith((statuses) {
if (statuses.contains(WidgetState.disabled)) {
return PilllColors.lightGray;
}
return PilllColors.gray;
Expand Down
3 changes: 1 addition & 2 deletions lib/components/molecules/diagonal_striped_line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class DiagonalStripedLine extends CustomPainter {
DiagonalStripedLine({required this.color, required this.isNecessaryBorder});
@override
void paint(Canvas canvas, Size size) {
canvas.drawRect(
Rect.fromLTWH(0, 0, size.width, size.height), Paint()..color = color);
canvas.drawRect(Rect.fromLTWH(0, 0, size.width, size.height), Paint()..color = color);
if (!isNecessaryBorder) {
return;
}
Expand Down
13 changes: 2 additions & 11 deletions lib/components/molecules/select_circle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@ class SelectCircle extends StatelessWidget {
Widget build(BuildContext context) {
return Stack(
children: [
SizedBox(
width: 20,
height: 20,
child: SvgPicture.asset("images/circle.line.svg")),
if (isSelected)
Positioned(
top: 5,
left: 5,
width: 10,
height: 10,
child: SvgPicture.asset("images/circle.fill.svg")),
SizedBox(width: 20, height: 20, child: SvgPicture.asset("images/circle.line.svg")),
if (isSelected) Positioned(top: 5, left: 5, width: 10, height: 10, child: SvgPicture.asset("images/circle.fill.svg")),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class CalendarScheduledMenstruationBandModel extends CalendarBandModel {

class CalendarMenstruationBandModel extends CalendarBandModel {
final Menstruation menstruation;
CalendarMenstruationBandModel(this.menstruation)
: super(menstruation.beginDate, menstruation.endDate);
CalendarMenstruationBandModel(this.menstruation) : super(menstruation.beginDate, menstruation.endDate);
}

class CalendarNextPillSheetBandModel extends CalendarBandModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ class SettingPillSheetGroupPillSheetTypeSelectRow extends StatelessWidget {
},
child: Container(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
constraints: BoxConstraints(
minWidth: MediaQuery.of(context).size.width - 80),
constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width - 80),
decoration: BoxDecoration(
color: PilllColors.white,
borderRadius: BorderRadius.circular(4),
Expand Down
36 changes: 11 additions & 25 deletions lib/entity/config.codegen.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ mixin _$Config {

/// @nodoc
abstract class $ConfigCopyWith<$Res> {
factory $ConfigCopyWith(Config value, $Res Function(Config) then) =
_$ConfigCopyWithImpl<$Res, Config>;
factory $ConfigCopyWith(Config value, $Res Function(Config) then) = _$ConfigCopyWithImpl<$Res, Config>;
@useResult
$Res call({String minimumSupportedAppVersion});
}

/// @nodoc
class _$ConfigCopyWithImpl<$Res, $Val extends Config>
implements $ConfigCopyWith<$Res> {
class _$ConfigCopyWithImpl<$Res, $Val extends Config> implements $ConfigCopyWith<$Res> {
_$ConfigCopyWithImpl(this._value, this._then);

// ignore: unused_field
Expand All @@ -61,21 +59,15 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config>

/// @nodoc
abstract class _$$ConfigImplCopyWith<$Res> implements $ConfigCopyWith<$Res> {
factory _$$ConfigImplCopyWith(
_$ConfigImpl value, $Res Function(_$ConfigImpl) then) =
__$$ConfigImplCopyWithImpl<$Res>;
factory _$$ConfigImplCopyWith(_$ConfigImpl value, $Res Function(_$ConfigImpl) then) = __$$ConfigImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String minimumSupportedAppVersion});
}

/// @nodoc
class __$$ConfigImplCopyWithImpl<$Res>
extends _$ConfigCopyWithImpl<$Res, _$ConfigImpl>
implements _$$ConfigImplCopyWith<$Res> {
__$$ConfigImplCopyWithImpl(
_$ConfigImpl _value, $Res Function(_$ConfigImpl) _then)
: super(_value, _then);
class __$$ConfigImplCopyWithImpl<$Res> extends _$ConfigCopyWithImpl<$Res, _$ConfigImpl> implements _$$ConfigImplCopyWith<$Res> {
__$$ConfigImplCopyWithImpl(_$ConfigImpl _value, $Res Function(_$ConfigImpl) _then) : super(_value, _then);

@pragma('vm:prefer-inline')
@override
Expand All @@ -96,8 +88,7 @@ class __$$ConfigImplCopyWithImpl<$Res>
class _$ConfigImpl extends _Config {
_$ConfigImpl({required this.minimumSupportedAppVersion}) : super._();

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

@override
final String minimumSupportedAppVersion;
Expand All @@ -112,10 +103,8 @@ class _$ConfigImpl extends _Config {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ConfigImpl &&
(identical(other.minimumSupportedAppVersion,
minimumSupportedAppVersion) ||
other.minimumSupportedAppVersion ==
minimumSupportedAppVersion));
(identical(other.minimumSupportedAppVersion, minimumSupportedAppVersion) ||
other.minimumSupportedAppVersion == minimumSupportedAppVersion));
}

@JsonKey(ignore: true)
Expand All @@ -125,8 +114,7 @@ class _$ConfigImpl extends _Config {
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$ConfigImplCopyWith<_$ConfigImpl> get copyWith =>
__$$ConfigImplCopyWithImpl<_$ConfigImpl>(this, _$identity);
_$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => __$$ConfigImplCopyWithImpl<_$ConfigImpl>(this, _$identity);

@override
Map<String, dynamic> toJson() {
Expand All @@ -137,8 +125,7 @@ class _$ConfigImpl extends _Config {
}

abstract class _Config extends Config {
factory _Config({required final String minimumSupportedAppVersion}) =
_$ConfigImpl;
factory _Config({required final String minimumSupportedAppVersion}) = _$ConfigImpl;
_Config._() : super._();

factory _Config.fromJson(Map<String, dynamic> json) = _$ConfigImpl.fromJson;
Expand All @@ -147,6 +134,5 @@ abstract class _Config extends Config {
String get minimumSupportedAppVersion;
@override
@JsonKey(ignore: true)
_$$ConfigImplCopyWith<_$ConfigImpl> get copyWith =>
throw _privateConstructorUsedError;
_$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => throw _privateConstructorUsedError;
}
3 changes: 1 addition & 2 deletions lib/entity/config.codegen.g.dart

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

4 changes: 2 additions & 2 deletions lib/entity/diary.codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class Diary with _$Diary {
fromJson: NonNullTimestampConverter.timestampToDateTime,
toJson: NonNullTimestampConverter.dateTimeToTimestamp,
)
required DateTime date,
required DateTime date,
// NOTE: OLD data does't have createdAt
@JsonKey(
fromJson: TimestampConverter.timestampToDateTime,
toJson: TimestampConverter.dateTimeToTimestamp,
)
required DateTime? createdAt,
required DateTime? createdAt,
PhysicalConditionStatus? physicalConditionStatus,
required List<String> physicalConditions,
required bool hasSex,
Expand Down
Loading

0 comments on commit 4341355

Please sign in to comment.