Skip to content

Commit

Permalink
Merge pull request #39 from koji-1009/update
Browse files Browse the repository at this point in the history
chore: update
  • Loading branch information
koji-1009 authored Oct 5, 2024
2 parents f52d600 + 9583d11 commit de4126c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
cache: true
- run: flutter pub get
working-directory: example
- run: flutter build web --base-href "/paging_view/" --wasm
- run: flutter build web --base-href "/paging_view/" --web-renderer skwasm
working-directory: example
- uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ https://koji-1009.github.io/paging_view/
3. Set the step 2 instance obtained to `PagingList` or `PagingGrid`.

```dart
final dataSourcePublicRepositoriesProvider = Provider.autoDispose(
(ref) {
final dataSource = DataSourcePublicRepositories(
repository: ref.watch(
gitHubRepositoryProvider,
),
);
@riverpod
DataSourcePublicRepositories dataSourcePublicRepositories(
DataSourcePublicRepositoriesRef ref,
) {
final dataSource = DataSourcePublicRepositories(
repository: ref.watch(
gitHubRepositoryProvider,
),
);
ref.onDispose(() {
dataSource.dispose();
});
ref.onDispose(() {
dataSource.dispose();
});
return dataSource;
},
);
return dataSource;
}
/// 1
final class DataSourcePublicRepositories extends DataSource<int, Repository> {
Expand Down Expand Up @@ -60,7 +61,7 @@ final class DataSourcePublicRepositories extends DataSource<int, Repository> {
}
}
class HomePage extends HookConsumerWidget {
class HomePage extends ConsumerWidget {
const HomePage({super.key});
@override
Expand All @@ -70,18 +71,15 @@ class HomePage extends HookConsumerWidget {
final body = PagingList<int, Repository>(
/// 3
dataSource: dataSource,
builder: (context, repository, index) {
return Card(
child: ListTile(
title: Text(repository.fullName),
subtitle: Text(repository.description),
),
);
},
errorBuilder: (context, e) =>
Center(
child: Text('$e'),
),
builder: (context, repository, index) => Card(
child: ListTile(
title: Text(repository.fullName),
subtitle: Text(repository.description),
),
),
errorBuilder: (context, e) => Center(
child: Text('$e'),
),
initialLoadingWidget: const Center(
child: Padding(
padding: EdgeInsets.all(16),
Expand Down

0 comments on commit de4126c

Please sign in to comment.