Snippets Collections
https://webapp.diawi.com/install/U1m5Zb
class fontstyle {
  static FontWeight? Fontweights({FWT fontWeight = FWT.regular}) {
    switch (FWT) {
      case FWT.bold:
        return FontWeight.w700;
      case FWT.semiBold:
        return FontWeight.w600;
      case FWT.medium:
        return FontWeight.w500;
      case FWT.regular:
        return FontWeight.w400;
      case FWT.light:
        return FontWeight.w300;
      default:
        return FontWeight.w400;
    }
  }

  static TextStyle f14(
      {required Color colors, FWT? fontweight, double height = 0.0}) {
    return TextStyle(
        fontSize: 14.sp,
        fontFamily: "Poppins",
        fontWeight: Fontweights(fontWeight: fontweight!),
        color: Colors.amberAccent);
  }

  static TextStyle f12(
      {required Color colors, FWT? fontweight, double height = 0.0}) {
    return TextStyle(
        fontSize: 12.sp,
        fontFamily: "Poppins",
        fontWeight: Fontweights(fontWeight: fontweight!),
        color: Colors.amberAccent);
  }
}
class Splashbinding extends Bindings {
  @override
  void dependencies() {
    Get.put<SplashController>(SplashController());
    Get.lazyPut(() => SignupController());
  }
}
      
////////////////////////

final SharedPreferences pref =
                                        await SharedPreferences.getInstance();
                                    pref.setString("email",
                                        model.Login_Emailcontroller.value.text);

////////////
class SplashController extends GetxController
    with GetSingleTickerProviderStateMixin {
  @override
  void onInit() {
    super.onInit();
    Future.delayed(
      const Duration(seconds: 2),
      () async {
        final SharedPreferences pref = await SharedPreferences.getInstance();
        final u = pref.get("email");
        u != null ? Get.toNamed("/HomeScreen") : Get.toNamed("loginScreen");
      },
    );
  }
}

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;

class Errorpage extends StatefulWidget {
  const Errorpage({super.key});

  @override
  State<Errorpage> createState() => _ErrorpageState();
}

class _ErrorpageState extends State<Errorpage> {
  @override
  void initState() {
    super.initState();
    getval2();
    Data1;
  }

  bool? Data1;
  Future<void> getval2() async {
    try {
      final res = await http.get(Uri.parse("https://reqres.in/api/users/23"));

      if (res.statusCode == 404) {
        setState(() {
          Data1 = false;
        });
        print(Data1);
      }
    } catch (e) {
      print('Error fetching data: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
      child: Container(
          child: Data1 == false
              ? const Text("404 : PAGE NOT FOUND")
              : const Text("PAGE FOUND")),
    ));
  }
}
class Get1 {
  Data data;
  Support support;

  Get1({required this.data, required this.support});

  factory Get1.fromJson(Map<String, dynamic> json) => Get1(
        data: Data.fromJson(json["data"]),
        support: Support.fromJson(json["support"]),
      );

  Map<String, dynamic> toJson() => {
        "data": data.toJson(),
        "support": support.toJson(),
      };
}

class Data {
  int id;
  String email;
  String firstName;
  String lastName;
  String avatar;

  Data({
    required this.id,
    required this.email,
    required this.firstName,
    required this.lastName,
    required this.avatar,
  });

  factory Data.fromJson(Map<String, dynamic> json) => Data(
        id: json["id"],
        email: json["email"],
        firstName: json["first_name"],
        lastName: json["last_name"],
        avatar: json["avatar"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "email": email,
        "first_name": firstName,
        "last_name": lastName,
        "avatar": avatar,
      };
}

class Support {
  String url;
  String text;

  Support({
    required this.url,
    required this.text,
  });

  factory Support.fromJson(Map<String, dynamic> json) => Support(
        url: json["url"],
        text: json["text"],
      );

  Map<String, dynamic> toJson() => {
        "url": url,
        "text": text,
      };
}

/////////////////////
  
  
  
  
  
   List<Get1> Data = [];
  List<Get1> Support = [];

  @override
  void initState() {
    super.initState();
    getval();
  }

  Future<void> getval() async {
    try {
      final res = await http.get(Uri.parse("https://reqres.in/api/users/2"));
      Get1 val = Get1.fromJson(json.decode(res.body));
      setState(() {
        Data.add(val);
      });
      if (res.statusCode == 200) {
        print(Data);
      }
    } catch (e) {
      print('Error fetching data: $e');
    }
  }
  
  
  
  /////////////////////////////
  Text(
                                  "Mail : ${Data[0].data.email}",
                                  style: const TextStyle(
                                      fontSize: 20,
                                      color: Colors.white,
                                      fontWeight: FontWeight.bold),
                                ),
 Expanded(
                  child: WebView(
                    initialUrl: Data[0].support.url,
                    // "https://reqres.in/#support-heading",
                    onWebViewCreated: (WebViewController webViewController) {
                      _controller.complete(webViewController);
                    },
                    javascriptMode: JavascriptMode.unrestricted,
                    onWebResourceError: (WebResourceError error) {
                      print('----------------------: $error-----------------');
                    },
                  ),
                ),  
  
  
Step 1 : Download Link : https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download
Step 2 : Paste UnZip file in Users/Apple/Development folder.
Step 3 : add this path to .zshenv file 
export PATH=/Users/apple/development/flutter/bin:$PATH
Step 4 : Run terminal Command flutter doctor
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';

import 'api_constants.dart';
import 'api_exceptions.dart';

abstract class ApiClient {
  Future<dynamic> get(String path, {Map<String, dynamic>? params});
  Future<dynamic> post(String path, Map<String, dynamic> data);
  Future<dynamic> patch(String path, Map<String, dynamic> data);
  Future<dynamic> delete(String path);
}

class ApiClientImpl extends ApiClient {
  // final AuthLocalDataSource localDataSource; // GET TOKEN FROM LOCAL DB
  final Dio client; // FOR CREATING REQUIEST

  ApiClientImpl(this.client);

  @override
  Future get(String path, {Map<String, dynamic>? params}) async {
    // String? token = await localDataSource.getSessionId();

    final Map<String, String> header = {
      // "Authorization": "Bearer $token",
    };

    final response = await client.get(
      getPath(path, params: params),
      options: buildCacheOptions(
        const Duration(
          days: 1,
        ),
        forceRefresh: true,
        maxStale: const Duration(days: 7),
        options: Options(contentType: "application/json", headers: header),
      ),
    );

    return _errorHandler(response);
  }

  @override
  Future delete(String path) async {}

  @override
  Future patch(String path, Map<String, dynamic> data) async {}

  @override
  Future post(String path, Map<String, dynamic> data) async {}

  _errorHandler(Response response) {
    if (response.statusCode == 200) {
      return response.data;
    } else if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 401 ||
        response.statusCode == 405 ||
        response.statusCode == 500 ||
        response.statusCode == 409) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.data));

      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.data)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else {
      throw Exception(response.statusMessage);
    }
  }

  String getPath(String path, {Map<dynamic, dynamic>? params}) {
    var paramsString = '';
    if (params?.isNotEmpty ?? false) {
      params?.forEach((key, value) {
        paramsString += '&$key=$value';
      });
    }

    return '${ApiConstants.baseApiUrl}$path$paramsString';
  }
}
import 'dart:convert';
import 'dart:developer';

import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;

import '../../features/auth/data/datasources/authentication_local_data_source.dart';
import 'api_constants.dart';
import 'api_exceptions.dart';

class ApiClient {
  final AuthenticationLocalDataSource _authenticationLocalDataSource;
  final Client _client;

  ApiClient(this._client, this._authenticationLocalDataSource);

  dynamic get(String path,
      {Map<dynamic, dynamic>? filter,
      bool parse = true,
      Map<String, dynamic>? params}) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";

    var paramsString = '';
    if (filter?.isNotEmpty ?? false) {
      filter?.forEach((key, value) {
        paramsString += '&$key=$value';
      });
    }

    final pth =
        Uri.parse('${ApiConstants.baseApiUrl}$path$paramsString').replace(
      queryParameters: params,
    );

    final response = await _client.get(
      pth, //?format=json
      headers: {
        'token': '$sessionId',
        'Content-Type': 'application/json',
      },
    );

    // log("Token $sessionId path: ${pth}  Status code: ${response.statusCode}");
    // debugPrint("Get balance $pth status code ${response.statusCode} body ${response.body}");

    if (response.statusCode == 200) {
      if (parse) {
        return json.decode(utf8.decode(response.bodyBytes));
      }
      return response.body;
    } else if (response.statusCode == 400 || response.statusCode == 404 || response.statusCode == 500) {
      String msg = "unknown_error";

      var resp = jsonDecode(utf8.decode(response.bodyBytes));

      print("Response $resp");
      if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else if (resp.containsKey("error")) {
        msg = resp["error"];
      }   else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }

      print("msg $msg");
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else {
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic postPhoto(String path, {required String filename}) async {
    String? sessionId = await _authenticationLocalDataSource.getSessionId();

    log("File name $filename");

    var headers = {
      'Content-Type': 'application/json',
    };

    log("Basic $sessionId");
    if (sessionId != '') {
      print("Token $sessionId");

      headers.addAll({'Authorization': 'Bearer $sessionId'});
    }

    print("filename $filename");
    var request = http.MultipartRequest(
        'PUT', Uri.parse('${ApiConstants.baseApiUrl}$path'));
    request.files.add(await http.MultipartFile.fromPath(
      'avatar',
      filename,
    ));
    request.headers.addAll(headers);

    http.StreamedResponse response = await request.send();

    print("Status ${response.statusCode}");
    if (response.statusCode == 200) {
      print(await response.stream.bytesToString());
      return true;
    } else {
      print(response.reasonPhrase);
      return false;
    }

    // if (sessionId != '')
    //   headers.addAll({'Authorization': 'Basic YWRtaW46YWRtaW4='});

    // MultipartRequest request = http.MultipartRequest(
    //   'PUT',
    //   Uri.parse('${ApiConstants.baseApiUrl}$path'),
    // );
    // log("Zapros nachalo ${Uri.parse('${ApiConstants.baseApiUrl}$path')}");
    //
    // log("Request $request");
    //
    // request.files.add(await http.MultipartFile.fromPath("avatar", filename));
    //
    // request.headers.addAll(headers);
    //
    // log("Request: ${request}");
    //
    // http.StreamedResponse response = await request.send();
    //
    // log("REsponse status code: ${response.statusCode}");
    //
    // log(response.statusCode.toString());
    //
    // log(await response.stream.bytesToString());
    //
    // if (response.statusCode == 200) {
    //   return true;
    // } else {
    //   return false;
    // }
  }

  dynamic post(String path,
      {Map<dynamic, dynamic>? params, bool withToken = true}) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";
    Map<String, String> userHeader = {
      "Content-type": "application/json",
      "Accept": "*/*"
    };
    if (kDebugMode) {
      debugPrintThrottled("Request params: $params ");
    }
    if (sessionId != '' && withToken) {
      log("Session != null $sessionId");
      userHeader.addAll({'token': '$sessionId'});
    }

    final uri = Uri.parse(ApiConstants.baseApiUrl + path);

    log("Post uri = $uri");
    log("Post header = $userHeader");
    log("Post body =  ${jsonEncode(params)}");
    final response = await _client.post(
      uri,
      body: jsonEncode(params),
      headers: userHeader,
    );
    if (kDebugMode) {
      print("API post response: ${response.statusCode} ");
      print(utf8.decode(response.bodyBytes));
    }

    print("Response status ${response.statusCode}");
    if (response.statusCode == 200 || response.statusCode == 201) {
      // print("Everyt thing ok");
      return json.decode(utf8.decode(response.bodyBytes));
    }
    if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 405 ||
        response.statusCode == 500) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else if (response.statusCode == 404) {
      throw const ExceptionWithMessage("Not found");
    } else {
      print("Exception ${response.reasonPhrase}");
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic put(String path, {Map<dynamic, dynamic>? params}) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";
    Map<String, String> userHeader = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
    };

