Skip to content

Commit

Permalink
Event Session の実装 (#163)
Browse files Browse the repository at this point in the history
* refactor: profile画像Widgetをcomponent化

* add: conference image

* add: hands on widget

* fix: wanted component

* fix: WantedWidgetを使う形に変更

* add: image

* Auto format (#164)

Co-authored-by: YumNumm <YumNumm@users.noreply.github.com>

* fix: 生成コードの再生成
```fish
for file in (find . -name '*.g.dart' -or -name '*.freezed.dart')
    rm $file
end
fvm flutter pub run build_runner build -d
```

* fix: mobileでwantedWidgetのchildが表示されない問題を解消

* fix: Sectionの順番を変更

* add: header button

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: YumNumm <YumNumm@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 21, 2023
1 parent 7c74eeb commit 7be5d0a
Show file tree
Hide file tree
Showing 21 changed files with 371 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.14.0-0.2.pre@beta",
"flavors": {}
}
}
54 changes: 54 additions & 0 deletions assets/Illustration-Conference.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions lib/app/config.g.dart

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

39 changes: 36 additions & 3 deletions lib/app/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:confwebsite2023/core/theme.dart';
import 'package:confwebsite2023/features/access/ui/access_widget.dart';
import 'package:confwebsite2023/features/count_down/model/count_down_timer.dart';
import 'package:confwebsite2023/features/count_down/ui/count_down_section.dart';
import 'package:confwebsite2023/features/event/hands-on/ui/hands_on_event.dart';
import 'package:confwebsite2023/features/footer/ui/footer.dart';
import 'package:confwebsite2023/features/header/data/header_item_button_data.dart';
import 'package:confwebsite2023/features/header/ui/header_widget.dart';
Expand All @@ -28,6 +29,7 @@ class MainPage extends HookWidget {
const sectionKeys = (
access: GlobalObjectKey('accessSectionKey'),
event: GlobalObjectKey('eventSectionKey'),
ticket: GlobalObjectKey('ticketSectionKey'),
session: GlobalObjectKey('sessionSectionKey'),
sponsor: GlobalObjectKey('sponsorSectionKey'),
staff: GlobalObjectKey('staffSectionKey'),
Expand All @@ -42,6 +44,22 @@ class MainPage extends HookWidget {
duration: const Duration(milliseconds: 750),
),
),
HeaderItemButtonData(
title: 'Event',
onPressed: () async => Scrollable.ensureVisible(
sectionKeys.event.currentContext!,
curve: Curves.easeOutCirc,
duration: const Duration(milliseconds: 750),
),
),
HeaderItemButtonData(
title: 'Ticket',
onPressed: () async => Scrollable.ensureVisible(
sectionKeys.ticket.currentContext!,
curve: Curves.easeOutCirc,
duration: const Duration(milliseconds: 750),
),
),
HeaderItemButtonData(
title: 'Staff',
onPressed: () async => Scrollable.ensureVisible(
Expand Down Expand Up @@ -74,6 +92,7 @@ class _MainPageBody extends StatelessWidget {
final ({
GlobalObjectKey access,
GlobalObjectKey event,
GlobalObjectKey ticket,
GlobalObjectKey session,
GlobalObjectKey sponsor,
GlobalObjectKey staff
Expand Down Expand Up @@ -155,17 +174,31 @@ class _MainPageBody extends StatelessWidget {
padding: padding,
child: const NewsSection(),
),
const SliverToBoxAdapter(
child: Spaces.vertical_200,
),
_Sliver(
padding: padding,
child: const TicketSection(),
child: AccessWidget(
key: sectionKeys.access,
),
),
const SliverToBoxAdapter(
child: Spaces.vertical_200,
),
_Sliver(
padding: padding,
child: AccessWidget(
key: sectionKeys.access,
child: TicketSection(
key: sectionKeys.ticket,
),
),
const SliverToBoxAdapter(
child: Spaces.vertical_200,
),
_Sliver(
padding: padding,
child: HandsOnEvent(
key: sectionKeys.event,
),
),
const SliverToBoxAdapter(
Expand Down
54 changes: 54 additions & 0 deletions lib/core/components/left_filled_icon_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import 'package:confwebsite2023/core/theme.dart';
import 'package:flutter/material.dart';

class LeftFilledIconButton extends StatelessWidget {
const LeftFilledIconButton({
required this.onPressed,
required this.buttonTitle,
required this.icon,
super.key,
});

final void Function() onPressed;
final String buttonTitle;
final IconData icon;

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final textTheme = theme.textTheme;
final colorScheme = theme.colorScheme;
return SizedBox(
height: 40,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: colorScheme.primary,
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 8,
),
),
onPressed: onPressed,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Spaces.horizontal_8,
Text(
buttonTitle,
style: textTheme.labelLarge?.copyWith(
color: colorScheme.onPrimary,
),
),
Spaces.horizontal_8,
Icon(
icon,
size: 18,
color: colorScheme.onPrimary,
),
],
),
),
);
}
}
34 changes: 34 additions & 0 deletions lib/core/components/profile_image.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';
import 'package:transparent_image/transparent_image.dart';

class ProfileImage extends StatelessWidget {
const ProfileImage({
required this.imageUrl,
required this.size,
super.key,
});
final String imageUrl;
final double size;

@override
Widget build(BuildContext context) {
return SizedBox(
height: size,
width: size,
child: FittedBox(
child: ClipOval(
child: FadeInImage(
fit: BoxFit.cover,
image: NetworkImage(imageUrl),
placeholder: MemoryImage(kTransparentImage),
imageErrorBuilder: (_, __, ___) => const FittedBox(
child: Icon(
Icons.error,
),
),
),
),
),
);
}
}
Loading

0 comments on commit 7be5d0a

Please sign in to comment.