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

lm_dx

LM DX integration

Sample Usage #

import 'package:flutter/material.dart';
import 'package:lm_dx/lm_dx.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'LM - DX',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'LM - DX'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final LMDX lmWidgetKit = LMDX();
  late Future<void> _initFuture;

  @override
  void initState() {
    super.initState();
    _initFuture = lmWidgetKit.init(
      'https://healthcare.lucyday.io/',
      'SC:healthcare:a3490beca33befa6',
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: FutureBuilder<void>(
        future: _initFuture,
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.waiting) {
            return const Center(child: CircularProgressIndicator());
          } else if (snapshot.hasError) {
            return Center(child: Text('Error: ${snapshot.error}'));
          } else {
            return lmWidgetKit.LMWidget({
              "__template__": {
                "type": "simple-card",
                "id": "u-52e2377b-bfcd-4e5e-a22b-ea42086a82aa",
                "layout": {"w": 10, "h": 10},
                "zoom": 1,
                "locked": true,
              },
              "uiProps": {"tabs": [], "__widget_name__": "dcdf"},
            });
          }
        },
      ),
    );
  }
}
0
likes
120
points
160
downloads

Publisher

unverified uploader

Weekly Downloads

lm_dx

Homepage
Repository

Documentation

API reference

License

MIT (license)

Dependencies

flutter, iviva_core, uxp_widgets

More

Packages that depend on lm_dx