json2ui 1.0.0
json2ui: ^1.0.0 copied to clipboard
A powerful Flutter package for dynamically generating responsive, themed, and animated UI components from JSON configurations. Features include property validation, custom widget builders, responsive [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:json2ui/json2ui.dart';
import 'screens/home_screen.dart';
import 'screens/basic_widgets_screen.dart';
import 'screens/responsive_design_screen.dart';
import 'screens/custom_widgets_screen.dart';
import 'screens/theming_screen.dart';
import 'screens/property_processing_screen.dart';
import 'screens/animation_screen.dart';
import 'screens/interactive_demo_screen.dart';
void main() {
// Initialize json2ui with built-in widget builders
initializeJson2UI();
runApp(const Json2UIExampleApp());
}
class Json2UIExampleApp extends StatelessWidget {
const Json2UIExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Json2UI - Complete Example',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
brightness: Brightness.light,
),
darkTheme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
brightness: Brightness.dark,
),
themeMode: ThemeMode.system,
initialRoute: '/',
routes: {
'/': (context) => const HomeScreen(),
'/basic-widgets': (context) => const BasicWidgetsScreen(),
'/responsive-design': (context) => const ResponsiveDesignScreen(),
'/custom-widgets': (context) => const CustomWidgetsScreen(),
'/theming': (context) => const ThemingScreen(),
'/property-processing': (context) => const PropertyProcessingScreen(),
'/animation': (context) => const AnimationScreen(),
'/interactive-demo': (context) => const InteractiveDemoScreen(),
},
);
}
}