Created the bottom control bar

This commit is contained in:
2026-07-04 02:28:00 +03:00
parent 2cecb059f2
commit 14d100d79d
2 changed files with 41 additions and 18 deletions
+33 -10
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class FloatingToolbar extends StatelessWidget { class FloatingToolbar extends StatelessWidget {
const FloatingToolbar({super.key, required this.primColor}); const FloatingToolbar({super.key, required this.primColor});
@@ -6,28 +7,50 @@ class FloatingToolbar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Color textColor = primColor.computeLuminance() > 0.5
? Colors.black
: Colors.white;
return BottomAppBar( return BottomAppBar(
color: primColor, color: primColor,
child: IconTheme(
data: IconThemeData(color: textColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text('Key:', style: TextStyle(fontSize: 20, color: textColor)),
'Key:', Padding(padding: EdgeInsetsGeometry.all(5)),
style: TextStyle( SizedBox(
fontSize: 24, width: 30,
color: primColor.computeLuminance() > 0.5 child: TextField(
? Colors.black keyboardType: TextInputType.number,
: Colors.white, decoration: InputDecoration(
border: UnderlineInputBorder(),
hintText: '12',
hintStyle: TextStyle(color: Colors.yellow),
),
style: TextStyle(color: textColor, fontSize: 20),
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
), ),
), ),
IconButton( IconButton(
icon: Icon(Icons.code, size: 50), tooltip: 'Increase key by +1',
color: Colors.green, icon: const Icon(Icons.plus_one),
onPressed: () {},
),
IconButton(
tooltip: 'Decrease key by -1',
icon: const Icon(Icons.exposure_minus_1_outlined),
onPressed: () {},
),
IconButton(
tooltip: 'Swap',
icon: const Icon(Icons.swap_horiz),
onPressed: () {}, onPressed: () {},
), ),
], ],
), ),
),
); );
} }
} }
+1 -1
View File
@@ -61,7 +61,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
), ),
floatingActionButton: FloatingToolbar(primColor: primColor), bottomNavigationBar: FloatingToolbar(primColor: primColor),
); );
} }
} }