    if (sessionId != '') {
      userHeader.addAll({'Authorization': 'Bearer $sessionId'});
    }
    final response = await _client.put(
      getPath(path, null),
      body: jsonEncode(params),
      headers: userHeader,
    );
    if (kDebugMode) {
      print(utf8.decode(response.bodyBytes));
    }

    print("Response $path ${response.statusCode}");
    if (response.statusCode == 200 || response.statusCode == 201) {
      // print("Everyt thing ok");
      return json.decode(utf8.decode(response.bodyBytes));
    }
    if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 405) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else if (response.statusCode == 404) {
      throw const ExceptionWithMessage("Not found");
    } else {
      print("Exception ${response.reasonPhrase}");
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic deleteWithBody(String path, {Map<dynamic, dynamic>? params}) async {
    String sessionId =
        (await _authenticationLocalDataSource.getSessionId()) ?? "";
    final response = await _client.delete(
      //getPath(path, null),
      Uri.parse('${ApiConstants.baseApiUrl}$path'),

      headers: {
        'token': '$sessionId',
        // 'Content-Type': 'application/json',
      },
    );

    print("API delete response code: ${response.statusCode} ");
    print(utf8.decode(response.bodyBytes));
    if (response.statusCode == 204) {
      return {'success': true};
    } else if (response.statusCode == 200) {
      return {'success': true};
    } else if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 402 ||
        response.statusCode == 405) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else {
      throw Exception(response.reasonPhrase);
    }
  }

  Uri getPath(String path, Map<dynamic, dynamic>? params) {
    var paramsString = '';
    if (params?.isNotEmpty ?? false) {
      params?.forEach((key, value) {
        paramsString += '&$key=$value';
      });
    }

    return Uri.parse('${ApiConstants.baseApiUrl}$path$paramsString');
    // '${ApiConstants.BASE_URL}$path?api_key=${ApiConstants.API_KEY}$paramsString');
  }
}
import 'package:equatable/equatable.dart';
 
class AppError extends Equatable {
  final AppErrorType appErrorType;
  final String errorMessage;
  const AppError( {required this.appErrorType, this.errorMessage = ''});
 
  @override
  List<Object> get props => [appErrorType];
}
 
enum AppErrorType {
  api,
  network,
  database,
  unauthorised,
  sessionDenied,
  msgError,
  emailValidation
}
import 'package:equatable/equatable.dart';
 
class NoParams extends Equatable {
  @override
  List<Object> get props => [];
}
class UnauthorisedException implements Exception {}
 
class ExceptionWithMessage implements Exception {
  final String message;
  const ExceptionWithMessage(this.message);
}
import 'package:dartz/dartz.dart';
 
import '../entities/app_error.dart';
 
abstract class UseCase<Type, Params> {
  Future<Either<AppError, Type>> call(Params params);
}
import 'package:internet_connection_checker/internet_connection_checker.dart';
 
abstract class NetworkInfo {
  Stream<InternetConnectionStatus>  get connectionStream;
}
 
class NetworkInfoImpl implements NetworkInfo {
  late InternetConnectionChecker connectionChecker =
      InternetConnectionChecker();
 
  @override
  Stream<InternetConnectionStatus> get connectionStream => connectionChecker.onStatusChange;
}
import 'dart:io';
 
import 'package:dartz/dartz.dart';
 
import '../api/api_exceptions.dart';
import '../entities/app_error.dart';
 
Future<Either<AppError, T>> action<T>({required Future<T> task}) async {
  try {
    final response = await task;
 
    return Right(response);
  } on SocketException {
    return const Left(AppError(appErrorType: AppErrorType.network));
  } on UnauthorisedException {
    return const Left(AppError(appErrorType: AppErrorType.unauthorised));
  } on ExceptionWithMessage catch (e) {
    return Left(
        AppError(appErrorType: AppErrorType.msgError, errorMessage: e.message));
  } on Exception {
    return const Left(AppError(appErrorType: AppErrorType.api));
  }
}
import 'dart:io';

import 'package:dartz/dartz.dart';

import '../api/api_exceptions.dart';
import '../entities/app_error.dart';

Future<Either<AppError, T>> action<T>({required Future<T> task}) async {
  try {
    final response = await task;

    return Right(response);
  } on SocketException {
    return const Left(AppError(appErrorType: AppErrorType.network));
  } on UnauthorisedException {
    return const Left(AppError(appErrorType: AppErrorType.unauthorised));
  } on ExceptionWithMessage catch (e) {
    return Left(
        AppError(appErrorType: AppErrorType.msgError, errorMessage: e.message));
  } on Exception {
    return const Left(AppError(appErrorType: AppErrorType.api));
  }
}
class Num{
  int _x;
  
  Num(this._x);
  
  int get x => _x;
}

void main(){
 	Num num1 = Num(5);
  print(num1.x);
}
class Employee{
  String empName;
  DateTime joiningDate;
  
  Employee(this.empName, this.joiningDate);
  
  int get daysOfWork{
    return DateTime.now().difference(joiningDate).inDays;
  }
}

void main(){
  Employee m = Employee("Manish", DateTime(2023,07,12));
  print(m.daysOfWork);
}
class Employee{
  String _empName;
  double _empSalary;
  
  Employee(this._empName, this._empSalary);
  
  String get empName => _empName;
  
  set empName(String empName) {
    if(empName.length >= 3 && empName.length <= 25){
      _empName = empName;
    } else {
      print("EmpName should be of appropriate length");
    }
  } 
  
  
  double get empSalary => _empSalary;
}

void main(){
  Employee manish = Employee("Manish Basnet" , 20000);
  manish.empName = "MB";
  print(manish.empName);
  print(manish.empSalary);
}
class Employee{
  String empName;
  double empSalary;
  
  Employee(this.empName, this.empSalary);
}

void main(){
  Employee manish = Employee("Manish Basnet" , 20000);
  print(manish.empName);
  print(manish.empSalary);
}
import 'package:flutter/material.dart';

#set( $CamelCaseName = "" )
#set( $part = "" )
#foreach($part in $NAME.split("_"))
    #set( $CamelCaseName = "${CamelCaseName}$part.substring(0,1).toUpperCase()$part.substring(1).toLowerCase()" )
#end
#parse("File Header.java")
class ${CamelCaseName} extends StatelessWidget {
  const ${CamelCaseName}({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
     return Container();
  }
}
import 'package:flutter/material.dart';

#set( $CamelCaseName = "" )
#set( $part = "" )
#foreach($part in $NAME.split("_"))
    #set( $CamelCaseName = "${CamelCaseName}$part.substring(0,1).toUpperCase()$part.substring(1).toLowerCase()" )
#end
#parse("File Header.java")
class ${CamelCaseName} extends StatelessWidget {
  static route() =>
      MaterialPageRoute(builder: (context) => ${CamelCaseName}());
  const ${CamelCaseName}({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
     return Scaffold(
      body:  
       Column(
          children: [],
        ),
     
    );
  }
}
import 'package:flutter/material.dart';

class Application extends StatelessWidget {
  const Application({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: YourScreen(),
    );
  }
}
import 'dart:convert';
import 'dart:developer';

import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;

import '../../features/auth/data/datasources/authentication_local_data_source.dart';
import 'api_constants.dart';
import 'api_exceptions.dart';

class ApiClient {
  final AuthenticationLocalDataSource _authenticationLocalDataSource;
  final Client _client;

  ApiClient(this._client, this._authenticationLocalDataSource);

  dynamic get(String path,
      {Map<dynamic, dynamic>? filter,
      bool parse = true,
      Map<String, dynamic>? params}) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";

    var paramsString = '';
    if (filter?.isNotEmpty ?? false) {
      filter?.forEach((key, value) {
        paramsString += '&$key=$value';
      });
    }

    final pth =
        Uri.parse('${ApiConstants.baseApiUrl}$path$paramsString').replace(
      queryParameters: params,
    );

    debugPrint("Pth $pth");

    final header = {
      'Authorization': sessionId,
      'Content-Type': 'application/json',
    };

    final response = await _client.get(
      pth, //?format=json
      headers: header,
    );

    // log("Token $sessionId path: ${pth}  header $header Status code: ${response.statusCode}");
    // debugPrint("Get balance $pth status code ${response.statusCode} body ${response.body}");

    if (response.statusCode == 200) {
      if (parse) {
        return json.decode(utf8.decode(response.bodyBytes));
      }
      return response.body;
    } else if (response.statusCode == 400 || response.statusCode == 404) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else {
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic postPhoto({
    required List<int> fileBytes,
    required String userId,
    required String role,
  }) async {
    String? sessionId = await _authenticationLocalDataSource.getSessionId();

    var headers = {
      'Content-Type': 'multipart/form-data',
    };

    if (sessionId != '') {
      headers.addAll({'Authorization': '$sessionId'});
    }

    var request = http.MultipartRequest(
      'POST',
      Uri.parse(
        "${ApiConstants.baseApiUrl}${ApiConstants.uploads}",
      ),
    );

    final avatar = http.MultipartFile.fromBytes(
      'avatar',
      fileBytes,
      filename: 'avatar.png',
    );
    // Добавляем файл в запрос
    request.files.add(
      avatar,
    );

    // Добавляем параметры в тело запроса
    // request.fields['avatar'] = avatar;
    request.fields['userId'] = userId;
    request.fields['path'] = role;

    request.headers.addAll(headers);

    try {
      final response = await request.send();

      debugPrint("message ${response.request}");
      debugPrint("Status ${response.statusCode}");

      if (response.statusCode == 200) {
        debugPrint(await response.stream.bytesToString());
        return true;
      } else {
        debugPrint(response.reasonPhrase);
        return false;
      }
    } catch (error) {
      debugPrint("Error: $error");
      return false;
    }
  }

  dynamic post(
    String path, {
    Map<dynamic, dynamic>? params,
    bool withToken = true,
  }) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";
    Map<String, String> userHeader = {
      "Content-type": "application/json",
      "Accept": "*/*"
    };
    if (kDebugMode) {
      debugPrintThrottled("Request params: $params ");
    }
    if (sessionId != '' && withToken) {
      log("Session != null $sessionId");
      userHeader.addAll({
        'Authorization': ' $sessionId',
      });
    }

    final uri = Uri.parse(ApiConstants.baseApiUrl + path);

    log("Post uri = $uri");
    log("Post header = $userHeader");
    debugPrint("Post body =  ${jsonEncode(params)}");
    final response = await _client.post(
      uri,
      body: jsonEncode(params),
      headers: userHeader,
    );
    if (kDebugMode) {
      debugPrint("API post response: ${response.statusCode} ");
      debugPrint(utf8.decode(response.bodyBytes));
    }

    debugPrint("Response status ${response.statusCode}");
    if (response.statusCode == 200 || response.statusCode == 201) {
      // debugPrint("Everyt thing ok");
      return json.decode(utf8.decode(response.bodyBytes));
    }
    if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 405 ||
        response.statusCode == 500 || response.statusCode == 409) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else if (response.statusCode == 404) {
      throw const ExceptionWithMessage("Not found");
    } else {
      debugPrint("Exception ${response.reasonPhrase}");
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic patch(String path, {Map<dynamic, dynamic>? params}) async {
    String sessionId =
        await _authenticationLocalDataSource.getSessionId() ?? "";
    Map<String, String> userHeader = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
    };

    if (sessionId != '') {
      userHeader.addAll({'Authorization': sessionId});
    }

    final pth = getPath(path, null);
    debugPrint("Path $pth");
    final response = await _client.patch(
      pth,
      body: jsonEncode(params),
      headers: userHeader,
    );
    if (kDebugMode) {
      debugPrint(utf8.decode(response.bodyBytes));
    }

    debugPrint("Response $path ${response.statusCode}");
    if (response.statusCode == 200 || response.statusCode == 201) {
      // debugPrint("Everyt thing ok");
      return json.decode(utf8.decode(response.bodyBytes));
    }
    if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 405) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else if (response.statusCode == 404) {
      throw const ExceptionWithMessage("Not found");
    } else {
      debugPrint("Exception ${response.reasonPhrase}");
      throw Exception(response.reasonPhrase);
    }
  }

