|
| 1 | +import 'package:flutter/cupertino.dart'; |
| 2 | +import 'package:flutter/material.dart'; |
| 3 | + |
| 4 | +import 'package:flutter_tts/flutter_tts.dart'; |
| 5 | + |
| 6 | +enum TtsState { playing, stopped } |
| 7 | + |
| 8 | +class AboutPage extends StatefulWidget { |
| 9 | + AboutPage(); |
| 10 | + |
| 11 | + @override |
| 12 | + _AboutPageState createState() => _AboutPageState(); |
| 13 | +} |
| 14 | + |
| 15 | +class _AboutPageState extends State<AboutPage> { |
| 16 | + _AboutPageState(); |
| 17 | + |
| 18 | + // FlutterTts flutterTts; |
| 19 | + // TtsState ttsState = TtsState.stopped; |
| 20 | + |
| 21 | + @override |
| 22 | + void initState() { |
| 23 | + super.initState(); |
| 24 | + // initTTS(); |
| 25 | + // |
| 26 | + // |
| 27 | + // _getVoice("Command Accepted. Translating"); |
| 28 | + } |
| 29 | + |
| 30 | + // void _getVoice(String value) async { |
| 31 | + // if (value != null && value.isNotEmpty) { |
| 32 | + // if (ttsState != TtsState.playing) { |
| 33 | + // var result = await flutterTts.speak(value); |
| 34 | + // if (result == 1) setState(() => ttsState = TtsState.playing); |
| 35 | + // } |
| 36 | + // } |
| 37 | + // } |
| 38 | + |
| 39 | + @override |
| 40 | + void dispose() { |
| 41 | + super.dispose(); |
| 42 | + |
| 43 | + //flutterTts.stop(); |
| 44 | + } |
| 45 | + |
| 46 | + // initTTS() { |
| 47 | + // flutterTts = new FlutterTts(); |
| 48 | + // flutterTts.setStartHandler(() { |
| 49 | + // setState(() { |
| 50 | + // print("Playing"); |
| 51 | + // ttsState = TtsState.playing; |
| 52 | + // }); |
| 53 | + // }); |
| 54 | + // |
| 55 | + // flutterTts.setCompletionHandler(() { |
| 56 | + // setState(() { |
| 57 | + // print("Complete"); |
| 58 | + // ttsState = TtsState.stopped; |
| 59 | + // }); |
| 60 | + // }); |
| 61 | + // flutterTts.setCancelHandler(() { |
| 62 | + // setState(() { |
| 63 | + // print("Cancel"); |
| 64 | + // ttsState = TtsState.stopped; |
| 65 | + // }); |
| 66 | + // }); |
| 67 | + // } |
| 68 | + |
| 69 | + @override |
| 70 | + Widget build(BuildContext context) { |
| 71 | + return Scaffold( |
| 72 | + backgroundColor: Colors.blueGrey, |
| 73 | + appBar: AppBar( |
| 74 | + title: Text('About App'), |
| 75 | + backgroundColor: Colors.indigo, |
| 76 | + ), //AppBar |
| 77 | + body: Center( |
| 78 | + /** Card Widget **/ |
| 79 | + child: SingleChildScrollView( |
| 80 | + child: Card( |
| 81 | + elevation: 50, |
| 82 | + shadowColor: Colors.black, |
| 83 | + color: Colors.blue[600], |
| 84 | + child: SizedBox( |
| 85 | + width: 320, |
| 86 | + height: 500, |
| 87 | + child: Padding( |
| 88 | + padding: const EdgeInsets.all(12.0), |
| 89 | + child: Column( |
| 90 | + children: [ |
| 91 | + ClipRRect( |
| 92 | + borderRadius: BorderRadius.all(Radius.circular(10.0)), |
| 93 | + child: Container( |
| 94 | + child: Image.asset( |
| 95 | + "assets/eye.png", |
| 96 | + height: 120, |
| 97 | + width: 120, |
| 98 | + ), |
| 99 | + ), |
| 100 | + ), |
| 101 | + SizedBox( |
| 102 | + height: 10, |
| 103 | + ), |
| 104 | + Container( |
| 105 | + padding: const EdgeInsets.all(4), |
| 106 | + width: double.infinity, |
| 107 | + child: Center( |
| 108 | + child: Text( |
| 109 | + "Insight App", |
| 110 | + style: TextStyle( |
| 111 | + fontSize: 20, |
| 112 | + color: Colors.yellow, |
| 113 | + fontWeight: FontWeight.w900), |
| 114 | + ), |
| 115 | + ), |
| 116 | + ), //Text |
| 117 | + SizedBox( |
| 118 | + height: 18, |
| 119 | + ), //SizedBox |
| 120 | + Container( |
| 121 | + padding: const EdgeInsets.all(4), |
| 122 | + child: Text( |
| 123 | + "Developed By:", |
| 124 | + style: TextStyle(fontSize: 18, color: Colors.black87,fontWeight: FontWeight.w700), |
| 125 | + ), |
| 126 | + width: double.infinity, |
| 127 | + ), |
| 128 | + Container( |
| 129 | + padding: const EdgeInsets.all(4), |
| 130 | + child: Text( |
| 131 | + "Vijeth P H, Sathya M, Shashank Ashok Gadavi & Sagar V", |
| 132 | + style: TextStyle(fontSize: 18, color: Colors.amber), |
| 133 | + ), |
| 134 | + width: double.infinity, |
| 135 | + ), |
| 136 | + SizedBox( |
| 137 | + height: 10, |
| 138 | + ), //SizedBox |
| 139 | + Container( |
| 140 | + padding: const EdgeInsets.all(4), |
| 141 | + child: Text( |
| 142 | + "App Commands:", |
| 143 | + style: TextStyle(fontSize: 18, color: Colors.black87,fontWeight: FontWeight.w700), |
| 144 | + ), |
| 145 | + width: double.infinity, |
| 146 | + ), |
| 147 | + Container( |
| 148 | + padding: const EdgeInsets.all(4), |
| 149 | + child: Text( |
| 150 | + "1. Recognize Face\n2. Detect Objects\n3. Read Text\n4. Send My Location\n5. Translate <sentence> to <language>\n6. Video Call", |
| 151 | + style: TextStyle(fontSize: 18, color: Colors.white), |
| 152 | + ), |
| 153 | + width: double.infinity, |
| 154 | + ), //Text |
| 155 | + ], |
| 156 | + ), //Column |
| 157 | + ), //Padding |
| 158 | + ), //SizedBox |
| 159 | + ), |
| 160 | + ), //Card |
| 161 | + ), //Center |
| 162 | + //Scaffold |
| 163 | + ); |
| 164 | + } |
| 165 | +} |
0 commit comments