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