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
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; | |
class Notifications { | |
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = | |
FlutterLocalNotificationsPlugin(); | |
void initNotifications() async { | |
final AndroidInitializationSettings initializationSettingsAndroid = | |
AndroidInitializationSettings('app_icon'); | |
final IOSInitializationSettings initializationSettingsIOS = |
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
import 'package:flutter/material.dart'; | |
import 'package:push_messages/notifications.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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
import 'package:flutter/material.dart'; | |
class ReusableScreen extends StatelessWidget { | |
final String screenTitle; | |
final IconData tileIcon; | |
final String tileTitle; | |
final String tileSubtitle; | |
final Function cancelButtonAction; | |
final Function proceedButtonAction; |
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
pragma solidity 0.4.24; | |
pragma experimental "v0.5.0"; | |
pragma experimental ABIEncoderV2; |
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
/** | |
* @dev Sets all data for freelancer | |
* @param _firstname The first name of the freelancer | |
* @param _lastname The last name of the freelancer | |
* @param _coins Amount of coins available | |
* @param _cash Amount of cash available | |
* @param _service Service offered by the freelancer | |
* @return FreelancerData struct of the owner | |
*/ | |
function setFreelancer( |
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
/** | |
* @dev Constructor which inits at contract creation. | |
*/ | |
constructor() public { | |
owner = msg.sender; | |
coins = 0; | |
cash = 0; | |
service = ""; | |
} |
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
/** | |
* @dev Modifier which checks if sender is equal to owner. | |
*/ | |
modifier onlyFreelancer() { | |
require(owner == msg.sender, "Sender not authorized."); | |
_; | |
} |
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
mapping (address => FreelancerData) FreelancersData; |
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
struct FreelancerData { | |
bytes32 firstname; | |
bytes32 lastname; | |
uint256 coins; | |
uint256 cash; | |
bytes32 service; | |
} |
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
event logFreelancerChanged( | |
address indexed owner, | |
bytes32 firstname, | |
bytes32 lastname, | |
uint256 coins, | |
uint256 cash, | |
bytes32 service | |
); | |
event logAssetsChanged(address indexed owner, uint256 coins, uint256 cash, bytes32 service); |
NewerOlder