property_list 0.0.4 property_list: ^0.0.4 copied to clipboard
Property List
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:expandable/expandable.dart';
import 'package:property_list/property_list.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'PropertyList Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
State createState() {
return MyHomePageState();
}
}
class MyHomePageState extends State<MyHomePage> {
PropertySheetController controller = PropertySheetController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("PropertyList Demo"),
),
body: ExpandableTheme(
data: const ExpandableThemeData(
iconColor: Colors.blue,
useInkWell: true,
),
child: ListView(
physics: const BouncingScrollPhysics(),
children: [
PropertySheet.fromMap(
json.decode(testData),
),
PropertySheet(controller: controller,),
RaisedButton(child: Text("Populate"), onPressed: (){
controller.update(json.decode(testData));
},)
],
),
),
);
}
}
const testData = '''
{"widget": {
"debug": "on",
"enable": true,
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}}
''';