diff --git a/Flutter/lib/ChatScreen.dart b/Flutter/lib/ChatScreen.dart index 6b3d49a..87f1887 100644 --- a/Flutter/lib/ChatScreen.dart +++ b/Flutter/lib/ChatScreen.dart @@ -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( diff --git a/Flutter/lib/SoundRecorder.dart b/Flutter/lib/SoundRecorder.dart deleted file mode 100644 index 8b13789..0000000 --- a/Flutter/lib/SoundRecorder.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Flutter/lib/Speech_To_Text.dart b/Flutter/lib/Speech_To_Text.dart index 329040a..a54dd42 100644 --- a/Flutter/lib/Speech_To_Text.dart +++ b/Flutter/lib/Speech_To_Text.dart @@ -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 createState() => _SpeechState(); @@ -12,7 +12,6 @@ class _SpeechState extends State { final SpeechToText _speechToText = SpeechToText(); bool _speechEnabled = false; String _wordsSpoken = ""; - double _confidenceLevel = 0.0; @override void initState() { @@ -27,9 +26,7 @@ class _SpeechState extends State { void _startListening() async { await _speechToText.listen(onResult: _onSpeechResult); - setState(() { - _confidenceLevel = 0; - }); + setState(() {}); } void _stopListening() async { @@ -40,7 +37,6 @@ class _SpeechState extends State { void _onSpeechResult(result) { setState(() { _wordsSpoken = "${result.recognizedWords}"; - _confidenceLevel = result.confidence; }); print("Words spoken: $_wordsSpoken"); } diff --git a/Flutter/lib/main.dart b/Flutter/lib/main.dart index 66e41d5..493ebbc 100644 --- a/Flutter/lib/main.dart +++ b/Flutter/lib/main.dart @@ -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; @@ -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, ); diff --git a/Flutter/pubspec.lock b/Flutter/pubspec.lock index b5c0eb6..ee6c956 100644 --- a/Flutter/pubspec.lock +++ b/Flutter/pubspec.lock @@ -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: @@ -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 diff --git a/Flutter/pubspec.yaml b/Flutter/pubspec.yaml index 536ed55..60cc995 100644 --- a/Flutter/pubspec.yaml +++ b/Flutter/pubspec.yaml @@ -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: