flutter_modifier_ui 1.0.3
flutter_modifier_ui: ^1.0.3 copied to clipboard
High-performance linear modifier chains for flutter UIs with compile-time layout scopes, structural caching, and widget teleportation.
import 'package:flutter/material.dart';
import 'package:flutter_modifier_ui/flutter_modifier_ui.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(home: CounterScreen());
}
}
class CounterScreen extends StatefulWidget {
const CounterScreen({super.key});
@override
State<CounterScreen> createState() => _CounterScreenState();
}
class _CounterScreenState extends State<CounterScreen> {
int _counter = 0;
void _incrementCounter() => setState(() => _counter++);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Counter App'),
backgroundColor: Colors.purple,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"$_counter",
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 20.0,
),
)(
modifier: const Modifier()
.align(alignment: Alignment.center)
.sizedBoxSquare(dimension: 150.0)
.coloredBox(color: Colors.purple)
.clipOval()
.align(alignment: Alignment.center),
),
],
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
child: const Icon(Icons.add),
),
);
}
}