  dynamic deleteWithBody(String path, {Map<dynamic, dynamic>? params}) async {
    String sessionId =
        (await _authenticationLocalDataSource.getSessionId()) ?? "";
    final response = await _client.delete(
      //getPath(path, null),
      Uri.parse('${ApiConstants.baseApiUrl}$path'),

      headers: {
        'Authorization': ' $sessionId',

        // 'Content-Type': 'application/json',
      },
    );

    debugPrint("API delete response code: ${response.statusCode} ");
    debugPrint(utf8.decode(response.bodyBytes));
    if (response.statusCode == 204) {
      return {'success': true};
    } else if (response.statusCode == 200) {
      return {'success': true};
    } else if (response.statusCode == 400 ||
        response.statusCode == 403 ||
        response.statusCode == 402 ||
        response.statusCode == 405) {
      String msg = "unknown_error";
      var resp = jsonDecode(utf8.decode(response.bodyBytes));
      if (resp.containsKey("error")) {
        msg = resp["error"];
      } else if (resp.containsKey("message")) {
        var rsp = resp["message"];
        if (rsp.runtimeType == String) msg = resp["message"];
        if (rsp.runtimeType == List) msg = rsp[0];
      } else {
        msg = utf8
            .decode(response.bodyBytes)
            .replaceAll("[", '')
            .replaceAll("]", '')
            .replaceAll("}", '')
            .replaceAll("{", '')
            .replaceAll("\\", '');
      }
      throw ExceptionWithMessage(msg);
    } else if (response.statusCode == 401) {
      throw UnauthorisedException();
    } else {
      throw Exception(response.reasonPhrase);
    }
  }

  Uri getPath(String path, Map<dynamic, dynamic>? params) {
    var paramsString = '';
    if (params?.isNotEmpty ?? false) {
      params?.forEach((key, value) {
        paramsString += '&$key=$value';
      });
    }

    return Uri.parse('${ApiConstants.baseApiUrl}$path$paramsString');
    // '${ApiConstants.BASE_URL}$path?api_key=${ApiConstants.API_KEY}$paramsString');
  }
}

// ================ DIO ================ //
//
// import 'dart:convert';
// import 'dart:developer';
//
// import 'package:dio/dio.dart';
// import 'package:dio_http_cache/dio_http_cache.dart';
// import 'package:flutter/foundation.dart';
//
// import '../../features/auth/data/datasources/authentication_local_data_source.dart';
// import 'api_constants.dart';
// import 'api_exceptions.dart';
//
// class ApiClient {
//   final AuthenticationLocalDataSource _authenticationLocalDataSource;
//   final Dio _dio;
//
//   ApiClient(this._dio, this._authenticationLocalDataSource) {
//     _dio.interceptors.add(
//       InterceptorsWrapper(
//         onRequest: (options, handler) async {
//           // options.headers.addAll({
//           //   'Content-Type': 'application/json',
//           // });
//           return handler.next(options);
//         },
//       ),
//     );
//
//     _dio.interceptors.add(
//       DioCacheManager(CacheConfig(
//               baseUrl: ApiConstants.baseApiUrl,
//               defaultMaxAge: const Duration(days: 3),
//               defaultMaxStale: const Duration(days: 5)))
//           .interceptor,
//     );
//   }
//
//   Future<dynamic> get(String path,
//       {Map<dynamic, dynamic>? filter,
//       bool parse = true,
//       Map<String, dynamic>? params}) async {
//     try {
//       final sessionToken = await _authenticationLocalDataSource.getSessionId();
//       final header = {
//         'Authorization': sessionToken,
//         'Content-Type': 'application/json',
//       };
//       final response = await _dio.get(path,
//           // queryParameters: params,
//           options: Options(
//             headers: header,
//           ));
//
//       if (response.statusCode == 200) {
//         if (parse) {
//           return json.decode(response.data);
//         }
//         return response.data;
//       } else if (response.statusCode == 400 || response.statusCode == 404) {
//         throw const ExceptionWithMessage("Unknown error");
//       } else if (response.statusCode == 401) {
//         throw UnauthorisedException();
//       } else {
//         throw Exception(response.statusMessage);
//       }
//     } catch (error) {
//       throw Exception("Error: $error");
//     }
//   }
//
//   Future<dynamic> post(String path,
//       {Map<dynamic, dynamic>? params, bool withToken = true}) async {
//     try {
//       String sessionId =
//           await _authenticationLocalDataSource.getSessionId() ?? "";
//       Map<String, String> userHeader = {
//         "Content-type": "application/json",
//         "Accept": "*/*"
//       };
//
//           final uri = ApiConstants.baseApiUrl + path;
//
//       final response = await _dio.post(
//         uri,
//         options: Options(headers: userHeader),
//         data: jsonEncode(params),
//       );
//
//       if (sessionId != '' && withToken) {
//         log("Session != null $sessionId");
//         userHeader.addAll({
//           'Authorization': ' $sessionId',
//         });
//       }
//
//       debugPrint("API post response: ${response.statusCode} ");
//       debugPrint(utf8.decode(response.data));
//       if (response.statusCode == 200 || response.statusCode == 201) {
//         return json.decode(response.data.toString());
//       } else if (response.statusCode == 400 ||
//           response.statusCode == 403 ||
//           response.statusCode == 405 ||
//           response.statusCode == 500 ||
//           response.statusCode == 409) {
//         throw const ExceptionWithMessage("Unknown error");
//       } else if (response.statusCode == 401) {
//         throw UnauthorisedException();
//       } else if (response.statusCode == 404) {
//         throw const ExceptionWithMessage("Not found");
//       } else {
//         throw Exception(response.statusMessage);
//       }
//     } catch (error) {
//       throw Exception("Error: $error");
//     }
//   }
//
//   Future<dynamic> postPhoto({
//     required List<int> fileBytes,
//     required String userId,
//     required String role,
//   }) async {
//     try {
//       final sessionId = await _authenticationLocalDataSource.getSessionId();
//
//       var headers = {
//         'Content-Type': 'multipart/form-data',
//       };
//
//       if (sessionId != '') {
//         headers.addAll({'Authorization': '$sessionId'});
//       }
//
//       var request = FormData.fromMap({
//         'avatar': MultipartFile.fromBytes(
//           fileBytes,
//           filename: 'avatar.png',
//         ),
//         'userId': userId,
//         'path': role,
//       });
//
//       final response = await _dio.post(
//         "${ApiConstants.baseApiUrl}${ApiConstants.uploads}",
//         data: request,
//         options: Options(headers: headers),
//       );
//
//       if (response.statusCode == 200) {
//         return true;
//       } else {
//         return false;
//       }
//     } catch (error) {
//       throw Exception("Error: $error");
//     }
//   }
//
//   // Добавьте другие методы, такие как patch, deleteWithBody, если они используются в вашем коде.
//
//   // ...
//
//   Future<dynamic> patch(String path, {Map<dynamic, dynamic>? params}) async {
//     try {
//       final sessionId = await _authenticationLocalDataSource.getSessionId();
//
//       var userHeader = {
//         'Content-Type': 'application/json',
//         'Accept': '*/*',
//       };
//
//       if (kDebugMode) {
//         debugPrintThrottled("Request params: $params ");
//       }
//
//       if (sessionId != '') {
//         userHeader.addAll({
//           'Authorization': ' $sessionId',
//         });
//       }
//
//       final response = await _dio.patch(
//         ApiConstants.baseApiUrl + path,
//         data: params,
//         options: Options(headers: userHeader),
//       );
//
//       if (response.statusCode == 200 || response.statusCode == 201) {
//         return json.decode(response.toString());
//       } else if (response.statusCode == 400 ||
//           response.statusCode == 403 ||
//           response.statusCode == 405) {
//         throw const ExceptionWithMessage("Unknown error");
//       } else if (response.statusCode == 401) {
//         throw UnauthorisedException();
//       } else if (response.statusCode == 404) {
//         throw const ExceptionWithMessage("Not found");
//       } else {
//         throw Exception(response.statusMessage);
//       }
//     } catch (error) {
//       throw Exception("Error: $error");
//     }
//   }
//
//   Future<dynamic> deleteWithBody(String path,
//       {Map<dynamic, dynamic>? params}) async {
//     try {
//       final sessionId = await _authenticationLocalDataSource.getSessionId();
//
//       final response = await _dio.delete(
//         '${ApiConstants.baseApiUrl}$path',
//         data: params,
//         options: Options(
//           headers: {
//             'Authorization': ' $sessionId',
//           },
//         ),
//       );
//
//       if (response.statusCode == 204 || response.statusCode == 200) {
//         return {'success': true};
//       } else if (response.statusCode == 400 ||
//           response.statusCode == 403 ||
//           response.statusCode == 402 ||
//           response.statusCode == 405) {
//         throw const ExceptionWithMessage("Unknown error");
//       } else if (response.statusCode == 401) {
//         throw UnauthorisedException();
//       } else {
//         throw Exception(response.statusMessage);
//       }
//     } catch (error) {
//       throw Exception("Error: $error");
//     }
//   }
//
//   Uri getPath(String path, Map<dynamic, dynamic>? params) {
//     var paramsString = '';
//     if (params?.isNotEmpty ?? false) {
//       params?.forEach((key, value) {
//         paramsString += '&$key=$value';
//       });
//     }
//
//     return Uri.parse('${ApiConstants.baseApiUrl}$path$paramsString');
//   }
// }
class UnauthorisedException implements Exception {}

class ExceptionWithMessage implements Exception {
  final String message;
  const ExceptionWithMessage(this.message);
}
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart';



part 'network_state.dart';

class NetworkCubit extends Cubit<NetworkState> {
  final NetworkInfo networkService;

