This file contains hidden or 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
| set(BACKEND_DIR "${CMAKE_CURRENT_SOURCE_DIR}/backend") | |
| set(BACKEND_LIB "${BACKEND_DIR}/libBackend.lib") | |
| target_link_libraries(${BINARY_NAME} PRIVATE "${BACKEND_LIB}") |
This file contains hidden or 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
| struct IPS { | |
| std::map<std::string, std::string> ips; | |
| }; | |
| struct_mapping::reg(&IPS::ips, "ips"); | |
| IPS ipsStruct; | |
| // const char* ips = "{\"en0\":\"127.0.0.1\"}"; | |
| const char* ips = Backend_GetAvailableIPs(); | |
| std::string ipstr = std::string("{\"ips\":") + ips + std::string("}"); |
This file contains hidden or 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
| const EncodableValue* value = call.arguments(); | |
| if (std::holds_alternative<std::string>(*value)) { | |
| std::string ip = std::get<std::string>(*value); | |
| const char* ipchar = ip.c_str(); | |
| char* ipcharDump = _strdup(ipchar); | |
| printf("CMD_SET_CURRENT_IP: %s\n", ipcharDump); | |
| Backend_SetCurrentIP(ipcharDump); | |
| free(ipcharDump); | |
| } |
This file contains hidden or 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
| using namespace flutter; | |
| void Commands::registerMessenger(BinaryMessenger* binary_messenger) | |
| { | |
| std::string channel_name(PACKAGE_NAME); | |
| channel_name += COMMANDS; | |
| const StandardMethodCodec& codec = StandardMethodCodec::GetInstance(); | |
| method_channel_ = new MethodChannel<EncodableValue>(binary_messenger, channel_name, &codec); |
This file contains hidden or 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
| class Commands : NSObject { | |
| let COMMANDS = "/COMMANDS"; | |
| let CMD_OPEN_DIALOG = "CMD:OPEN_DIALOG"; | |
| weak var binaryMessager : FlutterBinaryMessenger? | |
| var methodChannel : FlutterMethodChannel? | |
| func methodInvoked(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void { | |
| NSLog(call.method); | |
| switch(call.method) { |
This file contains hidden or 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
| import Cocoa | |
| import FlutterMacOS | |
| class MainFlutterWindow: NSWindow { | |
| @IBOutlet weak var menuEvent: MenuEvents! | |
| @IBOutlet weak var commands: Commands! | |
| override func awakeFromNib() { | |
| .... | |
This file contains hidden or 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
| Expanded( | |
| child: TextButton( | |
| onPressed: () { | |
| importPhoto(); | |
| }, | |
| child: Text('ADD PHOTO'), | |
| ), | |
| ), |
This file contains hidden or 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
| import 'package:flutter/services.dart'; | |
| import 'package:package_info/package_info.dart'; | |
| const COMMANDS = '/COMMANDS'; | |
| const CMD_OPEN_DIALOG = 'CMD:OPEN_DIALOG'; | |
| MethodChannel _methodCommand; | |
| Future<MethodChannel> _getCommandsChannel() async { |