Open berkeresvan opened 5 months ago
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);
debugPrint(okunanString); debugPrint("*********"); List arabalarListesi = jsonObject; debugPrint(arabalarListesi[0]["model"][0]["fiyat"].toString());
} }
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);
} }