  NetworkCubit({required this.networkService}) : super(NetworkInitial()) {
    listenConnection();
  }

  static bool _isOnline = false;

  bool get isOnline => _isOnline;

  listenConnection() async {
    networkService.connectionStream.listen((status) {

      if(status == InternetConnectionStatus.connected) {
        _isOnline = true;
        emit(NetworkConnectedState());
      }else {
        _isOnline = false;
        emit(NetworkLostState());
      }
    });
  }
}
import 'package:equatable/equatable.dart';

class NoParams extends Equatable {
  @override
  List<Object> get props => [];
}
import 'package:equatable/equatable.dart';

class AppError extends Equatable {
  final AppErrorType appErrorType;
  final String errorMessage;
  const AppError( {required this.appErrorType, this.errorMessage = ''});

  @override
  List<Object> get props => [appErrorType];
}

enum AppErrorType {
  api,
  network,
  database,
  unauthorised,
  sessionDenied,
  msgError,
  emailValidation
}
import 'package:dartz/dartz.dart';

import '../entities/app_error.dart';

abstract class UseCase<Type, Params> {
  Future<Either<AppError, Type>> call(Params params);
}
import 'package:internet_connection_checker/internet_connection_checker.dart';

abstract class NetworkInfo {
  Stream<InternetConnectionStatus>  get connectionStream;
}

class NetworkInfoImpl implements NetworkInfo {
  late InternetConnectionChecker connectionChecker =
      InternetConnectionChecker();

  @override
  Stream<InternetConnectionStatus> get connectionStream => connectionChecker.onStatusChange;
}
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyScrollableScreen(),
    );
  }
}

class MyScrollableScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Scrollable Screen'),
      ),
      body: SingleChildScrollView(
        scrollDirection: Axis.horizontal,
        child: SingleChildScrollView(
          scrollDirection: Axis.vertical,
          child: Column(
            children: List.generate(
              18, // Number of main views
              (rowIndex) => Container(
                height: 80, // Set the height of each row
                margin: EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0),
                decoration: BoxDecoration(
                  border: Border.all(color: Colors.black, width: 1.0),
                ),
                child: Row(
                  children: List.generate(
                    20, // Number of labels
                    (columnIndex) => Container(
                      width: 80, // Set the width of each label
                      child: Center(
                        child: Text('Label $columnIndex'),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Hive Tutorial',
      home: FutureBuilder(
        future: Hive.openBox('contacts'),
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            if (snapshot.hasError)
              return Text(snapshot.error.toString());
            else
              return ContactPage();
          }
          // Although opening a Box takes a very short time,
          // we still need to return something before the Future completes.
          else
            return Scaffold();
        },
      ),
    );
  }

  @override
  void dispose() {
    Hive.close();
    super.dispose();
  }
}
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Container(
      color: const Color.fromARGB(255, 96, 106, 114),
      child: Center(
        child: Column(
          children: [
          const  Text(
              'Brand',
              style: TextStyle(
                color: Colors.white,
                fontSize: 100,
                fontWeight: FontWeight.bold,
                fontStyle: FontStyle.italic,
                letterSpacing: 2.0,
              decoration: TextDecoration.none
              ),
            ),
         const   Text(
              'builder',
              style: TextStyle(
                color: Colors.white,
                fontSize: 60,
                fontWeight: FontWeight.bold,
                fontStyle: FontStyle.italic,
                letterSpacing: 2.0,
           decoration: TextDecoration.none
              ),
            ),
         const   Text(
              'an IT company',
              style: TextStyle(
                color: Colors.white,
                fontSize: 18,
                fontWeight: FontWeight.bold,
                fontStyle: FontStyle.italic,
                letterSpacing: 2.0,
                decoration: TextDecoration.none
              ),
            ),
          const  SizedBox(height: 30),
           const  Text(
              'Our services',
              style: TextStyle(
                color: Colors.white,
                fontSize: 20,
                decoration: TextDecoration.none,
              ),
            ),
         const   SizedBox(height: 20),
            Wrap(
              alignment: WrapAlignment.start,
              spacing: 20, // Adjust spacing between service items
              runSpacing: 20, // Adjust run spacing
              children: [
              
                ServiceItem(
                  icon: Icons.palette,
                  text: 'Branding',
                ),
                ServiceItem(
                  icon: Icons.design_services,
                  text: 'UX/UI Design',
                ),
                ServiceItem(
                  icon: Icons.mobile_screen_share,
                  text: 'Mobile App Development',
                ),
                ServiceItem(
                  icon: Icons.storage,
                  text: 'Server Management',
                ),
                  ServiceItem(
                  icon: Icons.shop,
                  text: 'Digital Marketing',
                ),
                // Add more services here
              ],
            ),
          ],
        ),
      ),
    ),
  ));
}

class ServiceItem extends StatelessWidget {
  final IconData icon;
  final String text;

  ServiceItem({required this.icon, required this.text});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 160.0, // Adjust the width of each service box
      height: 160.0, // Adjust the height of each service box
      decoration: BoxDecoration(
        border: Border.all(
          color: Colors.white,
          width: 2.0,
        ),
        borderRadius: BorderRadius.circular(8.0),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(
            icon,
            color: Colors.white,
            size: 40,
          ),
          const SizedBox(height: 5),
          Text(
            text,
            textAlign: TextAlign.center,
            style: const TextStyle(
              color: Colors.white,
              fontSize: 14,
              decoration: TextDecoration.none,
              fontWeight: FontWeight.bold,
              letterSpacing: 1.0,
              shadows: [
                Shadow(
                  color: Colors.black,
                  blurRadius: 3.0,
                  offset: Offset(2, 2),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
class MyHomePage extends StatefulWidget{
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => MyHomePageState();
  }

  class MyHomePageState extends State<MyHomePage>{
    String _name = "Sumi";
    Widget build(BuildContext context){
      return Scaffold(
        body: Center(child: ElevatedButton(
          child: Text(_name),
          onPressed: (){
            setState(() {
              
            });
            _name = _name == "Sumi"?"Roma":"Sumi";
          },
        ),
      ),
     );
    }
  }
import 'package:flutter/material.dart';

class MyStatefulWidget extends StatefulWidget {
  const MyStatefulWidget({super.key});

  @override
  State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
}

class _MyStatefulWidgetState extends State<MyStatefulWidget> {
  int count = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text("$count"),
      ),
      floatingActionButton: FloatingActionButton(onPressed: (){
        setState(() {
          count++;
        });
      },
      child: const Icon(Icons.add),),
    );
  }
}
import 'package:flutter/material.dart';

class StatelessPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Stateless Widget'),
          backgroundColor: Colors.white,
        ),
        backgroundColor: Colors.red,
        body: Placeholder(),
      ),
    );
  }
}
++++++++++++++++getFcm.dart+++++++++++++
  
  Future<String?> getFcmToken() async {
  if(Platform.isIOS){
    String? fcmKey = await FirebaseMessaging.instance.getToken();
    return fcmKey;
  }

  String? fcmKey = await FirebaseMessaging.instance.getToken();
  return fcmKey;
  }

++++++++++++++++++++++++++++++++++++++++

final CollectionReference _tokensCollection =
      FirebaseFirestore.instance.collection('users');

Future<void> saveFCMTokenToFirestore() async {
  // Get the FCM token
  String? fcmToken = await getFcmToken();
  if (fcmToken != null) {
    // Create a document with the FCM token in Firestore
    await _tokensCollection.doc(globals.email).set({
      'token': fcmToken,
      'tokenCreatedAt': FieldValue.serverTimestamp(),
    });
  } else {
    print('Failed to retrieve FCM token');
  }
}
Cryptocurrency development is the process of creating a digital currency that is secured by cryptography and operates independently of a central authority. It involves designing and building a blockchain-based platform that allows for secure, transparent, and decentralized transactions. The cryptocurrency market is rapidly growing, and businesses are increasingly looking to integrate blockchain technology into their operations. A reputable cryptocurrency development company like Shamla Tech can provide valuable expertise and guidance to ensure a successful implementation. Shamla Tech specializes in providing comprehensive blockchain solutions to clients, including the creation of new cryptocurrencies, blockchain-based software applications, and custom smart contract development. 

Know more: https://shamlatech.com/cryptocurrency-development/
import 'package:flutter/material.dart';

class AppContext {
  static BuildContext? _context;

  static void set(BuildContext context) {
    _context = context;
  }

  static BuildContext get() {
    return _context!;
  }
}
import 'package:cryptocornars/common/utils/app_context.dart';
import 'package:cryptocornars/constants/global_variable.dart';
import 'package:flutter/material.dart';

class Toast {
  static void show(String msg, BuildContext context, double height) {
    Color textColor = Colors.white;
    Color backgroundColor = Colors.blueAccent;
    dismiss();
    Toast._createView(msg, context, backgroundColor, textColor, height);
  }

  static OverlayEntry? _overlayEntry;
  static bool isVisible = false;


  static void _createView(String msg, BuildContext context, Color background,

      Color textColor, double height) async {
    var overlayState = Overlay.of(context);
    AppContext.get();
    final themeData = Theme.of(context);

    _overlayEntry = OverlayEntry(
      builder: (BuildContext context) => _ToastAnimatedWidget(
        height: height,
        child: SizedBox(
          width: MediaQuery.of(context).size.width,
          child: Container(
            alignment: Alignment.center,
            width: MediaQuery.of(context).size.width,
            child: Container(
              decoration: BoxDecoration(
                color: GlobalVariable.whiteSmoke,
                borderRadius: BorderRadius.circular(10),
              ),
              margin: const EdgeInsets.symmetric(horizontal: 20),
              padding: const EdgeInsets.fromLTRB(16, 10, 16, 10),
              child: Text(
                msg,
                style: themeData.textTheme.bodyLarge?.copyWith(
                  color: GlobalVariable.platinum,
                  fontFamily: 'Roboto',
                  fontSize: 16,
                  fontWeight: FontWeight.w500,
                ),
              ),
            ),
          ),
        ),
      ),
    );
    isVisible = true;
    overlayState.insert(_overlayEntry!);
  }

  static dismiss() async {
    if (!isVisible) {
      return;
    }
    isVisible = false;
    _overlayEntry?.remove();
  }
}

class _ToastAnimatedWidget extends StatefulWidget {
  const _ToastAnimatedWidget({
    Key? key,
    required this.child,
    required this.height,
  }) : super(key: key);
  final double height;
  final Widget child;

  @override
  _ToastWidgetState createState() => _ToastWidgetState();
}

class _ToastWidgetState extends State<_ToastAnimatedWidget>
    with SingleTickerProviderStateMixin {
  bool get _isVisible => true; //update this value later

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Positioned(
        bottom: widget.height,
        child: AnimatedOpacity(
          duration: const Duration(seconds: 2),
          opacity: _isVisible ? 1.0 : 0.0,
          child: widget.child,
        ));
  }
}
class _MyNavigationBarState extends State<MyNavigationBar > {
  int _currentTabIndex = 0;

