exxen 0.0.9
exxen: ^0.0.9 copied to clipboard
Exxen is a Flutter package that offers extensions to make your code cleaner, reusable, and easier to maintain. It is compatible with WebAssembly (WASM).
import 'package:flutter/material.dart';
import 'package:exxen/exxen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int counter = 0;
/*
void _incrementCounter() {
setState(() {
_counter++;
});
} */
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
///context.theme is the same as Theme.of(context)
///context.colorScheme is the same as Theme.of(context).colorScheme
backgroundColor: context.colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'You have pushed the button this many times:',
),
Text(
'$counter',
///context.theme is the same as Theme.of(context)
///context.textTheme is the same as Theme.of(context).textTheme
style: context.textTheme.headlineMedium,
),
],
/// .center() is the same as Center(child: Column(...))
).center(),
floatingActionButton: const LayoutSnapperButton(),
);
}
}