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 / jira-board.dart
Created April 12, 2023 18:26
Kanban board / jira borad basic ui in flutter
appBar: AppBar(
title: const Text('Jira Board'),
body: Column(
children: [
child: Row(
children: [
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';
'Lorem ipsum dolor sit amet, is the best place to hide a text.',
textAlign: TextAlign.justify,
outerPadding: const EdgeInsets.all(20),
blockColor: Colors.blueAccent,
blockWidth: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
'Lorem ipsum dolor sit amet, is the best place to hide a text.',
textAlign: TextAlign.justify,
bharathraj-e / db-crud.php
Last active August 25, 2020 05:14
PHP DB CRUD CLASS - API Based Structure
require_once __DIR__ . '/response.php';
require_once __DIR__ . '/db.php';
class CRUD
private $db;
public function __construct()
bharathraj-e / check-request.php
Created March 29, 2020 06:01
Check request and finalize response
function err($err)
$res['state'] = false;
$res['err'] = $err;
echo json_encode($res);
import 'package:permission_handler/permission_handler.dart';
() async {
PermissionStatus p = await PermissionHandler()
if (p == PermissionStatus.disabled) {
// permission got already / success
return true;
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( - 1),
initialDate: initialDate ??,
lastDate: last ?? DateTime( + 2),
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'};