  @override
  Widget build(BuildContext context) {
    final _kTabPages = <Widget>[
      Page1(),
      Page2(),
      Page3(),
      Container(),
    ];
    final _kBottmonNavBarItems = <BottomNavigationBarItem>[
      const BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
      const BottomNavigationBarItem(icon: Icon(Icons.network_cell), label: 'Prices'),
      const BottomNavigationBarItem(icon: Icon(Icons.add_circle), label: 'Trade'),
      const BottomNavigationBarItem(icon: Icon(Icons.account_balance_wallet), label: 'Wallet'),
    ];
    assert(_kTabPages.length == _kBottmonNavBarItems.length);
    final bottomNavBar = BottomNavigationBar(
      items: _kBottmonNavBarItems,
      currentIndex: _currentTabIndex,
      type: BottomNavigationBarType.fixed,
      onTap: (int index) {
        if(index == 3){
          showBottomSheet();
          return;
        }

        setState(() {
          _currentTabIndex = index;
        });
      },
    );
    return Scaffold(
      body: _kTabPages[_currentTabIndex],
      bottomNavigationBar: bottomNavBar,
      ),
    );
  }
}

showBottomSheet(){
      Container _buildBottomSheet(BuildContext context) {
    return Container(
      height: 300,
      padding: const EdgeInsets.all(8.0),
      decoration: BoxDecoration(
        border: Border.all(color: Colors.blue, width: 2.0),
        borderRadius: BorderRadius.circular(8.0),
      ),
      child: ListView(
        children: <Widget>[
          const ListTile(title: Text('Bottom sheet')),
          const TextField(
            keyboardType: TextInputType.number,
            decoration: InputDecoration(
              border: OutlineInputBorder(),
              icon: Icon(Icons.attach_money),
              labelText: 'Enter an integer',
            ),
          ),
          Container(
            alignment: Alignment.center,
            child: ElevatedButton.icon(
              icon: const Icon(Icons.save),
              label: const Text('Save and close'),
              onPressed: () => Navigator.pop(context),
            ),
          )
        ],
      ),
    );
  }
}
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  final TextEditingController controller = TextEditingController();
  final _form = GlobalKey<FormState>();

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  bool isValid = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        margin: const EdgeInsets.all(10),
        child: Column(
          children: [
            Form(
              key: _form,
              child: FormField(
                validator: (val) =>
                    val == null || val == '' ? 'Type Something!' : null,
                builder: (formfielstate) {
                  return Column(
                    crossAxisAlignment: CrossAxisAlignment.end,
                     mainAxisSize: MainAxisSize.min,
                    children: [
                      TextField(
                        controller: controller,
                        decoration: const InputDecoration(labelText: 'Enter'),
                      ),
                      if (formfielstate.hasError)
                        Padding(
                          padding: const EdgeInsets.only(top: 10),
                          child: Text(
                            formfielstate.errorText!,
                            style: const TextStyle(color: Colors.red),
                          ),
                        ),

                    ],
                  );
                },
              ),
            ),
            Align(
              alignment: Alignment.center,
              child: ElevatedButton(
                onPressed: () {
                  if (_form.currentState!.validate()) {}
                },
                child: const Text('Click'),
              ),
            )
          ],
        ),
      ),
    );
  }
}
// TextFormField(
//                 controller: controller,
//                 decoration: const InputDecoration(
//                   errorStyle: TextStyle(
//                     textBaseline: TextBaseline.alphabetic
//                   ),
//                     hintText: 'Enter',
//                     border: OutlineInputBorder(
//                         borderSide: BorderSide(
//                       color: Colors.black38,
//                     )),
//                     enabledBorder: OutlineInputBorder(
//                         borderSide: BorderSide(
//                       color: Colors.black38,
//                     ))),
//                 validator: (val) {
//                   if (val == null || val.isEmpty) {
//                     return 'Enter your Enter';
//                   }
//
//                   return null;
//                 },
//               ),
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:healum/utils/trackers.dart';
import 'package:intl/intl.dart';

class DataBase {
  final database = FirebaseFirestore.instance;

  isUserAdded(String uid) async {
    return (await database.collection("users").doc(uid).get()).exists;
  }

  addUser(String uid) async {
    DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
    await database
        .collection('users')
        .doc(uid)
        .set((await deviceInfo.androidInfo).toMap());
  }

  pushTrackerData(
      Tracker tracker, String uid, Map<String, dynamic> trackerData) async {
    DateTime dateTime = DateTime.now();
    Map<String, dynamic> data = {
      "date_added_on": Timestamp.now(),
      "day_added_on": DateFormat('EEEE').format(dateTime)
    };
    data.addEntries(trackerData.entries);
    await database
        .collection('users')
        .doc(uid)
        .collection(tracker.key)
        .doc()
        .set(data);
  }

  getFirstTrackerData(Tracker tracker, String uid) async {
    try {
      return (await database
              .collection('users')
              .doc(uid)
              .collection(tracker.key)
              .orderBy("date_added_on", descending: true)
              .limit(1)
              .get())
          .docChanges
          .first
          .doc
          .data()['value']
          .toString();
    } catch (_) {
      return null;
    }
  }

  updateSpecificTrackerDataByTimestamp(
      Tracker tracker, String uid, Timestamp timestamp) async {
    final doc = (await database
            .collection('users')
            .doc(uid)
            .collection(tracker.key)
            .where("date_added_on", isEqualTo: timestamp)
            .limit(1)
            .get())
        .docChanges
        .first
        .doc
        .reference;
    Map existingData = (await doc.get()).data();
    print(existingData);
    existingData['value'] = tracker.value;
    var batch = database.batch();
    batch.update(doc, existingData);
    await batch.commit();
  }

  Future<List> getAllTrackerData(Tracker tracker, String uid) async {
    try {
      var snapshotList = (await database
              .collection('users')
              .doc(uid)
              .collection(tracker.key)
              .orderBy("date_added_on", descending: true)
              .get())
          .docChanges;
      List<Map<String, dynamic>> mapList =
          snapshotList.map((e) => e.doc.data()).toList();
      return mapList;
    } catch (_) {
      return null;
    }
  }
}
1. createState(): When the Framework is instructed to build a StatefulWidget, it immediately calls createState()

2. mounted is true: When createState creates your state class, a buildContext is assigned to that state. buildContext is, overly simplified, the place in the widget tree in which this widget is placed. Here's a longer explanation. All widgets have a bool this.mounted property. It is turned true when the buildContext is assigned. It is an error to call setState when a widget is unmounted.

3. initState(): This is the first method called when the widget is created (after the class constructor, of course.) initState is called once and only once. It must call super.initState().

4. didChangeDependencies(): This method is called immediately after initState on the first time the widget is built.

5. build(): This method is called often. It is required, and it must return a Widget.

6. didUpdateWidget(Widget oldWidget): If the parent widget changes and has to rebuild this widget (because it needs to give it different data), but it's being rebuilt with the same runtimeType, then this method is called. This is because Flutter is re-using the state, which is long lived. In this case, you may want to initialize some data again, as you would in initState.

7. setState(): This method is called often from the framework itself and from the developer. Its used to notify the framework that data has changed

8. deactivate(): Deactivate is called when State is removed from the tree, but it might be reinserted before the current frame change is finished. This method exists basically because State objects can be moved from one point in a tree to another.

9. dispose(): dispose() is called when the State object is removed, which is permanent. This method is where you should unsubscribe and cancel all animations, streams, etc.

10. mounted is false: The state object can never remount, and an error is thrown is setState is called.
import 'dart:isolate';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: BodyWidget(),
      ),
    );
  }
}

class BodyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          CircularProgressIndicator(),
          ElevatedButton(
            child: Text('start'),
            onPressed: () async {

              //ReceivePort is to listen for the isolate to finish job
              final receivePort = ReceivePort();
              // here we are passing method name and sendPort instance from ReceivePort as listener
              await Isolate.spawn(
                  computationallyExpensiveTask, receivePort.sendPort);

              //It will listen for isolate function to finish
              receivePort.listen((sum) {
                print(sum);
              });
            },
          )
        ],
      ),
    );
  }
}

// this function should be either top level(outside class) or static method
void computationallyExpensiveTask(SendPort sendPort) {
  print('heavy work started');
  var sum = 0;
  for (var i = 0; i <= 1000000000; i++) {
    sum += i;
  }
  print('heavy work finished');
  //Remember there is no return, we are sending sum to listener defined defore.
  sendPort.send(sum);
}
import 'package:flutter/material.dart';

void main() {
  runApp( MaterialApp(
       home: Home()
  ));
}

class Home extends  StatefulWidget {
  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {

  TextEditingController textarea = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
         appBar: AppBar(
            title: Text("Multi Line TextField"),
            backgroundColor: Colors.redAccent,
         ),
          body: Container(
             alignment: Alignment.center,
             padding: EdgeInsets.all(20),
             child: Column(
               children: [
                   TextField(
                      controller: textarea,
                      keyboardType: TextInputType.multiline,
                      maxLines: 4,
                      decoration: InputDecoration( 
                         hintText: "Enter Remarks",
                         focusedBorder: OutlineInputBorder(
                            borderSide: BorderSide(width: 1, color: Colors.redAccent)
                         )
                      ),
                       
                   ),

                   ElevatedButton(
                     onPressed: (){
                         print(textarea.text);
                     }, 
                     child: Text("Get TextField Value")
                    )
               ],
             ),
          )
      );
  }
}
class MySwitcher extends StatelessWidget {
  const MySwitcher({super.key});

  @override
  Widget build(BuildContext context) {
    final status = context.select((MyBloc bloc) => bloc.state.status);
    switch (status) {
      case MyStatus.initial:
      case MyStatus.loading:
        return const Center(child: CircularProgressIndicator());
      case MyStatus.success:
        return const MyView();
      case MyStatus.error:
        return Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text('Something went wrong.'),
              const SizedBox(height: 16),
              ElevatedButton(
                onPressed: () {
                  context.read<MyBloc>().add(MyDataRequested());
                },
                child: const Text('Try again'),
              ),
            ],
          ),
        );
    }
  }
}
// PAGE
class MyPage extends StatelessWidget {
  const MyPage({super.key});
 
  static String path = 'my';
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // Inject Bloc(s)
      body: BlocProvider(
        create: (context) => MyBloc(
          dependency: context.read<Dependency>(),
        )..add(MyDataRequested()),
        // SWITCHER
        // MySwitcher, and all its nested child Widgets, will have access to MyBloc
        child: const MySwitcher(),
      ),
    );
  }
}
class MyBloc extends Bloc<MyEvent, MyState> {
  MyBloc({required Dependency dependency})
      : _dependency = dependency,
        super(const MyState()) {
    on<MyDataRequested>(_dataRequested);
  }

  final Dependency _dependency;

  FutureOr<void> _dataRequested(
    MyDataRequested event,
    Emitter<MyState> emit,
  ) async {
    emit(state.copyWith(status: MyStatus.loading));
    try {
      final myAsyncData = await _dependency.asyncCall();
      emit(
        state.copyWith(
          myAsyncData: myAsyncData,
          status: MyStatus.success,
        ),
      );
    } catch (error, stackTrace) {
      addError(error, stackTrace);
      emit(state.copyWith(status: MyStatus.error));
    }
  }
}
enum MyStatus { initial, loading, success, error }

class MyState extends Equatable {
  const MyState({
    this.myAsyncData,
    this.status = MyStatus.initial,
  });

