nova_avx 1.0.0
nova_avx: ^1.0.0 copied to clipboard
A Flutter package for QR code scanning and product authentication with image quality analysis.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:nova_avx/nova_avx.dart';
void main() {
// Configure the API before running the app
NovaAvxConfig.configureApi(
baseUrl: 'https://9ahp0tc529.execute-api.ap-south-1.amazonaws.com/dev',
timeoutSeconds: 50,
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Nova AVX Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF2196F3), // Blue primary color
brightness: Brightness.light,
),
useMaterial3: true,
scaffoldBackgroundColor: const Color(0xFFF3F8FF), // Light blue background
appBarTheme: const AppBarTheme(
backgroundColor: Color(0xFF2196F3),
foregroundColor: Colors.white,
elevation: 0,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2196F3),
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
home: const MyHomePage(title: 'Nova AVX Example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: const Color(0xFF2196F3), // Blue primary color
foregroundColor: Colors.white,
title: Text(widget.title),
elevation: 0,
),
body: Container(
decoration: const BoxDecoration(
color: Color(0xFFF3F8FF), // Light blue background
),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Icon(
Icons.qr_code_scanner,
size: 100,
color: Color(0xFF2196F3), // Blue primary color
),
const SizedBox(height: 20),
const Text(
'Nova AVX Package Example',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 10),
const Text(
'QR Code Scanning and Product Authentication',
style: TextStyle(
fontSize: 16,
color: Colors.grey,
),
),
const SizedBox(height: 40),
const Text(
'Features:',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 20),
const FeatureItem(
icon: Icons.camera_alt,
title: 'QR Code Scanning',
description: 'Advanced QR code detection with image quality analysis',
),
const FeatureItem(
icon: Icons.verified,
title: 'Product Authentication',
description: 'Verify product authenticity using ML models',
),
const FeatureItem(
icon: Icons.analytics,
title: 'Image Quality Analysis',
description: 'Low light detection and sharpness analysis',
),
const SizedBox(height: 40),
ElevatedButton.icon(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CameraScreen(),
),
);
},
icon: const Icon(Icons.qr_code_scanner),
label: const Text('Start QR Scanning'),
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
),
textStyle: const TextStyle(fontSize: 18),
),
),
const SizedBox(height: 20),
const Text(
'Tap the button above to start the QR scanning process',
style: TextStyle(
fontSize: 14,
color: Colors.grey,
),
textAlign: TextAlign.center,
),
],
),
),
),
);
}
}
class FeatureItem extends StatelessWidget {
final IconData icon;
final String title;
final String description;
const FeatureItem({
super.key,
required this.icon,
required this.title,
required this.description,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Row(
children: [
Icon(
icon,
color: const Color(0xFF2196F3), // Blue primary color
size: 24,
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
Text(
description,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
),
),
],
),
),
],
),
);
}
}