-
Notifications
You must be signed in to change notification settings - Fork 172
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
8 changed files
with
145 additions
and
40 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,7 @@ | ||
gradle-wrapper.jar | ||
/.gradle | ||
/captures/ | ||
/gradlew | ||
/gradlew.bat | ||
/local.properties | ||
GeneratedPluginRegistrant.java |
12 changes: 12 additions & 0 deletions
12
android/app/src/main/kotlin/com/example/skype_clone/MainActivity.kt
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 @@ | ||
package com.example.skype_clone | ||
|
||
import androidx.annotation.NonNull; | ||
import io.flutter.embedding.android.FlutterActivity | ||
import io.flutter.embedding.engine.FlutterEngine | ||
import io.flutter.plugins.GeneratedPluginRegistrant | ||
|
||
class MainActivity: FlutterActivity() { | ||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { | ||
GeneratedPluginRegistrant.registerWith(flutterEngine); | ||
} | ||
} |
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,32 @@ | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.moved-aside | ||
*.pbxuser | ||
*.perspectivev3 | ||
**/*sync/ | ||
.sconsign.dblite | ||
.tags* | ||
**/.vagrant/ | ||
**/DerivedData/ | ||
Icon? | ||
**/Pods/ | ||
**/.symlinks/ | ||
profile | ||
xcuserdata | ||
**/.generated/ | ||
Flutter/App.framework | ||
Flutter/Flutter.framework | ||
Flutter/Flutter.podspec | ||
Flutter/Generated.xcconfig | ||
Flutter/app.flx | ||
Flutter/app.zip | ||
Flutter/flutter_assets/ | ||
Flutter/flutter_export_environment.sh | ||
ServiceDefinitions.json | ||
Runner/GeneratedPluginRegistrant.* | ||
|
||
# Exceptions to above rules. | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.pbxuser | ||
!default.perspectivev3 |
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,13 @@ | ||
import UIKit | ||
import Flutter | ||
|
||
@UIApplicationMain | ||
@objc class AppDelegate: FlutterAppDelegate { | ||
override func application( | ||
_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||
) -> Bool { | ||
GeneratedPluginRegistrant.register(with: self) | ||
return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||
} | ||
} |
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 @@ | ||
#import "GeneratedPluginRegistrant.h" |
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,58 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:hive/hive.dart'; | ||
import 'package:path_provider/path_provider.dart'; | ||
import 'package:skype_clone/models/log.dart'; | ||
import 'package:skype_clone/resources/local_db/interface/log_interface.dart'; | ||
|
||
class HiveMethods implements LogInterface { | ||
String _hiveBox = "Call_Logs"; | ||
|
||
@override | ||
init() async { | ||
final Directory d = await getApplicationDocumentsDirectory(); | ||
Hive.init(d.path); | ||
} | ||
|
||
@override | ||
addLogs(Log log) async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
var logMap = log.toMap(log); | ||
int idOfInput = await box.add(logMap); | ||
close(); | ||
return idOfInput; | ||
} | ||
|
||
updateLogs(int i, Log log) async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
var logMap = log.toMap(log); | ||
await box.put(i, logMap); | ||
close(); | ||
} | ||
|
||
@override | ||
Future<List<Log>> getLogs() async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
List<Log> list = []; | ||
|
||
for (int i = 0; i < box.length; i++) { | ||
var logMap = box.getAt(i); | ||
list.add( | ||
Log.fromMap( | ||
logMap, | ||
), | ||
); | ||
} | ||
|
||
return list; | ||
} | ||
|
||
@override | ||
deleteLogs(int logId) async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
await box.deleteAt(logId); | ||
} | ||
|
||
@override | ||
close() => Hive.close(); | ||
} |
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,54 +1,35 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:hive/hive.dart'; | ||
import 'package:path_provider/path_provider.dart'; | ||
import 'package:skype_clone/models/log.dart'; | ||
import 'package:skype_clone/resources/local_db/interface/log_interface.dart'; | ||
|
||
class HiveMethods implements LogInterface { | ||
String _hiveBox; | ||
|
||
@override | ||
openDb(String dbName) => _hiveBox = dbName; | ||
|
||
@override | ||
init() async { | ||
final Directory d = await getApplicationDocumentsDirectory(); | ||
Hive.init(d.path); | ||
addLogs(Log log) { | ||
print("Adding values to hive db"); | ||
return null; | ||
} | ||
|
||
@override | ||
addLogs(Log log) async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
var logMap = log.toMap(log); | ||
int idOfInput = await box.add(logMap); | ||
Hive.close(); | ||
return idOfInput; | ||
close() { | ||
// TODO: implement close | ||
return null; | ||
} | ||
|
||
@override | ||
Future<List<Log>> getLogs() async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
List<Log> list = []; | ||
|
||
for (int i = 0; i < box.length; i++) { | ||
var logMap = box.getAt(i); | ||
list.add( | ||
Log.fromMap( | ||
logMap, | ||
), | ||
); | ||
} | ||
|
||
return list; | ||
deleteLogs(int logId) { | ||
// TODO: implement deleteLogs | ||
return null; | ||
} | ||
|
||
@override | ||
deleteLogs(int logId) async { | ||
final Box box = await Hive.openBox(_hiveBox); | ||
await box.deleteAt(logId); | ||
Future<List<Log>> getLogs() { | ||
// TODO: implement getLogs | ||
return null; | ||
} | ||
|
||
@override | ||
close() => Hive.close(); | ||
} | ||
init() { | ||
print("initialized hive db"); | ||
return null; | ||
} | ||
} |
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