ssr 0.0.9 copy "ssr: ^0.0.9" to clipboard
ssr: ^0.0.9 copied to clipboard

Generate Flutter Widgets from server generated json code without any dependency.

example/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ServerSideRendering.build({
      'Scaffold': {
        'appBar': {
          'AppBar': {
            'title': {
              'Text': ['Hi'],
            },
            'centerTitle': false,
          },
        },
        'body': {
          'Container': {
            'color': {
              'Color': [0xFFFFFFFF],
            },
            'alignment': 'Alignment.center',
            'child': {
              'Row': {
                'children': [
                  {
                    'Column': {
                      'children': [
                        {
                          'Text':
                              "Text #1.", // optional bracket for single positional argument
                        },
                        {
                          'Text': ["Text #2."],
                        }
                      ],
                    },
                  },
                  {
                    'Text': [
                      "Text #3",
                      {
                        'maxLines': 3,
                        'overflow': 'TextOverflow.ellipsis',
                        'style': {
                          'TextStyle': {
                            'color': {
                              'Color': [0xFF000000],
                            },
                            'fontSize': 20,
                          }
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        }
      }
    });
  }
}
16
likes
110
pub points
54%
popularity

Publisher

verified publisherensorta.com

Generate Flutter Widgets from server generated json code without any dependency.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on ssr