-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial library render (authors page)
- Loading branch information
Showing
14 changed files
with
292 additions
and
77 deletions.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export 'view/view.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,14 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class FullscreenErrorMessage extends StatelessWidget { | ||
const FullscreenErrorMessage({required this.text, super.key}); | ||
|
||
final String text; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Text(text), | ||
); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
lib/features/common/view/fullscreen_progress_indicator.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,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class FullscreenProgressIndicator extends StatelessWidget { | ||
const FullscreenProgressIndicator({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center( | ||
child: CircularProgressIndicator(), | ||
); | ||
} | ||
} |
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,2 @@ | ||
export 'fullscreen_error_message.dart'; | ||
export 'fullscreen_progress_indicator.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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,14 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AuthorListTile extends StatelessWidget { | ||
const AuthorListTile({required this.author, super.key}); | ||
|
||
final String author; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: Text(author), | ||
); | ||
} | ||
} |
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,37 @@ | ||
import 'dart:collection'; | ||
|
||
import 'package:bsr/features/library/library.dart'; | ||
import 'package:bsr/features/library/view/view.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AuthorTomesSliver extends StatelessWidget { | ||
const AuthorTomesSliver({ | ||
required this.author, | ||
required this.tomes, | ||
super.key, | ||
}); | ||
|
||
final String author; | ||
final LinkedHashMap<String, CachedTome> tomes; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SliverList.list( | ||
children: [ | ||
SliverToBoxAdapter( | ||
child: AuthorListTile( | ||
author: author, | ||
), | ||
), | ||
SliverList.builder( | ||
itemBuilder: (context, index) => SliverToBoxAdapter( | ||
child: TomeListTile( | ||
tome: tomes.values.elementAt(index), | ||
), | ||
), | ||
itemCount: tomes.length, | ||
), | ||
], | ||
); | ||
} | ||
} |
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,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class FullscreenEmptyLibrary extends StatelessWidget { | ||
const FullscreenEmptyLibrary({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center( | ||
child: Text('Library is empty'), | ||
); | ||
} | ||
} |
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,11 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
|
||
class TomeCard extends StatelessWidget { | ||
const TomeCard({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} |
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,22 @@ | ||
import 'package:bsr/features/library/library.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class TomeListTile extends StatelessWidget { | ||
const TomeListTile({required this.tome, super.key}); | ||
|
||
final CachedTome tome; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final tomeInfo = tome.tomeInfo; | ||
|
||
return Card( | ||
child: ListTile( | ||
leading: const Icon(Icons.book), | ||
title: Text(tomeInfo.title ?? ''), | ||
subtitle: Text(tomeInfo.author ?? ''), | ||
trailing: const Icon(Icons.more_vert), | ||
), | ||
); | ||
} | ||
} |
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,5 @@ | ||
export 'author_list_tile.dart'; | ||
export 'author_tomes_sliver.dart'; | ||
export 'fullscreen_empty_library.dart'; | ||
export 'tome_card.dart'; | ||
export 'tome_list_tile.dart'; |
Oops, something went wrong.