Open berkeresvan opened 5 months ago
[ { "araba_adi":"Mercedes", "ulke":"almanya", "kurulus":"1920", "model":[ { "modeladi":"a serisi", "fiyat":15000, "benzinli":true }, { "modeladi":"b serisi", "fiyat":25000, "benzinli":true }, { "modeladi":"c serisi", "fiyat":35000, "benzinli":true } ] } , { "araba_adi":"Honda", "ulke":"japonya", "kurulus":"1960", "model":[ { "modeladi":"civic", "fiyat":14000, "benzinli":true }, { "modeladi":"jazz", "fiyat":24000, "benzinli":true }
]
}
]
import 'dart:convert';
import 'package:flutter/material.dart';
class LocalJson extends StatefulWidget { const LocalJson({super.key});
@override State createState() => _LocalJsonState();
}
class _LocalJsonState extends State {
@override
Widget build(BuildContext context) {
arabalarJsonOku();
return Scaffold(
appBar: AppBar(
title: const Text("Local Json Islemleri"),
),
body: const Center(),
);
}
arabalarJsonOku() async { String okunanString = await DefaultAssetBundle.of(context) .loadString("assets/data/arabalar.json"); var jsonObject = jsonDecode(okunanString);
} }