This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package: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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:health/health.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class HomeScreen extends StatelessWidget { | |
const HomeScreen({Key? key}) : super(key: key); | |
static const route = '/home'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:http/http.dart' as http; | |
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package: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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package: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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authentication_token: | |
path: /authentication | |
methods: ['POST'] |
NewerOlder