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/material.dart'; | |
| class ScaleFadeTransition extends StatefulWidget { | |
| const ScaleFadeTransition({ | |
| required this.child, | |
| super.key, | |
| this.show = false, | |
| this.alignment = Alignment.center, | |
| this.curve = Curves.easeInOut, | |
| }); |
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/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| class CountSelector extends StatefulWidget { | |
| const CountSelector({ | |
| super.key, | |
| this.value = 0, | |
| this.onChanged, | |
| this.displayFunction, | |
| this.min = 0, |
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 LineWidgetText extends ConsumerStatefulWidget { | |
| const LineWidgetText({ | |
| required this.element, | |
| super.key, | |
| }); | |
| final LineElement element; | |
| @override | |
| ConsumerState<LineWidgetText> createState() => _LineWidgetTextState(); |
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/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| // pan gesture detector that only responds to specific device kinds | |
| // e.g. only responds to mouse drags but ignores trackpad drags | |
| class DeviceKindPanGestureDetector extends StatefulWidget { | |
| const DeviceKindPanGestureDetector({ | |
| required this.child, | |
| required this.onStart, | |
| required this.onUpdate, |
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
| function loadAddOn(event) { | |
| var accessToken = event.gmail.accessToken; | |
| var messageId = event.gmail.messageId; | |
| GmailApp.setCurrentMessageAccessToken(accessToken); | |
| var mailMessage = GmailApp.getMessageById(messageId); | |
| var from = mailMessage.getFrom() | |
| var mail = from.split("<")[1].split(">")[0]; | |
| var name = from.split("<")[0]; | |
| var sendDataButton = CardService.newTextButton() |
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/material.dart'; | |
| // I will have to clean this a little bit, I pasted my context_extension below so it works out of the box | |
| class InteractableCard extends StatefulWidget { | |
| const InteractableCard({ | |
| required this.child, | |
| this.highlightColor, | |
| super.key, | |
| this.onTap, | |
| this.unselectedColor, |
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 'dart:async'; | |
| import 'dart:convert'; | |
| import 'package:firebase_analytics/firebase_analytics.dart'; | |
| import 'logging.dart'; | |
| void logEvent( | |
| String name, [ | |
| Map<String, Object>? params, |
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
| #!/bin/sh | |
| # To use add to your projects `.git/hooks/` | |
| # Should be named `pre-push` | |
| # Don't forget to make it executable with `chmod +x` | |
| # run Flutter analyze + test | |
| flutter analyze | |
| if [ $? -ne 0 ]; then | |
| exit 1 |
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
| Future<String> sendCoind(String targetAddressHex, int amount) async { | |
| EthereumAddress address = EthereumAddress.fromHex(targetAddressHex); | |
| // uint in smart contract means BigInt for us | |
| var bigAmount = BigInt.from(amount); | |
| // sendCoin transaction | |
| var response = await submit("sendCoin", [address, bigAmount]); | |
| // hash of the transaction | |
| return response; | |
| } |
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
| Future<String> submit(String functionName, List<dynamic> args) async { | |
| EthPrivateKey credentials = EthPrivateKey.fromHex( | |
| "3d272d3193203d7a4458ea2a38ace936075c776512fc27093597ca2c790602a9"); | |
| DeployedContract contract = await loadContract(); | |
| final ethFunction = contract.function(functionName); | |
| var result = await ethClient.sendTransaction( | |
| credentials, |
NewerOlder