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

Loading…
Cancel
Save