Created the bottom control bar
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class FloatingToolbar extends StatelessWidget {
|
||||
const FloatingToolbar({super.key, required this.primColor});
|
||||
@@ -6,27 +7,49 @@ class FloatingToolbar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color textColor = primColor.computeLuminance() > 0.5
|
||||
? Colors.black
|
||||
: Colors.white;
|
||||
|
||||
return BottomAppBar(
|
||||
color: primColor,
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Key:',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color: primColor.computeLuminance() > 0.5
|
||||
? Colors.black
|
||||
: Colors.white,
|
||||
child: IconTheme(
|
||||
data: IconThemeData(color: textColor),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('Key:', style: TextStyle(fontSize: 20, color: textColor)),
|
||||
Padding(padding: EdgeInsetsGeometry.all(5)),
|
||||
SizedBox(
|
||||
width: 30,
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
hintText: '12',
|
||||
hintStyle: TextStyle(color: Colors.yellow),
|
||||
),
|
||||
style: TextStyle(color: textColor, fontSize: 20),
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.code, size: 50),
|
||||
color: Colors.green,
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
IconButton(
|
||||
tooltip: 'Increase key by +1',
|
||||
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: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
),
|
||||
|
||||
floatingActionButton: FloatingToolbar(primColor: primColor),
|
||||
bottomNavigationBar: FloatingToolbar(primColor: primColor),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user