Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* Where:
Build file '/home/mic/progetti-applicazioni/appprovo/android/app/build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 417ms
Exception: Gradle task assembleDebug failed with exit code 1
[
{
"catnid": 101,
"nome": "Bar/Ristoranti/Pizzerie",
"icona": "MdiIcons.food-fork-drink",
"coloreicona": 4291444800
},
{
"catnid": 110,
"nome": "Supermercati",
"icona": "Icons.shopping_cart",
"coloreicona": 4280439256
},
{
"catnid": 205,
"nome": "Farmacie",
"icona": "Icons.add",
"coloreicona": 4281103636
}
]
class TipizzataCategoria {
@required
final int numero;
@required
final String nome;
final IconData icona;
final Color coloreicona;
TipizzataCategoria({
this.numero,
this.nome,
this.icona,
this.coloreicona,
});
factory TipizzataCategoria.dajson(Map<String, dynamic> json) =>
TipizzataCategoria(
numero: json['catnid'] as int,
nome: json['nome'] as String,
// proviamo così:
icona: (Icons.json['icona'].toString().toLowerCase() != null ? 'Icons.${json['icona'].toString().toLowerCase()}' : '') as IconData,
// o così:
icona: json['icona'] as IconData,
coloreicona: Color(json['coloreicona'] as int),
);
}
"icona": "Icons.add",
"coloreicona": 4281103636
IconData(58746, fontFamily: 'MaterialIcons')
class FontAwesomeIcons {
static const IconData fiveHundredPx = const IconDataBrands(0xf26e);
static const IconData accessibleIcon = const IconDataBrands(0xf368);
static const IconData accusoft = const IconDataBrands(0xf369);
static const IconData acquisitionsIncorporated = const IconDataBrands(0xf6af);
static const IconData ad = const IconDataSolid(0xf641);
static const IconData addressBook = const IconDataRegular(0xf2b9);
static const IconData solidAddressBook = const IconDataSolid(0xf2b9);
static const IconData addressCard = const IconDataRegular(0xf2bb);
static const IconData solidAddressCard = const IconDataSolid(0xf2bb);
static const IconData adjust = const IconDataSolid(0xf042);
Questo l'ho capito dall'inizio, e ora direi che stiamo nella strada giusta per arrivare al traguardo. :ok:In soldoni devi salvare nel database le proprietà degli oggetti di questa classe https://api.flutter.dev/flutter/widgets/IconData-class.html
IconData(int codePoint, {String fontFamily, String fontPackage, bool matchTextDirection: false})
"icona-numero-intero": 200,
"icona-font-nome": 'nome font',
"icona-font-pacchetto": 'nome pacchetto',
IconData quale_icona = IconData(codePoint: json['icona-numero-intero'], fontFamily: json['icona-font-nome'], fontPackage: json['icona-font-pacchetto']);
class FontAwesome {
// altre icone
static const IconData newspaper_o = const FlutterIconData.fontAwesome(61930);
}