mca_official_inspection_sdk 0.0.1 mca_official_inspection_sdk: ^0.0.1 copied to clipboard
The Official Flutter SDK from MyCover.ai for vehicle inspection
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:mca_official_inspection_sdk/views/inspection.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final cameras = await availableCameras();
final firstCamera = cameras.first;
runApp(MyApp(
camera: firstCamera,
));
}
class MyApp extends StatelessWidget {
const MyApp({Key? key, required this.camera}) : super(key: key);
final CameraDescription camera;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHomePage(title: 'Flutter Demo Home Page', camera: camera),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title, required this.camera})
: super(key: key);
final String title;
final CameraDescription camera;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
initialiseSdk(context) {
var email = "olakunle@mycovergenius.com";
var token =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dCI6ImN1c3RvbWVyIiwiYmlkIjoiOTJlMzliYzUtNjExMC00ZGNiLTg1ODMtYmM1MGMyZTY5MjJiIiwic3ViIjoiMTVhZTY1MzQtZWUxYS00ODAzLThkMjgtYmNmNDM4ZTdlZmU4IiwicGlkcyI6WyIxMDQ4IiwiMTA1MSIsIjEwNTEiLCIxMDI2IiwiMTA0NiIsIjEwNDciLCIxMDI2IiwiMTA0OCIsIjEwNDUiLCIxMDQ5IiwiMTA0NyIsIjEwNDkiLCIxMDUwIiwiMTA1MiIsIjEwNTAiLCIxMDQ2IiwiMTA0NSIsIjEwNTIiXSwianRpIjoiMGFhN2ZkMGEtODM4Ny00Njg0LWJlYjItZjA5NWRlMzNmOGNkIiwiaWF0IjoxNjY4NzEzNjg4LCJleHAiOjE2Njg3MjYwMDB9.5QKatQRP4_MGmq4_uewAbE3eA6QkUvUaUR7YuzA9KmY";
final mycover = MyCoverInspection(
context: context,
email: email,
token: token,
camera: widget.camera,
providerId: '',
distributorId: '',
customerId: '',
productId: '',
policyId: '52e66198-0028-4958-80b5-1cb9c5a8ca73',
typeOfInspection: InspectionType.preClaim);
mycover.initialise();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(widget.title)),
body: const Center(child: Text('Click the FAB to Inspect')),
floatingActionButton: FloatingActionButton(
onPressed: () => initialiseSdk(context),
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}