quixxi 0.0.1
quixxi: ^0.0.1 copied to clipboard
Flutter plugin for adding SSL Pinning to application, Prevent copy and paste inside the application.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:quixxi/services.dart';
import 'package:quixxi_shield_plugin_example/view/dashboard_view.dart';
import 'package:quixxi_shield_plugin_example/view/launch_view.dart';
import 'package:quixxi_shield_plugin_example/view/ssl_pinning_bypass_view.dart';
import 'package:quixxi_shield_plugin_example/view/txtfields_view.dart';
import 'helper/AppConstants/app_constants.dart';
import 'helper/CustomColors/custom_colors.dart';
import 'helper/RouteHelper/route_helper.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _PiningSslData {
String serverURL = '';
Map<String, String> headerHttp = {};
String allowedSHAFingerprint = '';
int timeout = 0;
SHA? sha;
}
class _MyAppState extends State<MyApp> {
String _platformVersion = '1.0';
final _quixxiShieldPlugin = QuixxiShieldPlugin();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final _PiningSslData _data = _PiningSslData();
final _messengerKey = GlobalKey<ScaffoldMessengerState>();
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
// We also handle the message potentially returning null.
try {
platformVersion =
await _quixxiShieldPlugin.getPlatformVersion() ?? 'Unknown platform version';
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
setState(() {
_platformVersion = platformVersion;
});
}
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: AppConstants.appName,
theme: ThemeData(
useMaterial3: false,
colorScheme: ColorScheme.fromSeed(
seedColor: CustomColors.themeColor,
brightness: Brightness.light,
),
),
debugShowCheckedModeBanner: false,
initialRoute: '/',
routes: {
'/': (context) => const LaunchView(),
RouteHelper.dashboardScreen: (context) => const DashboardScreen(),
RouteHelper.txtFieldsScreen: (context) => const TxtFieldsScreen(),
RouteHelper.sslPinningScreen: (context) => const SSLPinningScreen(),
},
);
}
}