|
|
@ -1,7 +1,10 @@
|
|
|
|
|
|
|
|
import 'package:another_flushbar/flushbar.dart';
|
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
|
|
|
import 'package:ionicons/ionicons.dart';
|
|
|
|
|
|
|
|
import 'package:zoom_tap_animation/zoom_tap_animation.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../config/routes.dart';
|
|
|
|
import '../config/routes.dart';
|
|
|
|
import '../values/constants.dart';
|
|
|
|
import '../values/constants.dart';
|
|
|
@ -15,13 +18,59 @@ class TopNavBarComponent extends StatefulWidget {
|
|
|
|
State<TopNavBarComponent> createState() => _TopNavBarComponentState();
|
|
|
|
State<TopNavBarComponent> createState() => _TopNavBarComponentState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _TopNavBarComponentState extends State<TopNavBarComponent> {
|
|
|
|
class _TopNavBarComponentState extends State<TopNavBarComponent>
|
|
|
|
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
bool choice = true;
|
|
|
|
bool choice = true;
|
|
|
|
|
|
|
|
late AnimationController _controller;
|
|
|
|
|
|
|
|
|
|
|
|
void actionSurBouton() {
|
|
|
|
void actionSurBouton() {
|
|
|
|
widget.callback(choice);
|
|
|
|
widget.callback(choice);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void initState() {
|
|
|
|
|
|
|
|
_controller = AnimationController(
|
|
|
|
|
|
|
|
vsync: this,
|
|
|
|
|
|
|
|
duration: Duration(seconds: 3),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void showCapsuleDot() {
|
|
|
|
|
|
|
|
Flushbar(
|
|
|
|
|
|
|
|
maxWidth: 210,
|
|
|
|
|
|
|
|
animationDuration: Duration(seconds: 1),
|
|
|
|
|
|
|
|
forwardAnimationCurve: Curves.easeOutCirc,
|
|
|
|
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
|
|
|
|
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
Ionicons.sparkles,
|
|
|
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
|
|
|
size: 22,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
|
|
|
|
|
|
|
|
messageText: Align(
|
|
|
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
"Capsule disponible",
|
|
|
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
flushbarStyle: FlushbarStyle.FLOATING,
|
|
|
|
|
|
|
|
flushbarPosition: FlushbarPosition.BOTTOM,
|
|
|
|
|
|
|
|
textDirection: Directionality.of(context),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(1000),
|
|
|
|
|
|
|
|
borderWidth: 1,
|
|
|
|
|
|
|
|
borderColor: Colors.white.withOpacity(0.04),
|
|
|
|
|
|
|
|
duration: const Duration(minutes: 100),
|
|
|
|
|
|
|
|
leftBarIndicatorColor: Colors.transparent,
|
|
|
|
|
|
|
|
positionOffset: 20,
|
|
|
|
|
|
|
|
onTap: (_) {
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, '/post');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).show(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
@ -38,11 +87,12 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> {
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: GestureDetector(
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pushNamed(context, '/post');
|
|
|
|
showCapsuleDot();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: const Image(
|
|
|
|
child: const Icon(
|
|
|
|
image: AssetImage("assets/images/add_friend.png"),
|
|
|
|
Icons.person_add_alt_1_rounded,
|
|
|
|
width: 25,
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
size: 30,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -51,10 +101,19 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const Image(
|
|
|
|
ZoomTapAnimation(
|
|
|
|
image: AssetImage("assets/images/logo.png"),
|
|
|
|
enableLongTapRepeatEvent: false,
|
|
|
|
height: 30,
|
|
|
|
longTapRepeatDuration: const Duration(milliseconds: 100),
|
|
|
|
),
|
|
|
|
begin: 1.0,
|
|
|
|
|
|
|
|
end: 0.97,
|
|
|
|
|
|
|
|
beginDuration: const Duration(milliseconds: 70),
|
|
|
|
|
|
|
|
endDuration: const Duration(milliseconds: 100),
|
|
|
|
|
|
|
|
beginCurve: Curves.decelerate,
|
|
|
|
|
|
|
|
endCurve: Curves.easeInOutSine,
|
|
|
|
|
|
|
|
child: Image(
|
|
|
|
|
|
|
|
image: AssetImage("assets/images/logo.png"),
|
|
|
|
|
|
|
|
height: 30,
|
|
|
|
|
|
|
|
)),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
@ -139,7 +198,7 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> {
|
|
|
|
// Image radius
|
|
|
|
// Image radius
|
|
|
|
child: const Image(
|
|
|
|
child: const Image(
|
|
|
|
image: AssetImage("assets/images/exemple_profile.png"),
|
|
|
|
image: AssetImage("assets/images/exemple_profile.png"),
|
|
|
|
width: 25,
|
|
|
|
width: 30,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|