mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 08:54:54 +00:00
icon_settings
This commit is contained in:
@ -477,19 +477,18 @@ FutureOr<void> _fetchIconScene(
|
||||
emit(CreateSceneLoading());
|
||||
try {
|
||||
final response = await SceneApi.getIcon();
|
||||
|
||||
// Parse the response as a List of IconModel
|
||||
iconModel = (response as List<dynamic>)
|
||||
.map((iconJson) => IconModel.fromJson(iconJson as Map<String, dynamic>))
|
||||
.map((iconJson) =>
|
||||
IconModel.fromJson(iconJson as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
emit(CreateSceneLoaded(iconModel)); // Ensure this state is defined to handle the loaded list
|
||||
print(iconModel[0].iconBase64.toString());
|
||||
emit(CreateSceneLoaded(
|
||||
iconModel)); // Ensure this state is defined to handle the loaded list
|
||||
} catch (e) {
|
||||
emit(const CreateSceneError(message: 'Something went wrong'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String _getDayFromIndex(int index) {
|
||||
const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
||||
return days[index];
|
||||
|
||||
@ -63,8 +63,6 @@ class SceneAutoSettings extends StatelessWidget {
|
||||
return CircularProgressIndicator();
|
||||
} else if (state is CreateSceneLoaded) {
|
||||
return Container(
|
||||
height: 100,
|
||||
width: 100,
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
state.iconModels.length,
|
||||
|
||||
@ -133,9 +133,6 @@ class SceneApi {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
//getScene
|
||||
|
||||
static Future<SceneDetailsModel> getSceneDetails(String sceneId) async {
|
||||
try {
|
||||
final response = await _httpService.get(
|
||||
|
||||
Reference in New Issue
Block a user