@@ -91,40 +91,40 @@ class _CameraScreenState extends State<CameraScreen> {
9191 return BackdropFilter (
9292 filter: ImageFilter .blur (sigmaX: 6 , sigmaY: 6 ),
9393 child: AlertDialog (
94- title: Text ('Pilih Bahasa' ),
94+ title: const Text ('Pilih Bahasa' ),
9595 content: SingleChildScrollView (
9696 child: Column (
9797 children: [
9898 ListTile (
99- title: Text ('English, Indonesia, dll' ),
99+ title: const Text ('English, Indonesia, dll' ),
100100 onTap: () {
101101 Navigator .pop (context);
102102 _changeLanguage (TextRecognitionScript .latin);
103103 },
104104 ),
105105 ListTile (
106- title: Text ('Chinese' ),
106+ title: const Text ('Chinese' ),
107107 onTap: () {
108108 Navigator .pop (context);
109109 _changeLanguage (TextRecognitionScript .chinese);
110110 },
111111 ),
112112 ListTile (
113- title: Text ('Devanagari' ),
113+ title: const Text ('Devanagari' ),
114114 onTap: () {
115115 Navigator .pop (context);
116116 _changeLanguage (TextRecognitionScript .devanagiri);
117117 },
118118 ),
119119 ListTile (
120- title: Text ('Japanese' ),
120+ title: const Text ('Japanese' ),
121121 onTap: () {
122122 Navigator .pop (context);
123123 _changeLanguage (TextRecognitionScript .japanese);
124124 },
125125 ),
126126 ListTile (
127- title: Text ('Korean' ),
127+ title: const Text ('Korean' ),
128128 onTap: () {
129129 Navigator .pop (context);
130130 _changeLanguage (TextRecognitionScript .korean);
@@ -148,16 +148,16 @@ class _CameraScreenState extends State<CameraScreen> {
148148 child: Wrap (
149149 children: [
150150 ListTile (
151- leading: Icon (Icons .photo_library),
152- title: Text ('Dari Galeri' ),
151+ leading: const Icon (Icons .photo_library),
152+ title: const Text ('Dari Galeri' ),
153153 onTap: () {
154154 Navigator .pop (context);
155155 _pickImageFromGallery ();
156156 },
157157 ),
158158 ListTile (
159- leading: Icon (Icons .photo_camera),
160- title: Text ('Ambil Foto' ),
159+ leading: const Icon (Icons .photo_camera),
160+ title: const Text ('Ambil Foto' ),
161161 onTap: () {
162162 Navigator .pop (context);
163163 _pickImageFromCamera ();
@@ -269,7 +269,7 @@ class _CameraScreenState extends State<CameraScreen> {
269269 @override
270270 Widget build (BuildContext context) {
271271 if (! _controller.value.isInitialized) {
272- return Scaffold (
272+ return const Scaffold (
273273 body: Center (child: CircularProgressIndicator ()),
274274 );
275275 }
@@ -279,37 +279,37 @@ class _CameraScreenState extends State<CameraScreen> {
279279 actions: [
280280 DropdownButton <TextRecognitionScript >( //* Dropdown button untuk pilihan bahasa
281281 value: _currentScript,
282- icon: Icon (Icons .language, color: Colors .black),
282+ icon: const Icon (Icons .language, color: Colors .black),
283283 dropdownColor: Colors .blue,
284284 onChanged: (TextRecognitionScript ? newScript) {
285285 if (newScript != null ) {
286286 _changeLanguage (newScript);
287287 }
288288 },
289289 items: [
290- DropdownMenuItem (
290+ const DropdownMenuItem (
291291 value: TextRecognitionScript .latin,
292292 child: Text ('Latin' , style: TextStyle (color: Colors .black)),
293293 ),
294- DropdownMenuItem (
294+ const DropdownMenuItem (
295295 value: TextRecognitionScript .chinese,
296296 child: Text ('Chinese' , style: TextStyle (color: Colors .black)),
297297 ),
298- DropdownMenuItem (
298+ const DropdownMenuItem (
299299 value: TextRecognitionScript .devanagiri,
300300 child: Text ('Devanagiri' , style: TextStyle (color: Colors .black)),
301301 ),
302- DropdownMenuItem (
302+ const DropdownMenuItem (
303303 value: TextRecognitionScript .japanese,
304304 child: Text ('Japanese' , style: TextStyle (color: Colors .black)),
305305 ),
306- DropdownMenuItem (
306+ const DropdownMenuItem (
307307 value: TextRecognitionScript .korean,
308308 child: Text ('Korean' , style: TextStyle (color: Colors .black)),
309309 ),
310310 ],
311311 ),
312- SizedBox (width: 20 ),
312+ const SizedBox (width: 20 ),
313313 ],
314314 ),
315315 body: Column (
@@ -321,19 +321,19 @@ class _CameraScreenState extends State<CameraScreen> {
321321 Expanded (
322322 flex: 1 ,
323323 child: Container (
324- padding: EdgeInsets .all (16 ),
324+ padding: const EdgeInsets .all (16 ),
325325 child: SingleChildScrollView (
326326 child: Text (
327327 _recognizedText,
328- style: TextStyle (fontSize: 16 ),
328+ style: const TextStyle (fontSize: 16 ),
329329 ),
330330 ),
331331 ),
332332 ),
333333 ],
334334 ),
335335 floatingActionButton: Padding (
336- padding: EdgeInsets .only (left: 30 ),
336+ padding: const EdgeInsets .only (left: 30 ),
337337 child: Row (
338338 mainAxisAlignment: MainAxisAlignment .center,
339339 children: [
@@ -342,20 +342,20 @@ class _CameraScreenState extends State<CameraScreen> {
342342 backgroundColor: _isProcessing ? Colors .grey: Colors .blue,
343343 elevation: 20 , // biar ada shadow effect pada icon
344344 child: _isProcessing
345- ? CircularProgressIndicator (color: Colors .white)
346- : Icon (Icons .camera)
345+ ? const CircularProgressIndicator (color: Colors .white)
346+ : const Icon (Icons .camera)
347347 ),
348- SizedBox (width: 20 ),
348+ const SizedBox (width: 20 ),
349349 FloatingActionButton (
350350 onPressed: _showImageSourceSelection,
351351 backgroundColor: Colors .green,
352- child: Icon (Icons .photo_library)
352+ child: const Icon (Icons .photo_library)
353353 ),
354- SizedBox (width: 20 ),
354+ const SizedBox (width: 20 ),
355355 FloatingActionButton (
356356 onPressed: _showLanguageSelection,
357357 backgroundColor: Colors .orange,
358- child: Icon (Icons .language)
358+ child: const Icon (Icons .language)
359359 ),
360360 ],
361361 ),
0 commit comments