Skip to content

Commit

Permalink
redirecturi
Browse files Browse the repository at this point in the history
  • Loading branch information
riverscuomo committed Jul 12, 2024
1 parent b2f0814 commit a4335a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
"SPOTIFY_REDIRECT_URI": "$SPOTIFY_REDIRECT_URI",
"SPOTIFY_SCOPE": "$SPOTIFY_SCOPE",
"BACKEND_URL": "$BACKEND_URL"
}' > web/assets/config.json
}' > assets/config.json

- name: Build Spotkin web app
Expand Down
12 changes: 6 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';

import 'screens/screens.dart';




void main() async {
WidgetsFlutterBinding.ensureInitialized();
setUrlStrategy(PathUrlStrategy()); // Use path URL strategy
Expand All @@ -21,6 +18,7 @@ void main() async {

Future<Map<String, dynamic>> loadConfig() async {
String configString = await rootBundle.loadString('assets/config.json');
print(configString);
return jsonDecode(configString);
}

Expand All @@ -42,7 +40,8 @@ class MyApp extends StatelessWidget {
onGenerateRoute: (settings) {
if (settings.name == '/') {
return MaterialPageRoute(
builder: (context) => MyHomePage(config: config, sampleJobs: sampleJobs),
builder: (context) =>
MyHomePage(config: config, sampleJobs: sampleJobs),
);
}
// Handle Spotify callback
Expand All @@ -68,7 +67,8 @@ class MyHomePage extends StatefulWidget {
final String sampleJobs;
final String? initialAuthCode;

MyHomePage({required this.config, required this.sampleJobs, this.initialAuthCode});
MyHomePage(
{required this.config, required this.sampleJobs, this.initialAuthCode});

@override
_MyHomePageState createState() => _MyHomePageState();
Expand Down Expand Up @@ -115,7 +115,7 @@ class _MyHomePageState extends State<MyHomePage> {
final tokenData = json.decode(response.body);
final accessToken = tokenData['access_token'];
print('Access Token: $accessToken');

// Navigate to UpdatePlaylistsScreen
Navigator.of(context).pushReplacement(
MaterialPageRoute(
Expand Down

0 comments on commit a4335a1

Please sign in to comment.