  final AsyncData? myAsyncData;
  final MyStatus status;

  @override
  List<Object> get props => [myAsyncData, status];

  // Creates a new state with the changed data keeping the BlocState immutable
  MyState copyWith({
    AsyncData? myAsyncData,
    MyStatus? status,
  }) {
    return MyState(
      myAsyncData: myAsyncData ?? this.myAsyncData,
      status: status ?? this.status,
    );
  }
}
// PAGE
class MyPage extends StatelessWidget {
  const MyPage({super.key});
 
  static String path = 'my';
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // Inject Bloc(s)
      body: BlocProvider(
        create: (context) => MyBloc(dependency: context.read<Dependency>()),
        // VIEW
        // MyView, and all its nested child Widgets, will have access to MyBloc
        child: const MyView(),
      ),
    );
  }
}
import 'dart:ui' show ImageFilter;

import 'package:flutter/material.dart';

class BlurContainer extends StatelessWidget {
  final Widget child;
  final double? height;
  final double? width;
  final double elevation;
  final double blur;
  final EdgeInsetsGeometry padding;
  final Color color;
  final BorderRadius borderRadius;
  final String? image;
  final AlignmentGeometry? imageAlignment;

  const BlurContainer({
    Key? key,
    required this.child,
    this.height,
    this.width,
    this.blur = 5,
    this.elevation = 0,
    this.padding = const EdgeInsets.all(8),
    this.color = Colors.transparent,
    this.borderRadius = const BorderRadius.all(Radius.circular(20)),
    this.image,
    this.imageAlignment,
  }) : super(key: key);

  const BlurContainer.square({
    Key? key,
    required this.child,
    double? dimension,
    this.blur = 5,
    this.elevation = 0,
    this.padding = const EdgeInsets.all(8),
    this.color = Colors.transparent,
    this.borderRadius = const BorderRadius.all(Radius.circular(20)),
    this.image,
    this.imageAlignment,
  })  : width = dimension,
        height = dimension,
        super(key: key);

  const BlurContainer.expand({
    Key? key,
    required this.child,
    this.blur = 5,
    this.elevation = 0,
    this.padding = const EdgeInsets.all(8),
    this.color = Colors.transparent,
    this.borderRadius = BorderRadius.zero,
    this.image,
    this.imageAlignment,
  })  : width = double.infinity,
        height = double.infinity,
        super(key: key);

  @override
  Widget build(BuildContext context) {
    return Material(
      elevation: elevation,
      color: Colors.transparent,
      borderRadius: borderRadius,
      child: ClipRRect(
        borderRadius: borderRadius,
        child: BackdropFilter(
          filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
          child: Container(
            height: height,
            width: width,
            padding: padding,
            decoration: BoxDecoration(
                color: color,
                image: image != null
                    ? DecorationImage(
                        image: AssetImage(image!),
                        alignment: imageAlignment ?? Alignment.center,
                      )
                    : null),
            child: child,
          ),
        ),
      ),
    );
  }
}
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class BlocLoggerObserver extends BlocObserver {
  @override
  void onCreate(BlocBase bloc) {
    super.onCreate(bloc);
    _log("bloc created: $bloc");
  }

  @override
  void onClose(BlocBase bloc) {
    super.onClose(bloc);
    _log("bloc closed: $bloc");
  }

  @override
  void onChange(BlocBase bloc, Change change) {
    super.onChange(bloc, change);
    _log("bloc changed: $bloc, $change");
  }

  @override
  void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
    super.onError(bloc, error, stackTrace);
    _log("bloc error: $bloc, $error, $stackTrace");
  }

  @override
  void onEvent(Bloc bloc, Object? event) {
    super.onEvent(bloc, event);
    _log("bloc event: $bloc, $event");
  }


  void _log(message) {
    if (kDebugMode) {
      print(message);
    }
  }
}
import 'package:flutter/material.dart';

extension ImagePreloadExtention on Image {
  void preload({
    VoidCallback? onImageLoaded,
    VoidCallback? onError,
  }) {
    image
        .resolve(ImageConfiguration())
        .addListener(ImageStreamListener((ImageInfo info, bool syncCall) {
          onImageLoaded?.call();
        }, onError: (Object exception, StackTrace? stackTrace) {
          onError?.call();
        }));
  }
}

extension PreloadImageProviderExtension on ImageProvider {
  void preload({
    VoidCallback? onImageLoaded,
    VoidCallback? onError,
  }) {
    this
        .resolve(ImageConfiguration())
        .addListener(ImageStreamListener((ImageInfo info, bool syncCall) {
          onImageLoaded?.call();
        }, onError: (Object exception, StackTrace? stackTrace) {
          onError?.call();
        }));
  }
}
       Image.network(
                  widget.networkUrl,
                  fit: BoxFit.fill,
                  loadingBuilder: (BuildContext context, Widget child,
                      ImageChunkEvent? loadingProgress) {
                    if (loadingProgress == null) return child;
                    return Center(
                      child: CircularProgressIndicator(
                        value: loadingProgress.expectedTotalBytes != null
                            ? loadingProgress.cumulativeBytesLoaded /
                                loadingProgress.expectedTotalBytes!
                            : null,
                      ),
                    );
                  },
                ),
BarChart(
    ...
    domainAxis: charts.OrdinalAxisSpec(
              renderSpec: charts.SmallTickRendererSpec(labelRotation: 60),
       ),
 ),
Column(
    children: [
        if (_selectedIndex == 0) ...[
          DayScreen(),
        ] else ...[
          StatsScreen(),
        ],
    ],
 ),
import 'package:flutter/material.dart';

class FormValidator {
  static String? empty(
    String? value,
    String errorMessage,
  ) {
    if (value == null || value.length <= 3) {
      return 'Required';
    }
    return null;
  }

  static String? validateEmail(value) {
    bool emailValid = RegExp(
            r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
        .hasMatch(value ?? '');
    if (value == null || value.isEmpty || !emailValid) {
      return 'Please enter email';
    }
    return null;
  }

  static String? password(String? value) {
    if (empty(value, 'Required') != null) {
      return empty(value, 'Required');
    }

    RegExp regEx = RegExp(r"(?=.*[A-Z])\w+");

    if (value!.length < 8 || !regEx.hasMatch(value)) {
      return 'Please enter password';
    }

    return null;
  }

  static String? passwordConfirm(value, TextEditingController controller) {
    if (value == null || value.isEmpty) {
      return 'Required';
    }

    if (value.toString() != controller.text) {
      return 'Required';
    }

    return null;
  }
}
Container(
                      width: 200.0,
                      height: 200.0,
                      decoration: BoxDecoration(
                        color: const Color(0xff7c94b6),
                        image: DecorationImage(
                          image: NetworkImage(
                              'https://media-exp1.licdn.com/dms/image/C5603AQEzw6Dk3IPgHA/profile-displayphoto-shrink_800_800/0/1608714667178?e=1650499200&v=beta&t=LOwP7T4YXz7as8iYcmzjrtdBcAVMBUN5hGSkSgSDl-8'),
                          fit: BoxFit.cover,
                        ),
                        borderRadius: BorderRadius.all(Radius.circular(95.0)),
                        border: Border.all(
                          color: Color(0xFFe0e0e0),
                          width: 4.0,
                        ),
                      ),
                    ),
 ListTile(
              title: Text(
                'Exit',
                style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: 18,
                ),
              ),
              trailing: Icon(
                Icons.logout,
              ),
              onTap: () {
                exit(0);
              },
            ),
Column(
                          mainAxisAlignment: MainAxisAlignment.end,
                          children: [
                            SizedBox(
                              width: 200.0,
                              height: 25.0,
                              child: Container(
                                width: 200,
                                decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(10),
                                  color: Colors.red,
                                ),
                                child: Text(
                                  categoris[index].categoryName,
                                  textAlign: TextAlign.center,
                                  style: TextStyle(
                                      fontSize: 21, color: Colors.black),
                                ),
                              ),
                            ),
                          ]),
                  Text(
                    'Password',
                    style: TextStyle(
                      color: Colors.white,
                    ),
                  ),
                  Container(
                    decoration: BoxDecoration(
                      border: Border.all(color: Colors.black26),
                    ),
                    child: TextFormField(
                      decoration: InputDecoration(
                        labelText: 'Enter Password Here',
                        labelStyle: TextStyle(
                          color: Colors.white,
                          fontSize: 14,
                        ),
                        prefixIcon: Icon(Icons.lock),
                        contentPadding: EdgeInsets.all(5),
                      ),
                    ),
                  ),
        showDialog<dynamic>(
            useRootNavigator: false,
            barrierDismissible: false,
            context: context,
            builder: (BuildContext context) {
              return AlertDialog(
                title: Text(
                  Utils.getString(context, 'report_item'),
                ),
                content: TextField(
                  controller: showdialogText,
                  keyboardType: TextInputType.multiline,
                  textInputAction: TextInputAction.newline,
                  minLines: 1,
                  maxLines: 5,
                  onChanged: (value) {
                    setState(() {
                      valueText = value;
                    });
                  },
                ),
                actions: <Widget>[
                  Container(
                    padding: EdgeInsets.all(5),
                    child: Row(
                      children: <Widget>[
                        Expanded(
                          flex: 1,
                          child: ElevatedButton.icon(
                            icon: const Icon(Icons.cancel),
                            label: Text(
                              Utils.getString(context, 'cancel'),
                            ),
                            onPressed: () {
                              Navigator.of(context).pop();
                            },
                            style: ElevatedButton.styleFrom(
                              primary: Colors.red,
                              onPrimary: Colors.white,
                            ),
                          ),
                        ),
                        const SizedBox(width: 5),
                        Expanded(
                            flex: 1,
                            child: ElevatedButton.icon(
                              icon: const Icon(Icons.save),
                              label: Text(
                                Utils.getString(context, 'save'),
                              ),
                              onPressed: () async {
                                await PsProgressDialog.showDialog(context);
                                final UserReportItemParameterHolder userReportItemParameterHolder = UserReportItemParameterHolder(
                                  itemId: widget.itemId,
                                  reportedUserId: widget.reportedUserId,
                                  message: valueText,
                                );
                                final PsResource<ApiStatus> _apiStatus = await widget.userProvider!.userReportItem(userReportItemParameterHolder.toMap());

                                if (_apiStatus.data != null && _apiStatus.data!.status != null) {
                                  await widget.itemDetailProvider.deleteLocalProductCacheById(widget.itemId, widget.reportedUserId);
                                }

                                PsProgressDialog.dismissDialog();
                                Navigator.pushReplacementNamed(
                                  context,
                                  RoutePaths.home,
                                );
                              },
                              style: ElevatedButton.styleFrom(
                                primary: Colors.green,
                                onPrimary: Colors.white,
                              ),
                            )),
                      ],
                    ),
                  ),
                ],
              );
            });
 body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Center(
            child: Container(
              child: ListView.builder(
                itemCount: 10,
                itemBuilder: (context, index) => Container(
                  height: 200,
                  width: 200,
                  color: Colors.blueGrey[300],
                ),
              ),
              height: 300,
              width: 400,
            ),
          ),
        ],
      ),
