pixels 1.0.1 pixels: ^1.0.1 copied to clipboard
Minimalistic pixel editor for Flutter.
import 'package:flutter/material.dart';
import 'package:pixels/pixels.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Pixels Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({
super.key,
});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final _controller = PixelImageController(
palette: const PixelPalette.rPlace(),
width: 64,
height: 64,
);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Center(
child: PixelEditor(
controller: _controller,
),
),
);
}
}