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 Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb10645493####9351</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
View main.dart
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
View customDateTimePicker.dart
class CustomPicker extends CommonPickerModel {
String digits(int value, int length) {
return '$value'.padLeft(length, "0");
}
CustomPicker({DateTime currentTime, LocaleType locale}) : super(locale: locale) {
this.currentTime = currentTime ?? DateTime.now();
this.setLeftIndex(this.currentTime.hour);
this.setMiddleIndex(this.currentTime.minute);
this.setRightIndex(this.currentTime.second);
}
View pubspec.yaml
...
flutter:
uses-material-design: true
assets:
- assets/images/listening.gif
...
View const.dart
const AlertDialog({
Key key,
Widget title,
EdgeInsetsGeometry titlePadding,
TextStyle titleTextStyle,
Widget content,
EdgeInsetsGeometry contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
TextStyle contentTextStyle,
List<Widget> actions,
Color backgroundColor,
View voicePayDialogDemo.dart
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return VoicePay();
},
);
},
View voicePayDialog.dart
import 'package:flutter/material.dart';
class VoicePay extends StatefulWidget {
@override
_VoicePayState createState() => _VoicePayState();
}
class _VoicePayState extends State<VoicePay> {
@override
View shopping_cart_tab.dart
switch (index) {
case 0:
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _buildNameField(),
);
case 1:
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _buildEmailField(),
View shopping_cart_tab.dart
SliverChildBuilderDelegate _buildSliverChildBuilderDelegate(
AppStateModel model) {
return SliverChildBuilderDelegate(
(context, index) {
switch (index) {
case 0:
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: _buildNameField(),
);
View shopping_cart_tab.dart
class _ShoppingCartTabState extends State<ShoppingCartTab> {
// ...
Widget _buildDateAndTimePicker(BuildContext context) { // NEW FROM HERE
return Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(