-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/account page #115
Merged
Merged
Feature/account page #115
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ddc3e86
ワーカーページとホストとして登録ページを実装
narunblog 0e64cb2
カード状のウィジェットをコンポーネントに切り出し
narunblog 094861a
ホストかどうかで表示を出し分け
narunblog ea9e66f
analyzeエラーを修正
narunblog 7a32dbb
auto_routerを使ったfullScreenDialogに変更
narunblog 9a59d03
ホストページ作成
narunblog 31424fc
カードコンポーネントの文字を左寄せに修正
narunblog 004b5ee
router生成ファイル更新
narunblog a4861c3
各セクションのタイトルとコンテンツの間隔調整
narunblog b4aeb89
ワーカー情報編集ページ作成
narunblog 9dfd5ce
ホストページ掲載中のお仕事をjobsリポジトリーからuserIdで取得できるように変更
narunblog fe41641
ページ遷移時に作成するのか更新するのかをパラメタとして渡せるように修正
narunblog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export 'generic_image.dart'; | ||
export 'material_horizontal_card.dart'; | ||
export 'section.dart'; | ||
export 'selectable_chips.dart'; |
66 changes: 66 additions & 0 deletions
66
packages/dart_flutter_common/lib/src/widgets/material_horizontal_card.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,66 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../dart_flutter_common.dart'; | ||
|
||
/// タイトル、詳細、画像の3つを表示するカードウィジェット | ||
class MaterialHorizontalCard extends StatelessWidget { | ||
/// タイトル、詳細、画像の3つを表示するカードウィジェット | ||
const MaterialHorizontalCard({ | ||
required this.title, | ||
required this.description, | ||
required this.imageUrl, | ||
super.key, | ||
}); | ||
|
||
/// 表示する画像の URL 文字列。 | ||
final String imageUrl; | ||
|
||
/// カードに表示するタイトル。 | ||
final String title; | ||
|
||
/// カードに表示する詳細 | ||
final String description; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Card( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(12), | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Flexible( | ||
child: Padding( | ||
padding: const EdgeInsets.all(12), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
title, | ||
style: Theme.of(context).textTheme.titleMedium, | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
Text( | ||
description, | ||
style: Theme.of(context).textTheme.labelSmall, | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
ClipRRect( | ||
borderRadius: const BorderRadius.only( | ||
topRight: Radius.circular(12), | ||
bottomRight: Radius.circular(12), | ||
), | ||
child: GenericImage.square( | ||
imageUrl: imageUrl, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
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
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
53 changes: 53 additions & 0 deletions
53
packages/mottai_flutter_app/lib/host/ui/create_or_update_host.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,53 @@ | ||
import 'package:auto_route/auto_route.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
/// ホスト情報を作成するか更新するかのタイプ | ||
enum ActionType { | ||
/// ホスト情報を新規に作成する | ||
create, | ||
|
||
/// ホスト情報を更新する | ||
update | ||
} | ||
|
||
/// ホストページ。 | ||
@RoutePage() | ||
class CreateOrUpdateHostPage extends ConsumerWidget { | ||
const CreateOrUpdateHostPage({ | ||
@PathParam('userId') required this.userId, | ||
@PathParam('actionType') required this.actionType, | ||
super.key, | ||
}); | ||
|
||
/// [AutoRoute] で指定するパス文字列。 | ||
static const path = '/host/:userId/:actionType'; | ||
|
||
/// [CreateOrUpdateHostPage] に遷移する際に `context.router.pushNamed` で指定する文字列。 | ||
static String location({ | ||
required String userId, | ||
required String actionType, | ||
}) => | ||
'/host/$userId/$actionType'; | ||
|
||
/// パスパラメータから得られるユーザーの ID. | ||
final String userId; | ||
|
||
/// パスパラメータから得られるホスト情報を【作成】するか【更新】するかの タイプ. | ||
final String actionType; | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('ホスト情報を入力'), | ||
), | ||
body: Column( | ||
children: [ | ||
const Text('ホスト情報の作成または更新ページ'), | ||
Text('このページは【$actionType】タイプで表示されています') | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
実機で見ました、めちゃいい感じですね!!