Skip to content

Instantly share code, notes, and snippets.

View omarzer0's full-sized avatar
🏠
Working from home

Omar AZ omarzer0

🏠
Working from home
View GitHub Profile
fun Activity.changeStatusAndNavigationBarVisibility(
hideStatusBar: Boolean = true,
hideNavigationBar: Boolean = true,
) {
// if (Build.VERSION.SDK_INT >= 30) {
// rootView.windowInsetsController?.hide(WindowInsets.Type.statusBars() or WindowInsets.Type.navigationBars())
// } else {
// rootView.systemUiVisibility = View.SYSTEM_UI_FLAG_LOW_PROFILE or
// View.SYSTEM_UI_FLAG_FULLSCREEN or
// View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
@omarzer0
omarzer0 / shared_pref.dart
Created February 9, 2023 15:35
shared preferences
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: QuranScreen(),
),
);
@omarzer0
omarzer0 / main.dart
Created February 2, 2023 16:04
Files Files
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
void main() {
runApp(
MaterialApp(
@omarzer0
omarzer0 / Screen.dart
Created January 12, 2023 16:04
Sqlfilte session
import 'package:flutter/material.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: TestBB(),
));
}
@omarzer0
omarzer0 / network2.dart
Created December 22, 2022 15:41
async await
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
// Uri uri1 = Uri.parse('https://example.com/whatsit/create');
// http.get(uri1).then((value) => print(value.statusCode));
// Uri uri2 = Uri.parse('https://jsonplaceholder.typicode.com/albums/1');
// http.get(uri2).then((value) => print(value.statusCode));
import 'package:another_flushbar/flushbar.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
showSemanticsDebugger: false,
home: LoginScreen(),
),
);
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: Screen(),
),
);
}
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: Screen()));
}
class Screen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
import 'package:http/http.dart' as http;
void main(){
// Uri uri1 = Uri.parse('https://example.com/whatsit/create');
// http.get(uri1).then((value) => print(value.statusCode));
// Uri uri2 = Uri.parse('https://jsonplaceholder.typicode.com/albums/1');
// http.get(uri2).then((value) => print(value.statusCode));
@omarzer0
omarzer0 / passwordStrengthTask.dart
Created October 27, 2022 16:42
Measure passwords strength task of flutter sessions at Roqay
import 'dart:convert';
import 'dart:io';
void main() {
var pass = stdin.readLineSync(encoding: utf8) ?? "";
getPasswordStrength(pass);
}
void getPasswordStrength(String pass) {