Skip to content

Instantly share code, notes, and snippets.

View yusufbiberoglu's full-sized avatar
🎯
Focusing

Yusuf yusufbiberoglu

🎯
Focusing
View GitHub Profile
@yusufbiberoglu
yusufbiberoglu / user_model.g.dart
Created July 12, 2023 16:30
user_model.g.dart
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UserModel _$UserModelFromJson(Map<String, dynamic> json) => UserModel(
id: json['id'] as int,
@yusufbiberoglu
yusufbiberoglu / user_model.dart
Last active July 13, 2023 13:06
user_model.dart
import 'package:json_annotation/json_annotation.dart';
import 'package:app/model/index.dart';
part 'user_model.g.dart';
@JsonSerializable()
class UserModel {
int id;
String name;
String surname;
import 'package:flutter/material.dart';
import 'package:health/health.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
ListView.separated(
padding: const EdgeInsets.only(top: 120),
itemBuilder: (BuildContext context, int index) {
return ListTile(
tileColor:
index.isEven || index == 0 ? Colors.grey[350] : Colors.white,
title: const Padding(
padding: EdgeInsets.only(
left: 11,
right: 15,
import 'package:flutter/material.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
static const route = '/home';
@override
Widget build(BuildContext context) {
return Scaffold(
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Api {
token() async {
SharedPreferences localStorage = await SharedPreferences.getInstance();
var token = localStorage.getString('token');
return '?token=$token';
import 'dart:convert';
import 'package:blog_app/home_screen.dart';
import 'package:blog_app/service/api.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class SignIn extends StatefulWidget {
const SignIn({Key? key}) : super(key: key);
static const route = '/signin';
import 'package:blog_app/home_screen.dart';
import 'package:blog_app/sign_in.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: MyApp()));
}
/*
How to solve Flutter CERTIFICATE_VERIFY_FAILED error while performing a POST request?
<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Repository\UserRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
authentication_token:
path: /authentication
methods: ['POST']