- https://drexel-ue.github.io/
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 'dart:async'; | |
import 'package:aqueduct/aqueduct.dart'; | |
import 'package:faker/faker.dart'; | |
import 'package:uuid/uuid.dart'; | |
class Migration9 extends Migration { | |
@override | |
Future upgrade() async {} | |
@override |
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
create table user_mapper (id serial, user_id int); | |
create index on user_mapper (id); | |
create index on user_mapper (user_id); | |
create or replace function user_mapper_insert() | |
Returns trigger as | |
$body$ | |
begin |
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
QUERY: | |
final alertQuery = Query<User>(context) | |
..where((User user) => user.id).equalTo(id) | |
..join(set: (User user) => user.likes) | |
.join(object: (Like like) => like.liker) | |
.returningProperties((User user) => [user.displayName]) | |
..join(set: (User user) => user.shares) | |
.join(object: (Share share) => share.sharer) | |
.returningProperties((User user) => [user.displayName]); |
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
QUERY: | |
final alertQuery = Query<User>(context) | |
..join(set: (User user) => user.likes).returningProperties( | |
(Like like) => [like.createdAt, like.liker.displayName]) | |
..join(set: (User user) => user.shares).returningProperties( | |
(Share share) => [share.createdAt, share.sharer.displayName]); | |
RESPONSE: |
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
{ | |
'user' : { | |
'id' : 2, | |
'name' : 'taco', | |
'likes' : [ | |
{ | |
'id' : 3, | |
'video_id' : 23, | |
'liker_id' : 3, | |
'likee_id' : 2, |
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
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') |
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.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), |
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
@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( |
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
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, |
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
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, |