Skip to content

Commit

Permalink
Merge branch 'darshin' into Abhinav
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainath12204 authored Apr 25, 2024
2 parents 0febe13 + bc5a4c5 commit ac90892
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 20 deletions.
2 changes: 2 additions & 0 deletions Flutter/lib/ChatScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutterbasics/DashBoardScreen.dart';

class ChatScreen extends StatelessWidget {
const ChatScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down
1 change: 0 additions & 1 deletion Flutter/lib/SoundRecorder.dart

This file was deleted.

8 changes: 2 additions & 6 deletions Flutter/lib/Speech_To_Text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:speech_to_text/speech_to_text.dart';

class Speech extends StatefulWidget {
const Speech({Key? key}) : super(key: key);
const Speech({super.key});

@override
State<Speech> createState() => _SpeechState();
Expand All @@ -12,7 +12,6 @@ class _SpeechState extends State<Speech> {
final SpeechToText _speechToText = SpeechToText();
bool _speechEnabled = false;
String _wordsSpoken = "";
double _confidenceLevel = 0.0;

@override
void initState() {
Expand All @@ -27,9 +26,7 @@ class _SpeechState extends State<Speech> {

void _startListening() async {
await _speechToText.listen(onResult: _onSpeechResult);
setState(() {
_confidenceLevel = 0;
});
setState(() {});
}

void _stopListening() async {
Expand All @@ -40,7 +37,6 @@ class _SpeechState extends State<Speech> {
void _onSpeechResult(result) {
setState(() {
_wordsSpoken = "${result.recognizedWords}";
_confidenceLevel = result.confidence;
});
print("Words spoken: $_wordsSpoken");
}
Expand Down
38 changes: 25 additions & 13 deletions Flutter/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutterbasics/ChatScreen.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:flutterbasics/DashBoardScreen.dart';
import 'package:flutterbasics/Speech_To_Text.dart';

import 'upload_image.dart';

void main() {
runApp(MyApp());
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: "Vision Crafters",
theme: ThemeData(primarySwatch: Colors.green),
home: HomePage(),
home: const HomePage(),
);
}
}

class HomePage extends StatelessWidget {
const HomePage({super.key});

@override
Widget build(BuildContext context) {
const isRecording = false;
Expand Down Expand Up @@ -52,16 +54,26 @@ class HomePage extends StatelessWidget {
),
body: const Speech(),
floatingActionButton: FloatingActionButton(
heroTag: 'uniqueTag1', // Unique tag assigned here
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const UploadImageScreen()),
);
},
child: const Icon(Icons.camera_alt),
backgroundColor: Colors.green,
tooltip: 'Open camera',
onPressed: () {},
child: SpeedDial(
animatedIcon: AnimatedIcons.menu_close,
direction: SpeedDialDirection.up,
children: [
SpeedDialChild(
child: const Icon(Icons.camera),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const UploadImageScreen()),
);
},
),
SpeedDialChild(
child: const Icon(Icons.video_call),
onTap: () {},
),
],
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
);
Expand Down
16 changes: 16 additions & 0 deletions Flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_expandable_fab:
dependency: "direct main"
description:
name: flutter_expandable_fab
sha256: "2aa5735bebcdbc49f43bcb32a29f9f03a9b7029212b8cd9837ae332ab2edf647"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -118,6 +126,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "9.4.6"
flutter_speed_dial:
dependency: "direct main"
description:
name: flutter_speed_dial
sha256: "698a037274a66dbae8697c265440e6acb6ab6cae9ac5f95c749e7944d8f28d41"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
2 changes: 2 additions & 0 deletions Flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ dependencies:
cupertino_icons: ^1.0.6
flutter_sound: ^9.4.6
speech_to_text: ^6.6.1
flutter_expandable_fab: ^2.0.0
flutter_speed_dial:

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit ac90892

Please sign in to comment.