nativemind_widgets 0.5.0
nativemind_widgets: ^0.5.0 copied to clipboard
Themed, localized Flutter widgets above Material and Cupertino: data tables, adaptive navigation, charts, Fugue icons and domain widget libraries.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:nativemind_widgets/account.dart';
import 'package:nativemind_widgets/parsing.dart';
// The AI pages move to the nativemind_copilot example (plan Phase 8); until then they show the frozen 0.4 copy.
// ignore: deprecated_member_use
import 'package:nativemind_widgets/ai.dart';
import 'package:nativemind_widgets/billing.dart';
import 'package:nativemind_widgets/marketing.dart';
import 'package:nativemind_widgets/network.dart';
import 'package:nativemind_widgets/real_estate.dart';
import 'package:nativemind_widgets/telecom.dart';
import 'gallery_shell.dart';
void main() => runApp(const GalleryApp());
/// Live theme settings of the gallery.
class GallerySettings extends ChangeNotifier {
NmPalette palette = NmPalette.nativeMindBlue;
NmPreset preset = NmPreset.workspace;
ThemeMode mode = ThemeMode.light;
NmDensity? density;
double? frameWidth; // null = full window
NmTheme get theme =>
NmTheme(palette: palette, preset: preset, mode: mode, density: density);
void update(void Function(GallerySettings s) change) {
change(this);
notifyListeners();
}
}
class GalleryApp extends StatefulWidget {
const GalleryApp({super.key});
@override
State<GalleryApp> createState() => _GalleryAppState();
}
class _GalleryAppState extends State<GalleryApp> {
final settings = GallerySettings();
final locale = NmLocaleController(storageKey: 'gallery.locale');
@override
Widget build(BuildContext context) => ListenableBuilder(
listenable: settings,
builder: (context, _) => NmApp(
title: 'nativemind_widgets',
theme: settings.theme,
localeController: locale,
supportedLocales: NmL10n.supportedLocales,
localizationsDelegates: const [
NmParsing.delegate,
NmRealEstate.delegate,
NmTelecom.delegate,
NmAi.delegate,
NmMarketing.delegate,
NmBilling.delegate,
NmNetwork.delegate,
NmAccount.delegate,
],
home: GalleryShell(settings: settings),
),
);
}