Skip to content

Instantly share code, notes, and snippets.

View bharathraj-e's full-sized avatar
🦊

Bharathraj bharathraj-e

🦊
View GitHub Profile
import 'package:flutter/material.dart';
class GameButton extends StatelessWidget {
const GameButton({required this.child, this.color, this.height = 56, this.width, required this.onTap, super.key});
final Widget child;
final Color? color;
final double height;
final double? width;
final VoidCallback onTap;
@bharathraj-e
bharathraj-e / jira-board.dart
Created April 12, 2023 18:26
Kanban board / jira borad basic ui in flutter
Scaffold(
appBar: AppBar(
title: const Text('Jira Board'),
),
body: Column(
children: [
Expanded(
child: Row(
children: [
Expanded(
@bharathraj-e
bharathraj-e / main.dart
Last active May 22, 2022 05:50
Expansion panel - single expanded
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
BlockQuote(
child:
Text(
'Lorem ipsum dolor sit amet, is the best place to hide a text.',
textAlign: TextAlign.justify,
),
),
BlockQuote(
outerPadding: const EdgeInsets.all(20),
blockColor: Colors.blueAccent,
blockWidth: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Lorem ipsum dolor sit amet, is the best place to hide a text.',
textAlign: TextAlign.justify,
@bharathraj-e
bharathraj-e / db-crud.php
Last active August 25, 2020 05:14
PHP DB CRUD CLASS - API Based Structure
<?php
require_once __DIR__ . '/response.php';
require_once __DIR__ . '/db.php';
class CRUD
{
private $db;
public function __construct()
@bharathraj-e
bharathraj-e / check-request.php
Created March 29, 2020 06:01
Check request and finalize response
<?php
function err($err)
{
$res['state'] = false;
$res['err'] = $err;
echo json_encode($res);
die();
}
import 'package:permission_handler/permission_handler.dart';
() async {
PermissionStatus p = await PermissionHandler()
.checkPermissionStatus(PermissionGroup.contacts);
if (p == PermissionStatus.disabled) {
// permission got already / success
return true;
}
@bharathraj-e
bharathraj-e / date_format.dart
Created February 1, 2020 04:51
date picker and date to user readable string
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
Future<DateTime> fetchDate(BuildContext context,
{DateTime initialDate, DateTime last}) async {
DateTime t = await showDatePicker(
context: context,
firstDate: DateTime(DateTime.now().year - 1),
initialDate: initialDate ?? DateTime.now(),
lastDate: last ?? DateTime(DateTime.now().year + 2),
@bharathraj-e
bharathraj-e / request.dart
Last active September 15, 2020 08:55
Flutter http request simplified
import 'dart:convert';
import 'package:http/http.dart' as http;
const String _host = "https://<....>";
class MyRequest {
final String url;
final Map<String, String> headers = {'Authorization': 'Bearer token'};