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
// Url Launcher ... | |
url_launcher: ^0.4.2 | |
// Permission Handler... | |
permission_handler: ^3.2.1+1 | |
// Device & Package Info... | |
device_info: ^0.1.2 | |
package_info: ^0.4.0+6 |
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:convert' show utf8, base64; | |
main() { | |
final str = 'https://dartpad.dartlang.org/'; | |
final encoded = base64.encode(UTF8.encode(str)); | |
print('base64: $encoded'); | |
final str2 = utf8.decode(base64.decode(encoded)); |
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
Initiate passwordVisible to false in initState() | |
@override | |
void initState() { | |
passwordVisible = false; | |
} | |
Following is the TextFormField widget : | |
TextFormField( |
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
//// Using Device Info Package................ | |
Future<String> _getId() async { | |
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); | |
if (Theme.of(context).platform == TargetPlatform.iOS) { | |
IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo; | |
return iosDeviceInfo.identifierForVendor; // unique ID on iOS | |
} else { | |
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo; | |
return androidDeviceInfo.androidId; // unique ID on Android |
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/foundation.dart' show TargetPlatform; | |
//... | |
if(Theme.of(context).platform == TargetPlatform.android) | |
//do sth for Android | |
else if(Theme.of(context).platform == TargetPlatform.iOS) | |
//do sth else for iOS | |
else if(Theme.of(context).platform == TargetPlatform.fuchsia) |
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
public abstract class BaseAdapter<D> extends RecyclerView.Adapter<BaseViewHolder> { | |
public static final int VIEW_TYPE_ITEM = 1; | |
public static final int VIEW_TYPE_FOOTER = 2; | |
protected ArrayList<D> dataList; | |
protected Context context; | |
protected LayoutInflater layoutInflater; |
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
public String getAssetJsonData(Context context, String jsonFileName) { | |
String json = null; | |
try { | |
InputStream is = context.getAssets().open(jsonFileName + ".json"); | |
int size = is.available(); | |
byte[] buffer = new byte[size]; | |
is.read(buffer); | |
is.close(); | |
json = new String(buffer, "UTF-8"); |
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 UIKit | |
protocol SSAdapterDelegate { | |
func willDisplay(cell: UITableViewCell, indexPath: IndexPath) | |
func didSelected(indexPath: IndexPath) | |
func hasNextPage()->Bool | |
func isLoadingFooterAdded()->Bool | |
func loadMoreData() | |
func refreshTableData() |
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 UIKit | |
import SafariServices | |
class AppUtils: NSObject { | |
private override init() {} | |
public static let shared: AppUtils = AppUtils() | |
func showSafariVc(in vc: UIViewController, for url: String){ |