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
Widget _getItem(IconData iconData, String name, String tag) => | |
GestureDetector( | |
child: Card( | |
child: Padding( | |
padding: const EdgeInsets.all(10.0), | |
child: Row( | |
children: [ | |
Hero(child: Icon(iconData), tag: tag), | |
Expanded( | |
child: Text( |
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 FirstPage extends StatefulWidget { | |
final String title; | |
const FirstPage({Key? key, required this.title}) : super(key: key); | |
@override | |
_FirstPageState createState() => _FirstPageState(); | |
} | |
class _FirstPageState extends State<FirstPage> { | |
@override |
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
<?php | |
require('parser.php'); | |
define('BOT_TOKEN', 'SEU TOKEN'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function processMessage($message) { | |
// processa a mensagem recebida | |
$message_id = $message['message_id']; |
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
<?php | |
if (isset($message['photo'])) { //checa se existe uma imagem na mensagem | |
$photo = $message['photo'][count($message['photo'])-1]; //obtém a imagem no tamanho original | |
//envia a imagem recebida com a legenda | |
sendMessage("sendPhoto", array('chat_id' => $chat_id, "photo" => $photo["file_id"], "caption" => "A legenda da foto foi: ".$$message["caption"])); | |
} | |
?> |
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
{ | |
"update_id":360000000, | |
"message":{ | |
"message_id":00000, | |
"from":{"id":137000000,"is_bot":false,"first_name":"Luiz Teste","username":"teste","language_code":"pt-br"}, | |
"chat":{"id":137000000,"first_name":"Luiz Teste","username":"teste","type":"private"}, | |
"date":1616007215, | |
"photo":[ | |
{"file_id":"AgACAgEQWQSxkBAAKmzWsfrerrgdfgEwSFxc7Zb1OAAK-qDEbXP2QRjWxhui1v8GZjuOuSxcAAwEAAwIAA20AA_HPAAIeCV","file_unique_id":"AQADjuOuSxcAA_HPAAI","file_size":19198,"width":301,"height":320}, | |
{"file_id":"AgACAgEQWQSxkBAAKmzWsfrerrgdfgEwSFxc7Zb1OAAK-qDEbXP2QRjWxhui1v8GZjuOuSxcAAwEAAwIAA20AA_HPAAIeCV","file_unique_id":"AQADjuOuSxcAA_LPAAI","file_size":52522,"width":752,"height":800}, |
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
Drawer( | |
child: ListView( | |
padding: EdgeInsets.zero, | |
children: <Widget>[ | |
DrawerHeader( | |
child: Text('Cabeçalho'), | |
decoration: BoxDecoration( | |
color: Colors.blue, | |
), | |
), |
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
<?php | |
require('parser.php'); | |
function processMessage($text) { | |
if (isset($text)) { | |
if ($text === "mega") { | |
echo getResult('megasena', $text); | |
} else if ($text === "quina") { | |
echo getResult('quina', $text); | |
} else if ($text === "lotomania") { |
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
void onSend(ChatMessage message) async { | |
print(message.toJson()); | |
setState(() { | |
messages = [...messages, message]; | |
print(messages.length); | |
}); | |
sendMessage(message.text); | |
} | |
void initDio() { |
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
List<ChatMessage> messages = List<ChatMessage>(); |
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
final ChatUser user = ChatUser( | |
name: "Usuário", | |
firstName: "Usuário", | |
lastName: "Fulano", | |
uid: "0001", | |
); | |
final ChatUser bot = ChatUser( | |
name: "Bot", | |
uid: "0002", |