body_part_selector 0.2.0 body_part_selector: ^0.2.0 copied to clipboard
A beautiful selector for different body parts
import 'package:body_part_selector/body_part_selector.dart';
import 'package:flutter/material.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: 'Body Part Selector',
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.purple),
),
home: const MyHomePage(title: 'Body Part Selector'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({required this.title, super.key});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
BodyParts _bodyParts = const BodyParts();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: SafeArea(
child: BodyPartSelectorTurnable(
bodyParts: _bodyParts,
onSelectionUpdated: (p) => setState(() => _bodyParts = p),
labelData: const RotationStageLabelData(
front: 'Vorne',
left: 'Links',
right: 'Rechts',
back: 'Hinten',
),
),
),
);
}
}