From 70b234daa1dda48c9aae413d3e5da5c62237a1d0 Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Fri, 22 Sep 2023 11:53:47 +0900 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=97=E3=83=A9=E3=83=B3=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E3=83=BC=E3=81=AE=E5=90=8D=E7=A7=B0=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onsor_rank_header.dart => sponsor_plan_header.dart} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename lib/features/sponsor/ui/{sponsor_rank_header.dart => sponsor_plan_header.dart} (88%) diff --git a/lib/features/sponsor/ui/sponsor_rank_header.dart b/lib/features/sponsor/ui/sponsor_plan_header.dart similarity index 88% rename from lib/features/sponsor/ui/sponsor_rank_header.dart rename to lib/features/sponsor/ui/sponsor_plan_header.dart index 40c4421d..a6721d28 100644 --- a/lib/features/sponsor/ui/sponsor_rank_header.dart +++ b/lib/features/sponsor/ui/sponsor_plan_header.dart @@ -2,8 +2,8 @@ import 'package:confwebsite2023/core/components/section_header.dart'; import 'package:confwebsite2023/core/theme.dart'; import 'package:flutter/material.dart'; -final class SponsorRankHeader extends StatelessWidget { - SponsorRankHeader.platinum({ +final class SponsorPlanHeader extends StatelessWidget { + SponsorPlanHeader.platinum({ required String text, required TextStyle style, }) : this._( @@ -12,7 +12,7 @@ final class SponsorRankHeader extends StatelessWidget { gradient: GradientConstant.sponsor.platinum, ); - SponsorRankHeader.gold({ + SponsorPlanHeader.gold({ required String text, required TextStyle style, }) : this._( @@ -21,7 +21,7 @@ final class SponsorRankHeader extends StatelessWidget { gradient: GradientConstant.sponsor.gold, ); - SponsorRankHeader.silver({ + SponsorPlanHeader.silver({ required String text, required TextStyle style, }) : this._( @@ -30,7 +30,7 @@ final class SponsorRankHeader extends StatelessWidget { gradient: GradientConstant.sponsor.silver, ); - SponsorRankHeader._({ + SponsorPlanHeader._({ required this.text, required TextStyle style, required this.gradient, From 7bd166a0183dcca9cffd8de3d599d903ae4a4ae9 Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Fri, 22 Sep 2023 11:55:24 +0900 Subject: [PATCH 2/4] =?UTF-8?q?improve:=20=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=97=E3=83=A9=E3=83=B3=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E3=83=BC=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=E3=82=92=E3=83=97=E3=83=A9=E3=83=B3?= =?UTF-8?q?=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=84=E3=81=9F=E5=BD=A2=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sponsor/ui/sponsor_plan_header.dart | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/lib/features/sponsor/ui/sponsor_plan_header.dart b/lib/features/sponsor/ui/sponsor_plan_header.dart index a6721d28..f6f3c314 100644 --- a/lib/features/sponsor/ui/sponsor_plan_header.dart +++ b/lib/features/sponsor/ui/sponsor_plan_header.dart @@ -1,33 +1,22 @@ import 'package:confwebsite2023/core/components/section_header.dart'; import 'package:confwebsite2023/core/theme.dart'; +import 'package:confwebsite2023/features/sponsor/data/sponsor_rank.dart'; import 'package:flutter/material.dart'; +/// スポンサープランのヘッダー final class SponsorPlanHeader extends StatelessWidget { - SponsorPlanHeader.platinum({ + SponsorPlanHeader({ required String text, required TextStyle style, + required SponsorPlan plan, }) : this._( text: text, style: style, - gradient: GradientConstant.sponsor.platinum, - ); - - SponsorPlanHeader.gold({ - required String text, - required TextStyle style, - }) : this._( - text: text, - style: style, - gradient: GradientConstant.sponsor.gold, - ); - - SponsorPlanHeader.silver({ - required String text, - required TextStyle style, - }) : this._( - text: text, - style: style, - gradient: GradientConstant.sponsor.silver, + gradient: switch (plan) { + SponsorPlan.platinum => GradientConstant.sponsor.platinum, + SponsorPlan.gold => GradientConstant.sponsor.gold, + SponsorPlan.silver => GradientConstant.sponsor.silver, + }, ); SponsorPlanHeader._({ @@ -46,7 +35,7 @@ final class SponsorPlanHeader extends StatelessWidget { final String text; - final TextStyle style; + late final TextStyle style; final Gradient gradient; From 0ee20a053a9f2344b86d970d12d4ef67098320b0 Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Fri, 22 Sep 2023 11:56:49 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=97=E3=83=A9=E3=83=B3=E3=81=AE=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/sponsor/data/sponsor.dart | 2 +- .../sponsor/data/{sponsor_rank.dart => sponsor_plan.dart} | 0 lib/features/sponsor/ui/sponsor_plan_header.dart | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename lib/features/sponsor/data/{sponsor_rank.dart => sponsor_plan.dart} (100%) diff --git a/lib/features/sponsor/data/sponsor.dart b/lib/features/sponsor/data/sponsor.dart index 365a5d7f..8b499c6e 100644 --- a/lib/features/sponsor/data/sponsor.dart +++ b/lib/features/sponsor/data/sponsor.dart @@ -1,4 +1,4 @@ -import 'package:confwebsite2023/features/sponsor/data/sponsor_rank.dart'; +import 'package:confwebsite2023/features/sponsor/data/sponsor_plan.dart'; import 'package:confwebsite2023/features/sponsor/data/sponsor_session.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; diff --git a/lib/features/sponsor/data/sponsor_rank.dart b/lib/features/sponsor/data/sponsor_plan.dart similarity index 100% rename from lib/features/sponsor/data/sponsor_rank.dart rename to lib/features/sponsor/data/sponsor_plan.dart diff --git a/lib/features/sponsor/ui/sponsor_plan_header.dart b/lib/features/sponsor/ui/sponsor_plan_header.dart index f6f3c314..bf88c6b1 100644 --- a/lib/features/sponsor/ui/sponsor_plan_header.dart +++ b/lib/features/sponsor/ui/sponsor_plan_header.dart @@ -1,6 +1,6 @@ import 'package:confwebsite2023/core/components/section_header.dart'; import 'package:confwebsite2023/core/theme.dart'; -import 'package:confwebsite2023/features/sponsor/data/sponsor_rank.dart'; +import 'package:confwebsite2023/features/sponsor/data/sponsor_plan.dart'; import 'package:flutter/material.dart'; /// スポンサープランのヘッダー From 7a669a7a33e69c05d4202c05dd125d289489301e Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Fri, 22 Sep 2023 14:31:50 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=E4=B8=8D=E8=A6=81=E3=81=AA=20l?= =?UTF-8?q?ate=20=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/sponsor/ui/sponsor_plan_header.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/features/sponsor/ui/sponsor_plan_header.dart b/lib/features/sponsor/ui/sponsor_plan_header.dart index bf88c6b1..1680aba2 100644 --- a/lib/features/sponsor/ui/sponsor_plan_header.dart +++ b/lib/features/sponsor/ui/sponsor_plan_header.dart @@ -35,7 +35,7 @@ final class SponsorPlanHeader extends StatelessWidget { final String text; - late final TextStyle style; + final TextStyle style; final Gradient gradient;