This file contains 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:permission_handler/permission_handler.dart'; | |
() async { | |
PermissionStatus p = await PermissionHandler() | |
.checkPermissionStatus(PermissionGroup.contacts); | |
if (p == PermissionStatus.disabled) { | |
// permission got already / success | |
return true; | |
} |
This file contains 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/material.dart'; | |
import 'package:intl/intl.dart'; | |
Future<DateTime> fetchDate(BuildContext context, | |
{DateTime initialDate, DateTime last}) async { | |
DateTime t = await showDatePicker( | |
context: context, | |
firstDate: DateTime(DateTime.now().year - 1), | |
initialDate: initialDate ?? DateTime.now(), | |
lastDate: last ?? DateTime(DateTime.now().year + 2), |
This file contains 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 ResponsiveExample extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.grey[350], | |
appBar: AppBar( | |
title: Text('Responsive Example'), | |
centerTitle: true, | |
), | |
body: Container( |
This file contains 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
//final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); | |
snackyBar(String content, GlobalKey<ScaffoldState> _scaffoldKey) { | |
final snackBar = SnackBar( | |
content: Text(content), | |
duration: const Duration(seconds: 2), | |
backgroundColor: Colors.lightBlue, | |
); | |
_scaffoldKey.currentState.showSnackBar(snackBar); | |
} |
This file contains 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
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); |
This file contains 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
webView.setDownloadListener(new DownloadListener() { | |
@Override | |
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { | |
DownloadManager.Request request = new | |
DownloadManager.Request(Uri.parse(url)); | |
request.setMimeType(mimeType); | |
//------------------------COOKIE!!------------------------ | |
String cookies = CookieManager.getInstance().getCookie(url); | |
request.addRequestHeader("cookie", cookies); |
NewerOlder