app_view 0.0.4 copy "app_view: ^0.0.4" to clipboard
app_view: ^0.0.4 copied to clipboard

Library untuk membuat widget / app dari data json untuk semua platform + Support mix with native dart ( Flutter Widget ).

example/lib/main.dart

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:app_view/app_view.dart';

void main() {
  runApp(const MyHomePage());
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  task() {
    Timer.periodic(const Duration(milliseconds: 1), (t) {
      setState(() {
        _counter++;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return AppView({
      "@type": "MaterialApp",
      "debugShowCheckedModeBanner": true,
      "home": {
        "@type": "Scaffold",
        "body": {
          "@type": "Column",
          "children": [
            {
              "@type": "Padding",
              "padding": const {
                "@type": "EdgeInsets.all",
                "value": 10,
              },
              "child": {
                "@type": "Center",
                "child": {
                  "@type": "Container",
                  "child": {
                    "@type": "Text",
                    "data": "Hello world $_counter",
                  }
                }
              },
            },
            {
              "@type": "Center",
              "child": {
                "@type": "Container",
                "child": {
                  "@type": "Text",
                  "data": "Hello world $_counter",
                }
              }
            },
            {
              "@type": "Padding",
              "padding": const {
                "@type": "EdgeInsets.symmetric",
                "vertical": 50,
              },
              "child": {
                "@type": "Padding",
                "padding": const {
                  "@type": "EdgeInsets.all",
                  "value": 10,
                },
                "child": {
                  "@type": "Row",
                  "children": List.generate(5, (index) {
                    return {
                      "@type": "Padding",
                      "padding": const EdgeInsets.all(10),
                      "child": {
                        "@type": "Text",
                        "data": "Row Text $index",
                      }
                    };
                  })
                }
              }
            },
          ]
        },
        "floatingActionButton": {
          "@type": "floatingActionButton",
          "onPressed": {
            "@type": "SendCallbackData",
            "data": const {"helo": "as"},
          },
          "tooltip": 'Increment',
          "child": const Icon(Icons.abc),
        }
      }
    }, callback: (value) {
      if (kDebugMode) {
        print(value);
      }
    });
  }
}
1
likes
130
pub points
15%
popularity

Publisher

unverified uploader

Library untuk membuat widget / app dari data json untuk semua platform + Support mix with native dart ( Flutter Widget ).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cupertino_icons, flutter

More

Packages that depend on app_view