Merge remote-tracking branch 'origin/api-implementation' into api-implementation

# Conflicts:
#	Sources/dafl_project_flutter/.metadata
#	Sources/dafl_project_flutter/lib/views/pages/sign_up/p_sign_up.dart
pull/82/head
Félix MIELCAREK 3 years ago
commit 43a3b51f16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

@ -1,5 +1,35 @@
# dafl_project_flutter
*```dafl_project_flutter``` est le nom de notre projet Flutter.*
## Gestion de Git
* Ceci est un **ordre** !
Faire les commit en ligne de commande car Android Studio déclare des erreurs factices dans des fichiers créés pour les plateformes.
1. Ajout de tous les fichiers modifiés / ou créés dans la staging area (fichers locaux prêts à être commit)
```shell
git add -A
```
2. Validation des fichiers destinées à être envoyé sur le repo
```shell
git commit -m "Message corresponding to modifications done in my commmit"
```
*Insérer un message entre les doubles quotes après le ```-m```*
3. Envoi des commit
```shell
git push origin my_branch
```
*Remplacer ```my_branch``` par la branche sur laquelle on a voulu trailler*
## Convention de nommage des répertoires
```

@ -0,0 +1,38 @@
import 'package:url_launcher/url_launcher.dart';
import 'dart:math';
class Api {
var clientId = '7ceb49d874b9404492246027e4d68cf8';
var redirectUri='https://192.168.183.120:8888/';
var state;
var scopes = 'user-read-private';
var url;
Api() {
state = generateRandomString();
url = Uri.https('accounts.spotify.com', 'en/authorize', {
'client_id': clientId,
'response_type': 'code',
'redirect_uri': redirectUri,
'state': state,
'scope': scopes,
'show_dialog': 'true'
});
}
Future<void> launchInBrowser() async {
if (!await launchUrl(
url,
mode: LaunchMode.inAppWebView,
)) {
throw 'Could not launch $url';
}
}
// for state value
String generateRandomString() {
var r = Random();
return String.fromCharCodes(
List.generate(16, (index) => r.nextInt(33) + 89));
}
}

@ -1,4 +1,4 @@
import 'package:dafl_project_flutter/spotify_api/api_sptfy.dart';
import 'package:dafl_project_flutter/spotify_api/api.dart';
import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart';
import '../home/p_home.dart';
@ -16,7 +16,7 @@ class _SignUpPageState extends State<SignUpPage> {
bool isHovering = false;
TextEditingController passwordconfirm = TextEditingController();
bool isChecked = false;
ApiSptfy apiSptfy = ApiSptfy();
Api apiSptfy = Api();
Future<void>? _launched;
@override
Widget build(BuildContext context) {
@ -209,25 +209,22 @@ class _SignUpPageState extends State<SignUpPage> {
),
),
SizedBox(
height: 55,
height: 43,
width: width * 0.75,
child: Padding(
padding: EdgeInsets.fromLTRB(0, 10, 10, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF24CF5F),
backgroundColor: Color(0xFF24CF5F),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
borderRadius: BorderRadius.circular(100),
), // background// foreground
),
onPressed: () => setState(() {
_launched = apiSptfy.launchInBrowser();
}),
child: const Text(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Lier compte ",
style: TextStyle(
fontFamily: 'DMSans',
@ -235,7 +232,6 @@ class _SignUpPageState extends State<SignUpPage> {
fontSize: 18,
fontWeight: FontWeight.w700),
),
),
Image.asset(
'assets/images/spotify_logo.png',
height: 25,
@ -243,8 +239,7 @@ class _SignUpPageState extends State<SignUpPage> {
fit: BoxFit.cover,
),
],
),
),
)),
),
],
)),
@ -303,7 +298,7 @@ class _SignUpPageState extends State<SignUpPage> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Tu nas déjà un compte?',
const Text('Tu as déjà un compte ?',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.normal,

Loading…
Cancel
Save