Skip to content

Instantly share code, notes, and snippets.

Avatar
🎖️
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
FlatButton(
onPressed: () {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime(2000, 1, 1),
maxTime: DateTime(2022, 12, 31),
onChanged: (date) {print('change $date');},
onConfirm: (date) {print('confirm $date');},
currentTime: DateTime.now(), 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: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View README.md

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.

Installation

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
{
public:
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 {
@override
_DateTimePickerState createState() => _DateTimePickerState();
}
View pubspec.yaml
...
dependencies:
flutter:
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, snapshot.data.documents);
},
);
}
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.color,
this.backgroundColor,
this.notificationPredicate = defaultScrollNotificationPredicate,
this.semanticsLabel,
this.semanticsValue,
View syntax.dart
const RefreshIndicator({
Key key,
@required Widget child,
double displacement: 40.0,
@required RefreshCallback onRefresh,
Color color,
Color backgroundColor,
ScrollNotificationPredicate
notificationPredicate: defaultScrollNotificationPredicate,
String semanticsLabel,