Skip to content

fadingcodex/fading_ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

fading_ui

Neumorphic Flutter components with a sad sunset palette and retrofuturistic tone.

Features

  • Runtime day/night theme mode support through FadingThemeScope.
  • Reusable raised and inset neumorphic surfaces.
  • Material and Cupertino free.
  • Core components: button, card, surface, toast, and text field.
  • Selection and control components: checkbox, switch, slider, radio group, and tab bar.
  • Progress components: linear and circular progress indicators.
  • Flutter-only implementation with no external neumorphism package.

Getting started

Add the package to your app and apply the theme:

import 'package:flutter/widgets.dart';
import 'package:fading_ui/fading_ui.dart';

Widget buildApp() {
	return FadingThemeScope(
		mode: FadingThemeMode.night,
		data: FadingThemeData.night,
		child: WidgetsApp(
			color: FadingThemeData.night.backgroundStart,
			debugShowCheckedModeBanner: false,
			pageRouteBuilder: <T>(RouteSettings settings, WidgetBuilder builder) {
				return PageRouteBuilder<T>(
					settings: settings,
					pageBuilder: (BuildContext context, _, _) => builder(context),
				);
			},
			home: const MyScreen(),
		),
	);
}

Switch theme mode at runtime:

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

	@override
	State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
	FadingThemeMode _mode = FadingThemeMode.night;

	@override
	Widget build(BuildContext context) {
		final FadingThemeData theme = FadingThemeData.fromMode(_mode);

		return FadingThemeScope(
			mode: _mode,
			data: theme,
			child: WidgetsApp(
				color: theme.backgroundStart,
				debugShowCheckedModeBanner: false,
				home: MyScreen(
					onToggleTheme: () {
						setState(() {
							_mode = _mode == FadingThemeMode.night
								? FadingThemeMode.day
								: FadingThemeMode.night;
						});
					},
				),
			),
		);
	}
}

Usage

Column(
	children: <Widget>[
		FadingButton(
			label: 'Engage Drive',
			onPressed: () {},
		),
		const SizedBox(height: 16),
		const FadingCard(
			title: 'Noble House Signal',
			child: Text('Orbital route synchronized.'),
		),
		const SizedBox(height: 16),
		const FadingTextField(
			label: 'Transmission',
			hint: 'Type your command',
		),
		const SizedBox(height: 16),
		FadingCheckbox(
			value: true,
			onChanged: (bool value) {},
			label: 'Enable pulse lock',
		),
		const SizedBox(height: 16),
		FadingSwitch(
			value: false,
			onChanged: (bool value) {},
			label: 'Aux relay',
		),
		const SizedBox(height: 16),
		FadingSlider(
			value: 42,
			min: 0,
			max: 100,
			onChanged: (double value) {},
		),
		const SizedBox(height: 16),
		const FadingProgressIndicator(
			value: 0.6,
			label: 'Telemetry',
		),
	],
)

Theme

FadingThemeData provides day and night palettes plus semantic tokens for text, surfaces, controls, and progress states. Use FadingThemeData.fromMode(...) to switch between the built-in themes, or construct your own theme data if you want a custom palette.

Public API

The package exports the following widgets from fading_ui.dart: FadingButton, FadingCard, FadingSurface, FadingToast, FadingTextField, FadingCheckbox, FadingSwitch, FadingSlider, FadingProgressIndicator, FadingRadioGroup, and FadingTabBar.

About

ui under the fading suns

Resources

Stars

Watchers

Forks

Contributors

Languages