This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return MaterialApp( | |
title: 'Flutter App', | |
builder: (context, widget) { | |
ErrorWidget.builder = (FlutterErrorDetails errorDetails) { | |
return CustomErrorWidget(errorDetails: errorDetails); | |
}; | |
return widget ?? const Scaffold(); | |
}, | |
... | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; | |
Future<void> secureStorageActions() async { | |
// Create storage | |
const storage = FlutterSecureStorage(); | |
// Read value | |
String? value = await storage.read(key: 'key'); | |
// Read all values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:http/io_client.dart'; | |
Future<SecurityContext> get globalContext async { | |
final sslCert = await rootBundle.load('assets/certs/ryandsilva-dev.pem'); | |
final sc = SecurityContext(withTrustedRoots: false); | |
sc.setTrustedCertificatesBytes(sslCert.buffer.asInt8List()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="dev.ryandsilva.flutter_app"> | |
<application | |
android:label="flutter_app" | |
android:name="${applicationName}" | |
android:icon="@mipmap/ic_launcher" | |
android:networkSecurityConfig="@xml/security_config"> | |
... | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>ryandsilva.dev</key> | |
<dict> | |
<!--Include to allow subdomains--> | |
<key>NSIncludesSubdomains</key> | |
<true/> | |
<!--Include to allow HTTP requests--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter_jailbreak_detection/flutter_jailbreak_detection.dart'; | |
Future<bool> checkJailbrokenOrRooted() async { | |
bool jailbrokenOrRooted = true; | |
try { | |
if (Platform.isAndroid) { | |
jailbrokenOrRooted = await FlutterJailbreakDetection.developerMode; |
OlderNewer