Skip to content

Instantly share code, notes, and snippets.

finishing the todo list, one task at a time.

Shivam Goyal ShivamGoyal1899

finishing the todo list, one task at a time.
View GitHub Profile
View syntax.dart
onPressed: () {
showTitleActions: true,
minTime: DateTime(2000, 1, 1),
maxTime: DateTime(2022, 12, 31),
onChanged: (date) {print('change $date');},
onConfirm: (date) {print('confirm $date');},
currentTime:, locale: LocaleType.en);},
child: Text('Show DateTime Picker',)
View settings.json
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see:
"$schema": "",

Image Picker plugin for Flutter

pub package

A Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera.


First, add image_picker as a dependency in your pubspec.yaml file.

View mpp.cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution
long MaxProduct(vector<int> &nums)
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
void main() => runApp(DateTimePicker());
class DateTimePicker extends StatefulWidget {
_DateTimePickerState createState() => _DateTimePickerState();
View pubspec.yaml
sdk: flutter
firebase_core: ^0.2.5 # add dependency for Firebase Core
cloud_firestore: ^0.8.2 # add dependency for Cloud Firestore
View method.dart
Widget _buildBody(BuildContext context) {
return StreamBuilder<QuerySnapshot>(
stream: Firestore.instance.collection('candidate').snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) return LinearProgressIndicator();
return _buildList(context,;
View main.dart
import 'dart:async';
import 'dart:math';
View implementation.dart
const RefreshIndicator({
Key key,
@required this.child,
this.displacement = 40.0,
@required this.onRefresh,
this.notificationPredicate = defaultScrollNotificationPredicate,
View syntax.dart
const RefreshIndicator({
Key key,
@required Widget child,
double displacement: 40.0,
@required RefreshCallback onRefresh,
Color color,
Color backgroundColor,
notificationPredicate: defaultScrollNotificationPredicate,
String semanticsLabel,