ux4g 0.1.1
ux4g: ^0.1.1 copied to clipboard
Community-driven implementation of the Government of India UX4G design system for Flutter. Production-ready UI library for accessible, responsive apps.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:ux4g/ux4g.dart';
import 'home_page.dart';
void main() {
runApp(const Ux4gExampleApp());
}
class Ux4gExampleApp extends StatefulWidget {
const Ux4gExampleApp({super.key});
@override
State<Ux4gExampleApp> createState() => _Ux4gExampleAppState();
}
class _Ux4gExampleAppState extends State<Ux4gExampleApp> {
ThemeMode _themeMode = ThemeMode.light;
void _toggleTheme() {
setState(() {
_themeMode = _themeMode == ThemeMode.light
? ThemeMode.dark
: ThemeMode.light;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'UX4G Flutter Showcase',
debugShowCheckedModeBanner: false,
theme: Ux4gTheme.light(),
darkTheme: Ux4gTheme.dark(),
themeMode: _themeMode,
home: HomePage(
onToggleTheme: _toggleTheme,
isDarkMode: _themeMode == ThemeMode.dark,
),
);
}
}