Bot Nav Done
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
|
||||
double op1 = 0;
|
||||
double op2 = 0;
|
||||
double op3 = 0;
|
||||
Widget CustomBody({required Widget child,required BuildContext context, required Function() onAnimEnd}) {
|
||||
Widget CustomBody({required Widget child,required BuildContext context, required Function() onAnimEnd, List<BottomNavBarItem>? bottomNav}) {
|
||||
Duration opDuration = const Duration(milliseconds: 1500);
|
||||
var random = new Random();
|
||||
|
||||
@@ -110,11 +110,31 @@ Widget CustomBody({required Widget child,required BuildContext context, required
|
||||
),
|
||||
),
|
||||
),
|
||||
(bottomNav != null) ? Positioned(
|
||||
bottom: 20,
|
||||
right: screenWidth * 0.15,
|
||||
child: Container(
|
||||
width: screenWidth * 0.7,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black26, offset: Offset.fromDirection(1, 2))
|
||||
]),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: bottomNav,
|
||||
)),
|
||||
) : Container(),
|
||||
AnimatedContainer(duration: opDuration,child: child)
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Widget NeonButton(
|
||||
{required void Function() onPressed,
|
||||
required String text,
|
||||
@@ -171,9 +191,37 @@ Widget NeonButton(
|
||||
);
|
||||
}
|
||||
|
||||
class BottomNavBarItem extends StatelessWidget {
|
||||
BottomNavBarItem({required this.active,required IconData this.icon, String? this.text, required Function() this.onPressed,});
|
||||
IconData icon;
|
||||
String? text;
|
||||
Function() onPressed;
|
||||
bool active = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: implement build
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
onPressed();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AnimatedSize(duration: const Duration(milliseconds: 300),child: Icon(icon,size:active ? 45 : 25, color: active ? Colors.deepPurpleAccent : Colors.blue)),
|
||||
(text!=null) ? Text(text!) : Container()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GradientText extends StatelessWidget {
|
||||
const GradientText(
|
||||
{required this.text,
|
||||
{super.key, required this.text,
|
||||
required this.gradient,
|
||||
this.style,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user