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 com.android.build.api.dsl.ApplicationExtension | |
import com.android.build.api.dsl.CommonExtension | |
import com.android.build.api.dsl.LibraryExtension | |
allprojects { | |
repositories { | |
mavenLocal() | |
google() | |
mavenCentral() | |
} |
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
package com.example.centralized_login | |
import android.accounts.Account | |
import android.accounts.AccountManager | |
import android.app.Activity | |
import android.content.Intent | |
import android.os.* | |
import androidx.annotation.NonNull | |
import io.flutter.embedding.engine.plugins.FlutterPlugin | |
import io.flutter.embedding.engine.plugins.activity.ActivityAware |
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 Flutter | |
import UIKit | |
import KeychainSwift | |
import Security | |
public class CentralizedLoginPlugin: NSObject, FlutterPlugin { | |
private var channel: FlutterMethodChannel? | |
public static func register(with registrar: FlutterPluginRegistrar) { | |
let channel = FlutterMethodChannel(name: "centralizedloginchannel", binaryMessenger: registrar.messenger()) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<account-authenticator | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:accountType="enter_accounttype" | |
android:icon="@mipmap/ic_launcher" | |
android:smallIcon="@mipmap/ic_launcher" | |
android:label="@string/account_label" /> |
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
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> | |
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> | |
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> | |
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> | |
//Not sure if application still work after removing permission// | |
//application | |
//Add service to add account | |
<service android:name=".AuthenticatorService" android:exported="false"> |
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:async'; | |
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
Future<List<Author>> fetchData() async { | |
final response = await http.get(Uri.parse( | |
'https://raw.githubusercontent.com/SudipZluck/pod_player/master/test.json')); | |
if (response.statusCode == 200) { | |
// If the server did return a 200 OK response, |
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
class CardRegExp { | |
/// Checks if string is American Express. | |
static bool isAmericanExpress(String s) => | |
hasMatch(s, r"^([3]+([4]|[7]))+[0-9]{13,13}$"); | |
/// Checks if string is Visa. | |
static bool isVisa(String s) => | |
hasMatch(s, r"^[4]+([0-9]{12,12}|[0-9]{15,15})$"); | |
/// Checks if string is MasterCard. |