Container(
                                child: Text(
                                  items[index].itemName,
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 30),
                                  textAlign: TextAlign.center,
                                ), //Text
                                height: 40,
                                width: 400,
                                  decoration:
                               BoxDecoration(
                  border: Border.all(color: Colors.black38, width: 3),
                  borderRadius: BorderRadius.circular(20),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withOpacity(0.5),
                      spreadRadius: 5,
                      blurRadius: 5,
                      offset: Offset(0, 3), // changes position of shadow
                    ),
                  ],
                  color: Colors.white,
                  image: DecorationImage(
                    image: AssetImage(filterList[index].itemImg),
                    fit: BoxFit.contain,
                  ),
                ),
child: Padding(
                        padding: EdgeInsets.all(5),
                        child: Container(
                          height: 100,
                          width: 350,
                          color: Colors.amber[700],
                          child: Text(items[index].itemName), //Text
                        ),
                      ),
child: Text(
                      categoris[index].categoryName,
                      style: TextStyle(color: Colors.black, fontSize: 40),
                      textAlign: TextAlign.center,
                    ),
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}
IconButton(
          onPressed: () {
            print('It was pressed');
          },
            tooltip: 'Menu Bar',
          iconSize: 40,
          icon: Icon(Icons.menu),
          color: Colors.black,
        )
 appBar: PreferredSize(
        preferredSize: Size.fromHeight(90),
        child: AppBar(
          title: Text(
            'About This App',
            style: TextStyle(fontSize: 28),
          ),
          centerTitle: true,
          backgroundColor: Color(0xffbf360c),
          elevation: 10,
          shadowColor: Color(0xff3f51b5),
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(25),
              bottomRight: Radius.circular(25),
            ),
          ),
        ),
      ),
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Text_input(),
      ),
    );
body: Stack(
        children: [
          Positioned(
            bottom: 20,
            right: 10,
            height: 25,
            width: 75,
            child: ElevatedButton(
              onPressed: () {
                Navigator.pop(
                  context,
                  MaterialPageRoute(
                    builder: (builder) => Text_input(),
                  ),
                );
              },
              child: Text('Back'),
            ),
          )
        ],
      ),
 TextField(
            decoration: InputDecoration(
                border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(20)),
                focusColor: Colors.amber,
                hintText: '@gmail.com',
                labelText: 'Your email',
                prefixIcon: Icon(Icons.account_circle_sharp)),
            onChanged: (value) {}),
hasSpecialCharacters = password.contains(new RegExp(r'[!@#$%^&*(),.?":{}|<>]')); 

  final bool isNumeric = password.contains(RegExp('[0-9]'));
  final bool isLowerCase = password.contains(RegExp("(?:[^a-z]*[a-z]){1}"));
  final bool isUpperCase = password.contains(RegExp("(?:[^A-Z]*[A-Z]){1}"));
InputDecoration(
   isDense: true,
   prefixIcon:Text("\$"),
   prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0),
),
RichText(
  text: TextSpan(
    text: 'Hello ',
    style: DefaultTextStyle.of(context).style,
    children: const <TextSpan>[
      TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold)),
      TextSpan(text: ' world!'),
    ],
  ),
)
RotatedBox(quarterTurns:turns,
  child: AspectRatio(
    aspectRatio: _controller.value.aspectRatio,
    child:  Stack(
      alignment: Alignment.bottomCenter,
      children: [

        VideoPlayer(_controller),
        _ControlsOverlay(controller: _controller,onClickCallback:(){
          setState(() {
            if( turns==0)
              turns=1;
            else turns=0;
          });
        }),
        VideoProgressIndicator(_controller, allowScrubbing: true),

      ],

    ),),
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
      child: RaisedButton(
        onPressed: _incrementCounter,
        child: Text('Increment Counter'),
        ),
      ),
    ),
  ));
}

_incrementCounter() async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  int counter = (prefs.getInt('counter') ?? 0) + 1;
  print('Pressed $counter times.');
  await prefs.setInt('counter', counter);
}
@override
Widget build(BuildContext context) {

  return new FutureBuilder<User>(
      future: userInfo,
      builder: (BuildContext context, AsyncSnapshot<User> snapshot) 
    {
      switch(snapshot.connectionState) {
        case ConnectionState.none:
          _showDialog(context);
          return Container();
        case ConnectionState.waiting:
          return new Center(
            child: new CircularProgressIndicator());
        case ConnectionState.active:
          return new Text('');
        case ConnectionState.done:
          if(snapshot.hasError) {
            error = snapshot.error;
            _showDialog(context);
            return Container();
          } else {
            return Container();
          }
      }
  });
import 'dart:async';
import 'dart:isolate';
main() async {
  var receivePort = new ReceivePort();
  await Isolate.spawn(echo, receivePort.sendPort);
// The 'echo' isolate sends it's SendPort as the first message
  var sendPort = await receivePort.first;
var msg = await sendReceive(sendPort, "bye");
  print('received $msg');
  msg = await sendReceive(sendPort, "hello");
  print('received $msg');
}
// the entry point for the isolate
echo(SendPort sendPort) async {
  // Open the ReceivePort for incoming messages.
  var port = new ReceivePort();
// Notify any other isolates what port this isolate listens to.
  sendPort.send(port.sendPort);
await for (var msg in port) {
    var data = msg[0];
    SendPort replyTo = msg[1];
    replyTo.send(data);
    if (data == "hello") port.close();
  }
}
/// sends a message on a port, receives the response,
/// and returns the message
Future sendReceive(SendPort port, msg) {
  ReceivePort response = new ReceivePort();
  port.send([msg, response.sendPort]);
  return response.first;
}
TextField(
 enabled: false, // to trigger disabledBorder
 decoration: InputDecoration(
   filled: true,
   fillColor: Color(0xFFF2F2F2),
   focusedBorder: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,color: Colors.red),
   ),
   disabledBorder: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,color: Colors.orange),
   ),
   enabledBorder: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,color: Colors.green),
   ),
   border: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,)
   ),
   errorBorder: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,color: Colors.black)
   ),
   focusedErrorBorder: OutlineInputBorder(
     borderRadius: BorderRadius.all(Radius.circular(4)),
     borderSide: BorderSide(width: 1,color: Colors.yellowAccent)
   ),
   hintText: "HintText",
   hintStyle: TextStyle(fontSize: 16,color: Color(0xFFB3B1B1)),
   errorText: snapshot.error,
 ),
 controller: _passwordController,
 onChanged: _authenticationFormBloc.onPasswordChanged,
                            obscureText: false,
),
class AppColors {
  static MaterialColor hex(String hex) =>
      AppColors._factoryColor(AppColors._getColorHexFromStr(hex));

  static MaterialColor _factoryColor(int color) {
    return MaterialColor(color, <int, Color>{
      50: Color(color),
      100: Color(color),
      200: Color(color),
      300: Color(color),
      400: Color(color),
      500: Color(color),
      600: Color(color),
      700: Color(color),
      800: Color(color),
      900: Color(color),
    });
  }

  static int _getColorHexFromStr(String colorStr) {
    colorStr = "FF" + colorStr;
    colorStr = colorStr.replaceAll("#", "");
    int val = 0;
    int len = colorStr.length;
    for (int i = 0; i < len; i++) {
      int hexDigit = colorStr.codeUnitAt(i);
      if (hexDigit >= 48 && hexDigit <= 57) {
        val += (hexDigit - 48) * (1 << (4 * (len - 1 - i)));
      } else if (hexDigit >= 65 && hexDigit <= 70) {
        // A..F
        val += (hexDigit - 55) * (1 << (4 * (len - 1 - i)));
      } else if (hexDigit >= 97 && hexDigit <= 102) {
        // a..f
        val += (hexDigit - 87) * (1 << (4 * (len - 1 - i)));
      } else {
        val = 0xFFFFFFFF;
      }
    }
    return val;
  }
}

// Example: In your app
// ...
class MyExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
    	height: 100.0,
      	width: 100.0,
      	decoration: BoxDecoration(
    		color: AppColors.hex('#000000'),	
    ),
    );
  }
}
Column( 
  crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container( child: Text('${payment.name}',textAlign: TextAlign.left,), color: Colors.redAccent, ), ...... )
 decoration: BoxDecoration(
          border: Border(
            top: BorderSide(width: 16.0, color: Colors.lightBlue.shade600),
            bottom: BorderSide(width: 16.0, color: Colors.lightBlue.shade900),
          ),
          color: Colors.white,
        ),
extension StringExtension on String {
    String capitalize() {
      return "${this[0].toUpperCase()}${this.substring(1)}";
    }
}
appBar: AppBar(
        automaticallyImplyLeading: false,
        title: Text(signedIn ? 'Home' : 'Sign In'),
      ),
Container(
      height: 120.0,
      width: 120.0,
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage(
              'assets/assets/alucard.jpg'),
          fit: BoxFit.fill,
        ),
        shape: BoxShape.circle,
      ),
    )
