This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In pubsbec yaml | |
Use that library | |
logger: ^0.9.4 | |
*/ | |
//File logger.dart | |
//More info: https://pub.dev/packages/logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
///This class customize the default class SearchDelegate to use less code in each implementation | |
/// | |
///The `Custom` sufix refers to properties from this class | |
/// | |
///`Constructor class` | |
/// | |
/// ```dart | |
///SearchDelegateCustom( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<String> getDateByUser(BuildContext context) async { | |
/*Support lenguage | |
How to: https://stackoverflow.com/questions/61529343/how-to-change-language-of-show-date-picker-in-flutter | |
https://flutter.dev/docs/development/accessibility-and-localization/internationalization | |
*/ | |
DateTime selectedDate = DateTime.now(); | |
final DateTime picked = await showDatePicker( | |
context: context, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cloud Firestore: | |
Store in: | |
Collections and Documents | |
(insisde Documents could be: Data or more collecions. NO Documents) | |
Set a ubication: https://firebase.google.com/docs/firestore/locations | |
Set rules: https://firebase.google.com/docs/firestore/security/rules-structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Use a globalKey | |
final _formKey = GlobalKey<FormState>(); | |
//Use that key inside a Form Widget | |
return Form( | |
key: _formKey, | |
autovalidate: autovaldiate, | |
child: Column( | |
children: [ | |
Space(0.05), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/gestures.dart'; | |
///THIS FILE CONTAINS A LOT OF WIDGET USEFUL | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import '../../utils/utils.dart'; | |
class CenterText extends StatelessWidget { | |
const CenterText(this.text, {this.textAlign = TextAlign.center}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Just push to the next page | |
nextPage(BuildContext context, Widget widget) => Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => widget, | |
)); | |
///Remove the stack | |
nextRemoveWhole(BuildContext context, String route) => | |
Navigator.of(context).pushNamedAndRemoveUntil(route, (route) => false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<int> getmillisecondsSinceEpochNowAndAfter() { | |
//Get this day | |
String value = DateTime.now().toString(); | |
//Get the only the date | |
String prefix = value.substring(0, 10); | |
//Today from 0 hours | |
var today = DateTime.parse("$prefix 00:00:00Z"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:vento_app/notifiers/data_stores_notifiers.dart'; | |
import 'package:vento_app/notifiers/search_item.dart'; | |
//ProxyProvider | |
class SearchStoreProxy { | |
//Notifier | |
DataStoreNotifier _dataStore; | |
//Notifier | |
SearchItemNotifier _searhItems; |
NewerOlder