add fake navigation

WORK-LDE
Lucas Delanier 2 years ago
parent 30150df695
commit d3d64ad1ec

@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../config/routes.dart';
import '../values/constants.dart';
class TopNavBarComponent extends StatefulWidget {
@ -33,13 +34,18 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Flexible(
Flexible(
flex: 1,
child: Image(
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/post');
},
child: const Image(
image: AssetImage("assets/images/add_friend.png"),
width: 25,
),
),
),
ConstrainedBox(
constraints: BoxConstraints(maxWidth: 170),
child: Column(
@ -126,12 +132,12 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> {
flex: 1,
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/profile');
Navigator.of(context).push(createRoute());
},
child: ClipOval(
child: SizedBox.fromSize(
// Image radius
child: Image(
child: const Image(
image: AssetImage("assets/images/exemple_profile.png"),
width: 25,
),

@ -0,0 +1,21 @@
import 'package:flutter/Material.dart';
import 'package:justmusic/screens/profile_screen.dart';
Route createRoute() {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) =>
const ProfileScreen(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0.0);
const end = Offset.zero;
const curve = Curves.ease;
var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
);
}

@ -244,7 +244,6 @@ class _FeedScreenState extends State<FeedScreen>
children: [
CircularRevealAnimation(
animation: animation,
// centerAlignment: Alignment.centerRight,
centerOffset: Offset(30.w, -100),
child: SingleChildScrollView(
child: SizedBox(

@ -33,11 +33,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
onTap: () {
Navigator.pop(context);
},
child: Container(
height: 15,
width: 15,
child: Image(
image: AssetImage("assets/images/return_icon.png"),
height: 11.h,
),
height: 8,
),
)),
Align(
child: Text(
"Profile",

Loading…
Cancel
Save