const color = const Color(0xffb74093); // Second `const` is optional in assignments.
Text(
  'Hello world',
  style: TextStyle(
    decoration: TextDecoration.underline,
  ),
)
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicWidth(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () {},
              child: Text('Short'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('A bit Longer'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('The Longest text button'),
            ),
          ],
        ),
      ),
    ),
  );
}
void main() {
  final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();


  testWidgets('some test', (WidgetTester tester) async {
    await binding.setSurfaceSize(Size(640, 1136));
    print(binding.createViewConfiguration());
 ...
void main() {
  final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();


  testWidgets('some test', (WidgetTester tester) async {
    await binding.setSurfaceSize(Size(640, 1136));
    print(binding.createViewConfiguration());
 ...
void main() {
  final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();


  testWidgets('some test', (WidgetTester tester) async {
    await binding.setSurfaceSize(Size(640, 1136));
    print(binding.createViewConfiguration());
 ...
final List<String> entries = <String>['A', 'B', 'C'];
final List<int> colorCodes = <int>[600, 500, 100];

ListView.separated(
  padding: const EdgeInsets.all(8),
  itemCount: entries.length,
  itemBuilder: (BuildContext context, int index) {
    return Container(
      height: 50,
      color: Colors.amber[colorCodes[index]],
      child: Center(child: Text('Entry ${entries[index]}')),
    );
  },
  separatorBuilder: (BuildContext context, int index) => const Divider(),
);
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicHeight(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () {},
              child: Text('Short'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('A bit Longer'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('The Longest text button'),
            ),
          ],
        ),
      ),
    ),
  );
}
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicWidth(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () {},
              child: Text('Short'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('A bit Longer'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('The Longest text button'),
            ),
          ],
        ),
      ),
    ),
  );
}
import 'package:flutter/material.dart';

void main() {
  runApp(
    new MaterialApp(
      title: 'Hello World App',
      home: new myApp(),
    )
  );
}

class myApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Hello World App'),
      ),
      body: new Center(
        child: new Text(
          'Hello, world!'
        ),
      ),
    );
  }
}
Text("Border test",
    style: TextStyle(
      inherit: true,
      fontSize: 48.0,
      color: Colors.pink,
      shadows: [
        Shadow( // bottomLeft
          offset: Offset(-1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // bottomRight
          offset: Offset(1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // topRight
          offset: Offset(1.5, 1.5),
          color: Colors.white
        ),
        Shadow( // topLeft
          offset: Offset(-1.5, 1.5),
          color: Colors.white
        ),
      ]
    ),
);
String capitalize(String s) {
  if (s == null || s.isEmpty) {
    return s;
  }
  return s.length < 1 ? s.toUpperCase() : s[0].toUpperCase() + s.substring(1);
}
star

Mon Apr 29 2024 12:38:22 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Thu Apr 25 2024 07:51:39 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Fri Apr 12 2024 07:49:03 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Fri Apr 05 2024 13:36:55 GMT+0000 (Coordinated Universal Time) https://reqres.in/api/users/23

#dart #flutter
star

Fri Apr 05 2024 12:46:26 GMT+0000 (Coordinated Universal Time) https://reqres.in/api/users/2

#dart #flutter
star

Fri Mar 22 2024 07:02:08 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Wed Jan 24 2024 17:20:57 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:13:34 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:09:32 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:08:30 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:06:13 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:05:03 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 17:02:03 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Wed Jan 24 2024 16:58:19 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Fri Jan 19 2024 18:23:36 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Jan 19 2024 16:22:19 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Jan 19 2024 16:10:34 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Jan 19 2024 15:52:09 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Jan 19 2024 12:46:34 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Jan 12 2024 11:46:34 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Jan 12 2024 11:46:15 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Jan 12 2024 11:45:42 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Jan 12 2024 09:29:57 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:10:05 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:07:36 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:06:29 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:06:00 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:05:23 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Jan 09 2024 10:04:46 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Wed Nov 29 2023 10:25:06 GMT+0000 (Coordinated Universal Time)

#flutter #dart #scroll
star

Wed Oct 11 2023 08:13:18 GMT+0000 (Coordinated Universal Time) https://resocoder.com/2019/09/30/hive-flutter-tutorial-lightweight-fast-database/

#flutter
star

Tue Sep 05 2023 05:21:02 GMT+0000 (Coordinated Universal Time) s

#flutter
star

Sun Aug 06 2023 09:09:48 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Aug 04 2023 11:43:55 GMT+0000 (Coordinated Universal Time)

#flutter
star

Wed Aug 02 2023 12:31:13 GMT+0000 (Coordinated Universal Time)

#flutter
star

Sat Jun 24 2023 13:17:30 GMT+0000 (Coordinated Universal Time)

#flutter
star

Tue May 23 2023 10:37:50 GMT+0000 (Coordinated Universal Time) https://shamlatech.com/cryptocurrency-development/

#flutter #c# #c++
star

Mon May 08 2023 10:35:05 GMT+0000 (Coordinated Universal Time) https://shamlatech.com/paxful-clone-script/

#flutter #c# #c++
star

Tue Mar 21 2023 07:34:59 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Tue Mar 21 2023 07:34:30 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Thu Feb 16 2023 11:01:26 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/69482360/flutter-open-modal-bottom-sheet-on-bottom-navigation-bar-item-click

#dart #flutter
star

Wed Feb 15 2023 18:26:11 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Sun Nov 27 2022 15:32:15 GMT+0000 (Coordinated Universal Time)

#flutter
star

Tue Nov 08 2022 10:57:04 GMT+0000 (Coordinated Universal Time)

#flutter
star

Tue Nov 08 2022 10:52:17 GMT+0000 (Coordinated Universal Time) https://codingwithtashi.medium.com/isoltate-flutter-dart-multithreading-cf5f67de9b46

#flutter #dart
star

Wed Oct 19 2022 04:21:14 GMT+0000 (Coordinated Universal Time) https://medium.com/@mibcoder/folder-creation-in-flutter-a554c238b7e8

#dart #flutter
star

Mon Oct 10 2022 22:46:16 GMT+0000 (Coordinated Universal Time) https://www.fluttercampus.com/guide/176/how-to-make-multi-line-textfield-input-textarea-in-flutter/

#dart #flutter
star

Thu Oct 06 2022 15:54:44 GMT+0000 (Coordinated Universal Time)

#dart #flutter #bloc #page #view
star

Thu Oct 06 2022 14:58:50 GMT+0000 (Coordinated Universal Time)

#dart #flutter #bloc #page #view
star

Thu Oct 06 2022 14:19:52 GMT+0000 (Coordinated Universal Time)

#dart #flutter #bloc #page #view
star

Thu Oct 06 2022 14:18:34 GMT+0000 (Coordinated Universal Time)

#dart #flutter #bloc #page #view
star

Thu Oct 06 2022 11:22:44 GMT+0000 (Coordinated Universal Time)

#dart #flutter #bloc #page #view
star

Sat Aug 27 2022 13:04:41 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Thu Jul 21 2022 09:37:04 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Thu Jul 14 2022 04:59:44 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri May 27 2022 06:04:14 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/53577962/better-way-to-load-images-from-network-flutter

#dart #flutter
star

Tue May 24 2022 20:56:04 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/54437448/charts-flutter-labels-text-on-x-axis-overlapping-each-other

#dart #flutter
star

Fri May 20 2022 14:41:48 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/49713189/how-to-use-conditional-statement-within-child-attribute-of-a-flutter-widget-cen

#flutter
star

Tue Apr 05 2022 11:46:23 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sat Feb 19 2022 05:43:45 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sun Feb 13 2022 20:38:55 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Feb 11 2022 08:09:17 GMT+0000 (Coordinated Universal Time) https://imgur.com/a/gMhKD7B

#flutter #dart
star

Wed Feb 09 2022 18:54:34 GMT+0000 (Coordinated Universal Time) https://imgur.com/a/TrU40gV

#flutter #dart
star

Wed Feb 09 2022 08:26:10 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Mon Jan 31 2022 16:47:09 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sun Jan 30 2022 11:39:22 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sun Jan 30 2022 09:21:01 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sun Jan 30 2022 08:43:08 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Fri Jan 28 2022 16:49:28 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/63873338/what-does-widgetsflutterbinding-ensureinitialized-do

#dart #flutter
star

Tue Jan 25 2022 14:02:13 GMT+0000 (Coordinated Universal Time)

#flutter #dart
star

Sun Jan 23 2022 19:33:41 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Sun Jan 23 2022 10:05:33 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Sun Jan 23 2022 08:57:24 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=EgtPleVwxBQ&t=64s

#dart #flutter
star

Fri Jan 21 2022 20:22:34 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Fri Jan 14 2022 15:10:07 GMT+0000 (Coordinated Universal Time) https://gist.github.com/rahulbagal/4a06a997497e6f921663b69e5286d859

#flutter
star

Sat Sep 18 2021 00:29:49 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/58819979/is-there-a-way-to-create-a-text-field-with-a-prefix-that-is-always-visible-in-fl

#dart #flutter
star

Tue Sep 14 2021 15:43:06 GMT+0000 (Coordinated Universal Time) https://api.flutter.dev/flutter/widgets/RichText-class.html

#dart #flutter
star

Tue Sep 14 2021 12:54:07 GMT+0000 (Coordinated Universal Time) https://rrtutors.com/tutorials/how-to-rotate-flutter-widget

#flutter #android
star

Tue Sep 14 2021 04:23:19 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/54135078/how-to-solve-error-running-pod-install-in-flutter-on-mac

#dart #flutter
star

Sat Sep 11 2021 03:44:46 GMT+0000 (Coordinated Universal Time) https://pub.dev/packages/shared_preferences

#flutter
star

Fri Aug 27 2021 05:58:23 GMT+0000 (Coordinated Universal Time) https://medium.com/flutter-community/flutter-threading-5c3a7b0c065f

#flutter #dart
star

Fri Aug 27 2021 05:28:55 GMT+0000 (Coordinated Universal Time) https://medium.com/flutterdevs/threading-in-flutter-e5b84c7d8d31

#flutter #dart #threading
star

Sun Jul 04 2021 12:02:09 GMT+0000 (Coordinated Universal Time) https://gist.github.com/matteocrippa/3a8b84c7b49c10bc070e58a66860e83f#file-flutter-md

#flutter #dart
star

Sun Jul 04 2021 12:00:39 GMT+0000 (Coordinated Universal Time) https://github.com/Temidtech/Flutter-Cheat-Sheet/blob/master/README.md

#dart #flutter
star

Mon Jun 28 2021 14:12:38 GMT+0000 (Coordinated Universal Time) https://www.advancedinstaller.com/install-test-certificate-from-msix.html

#flutter
star

Wed Jun 09 2021 11:44:26 GMT+0000 (Coordinated Universal Time) https://pub.dev/packages/table_calendar

#flutter
star

Fri Apr 23 2021 17:34:56 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/50122394/not-able-to-change-textfield-border-color

#dart #flutter
star

Fri Apr 23 2021 02:25:58 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Sat Apr 10 2021 06:33:52 GMT+0000 (Coordinated Universal Time)

#dart #flutter
star

Thu Mar 25 2021 15:10:11 GMT+0000 (Coordinated Universal Time) https://fluttercentral.com/Articles/Post/1056/How_to_add_a_border_to_only_one_part_of_the_container_in_Flutter

#dart #flutter
star

Mon Mar 22 2021 10:50:27 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/29628989/how-to-capitalize-the-first-letter-of-a-string-in-dart

#dart #flutter
star

Wed Mar 17 2021 13:56:41 GMT+0000 (Coordinated Universal Time) https://github.com/flutter/flutter/issues/67277

#dart #flutter
star

Tue Mar 16 2021 16:29:48 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/52211283/inserting-image-into-a-container-flutter-app

#dart #flutter
star

Mon Mar 15 2021 10:38:42 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/50081213/how-do-i-use-hexadecimal-color-strings-in-flutter

#dart #flutter
star

Thu Mar 11 2021 14:20:12 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/50614661/how-to-underline-text-in-flutter

#dart #flutter
star

Mon Mar 08 2021 13:00:55 GMT+0000 (Coordinated Universal Time) https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

#dart #flutter
star

Wed Sep 30 2020 06:33:59 GMT+0000 (Coordinated Universal Time)

#flutter
star

Wed Sep 30 2020 06:33:59 GMT+0000 (Coordinated Universal Time)

#flutter
star

Wed Sep 30 2020 06:33:59 GMT+0000 (Coordinated Universal Time)

#flutter
star

Fri Aug 07 2020 16:15:21 GMT+0000 (Coordinated Universal Time) https://api.flutter.dev/flutter/widgets/ListView-class.html

#flutter
star

Tue May 12 2020 11:03:36 GMT+0000 (Coordinated Universal Time) https://gist.github.com/basselch/51b8a047c5c86355c5859a2e5f198fd0

#dart #flutter
star

Tue May 12 2020 11:02:17 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/48893935/how-to-remove-debug-banner-in-flutter-on-android-emulator

#dart #flutter
star

Wed Jan 22 2020 18:43:41 GMT+0000 (Coordinated Universal Time) https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

#dart #flutter #layouts
star

Wed Jan 22 2020 18:35:33 GMT+0000 (Coordinated Universal Time) https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

#dart #flutter #layout
star

Sun Dec 29 2019 19:42:22 GMT+0000 (Coordinated Universal Time) https://kodestat.gitbook.io/flutter/flutter-hello-world

#android #dart #flutter #ios #helloworld
star

Thu Dec 26 2019 18:27:15 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/52146269/how-to-decorate-text-stroke-in-flutter

#dart #flutter #howto

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension