Skip to content

Instantly share code, notes, and snippets.

@ravindu9701
ravindu9701 / main.dart
Created May 4, 2020 13:57
Flutter Facebook Login
import 'package:flutter/material.dart';
import 'package:flutter_facebook_login/flutter_facebook_login.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:flutter_auth_buttons/flutter_auth_buttons.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
var Speaker = function () {
var synth
var utterance
var voices
this.init = function () {
// CHECK FOR SPEECHSYNTHESIS API
if (!(window.speechSynthesis)) {
@ravindu9701
ravindu9701 / data preprocessing.ipynb
Created May 24, 2020 19:11
data preprocessing code
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class DrawScreen extends StatefulWidget {
@override
_DrawScreenState createState() => _DrawScreenState();
}
class _DrawScreenState extends State<DrawScreen> {
final _points = List<Offset>();
final _recognizer = Recognizer();
List<Prediction> _prediction;
bool initialize = false;
class DrawingPainter extends CustomPainter {
final List<Offset> points;
DrawingPainter(this.points);
final Paint _paint = Paint()
..strokeCap = StrokeCap.round
..color = Colors.blue
..strokeWidth = Constants.strokeWidth;
final _canvasCullRect = Rect.fromPoints(
Offset(0, 0),
Offset(Constants.imageSize, Constants.imageSize),
);
final _whitePaint = Paint()
..strokeCap = StrokeCap.round
..color = Colors.white
..strokeWidth = Constants.strokeWidth;
class Prediction {
final double confidence;
final int index;
final String label;
Prediction({this.confidence, this.index, this.label});
factory Prediction.fromJson(Map<dynamic, dynamic> json) {
return Prediction(
confidence: json['confidence'],
class PredictionWidget extends StatelessWidget {
final List<Prediction> predictions;
const PredictionWidget({Key key, this.predictions}) : super(key: key);
Widget _numberWidget(int num, Prediction prediction) {
return Column(
children: <Widget>[
Text(
'$num',
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:tflite/tflite.dart';
void main() => runApp(MaterialApp(
home: MyApp(),
));
class MyApp extends StatefulWidget {