View main.dart
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'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
static const String _title = 'Flutter Code Sample'; | |
@override |
View blockquote-basic.dart
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
BlockQuote( | |
child: | |
Text( | |
'Lorem ipsum dolor sit amet, is the best place to hide a text.', | |
textAlign: TextAlign.justify, | |
), | |
), |
View blockquote-options.dart
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
BlockQuote( | |
outerPadding: const EdgeInsets.all(20), | |
blockColor: Colors.blueAccent, | |
blockWidth: 5, | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: [ | |
Text( | |
'Lorem ipsum dolor sit amet, is the best place to hide a text.', | |
textAlign: TextAlign.justify, |
View db-crud.php
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
<?php | |
require_once __DIR__ . '/response.php'; | |
require_once __DIR__ . '/db.php'; | |
class CRUD | |
{ | |
private $db; | |
public function __construct() |
View check-request.php
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
<?php | |
function err($err) | |
{ | |
$res['state'] = false; | |
$res['err'] = $err; | |
echo json_encode($res); | |
die(); | |
} |
View permission.dart
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; | |
} |
View date_format.dart
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), |
View request.dart
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 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
const String _host = "https://<....>"; | |
class MyRequest { | |
final String url; | |
final Map<String, String> headers = {'Authorization': 'Bearer token'}; |
View responsive_ui_demo.dart
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( |
View snacky-bar.dart
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); | |
} |
NewerOlder