Skip to main content

Posts

Full Screenshot in Webview flutter

  import 'dart:convert' ; import 'dart:io' ; import 'dart:typed_data' ; import 'package:flutter/material.dart' ; import 'package:flutter_inappwebview/flutter_inappwebview.dart' ; import 'package:path_provider/path_provider.dart' ; class InAppWebViewExampleScreen extends StatefulWidget { @override _InAppWebViewExampleScreenState createState () => new _InAppWebViewExampleScreenState (); } class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { late InAppWebViewController webView ; late Uint8List screenshotBytes ; @override void initState () { super .initState(); } @override void dispose () { super .dispose(); } @override Widget build (BuildContext context) { return Scaffold ( appBar: AppBar (title: Text ( "InAppWebView" )), body: Container ( child: Column (children: <Widget>[ Expanded ( child: InApp...

How to be a better salesperson

 ## Preparation: - Making the product good. - Gathering social proof. (Reviews, testimonials, case studies etc) - Free trial, low risk project, commission based. ## Emotion: - Dream or Fear. - Only works after preparation. ## Urgency/ Scarcity: - Price increasing to 5k tommorow. (1k current price) - Due to high demand, only 5 spots left! (1 spot filling out every minute)

which is better pdo or mysqli

 which is better pdo or mysqli The choice between PDO (PHP Data Objects) and MySQLi (MySQL Improved) largely depends on your specific needs and preferences for interacting with a database in PHP. Both are widely used for database interactions, but each has its strengths. Here’s a comparison of the two: 1. Database Support: PDO: Supports multiple database types (MySQL, PostgreSQL, SQLite, Oracle, etc.), making it more versatile if you plan to switch databases in the future. MySQLi: Specifically designed for MySQL databases. If you are only using MySQL and want to take full advantage of MySQL-specific features, MySQLi might be a better choice. 2. API Style: PDO: Object-oriented and supports both named and positional placeholders in prepared statements, which can help prevent SQL injection. MySQLi: Offers both an object-oriented and a procedural interface. This gives you flexibility based on your coding preferences. 3. Prepared Statements: PDO: Fully supports prepared statement...

API security best practices

 API with a focus on security best practices : Key Security Practices Included: Input Validation and Sanitization : All inputs are validated and sanitized to prevent SQL injection and other attacks. Prepared Statements : All database queries use prepared statements to avoid SQL injection. Password Hashing : Passwords are hashed using password_hash() and verified using password_verify() . Token-Based Authentication : JSON Web Tokens (JWTs) are used for secure API authentication. Error Hiding : Error details are logged but not exposed to users in production. Strict Content-Type Header : Ensures only JSON payloads are processed. Rate Limiting and Throttling : Optional mechanisms to prevent abuse. Validation for IDs : Integer inputs (like user_id or exam_id ) are explicitly validated.

Flutter Interview Questions

 If I use counter not within a class & used in multiple screen then It will be part of app state or not give me ans ChatGPT said: ChatGPT If you use a counter variable not within a class (i.e., as a global variable ) and access it across multiple screens, it is not considered part of the app state in a formal sense, unless you are actively managing the state using a state management solution.