Skip to content

Commit

Permalink
feat(style): changed button with microsoft icons
Browse files Browse the repository at this point in the history
  • Loading branch information
sambrus committed Dec 4, 2024
1 parent ed0bc8c commit b9640f6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 32 deletions.
Binary file added client_mobile/assets/images/microsoft_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 10 additions & 15 deletions client_mobile/lib/features/auth/login.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// import 'dart:io';
import 'package:client_mobile/features/auth/MicrosoftOAuth.dart';
import 'package:client_mobile/services/microsoft/MicrosoftAuthService.dart';
import 'package:client_mobile/widgets/button.dart';
import 'package:client_mobile/widgets/clickable_text.dart';
import 'package:client_mobile/widgets/form_field.dart';
import 'package:client_mobile/widgets/sign_in_button.dart';
import 'package:client_mobile/widgets/simple_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_appauth/flutter_appauth.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';

Expand All @@ -31,7 +30,6 @@ class _LoginPageState extends State<LoginPage> {
padding: const EdgeInsets.all(20),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SimpleText(
Expand All @@ -43,13 +41,10 @@ class _LoginPageState extends State<LoginPage> {
const SimpleText("Password", bold: true),
const AreaFormField(label: "Value"),
const SizedBox(height: 15),
Align(
alignment: Alignment.center,
child: AreaButton(
label: "Login",
onPressed: () {},
color: Colors.black,
),
AreaButton(
label: "Login",
onPressed: () {},
color: Colors.black,
),
const SizedBox(height: 30),
Align(
Expand All @@ -58,11 +53,11 @@ class _LoginPageState extends State<LoginPage> {
onPressed: () {
MicrosoftAuthService.auth(context);
},
label: "Sign in with Spotify",
icon: const FaIcon(
size: 34,
FontAwesomeIcons.spotify,
color: Colors.green,
label: "Sign in with Microsoft",
image: Image.asset(
"assets/images/microsoft_logo.png",
width: 40,
height: 30,
),
),
),
Expand Down
21 changes: 8 additions & 13 deletions client_mobile/lib/features/auth/register.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
// import 'dart:io';
import 'package:client_mobile/services/microsoft/MicrosoftAuthService.dart';
import 'package:client_mobile/widgets/button.dart';
import 'package:client_mobile/widgets/clickable_text.dart';
import 'package:client_mobile/widgets/form_field.dart';
import 'package:client_mobile/widgets/sign_in_button.dart';
import 'package:client_mobile/widgets/simple_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_appauth/flutter_appauth.dart';
// import 'package:flutter_web_auth/flutter_web_auth.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:oauth2/oauth2.dart' as oauth2;
// import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
// import 'package:oauth2_client/access_token_response.dart';
// import 'package:oauth2_client/authorization_response.dart';
// import 'package:oauth2_client/spotify_oauth2_client.dart';

class RegisterPage extends StatefulWidget {
@override
Expand Down Expand Up @@ -57,7 +52,7 @@ class _RegisterPageState extends State<RegisterPage> {
print("");
print("--------------------------------");

return;
return;
} catch (e) {
print('Authentication failed: $e');
}
Expand Down Expand Up @@ -100,13 +95,13 @@ class _RegisterPageState extends State<RegisterPage> {
alignment: Alignment.center,
child: SignInButton(
onPressed: () {
authenticateWithSpotifyOld();
MicrosoftAuthService.auth(context);
},
label: "Sign in with Spotify",
icon: const FaIcon(
size: 34,
FontAwesomeIcons.spotify,
color: Colors.green,
label: "Sign in with Microsoft",
image: Image.asset(
"assets/images/microsoft_logo.png",
width: 40,
height: 30,
),
),
),
Expand Down
9 changes: 5 additions & 4 deletions client_mobile/lib/widgets/sign_in_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';

class SignInButton extends StatelessWidget {
const SignInButton(
{super.key, required this.label, this.icon, this.onPressed});
{super.key, required this.label, this.image, this.onPressed});

final String label;
final FaIcon? icon;
final Image? image;
final void Function()? onPressed;

@override
Expand All @@ -16,6 +16,7 @@ class SignInButton extends StatelessWidget {
child: FilledButton(
onPressed: onPressed ?? () {},
style: ButtonStyle(
padding: const WidgetStatePropertyAll(EdgeInsets.all(10)),
backgroundColor: WidgetStateProperty.all(Colors.white),
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
Expand All @@ -34,8 +35,8 @@ class SignInButton extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
if (icon != null) icon!,
const SizedBox(width: 5),
if (image != null) image!,
// const SizedBox(width: 5),
Text(label,
style: const TextStyle(
fontFamily: "CoolveticaCondensed",
Expand Down
1 change: 1 addition & 0 deletions client_mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- .env
- assets/images/microsoft_logo.png
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

Expand Down

0 comments on commit b9640f6

Please sign in to comment.