Files
Redesnigned-Finamp/lib/components/DownloadLocationSettingsScreen/download_location_list.dart
T
Zakaria 1563409cb1
Build / Build for Android (push) Has been cancelled
Build / Build for iOS (push) Has been cancelled
first commit
2026-05-18 14:15:38 -04:00

42 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import '../../models/finamp_models.dart';
import '../../services/finamp_settings_helper.dart';
import 'download_location_list_tile.dart';
class DownloadLocationList extends StatefulWidget {
const DownloadLocationList({Key? key}) : super(key: key);
@override
State<DownloadLocationList> createState() => _DownloadLocationListState();
}
class _DownloadLocationListState extends State<DownloadLocationList> {
late Iterable<DownloadLocation> downloadLocationsIterable;
@override
void initState() {
super.initState();
downloadLocationsIterable =
FinampSettingsHelper.finampSettings.downloadLocationsMap.values;
}
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<Box<FinampSettings>>(
valueListenable: FinampSettingsHelper.finampSettingsListener,
builder: (context, box, child) {
return ListView.builder(
itemCount: downloadLocationsIterable.length,
itemBuilder: (context, index) {
return DownloadLocationListTile(
downloadLocation: downloadLocationsIterable.elementAt(index),
);
},
);
},
);
}
}