Skip to content

Instantly share code, notes, and snippets.

View drexel-ue's full-sized avatar

IKesh Pack drexel-ue

  • Ohio
View GitHub Profile
@drexel-ue
drexel-ue / card.dart
Created April 17, 2018 13:57
trying to use a listview with cards. for some reason i am not being allowed to enter my created variables
import 'package:flutter/material.dart';
class ListCard extends StatelessWidget {
final String backgroundImagePath;
final String title;
final String subtitle;
final int numberOfTrophies;
final IconData icon;
final Image iconAsset;
import 'package:flutter/material.dart';
import 'package:flutter_dialogflow/flutter_dialogflow.dart';
class TessChat extends StatefulWidget {
TessChat({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:carousel_pro/carousel_pro.dart';
class BarCard extends StatelessWidget {
final String backgroundImage;
final String title;
final String subtitle;
final String icon;
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const firestore = admin.firestore();
const settings = {timestampInSnapshots: true};
firestore.settings(settings);
const stripe = require('stripe')(functions.config().stripe.token);
# Write a method, peak_finder(arr), that accepts an array of numbers as an arg.
# The method should return an array containing all of "peaks" of the array.
# An element is considered a "peak" if it is greater than both it's left and right neighbor.
# The first or last element of the array is considered a "peak" if it is greater than it's one neighbor.
def peak_finder(arr)
peaks = []
(0...arr.length - 1).each do |i|
if arr[i - 1] == nil and arr[i] > arr[i + 1]
peaks << arr[i]
void _uploadVideo(UserData userData) async {
String selectedFilter = _filterTitleSubject.value ?? 'Normal';
final url = 'http://10.0.2.2:8888/videos';
final body = {
'video': base64Encode(await videoFile.readAsBytes()),
'userID': userData.id,
'createdBy': userData.displayName,
'appliedFilter': selectedFilter,
'title': title,
'aspectRatio': cameraController.value.aspectRatio,
void _uploadVideo(UserData userData) async {
String selectedFilter = _filterTitleSubject.value ?? 'Normal';
final url = 'http://10.0.2.2:8888/videos';
final body = {
'userID': userData.id,
'createdBy': userData.displayName,
'appliedFilter': selectedFilter,
'title': title,
'aspectRatio': json.encode(cameraController.value.aspectRatio),
'content': content,
@Operation.post()
Future<Response> handleUpload() async {
final transformer = MimeMultipartTransformer(
request.raw.headers.contentType.parameters["boundary"]);
final parts = await transformer
.bind(Stream.fromIterable([await request.body.decode<List<int>>()]))
.toList();
parts.forEach((MimeMultipart part) {
part.listen((List<int> data) async {
await File(
List.generate(profileBloc.content.length, (int index) {
final vid = profileBloc.content[index];
final controller =
VideoPlayerController.network(vid.downloadUrl);
return SizedBox(
height: height * 0.3,
width: width * 0.3,
child: Column(
children: <Widget>[
VideoPlayer(controller),
2019-06-22 20:53:31.622515
[SEVERE] aqueduct: GET /videoData/56 22285ms 500 {user-agent : Dart/2.3 (dart:io)\naccept-encoding : gzip\ncontent-length : 0\nhost : 10.0.2.2:8888\nauthorization : Bearer 8VlIFnNrPF0LbedAmE2pZA1Sc8RdjU8K\n} NoSuchMethodError: The getter 'length' was called on null.
Receiver: null
Tried calling: length
this is the offending code:
..route('/videoUpload')