make fabs to AppBar icon buttons

This commit is contained in:
2025-08-03 10:20:50 +02:00
parent 2e72060087
commit fb81499fed

View File

@@ -75,7 +75,35 @@ class _SheetViewerPageState extends State<SheetViewerPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: Text(widget.sheet.name)), appBar: AppBar(
title: Text(widget.sheet.name),
actions: [
IconButton(
onPressed: () {
setState(() {
if (twoPageMode) {
// TODO: notification that paint mode only in single page mode
} else {
paintMode = !paintMode;
}
});
},
icon: Icon(Icons.brush),
),
IconButton(
onPressed: () {
setState(() {
twoPageMode = !twoPageMode;
if (twoPageMode) {
paintMode = false;
// TODO: notification that paint mode was deactivated since only possible in single page mode
}
});
},
icon: Icon(twoPageMode ? Icons.filter_1 : Icons.filter_2),
),
],
),
body: FutureBuilder( body: FutureBuilder(
future: documentLoaded, future: documentLoaded,
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) { builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
@@ -211,42 +239,6 @@ class _SheetViewerPageState extends State<SheetViewerPage> {
), ),
], ],
), ),
Container(
alignment: Alignment.bottomLeft,
margin: EdgeInsets.all(10),
child: Column(
spacing: 10,
mainAxisAlignment: MainAxisAlignment.end,
children: [
FloatingActionButton(
onPressed: () {
setState(() {
if (twoPageMode) {
// TODO: notification that paint mode only in single page mode
} else {
paintMode = !paintMode;
}
});
},
child: Icon(Icons.brush),
),
FloatingActionButton(
onPressed: () {
setState(() {
twoPageMode = !twoPageMode;
if (twoPageMode) {
paintMode = false;
// TODO: notification that paint mode was deactivated since only possible in single page mode
}
});
},
child: Icon(
twoPageMode ? Icons.filter_1 : Icons.filter_2,
),
),
],
),
),
], ],
); );
} else if (snapshot.hasError) { } else if (snapshot.hasError) {