Skip to content

Instantly share code, notes, and snippets.

View jeroenouw's full-sized avatar
🎯
Focusing

jeroenouw jeroenouw

🎯
Focusing
View GitHub Profile
@jeroenouw
jeroenouw / notifications.dart
Created October 24, 2020 09:35
Notifications dart flutter notifications
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 =
@jeroenouw
jeroenouw / main.dart
Created October 24, 2020 09:33
Main dart flutter notifications
import 'package:flutter/material.dart';
import 'package:push_messages/notifications.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
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;
@jeroenouw
jeroenouw / versions.sol
Created September 3, 2018 13:14
versions
pragma solidity 0.4.24;
pragma experimental "v0.5.0";
pragma experimental ABIEncoderV2;
@jeroenouw
jeroenouw / functions.sol
Created September 3, 2018 13:11
functions
/**
* @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(
@jeroenouw
jeroenouw / constructor.sol
Created September 3, 2018 13:10
constructor
/**
* @dev Constructor which inits at contract creation.
*/
constructor() public {
owner = msg.sender;
coins = 0;
cash = 0;
service = "";
}
@jeroenouw
jeroenouw / modifier.sol
Last active September 3, 2018 13:12
modifier
/**
* @dev Modifier which checks if sender is equal to owner.
*/
modifier onlyFreelancer() {
require(owner == msg.sender, "Sender not authorized.");
_;
}
@jeroenouw
jeroenouw / mapping.sol
Created September 3, 2018 13:10
mapping
mapping (address => FreelancerData) FreelancersData;
@jeroenouw
jeroenouw / struct.sol
Last active September 3, 2018 13:13
struct
struct FreelancerData {
bytes32 firstname;
bytes32 lastname;
uint256 coins;
uint256 cash;
bytes32 service;
}
@jeroenouw
jeroenouw / events.sol
Created September 3, 2018 13:09
events
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);