163 lines
4.5 KiB
Dart
163 lines
4.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/theme.dart';
|
|
|
|
/// Fancy input screen with OCR, voice, and camera capabilities
|
|
class InputScreen extends StatefulWidget {
|
|
const InputScreen({super.key});
|
|
|
|
@override
|
|
State<InputScreen> createState() => _InputScreenState();
|
|
}
|
|
|
|
class _InputScreenState extends State<InputScreen> {
|
|
final TextEditingController _textController = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_textController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Input'),
|
|
centerTitle: true,
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
children: [
|
|
// Main text input area
|
|
Expanded(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: AppTheme.surfaceColor,
|
|
borderRadius: BorderRadius.circular(16),
|
|
border: Border.all(
|
|
color: AppTheme.primaryColor.withOpacity(0.3),
|
|
),
|
|
),
|
|
child: TextField(
|
|
controller: _textController,
|
|
maxLines: null,
|
|
expands: true,
|
|
style: const TextStyle(
|
|
color: AppTheme.textColor,
|
|
fontSize: 16,
|
|
),
|
|
decoration: const InputDecoration(
|
|
hintText: 'Enter or capture text...',
|
|
hintStyle: TextStyle(color: Colors.grey),
|
|
border: InputBorder.none,
|
|
contentPadding: EdgeInsets.all(16),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
// Action buttons row
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
_buildActionButton(
|
|
icon: Icons.camera_alt,
|
|
label: 'Camera',
|
|
onTap: _onCameraTap,
|
|
),
|
|
_buildActionButton(
|
|
icon: Icons.document_scanner,
|
|
label: 'OCR',
|
|
onTap: _onOcrTap,
|
|
),
|
|
_buildActionButton(
|
|
icon: Icons.mic,
|
|
label: 'Voice',
|
|
onTap: _onVoiceTap,
|
|
),
|
|
_buildActionButton(
|
|
icon: Icons.send,
|
|
label: 'Send',
|
|
onTap: _onSendTap,
|
|
isPrimary: true,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildActionButton({
|
|
required IconData icon,
|
|
required String label,
|
|
required VoidCallback onTap,
|
|
bool isPrimary = false,
|
|
}) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(12),
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
decoration: BoxDecoration(
|
|
color: isPrimary ? AppTheme.primaryColor : AppTheme.surfaceColor,
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(icon, color: AppTheme.textColor),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
label,
|
|
style: const TextStyle(
|
|
color: AppTheme.textColor,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
void _onCameraTap() {
|
|
// TODO: Implement camera capture
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(content: Text('Camera - Coming soon')),
|
|
);
|
|
}
|
|
|
|
void _onOcrTap() {
|
|
// TODO: Implement OCR scanning
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(content: Text('OCR - Coming soon')),
|
|
);
|
|
}
|
|
|
|
void _onVoiceTap() {
|
|
// TODO: Implement voice input
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(content: Text('Voice input - Coming soon')),
|
|
);
|
|
}
|
|
|
|
void _onSendTap() {
|
|
final text = _textController.text.trim();
|
|
if (text.isEmpty) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(content: Text('Please enter some text')),
|
|
);
|
|
return;
|
|
}
|
|
// TODO: Implement send functionality
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(content: Text('Sending: $text')),
|
|
);
|
|
}
|
|
}
|