-
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.
Merge pull request #4 from ProductLoft/suriya/showInsights
Suriya/show insights
- Loading branch information
Showing
11 changed files
with
344 additions
and
91 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,66 @@ | ||
name: Build and Release macOS App | ||
|
||
on: | ||
push: | ||
tags: # Trigger on creating a new tag (e.g., v1.0.0) | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies (if needed) | ||
run: brew install any-dependency | ||
|
||
- name: Set up Code Signing | ||
run: | | ||
# Export certificate from Keychain (replace placeholders) | ||
security export -t codesigning -i "Apple Development: Name (ID)" -P "YourPassword" -o development.p12 | ||
# Import certificate into Keychain | ||
security import development.p12 -k login.keychain -P "YourPassword" -T /usr/bin/codesign | ||
- name: Build the App | ||
run: | | ||
xcodebuild -workspace YourApp.xcworkspace \ | ||
-scheme YourAppScheme \ | ||
-configuration Release \ | ||
CODE_SIGN_STYLE=Automatic \ | ||
CODE_SIGN_IDENTITY="Apple Development: Name (ID)" \ | ||
PROVISIONING_PROFILE_SPECIFIER="Provisioning Profile Name" \ | ||
archive -archivePath build/YourApp.xcbuild | ||
# Build for macOS, adjust flags/parameters if needed | ||
- name: Prepare Release Artifacts | ||
run: | | ||
# Create a release directory if needed | ||
mkdir -p release | ||
# Copy the app, dSYM file, and any other assets into the release directory | ||
cp -r build/YourApp.xcbuild/Release/YourApp.app release/ | ||
cp -r build/YourApp.xcbuild/dSYMs/YourApp.dSYM release/ | ||
- name: Create Release on GitHub | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
*Download Links* (Adjust as needed) | ||
* macOS App: [YourApp.zip](URL_TO_ZIP) | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: release/YourApp.app.zip # Zip the app if needed | ||
asset_name: YourApp.app.zip | ||
asset_content_type: application/zip |
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,11 +1,26 @@ | ||
|
||
|
||
const DB_PATH = "db/lang.db"; | ||
const dbPath = "db/lang.db"; | ||
|
||
// names of columns | ||
|
||
|
||
// names of columns for user table | ||
const String userTable = "user"; | ||
const String userIdColumn = "id"; | ||
const String nameColumn = "name"; | ||
const String usernameColumn = "username"; | ||
const String emailColumn = "email"; | ||
const String cookieColumn = "cookie"; | ||
const String cookieColumn = "cookie"; | ||
|
||
// names of columns for recording table | ||
const String recordingTable = "recording"; | ||
const String idColumn = "id"; | ||
const String filePathColumn = "filePath"; | ||
const String commentColumn = "comment"; | ||
const String lengthColumn = "length"; | ||
const String timestampColumn = "timestamp"; | ||
|
||
|
||
// consts for network calls | ||
const String baseUrl = "http://127.0.0.1:8000"; | ||
const String loginUri = "/auth/login/"; |
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,10 @@ | ||
|
||
import 'package:lang_fe/const/consts.dart'; | ||
|
||
String getAuthUrl() { | ||
return '$baseUrl$loginUri'; | ||
} | ||
|
||
String getCurrentTime() { | ||
return DateTime.now().toIso8601String(); | ||
} |
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,81 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:sqflite/sqflite.dart'; | ||
|
||
import '../const/consts.dart'; | ||
import 'db_helper.dart'; | ||
|
||
class Recording { | ||
int? id; | ||
final String path; | ||
final String comment; | ||
final String length; | ||
final String timestamp; | ||
|
||
Recording({ | ||
this.id, | ||
required this.path, | ||
required this.comment, | ||
required this.length, | ||
required this.timestamp, | ||
}); | ||
|
||
Map<String, Object?> toMap() { | ||
var map = <String, Object?>{ | ||
idColumn: id, | ||
filePathColumn: path, | ||
commentColumn: comment, | ||
lengthColumn: length, | ||
timestampColumn: timestamp, | ||
}; | ||
return map; | ||
} | ||
} | ||
|
||
class RecordingProvider { | ||
RecordingProvider(); | ||
|
||
Future<Recording?> createRecording( | ||
filePath, comment, length, timestamp) async { | ||
Database db = await DatabaseHelper().database; | ||
Recording recording = Recording( | ||
path: filePath, | ||
comment: comment, | ||
length: length, | ||
timestamp: timestamp, | ||
); | ||
print(recording.toMap()); | ||
var r = await db.insert(recordingTable, recording.toMap(), | ||
conflictAlgorithm: ConflictAlgorithm.replace); | ||
recording.id = r; | ||
return recording; | ||
} | ||
|
||
Future<List<Recording>> getAll() async { | ||
Database db = await DatabaseHelper().database; | ||
List<Map<String, Object?>> maps = await db.query(recordingTable); | ||
List<Recording> recordings = []; | ||
for (var map in maps) { | ||
recordings.add(Recording( | ||
id: map[idColumn] as int, | ||
path: map[filePathColumn] as String, | ||
comment: map[commentColumn] as String, | ||
length: map[lengthColumn] as String, | ||
timestamp: map[timestampColumn] as String, | ||
)); | ||
} | ||
return recordings; | ||
} | ||
|
||
Future<bool> deleteRecording(int id) async { | ||
Database db = await DatabaseHelper().database; | ||
int r = await db | ||
.delete(recordingTable, where: '$idColumn = ?', whereArgs: [id]); | ||
if (r < 1) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
|
||
|
||
} |
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
Empty file.
Oops, something went wrong.