Skip to content

Commit

Permalink
Merge pull request #261 from yumemi-inc/feature/issue-260-github-deta…
Browse files Browse the repository at this point in the history
…il-page

#260 GitHubリポジトリの詳細ページにdescriptionを追加
  • Loading branch information
K9i-0 committed Jun 18, 2024
2 parents 8e01141 + 38aaeb8 commit f330243
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13 deletions.
3 changes: 2 additions & 1 deletion apps/app/lib/router/navigator/home_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ final class HomeNavigatorImpl implements HomeNavigator {
void goGitHubRepositoryDetailPage(
BuildContext context,
String repositoryName,
String? description,
) {
GitHubRepositoryDetailPageRoute(repositoryName).go(context);
GitHubRepositoryDetailPageRoute(repositoryName, description).go(context);
}
}
2 changes: 2 additions & 0 deletions apps/app/lib/router/provider/router.g.dart

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

8 changes: 6 additions & 2 deletions apps/app/lib/router/routes/main/home/home_shell_branch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ class HomePageRoute extends GoRouteData {
}

class GitHubRepositoryDetailPageRoute extends GoRouteData {
const GitHubRepositoryDetailPageRoute(this.repositoryName);
const GitHubRepositoryDetailPageRoute(this.repositoryName, this.description);

final String repositoryName;
final String? description;

static const path = 'github_repository_detail';

@override
Widget build(BuildContext context, GoRouterState state) {
return GitHubRepositoryDetailPage(repositoryName: repositoryName);
return GitHubRepositoryDetailPage(
repositoryName: repositoryName,
description: description,
);
}
}
1 change: 1 addition & 0 deletions packages/cores/navigation/lib/src/home/navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ abstract interface class HomeNavigator {
void goGitHubRepositoryDetailPage(
BuildContext context,
String repositoryName,
String? description,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ part 'github_repository.g.dart';
class GitHubRepository with _$GitHubRepository {
const factory GitHubRepository({
required String name,
required String? description,
}) = _GitHubRepository;

factory GitHubRepository.fromJson(Map<String, dynamic> json) =>
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import 'package:flutter/material.dart';
class GitHubRepositoryDetailPage extends StatelessWidget {
const GitHubRepositoryDetailPage({
required String repositoryName,
required String? description,
super.key,
}) : _repositoryName = repositoryName;
}) : _repositoryName = repositoryName,
_description = description;

final String _repositoryName;
final String? _description;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(_repositoryName)),
body: const SizedBox.shrink(),
body: Text(_description ?? 'No Description'),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GitHubRepositoryList extends HookConsumerWidget {
onTap: () => navigator.goGitHubRepositoryDetailPage(
context,
data.items[index].name,
data.items[index].description,
),
text: data.items[index].name,
);
Expand Down

0 comments on commit f330243

Please sign in to comment.