diff --git a/lib/Screens/about_page.dart b/lib/Screens/about_page.dart index 6cc3f28..0d69ab2 100644 --- a/lib/Screens/about_page.dart +++ b/lib/Screens/about_page.dart @@ -2,14 +2,13 @@ import 'package:flutter/material.dart'; import 'package:iconsax/iconsax.dart'; import 'package:line_icons/line_icons.dart'; import 'package:package_info_plus/package_info_plus.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class AboutPage extends StatefulWidget { - const AboutPage({Key? key}) : super(key: key); + const AboutPage({super.key}); @override - // ignore: library_private_types_in_public_api - _AboutPageState createState() => _AboutPageState(); + State createState() => _AboutPageState(); } class _AboutPageState extends State { @@ -122,15 +121,11 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch( - 'https://www.linkedin.com/in/sannidhyadubey')) { - await launch( - 'https://www.linkedin.com/in/sannidhyadubey', - forceSafariVC: false, - forceWebView: false, - ); + const url = 'https://www.linkedin.com/in/sannidhyadubey'; + if (await launchUrlString(url)) { + await launchUrlString(url); } else { - throw 'Could not launch'; + throw 'Could not launch $url'; } }, child: const ListTile( @@ -146,14 +141,11 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch('https://www.linkedin.com/in/roy15')) { - await launch( - 'https://www.linkedin.com/in/roy15', - forceSafariVC: false, - forceWebView: false, - ); + const url = 'https://www.linkedin.com/in/roy15'; + if (await launchUrlString(url)) { + await launchUrlString(url); } else { - throw 'Could not launch'; + throw 'Could not launch $url'; } }, child: const ListTile( @@ -163,21 +155,18 @@ class _AboutPageState extends State { child: Icon(Iconsax.user), ), title: Text('Bishal Roy'), - subtitle: Text('Lead Designer and Co-Lead'), + subtitle: Text('Lead Designer'), ), ), InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch( - 'https://www.linkedin.com/in/sneha-soni-918224236/')) { - await launch( - 'https://www.linkedin.com/in/sneha-soni-918224236/', - forceSafariVC: false, - forceWebView: false, - ); + const url = + 'https://www.linkedin.com/in/sneha-soni-918224236'; + if (await launchUrlString(url)) { + await launchUrlString(url); } else { - throw 'Could not launch'; + throw 'Could not launch $url'; } }, child: const ListTile( @@ -216,12 +205,10 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch( - 'https://www.linkedin.com/in/sannidhyadubey/')) { - await launch( - 'https://www.linkedin.com/in/sannidhyadubey/', - forceSafariVC: false, - forceWebView: false, + if (await launchUrlString( + 'https://www.linkedin.com/in/sannidhyadubey')) { + await launchUrlString( + 'https://www.linkedin.com/in/sannidhyadubey', ); } else { throw 'Could not launch'; @@ -240,12 +227,10 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch( - 'https://github.com/TheGuyDangerous/Aawaaz')) { - await launch( - 'https://github.com/TheGuyDangerous/Aawaaz', - forceSafariVC: false, - forceWebView: false, + if (await launchUrlString( + 'https://github.com/TheGuyDangerous/Voicerra')) { + await launchUrlString( + 'https://github.com/TheGuyDangerous/Voicerra', ); } else { throw 'Could not launch'; @@ -264,12 +249,10 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch( - 'https://github.com/TheGuyDangerous/Aawaaz/issues/new')) { - await launch( - 'https://github.com/TheGuyDangerous/Aawaaz/issues/new', - forceSafariVC: false, - forceWebView: false, + if (await launchUrlString( + 'https://github.com/TheGuyDangerous/Voicerra/issues/new')) { + await launchUrlString( + 'https://github.com/TheGuyDangerous/Voicerra/issues/new', ); } else { throw 'Could not launch'; @@ -288,11 +271,9 @@ class _AboutPageState extends State { InkWell( borderRadius: BorderRadius.circular(15.0), onTap: () async { - if (await canLaunch('https://paypal.me/GuyDangerous')) { - await launch( + if (await launchUrlString('https://paypal.me/GuyDangerous')) { + await launchUrlString( 'https://paypal.me/GuyDangerous', - forceSafariVC: false, - forceWebView: false, ); } else { throw 'Could not launch'; diff --git a/lib/Screens/edit_note_page.dart b/lib/Screens/edit_note_page.dart index fa65163..31521db 100644 --- a/lib/Screens/edit_note_page.dart +++ b/lib/Screens/edit_note_page.dart @@ -12,8 +12,7 @@ class AddEditNotePage extends StatefulWidget { this.note, }) : super(key: key); @override - // ignore: library_private_types_in_public_api - _AddEditNotePageState createState() => _AddEditNotePageState(); + State createState() => _AddEditNotePageState(); } class _AddEditNotePageState extends State { diff --git a/lib/Screens/note_detail_page.dart b/lib/Screens/note_detail_page.dart index 674d42f..a45ee8e 100644 --- a/lib/Screens/note_detail_page.dart +++ b/lib/Screens/note_detail_page.dart @@ -13,7 +13,7 @@ class NoteDetailPage extends StatefulWidget { }) : super(key: key); @override - _NoteDetailPageState createState() => _NoteDetailPageState(); + State createState() => _NoteDetailPageState(); } class _NoteDetailPageState extends State { @@ -30,43 +30,44 @@ class _NoteDetailPageState extends State { Future refreshNote() async { setState(() => isLoading = true); - this.note = await NotesDatabase.instance.readNote(widget.noteId); + note = await NotesDatabase.instance.readNote(widget.noteId); setState(() => isLoading = false); } @override Widget build(BuildContext context) => Scaffold( - backgroundColor: Color(0xffe7ddff), + backgroundColor: const Color(0xfff2f2f2), appBar: AppBar( - backgroundColor: Color(0xFF2f2554), + backgroundColor: const Color(0xFF2f2554), centerTitle: true, actions: [editButton(), deleteButton()], ), body: isLoading - ? Center(child: CircularProgressIndicator()) + ? const Center(child: CircularProgressIndicator()) : Padding( - padding: EdgeInsets.all(12), + padding: const EdgeInsets.all(12), child: ListView( - padding: EdgeInsets.symmetric(vertical: 8), + padding: const EdgeInsets.symmetric(vertical: 8), children: [ Text( note.title, - style: TextStyle( + style: const TextStyle( color: Color(0xff263238), fontSize: 22, fontWeight: FontWeight.bold, ), ), - SizedBox(height: 8), + const SizedBox(height: 8), Text( DateFormat.yMMMd().format(note.createdTime), - style: TextStyle(color: Colors.black26), + style: const TextStyle(color: Colors.black26), ), - SizedBox(height: 8), + const SizedBox(height: 8), Text( note.description, - style: TextStyle(color: Color(0xff263238), fontSize: 18), + style: const TextStyle( + color: Color(0xff263238), fontSize: 18), ) ], ), @@ -74,7 +75,7 @@ class _NoteDetailPageState extends State { ); Widget editButton() => IconButton( - icon: Icon(Icons.edit_outlined), + icon: const Icon(Icons.edit_outlined), onPressed: () async { if (isLoading) return; @@ -86,11 +87,12 @@ class _NoteDetailPageState extends State { }); Widget deleteButton() => IconButton( - icon: Icon(Icons.delete), + icon: const Icon(Icons.delete), onPressed: () async { + final navigator = Navigator.of(context); await NotesDatabase.instance.delete(widget.noteId); - Navigator.of(context).pop(); + navigator.pop(); }, ); } diff --git a/lib/Screens/notes_page.dart b/lib/Screens/notes_page.dart index 7048829..eeadd5e 100644 --- a/lib/Screens/notes_page.dart +++ b/lib/Screens/notes_page.dart @@ -62,7 +62,7 @@ class _NotesPageState extends State { height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( - color: Colors.white, + color: Color(0xFFf2f2f2), borderRadius: BorderRadius.only( topRight: Radius.circular(40), topLeft: Radius.circular(40), diff --git a/lib/Screens/transcribe_page.dart b/lib/Screens/transcribe_page.dart index 85a22da..2bb9466 100644 --- a/lib/Screens/transcribe_page.dart +++ b/lib/Screens/transcribe_page.dart @@ -8,45 +8,23 @@ import 'dart:async'; import 'package:iconsax/iconsax.dart'; import 'package:file_picker/file_picker.dart'; -class Transcriber extends StatelessWidget { - const Transcriber({super.key}); - - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return MaterialApp( - debugShowCheckedModeBanner: false, - title: 'Transcribe Page', - theme: ThemeData( - primarySwatch: Colors.blue, - fontFamily: 'poppins', - ), - home: const TranscribePage( - title: 'Transcribe', - ), - ); - } -} - class TranscribePage extends StatefulWidget { final String title; const TranscribePage({super.key, required this.title}); @override - // ignore: library_private_types_in_public_api - _TranscribePageState createState() => _TranscribePageState(); + State createState() => _TranscribePageState(); } class _TranscribePageState extends State { - // ignore: non_constant_identifier_names - bool is_Transcribing = false; + bool isTranscribing = false; String content = ''; File? file; void transcribe() async { setState(() { - is_Transcribing = true; + isTranscribing = true; }); final serviceAccount = ServiceAccount.fromString( (await rootBundle.loadString('assets/cloud.json'))); @@ -68,7 +46,7 @@ class _TranscribePageState extends State { }); }).whenComplete(() { setState(() { - is_Transcribing = false; + isTranscribing = false; }); }); } @@ -114,7 +92,7 @@ class _TranscribePageState extends State { height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( - color: Colors.white, + color: Color(0xFFf2f2f2), borderRadius: BorderRadius.only( topRight: Radius.circular(50), topLeft: Radius.circular(50), @@ -125,24 +103,28 @@ class _TranscribePageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ const SizedBox( - height: 70, + height: 50, ), Container( height: 200, - width: 300, + width: 350, decoration: BoxDecoration( - border: Border.all(color: Colors.black), + color: Colors.white, borderRadius: BorderRadius.circular(20), ), - padding: const EdgeInsets.all(5.0), + padding: const EdgeInsets.all(20.0), child: content == '' - ? const Text( - 'Your text will appear here', - style: TextStyle(color: Colors.grey), + ? const Center( + child: Text( + 'Your text will appear here', + style: TextStyle(color: Colors.grey), + ), ) - : Text( - content, - style: const TextStyle(fontSize: 20), + : Center( + child: Text( + content, + style: const TextStyle(fontSize: 20), + ), ), ), const SizedBox( @@ -150,7 +132,7 @@ class _TranscribePageState extends State { ), //Transcribe button Container( - child: is_Transcribing + child: isTranscribing ? const Padding( padding: EdgeInsets.symmetric( horizontal: 150, vertical: 70), @@ -168,7 +150,7 @@ class _TranscribePageState extends State { : Padding( padding: const EdgeInsets.all(8.0), child: TextButton( - onPressed: is_Transcribing ? () {} : transcribe, + onPressed: isTranscribing ? () {} : transcribe, child: Padding( padding: const EdgeInsets.symmetric( vertical: 25, horizontal: 15), diff --git a/lib/Screens/voice.dart b/lib/Screens/voice.dart index 0076d9f..a41c54d 100644 --- a/lib/Screens/voice.dart +++ b/lib/Screens/voice.dart @@ -7,10 +7,6 @@ import 'package:iconsax/iconsax.dart'; import 'package:voicerra/Screens/about_page.dart'; import 'package:voicerra/Screens/voice_beta.dart'; -void main() { - runApp(const VoiceApp()); -} - class VoiceApp extends StatelessWidget { const VoiceApp({Key? key}) : super(key: key); @@ -36,15 +32,12 @@ class SpeechScreen extends StatefulWidget { const SpeechScreen({super.key}); @override - // ignore: library_private_types_in_public_api - _SpeechScreenState createState() => _SpeechScreenState(); + State createState() => _SpeechScreenState(); } class _SpeechScreenState extends State { final Map _highlights = { 'project': HighlightedWord( - // ignore: avoid_print - onTap: () => print('project'), textStyle: const TextStyle( color: Colors.blue, fontWeight: FontWeight.bold, @@ -52,8 +45,6 @@ class _SpeechScreenState extends State { fontSize: 24.0), ), 'exhibition': HighlightedWord( - // ignore: avoid_print - onTap: () => print('exhibition'), textStyle: const TextStyle( color: Colors.green, fontWeight: FontWeight.bold, @@ -61,8 +52,6 @@ class _SpeechScreenState extends State { fontSize: 24.0), ), 'group': HighlightedWord( - // ignore: avoid_print - onTap: () => print('group'), textStyle: const TextStyle( color: Colors.red, fontWeight: FontWeight.bold, @@ -179,7 +168,7 @@ class _SpeechScreenState extends State { height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( - color: Colors.white, + color: Color(0xFFf2f2f2), borderRadius: BorderRadius.only( topRight: Radius.circular(50), topLeft: Radius.circular(50), diff --git a/lib/Screens/voice_recorder_page.dart b/lib/Screens/voice_recorder_page.dart index 6a087e0..690ae69 100644 --- a/lib/Screens/voice_recorder_page.dart +++ b/lib/Screens/voice_recorder_page.dart @@ -17,11 +17,10 @@ import 'package:voicerra/widget/mini_player.dart'; import 'package:wakelock/wakelock.dart'; class RecPage extends StatefulWidget { - const RecPage({Key? key}) : super(key: key); + const RecPage({super.key}); @override - // ignore: library_private_types_in_public_api - _RecPageState createState() => _RecPageState(); + State createState() => _RecPageState(); } typedef Fn = void Function(); diff --git a/pubspec.lock b/pubspec.lock index 18ed143..47aaced 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -330,7 +330,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.5" meta: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.9.0" speech_to_text: dependency: "direct main" description: @@ -657,7 +657,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" string_scanner: dependency: transitive description: @@ -685,7 +685,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.14" + version: "0.4.12" translator: dependency: "direct main" description: @@ -769,7 +769,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.2" wakelock: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 6a65ee5..13b7fdd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,32 +49,12 @@ dev_dependencies: flutter_test: sdk: flutter -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec -# The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: - #assets: - # - assets/images/ - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: fonts: @@ -92,17 +72,4 @@ flutter: assets: - assets/images/ - assets/cloud.json - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages +