Skip to content

Commit

Permalink
_self windowname for popupblock
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivers authored and Rivers committed Sep 10, 2024
1 parent 3bb2db9 commit 9ad13c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 59 deletions.
1 change: 0 additions & 1 deletion lib/helpers/utils.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:spotify/spotify.dart' hide Image;
import 'package:url_launcher/url_launcher.dart' as url_launcher;

class Utils {
Expand Down
8 changes: 5 additions & 3 deletions lib/screens/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ class _AuthScreenState extends State<AuthScreen> {

// Start the OAuth process using your existing SpotifyService logic
final result = await FlutterWebAuth2.authenticate(
url: authUrl.toString(),
callbackUrlScheme: callbackScheme,
);
url: authUrl.toString(),
callbackUrlScheme: callbackScheme,
options: const FlutterWebAuth2Options(
windowName: '_self',
));

// Extract the authorization code from the result
final uri = Uri.parse(result);
Expand Down
55 changes: 0 additions & 55 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import 'package:spotkin_flutter/app_core.dart';
import '../widgets/target_playlist_widget.dart';
import 'package:uuid/uuid.dart';

const maxJobs = 2;

class HomeScreen extends StatefulWidget {
final Map<String, dynamic> config;

Expand Down Expand Up @@ -328,56 +326,3 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
);
}
}


// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
// SchedulerBinding.instance.addPostFrameCallback((_) {
// _initTabController();
// });
// }
// void _initTabController() {
// final jobProvider = Provider.of<JobProvider>(context, listen: false);
// if (jobProvider == null) {
// print("JobProvider is null");
// return;
// }
// final jobs = jobProvider.jobs;
// _showAddJobButton = jobs.isNotEmpty &&
// !jobs.any((job) => job.targetPlaylist == null) &&
// jobs.length < maxJobs;

// _tabController = TabController(
// length: (jobs.isEmpty ? 1 : jobs.length) + (_showAddJobButton ? 1 : 0),
// vsync: this,
// );
// }

// void _updateTabController() {
// final jobProvider = Provider.of<JobProvider>(context, listen: false);
// final jobs = jobProvider.jobs;
// _showAddJobButton = jobs.isNotEmpty &&
// !jobs.any((job) => job.isNull) &&
// jobs.length < maxJobs;

// int newLength =
// (jobs.isEmpty ? 1 : jobs.length) + (_showAddJobButton ? 1 : 0);

// if (_tabController.length != newLength) {
// int oldIndex = _tabController.index;
// _tabController.dispose();
// _tabController = TabController(
// length: newLength,
// vsync: this,
// initialIndex: oldIndex < newLength ? oldIndex : newLength - 1,
// );
// // setState(() {}); // Trigger a rebuild
// }
// }

// @override
// void dispose() {
// _tabController.dispose();
// super.dispose();
// }

0 comments on commit 9ad13c7

Please sign in to comment.