Skip to content

Instantly share code, notes, and snippets.

View umuieme's full-sized avatar

Umesh Basnet umuieme

View GitHub Profile
import 'package:custom_form_field/src/choose_option_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CustomDropDownFormField<T> extends FormField<T> {
CustomDropDownFormField({
Key? key,
required List<DropdownMenuItem<T>> items,
FormFieldValidator<T>? validator,
Widget? hintText,
FormField<String>(
autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (value) =>
(value?.isNotEmpty ?? false) ? null : "Cannot be null",
onSaved: (value)=> customName = value,
builder: (state) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
@umuieme
umuieme / main.dart
Created August 31, 2020 14:25
date time simple parse
void main() {
var dummyData = {
'name': 'Umesh Basnet',
'date':'2019-08-15T11:28:49.703'
};
Test test = Test.fromJson(dummyData);
print(test.getFormattedText());
@umuieme
umuieme / ffmpeg-snippets.md
Created April 20, 2020 16:28 — forked from martinruenz/ffmpeg-snippets.md
ffmpeg snippets / cheatsheet
<html>
<body>
<h1> test </h1>
<p> this whould open the link <a href="fb-messenger://share?app_id=58567469885&redirect_uri=https%3A%2F%2Fwww.bbc.com%2Fnepali%2Fnews-51798024&link=https%3A%2F%2Fwww.bbc.com%2Fnepali%2Fnews-51798024%3FCMP%3Dshare_btn_me">link to messange</a> </p>
</body>
</html>
import 'package:flutter/material.dart';
class CustomRRect extends CustomClipper<Path> {
CustomRRect();
@override
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height/2 - 20);
[
{
"id": "18",
"name": "TestBook",
"price": "200.00",
"author": "Aryan1",
"category": "Sci-Fi",
"language": "en",
"ISBN": "123-00023",
"publish_date": "2019-04-05",
function sendNotifiction($title, $message){
$header = array(
"authorization: key=YOUR_FIREBASE_KEY",
"content-type: application/json",
);
$data = array
(
'title' => $title,
class _EventContentState extends State<EventContent> with AutomaticKeepAliveClientMixin<> {
final String url = 'https://furnishmenow.co.za/wp-json/wp/v2/posts'; // Testing url
List data;
Future<String> getEventContentData() async{
var res = await http.get(Uri.encodeFull(url), headers: { "Accept": "applications/json"});
setState(() {
var resBody = json.decode(res.body);
data = resBody;
class ZigZagClipper extends CustomClipper<Path> {
ClipType clipType;
ZigZagClipper(this.clipType);
@override
Path getClip(Size size) {
Path path = Path(); // the starting point is the 0,0 position of the widget.
path.lineTo(0, size.height); // this draws the line from current point to the left bottom position of widget
path.lineTo(size.width, size.height); // this draws the line from current point to the right bottom position of the widget.