perisst
continuous-integration/drone/push Build is passing Details

RESET_PASSWORD_EKA
Lucas Delanier 1 year ago
parent cb1fbb43db
commit 55294f9b8a

@ -0,0 +1,43 @@
import 'package:flutter/Material.dart';
class HistoricComponent extends StatefulWidget {
final int month;
const HistoricComponent({super.key, required this.month});
@override
State<HistoricComponent> createState() => _HistoricComponentState();
}
class _HistoricComponentState extends State<HistoricComponent> {
int getNumberOfDaysInMonth(int year, int month) {
if (month < 1 || month > 12) {
throw ArgumentError("Le numéro de mois doit être compris entre 1 et 12.");
}
return DateTime(year, month + 1, 0).day;
}
@override
Widget build(BuildContext context) {
return Wrap(
spacing: 14,
runSpacing: 14,
children: List.generate(getNumberOfDaysInMonth(DateTime.now().year, widget.month), (index) {
// Generate widgets
return LimitedBox(
maxWidth: MediaQuery.of(context).size.width - 40 / 5,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Color(0xFF1E1E1E).withOpacity(0.7),
Color(0xFF1E1E1E).withOpacity(0),
], begin: Alignment.topCenter, end: Alignment.bottomCenter),
borderRadius: BorderRadius.circular(3)),
height: 60,
width: 60,
),
);
}),
);
}
}

@ -1,5 +1,6 @@
import 'package:flutter/Material.dart';
import 'package:justmusic/screens/add_friend_screen.dart';
import 'package:justmusic/screens/capsule_historic_screen.dart';
import 'package:justmusic/screens/change_password_screen.dart';
import 'package:justmusic/screens/feed_screen.dart';
import 'package:justmusic/screens/profile_screen.dart';
@ -90,3 +91,21 @@ Route routePassword() {
},
);
}
Route routeHistoric() {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => const CapsuleHistoricScreen(),
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,
);
},
);
}

@ -0,0 +1,94 @@
import 'package:flutter/Material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../components/historic_component.dart';
import '../values/constants.dart';
class CapsuleHistoricScreen extends StatefulWidget {
const CapsuleHistoricScreen({super.key});
@override
State<CapsuleHistoricScreen> createState() => _CapsuleHistoricScreenState();
}
class _CapsuleHistoricScreenState extends State<CapsuleHistoricScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: Size(double.infinity, 58),
child: Container(
height: double.infinity,
color: bgAppBar,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: defaultPadding),
child: Stack(
alignment: Alignment.centerLeft,
children: [
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
Navigator.pop(context, true);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 30,
width: 30,
child: Image(
image: AssetImage("assets/images/return_icon.png"),
height: 8,
),
)),
Align(
child: Text(
"Historique des capsules",
style: GoogleFonts.plusJakartaSans(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
),
)
],
),
),
),
),
body: Container(
width: double.infinity,
height: double.infinity,
color: bgColor,
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: settingPadding),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 30, bottom: 40),
child: SizedBox(
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 15),
constraints: BoxConstraints(maxWidth: 600),
child: Column(
children: [
HistoricComponent(
month: DateTime.now().month,
),
],
),
)
],
),
),
),
],
),
),
),
),
);
}
}

@ -26,6 +26,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
Navigator.pushNamed(context, '/welcome');
}
void _openHistoric() {
Navigator.of(context).push(routeHistoric());
}
void _openDetail() {
Navigator.of(context).push(routeUser(MyApp.userViewModel.userCurrent));
}
@ -107,10 +111,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
label: 'Compte',
action: _openDetail,
),
const SettingPartComponent(
SettingPartComponent(
icon: JustMusicIcon.history,
label: 'Historiques des capsules',
action: null,
action: _openHistoric,
),
const SettingPartComponent(
icon: JustMusicIcon.spotify,

Loading…
Cancel
Save