This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
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.
add game in list create & view for game in list
- Loading branch information
1 parent
20fdf59
commit 2ce139b
Showing
12 changed files
with
187 additions
and
133 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
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,27 +1,29 @@ | ||
import 'package:floor/floor.dart'; | ||
|
||
import 'package:game_list/db/model/game.dart'; | ||
|
||
@dao | ||
abstract class GameDao { | ||
@delete | ||
Future<void> deleteGame(Game game); | ||
|
||
@delete | ||
Future<int> deleteGames(List<Game> games); | ||
|
||
@Query('SELECT * FROM Game ORDER BY name ASC') | ||
Future<List<Game>> findAllGames(); | ||
Stream<List<Game>> findAllAsStream(); | ||
|
||
@Query('SELECT * FROM Game WHERE name LIKE :name ORDER BY name ASC') | ||
Future<List<Game>> findGamesByName(String name); | ||
Stream<List<Game>> findAllAsStreamByName(String name); | ||
|
||
@Query('SELECT * FROM Game ORDER BY name ASC') | ||
Future<List<Game>> findAllGames(); | ||
|
||
@Query('SELECT * FROM Game WHERE id = :id') | ||
Stream<Game> findGameById(int id); | ||
Future<Game> findById(int id); | ||
|
||
@insert | ||
Future<void> insertGame(Game game); | ||
Future<void> insertObject(Game game); | ||
|
||
@Update(onConflict: OnConflictStrategy.replace) | ||
Future<void> updateGame(Game game); | ||
|
||
@delete | ||
Future<void> deleteGame(Game game); | ||
|
||
@delete | ||
Future<int> deleteGames(List<Game> games); | ||
} |
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,24 +1,23 @@ | ||
import 'package:floor/floor.dart'; | ||
|
||
import 'package:game_list/db/model/game_in_list.dart'; | ||
|
||
@dao | ||
abstract class GameInListDao { | ||
@delete | ||
Future<int> deleteGamesInList(List<GameInList> gamesInList); | ||
|
||
@delete | ||
Future<void> deleteObject(GameInList gameInList); | ||
|
||
@Query('SELECT * FROM GameInList') | ||
Future<List<GameInList>> findAllGamesInList(); | ||
Future<List<GameInList>> findAll(); | ||
|
||
@Query('SELECT * FROM GameInList WHERE id = :id') | ||
Stream<GameInList> findGameById(int id); | ||
@Query('SELECT * FROM GameInList WHERE game_id = :id') | ||
Future<GameInList> findByGameId(int id); | ||
|
||
@insert | ||
Future<void> insertGameInList(GameInList gameInList); | ||
Future<void> insertObject(GameInList gameInList); | ||
|
||
@Update(onConflict: OnConflictStrategy.replace) | ||
Future<void> updateGameInList(GameInList gameInList); | ||
|
||
@delete | ||
Future<void> deleteGameInList(GameInList gameInList); | ||
|
||
@delete | ||
Future<int> deleteGamesInList(List<GameInList> gamesInList); | ||
} |
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
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
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
Oops, something went wrong.