-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
509 additions
and
364 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
be0f9cbaccd7d29ffb981a4ff244b5fd |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
part of 'package:flutter_template/core/source/common/app_database.dart'; | ||
|
||
@DataClassName('Project') | ||
class ProjectTable extends Table { | ||
IntColumn get id => integer().autoIncrement()(); | ||
|
||
TextColumn get name => text()(); | ||
|
||
TextColumn get description => text()(); | ||
|
||
TextColumn get url => text()(); | ||
|
||
@JsonKey('image_url') | ||
TextColumn get imageUrl => text()(); | ||
|
||
TextColumn get language => text()(); | ||
|
||
@override | ||
Set<Column> get primaryKey => {id}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
// database.dart | ||
|
||
import 'dart:async'; | ||
|
||
import 'package:floor/floor.dart'; | ||
import 'package:flutter_template/core/model/db/repository_db_entity.dart'; | ||
import 'package:drift/drift.dart'; | ||
import 'package:flutter_template/core/source/project_local_source.dart'; | ||
import 'package:sqflite/sqflite.dart' as sqflite; | ||
|
||
part 'app_database.g.dart'; | ||
|
||
@Database(version: 1, entities: [ProjectDbEntity]) | ||
abstract class AppDatabase extends FloorDatabase { | ||
ProjectLocalSource get projectLocalSource; | ||
part 'package:flutter_template/core/model/db/project.dart'; | ||
|
||
@DriftDatabase( | ||
tables: [ | ||
ProjectTable, | ||
], | ||
daos: [ProjectLocalSource], | ||
) | ||
class AppDatabase extends _$AppDatabase { | ||
AppDatabase(QueryExecutor e) : super(e); | ||
|
||
Future<void> clearAllTables() async { | ||
await database.delete('projects'); | ||
} | ||
@override | ||
int get schemaVersion => 1; | ||
@override | ||
// TODO: implement migration | ||
MigrationStrategy get migration => super.migration; | ||
} |
Oops, something went wrong.