Skip to content

Instantly share code, notes, and snippets.

View pratikbutani's full-sized avatar
🎯
Exploring things

Pratik Butani pratikbutani

🎯
Exploring things
View GitHub Profile
@pratikbutani
pratikbutani / index.html
Last active March 7, 2023 17:56
Dart with HTML & CSS
<html>
<head>
<meta charset="UTF-8">
<title>Dart + HTML + CSS Example</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>Click the button to change the color of the text!</h1>
<br><br>
<button id="colorButton">Change color</button>
@pratikbutani
pratikbutani / main.dart
Last active October 16, 2022 14:01
Change color of border & IconData in TextInput
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@pratikbutani
pratikbutani / main.dart
Last active October 16, 2022 13:51
StatefulBuilder Use case with AlertDialog
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@pratikbutani
pratikbutani / main.dart
Created October 13, 2022 13:07
BottomSheet with TextInputBox & Keyboard
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter Code Sample';
@override
@pratikbutani
pratikbutani / main.dart
Last active October 1, 2022 14:59
Round Container With Image in Flutter
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@filiph
filiph / main.dart
Last active October 11, 2022 13:23
Human Life Counter
// This now lives in https://github.com/filiph/human-life/blob/main/lib/main.dart as source
// and at https://filiph.github.io/human-life/ as an app.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(HumanLifeApp());
}
@pratikbutani
pratikbutani / MyFirebaseMessagingService.java
Last active March 24, 2022 11:56
Android - Parse JSON Array from FCM Notifications : https://stackoverflow.com/a/55428420/1318946
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "MyFirebaseMessagingServ";
private static int NOTIFICATION_ID = 1;
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
// Check if message contains a data payload.
package com.shamikalashawn.truthordarecleanfun;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@theevangelista
theevangelista / RelativeRadioGroup.java
Created August 24, 2016 04:26
A RadioGroup with Relative Layout capabilities
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software