From f7db676502dc70c652d4493c9eeb94174c870637 Mon Sep 17 00:00:00 2001 From: delanierlucas Date: Sat, 5 Nov 2022 18:14:54 +0100 Subject: [PATCH] creation page tops --- .idea/libraries/Dart_Packages.xml | 8 + .../lib/views/pages/main/p_main.dart | 30 +++- .../lib/views/pages/main/w_top.dart | 144 ++++++++++++++++++ Sources/dafl_project_flutter/pubspec.lock | 7 + Sources/dafl_project_flutter/pubspec.yaml | 1 + 5 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 Sources/dafl_project_flutter/lib/views/pages/main/w_top.dart diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml index 6362b19..279019c 100644 --- a/.idea/libraries/Dart_Packages.xml +++ b/.idea/libraries/Dart_Packages.xml @@ -184,6 +184,13 @@ + + + + + + @@ -532,6 +539,7 @@ + diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart index 0764fe9..4a083b9 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/p_main.dart @@ -1,4 +1,5 @@ import 'package:dafl_project_flutter/presentation/custom_icons_icons.dart'; +import 'package:dafl_project_flutter/views/pages/main/w_top.dart'; import 'package:flutter/material.dart'; import './w_settings.dart'; import './w_spot.dart'; @@ -19,9 +20,9 @@ class _MainPageState extends State { int get index => _index; final screens = [ ProfilWidget(), - new DiscoveryWidget(), + DiscoveryWidget(), SpotsWidget(), - Center(child: Text('Tops'),), + TopsWidget(), MessagesWidget(), SettingsWidget(), ]; @@ -62,4 +63,29 @@ class _MainPageState extends State { ), ); } + + +} + +class GradientText extends StatelessWidget { + const GradientText( + this.text, { + required this.gradient, + this.style, + }); + + final String text; + final TextStyle? style; + final Gradient gradient; + + @override + Widget build(BuildContext context) { + return ShaderMask( + blendMode: BlendMode.srcIn, + shaderCallback: (bounds) => gradient.createShader( + Rect.fromLTWH(0, 0, bounds.width, bounds.height), + ), + child: Text(text, style: style), + ); + } } \ No newline at end of file diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_top.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_top.dart new file mode 100644 index 0000000..26c28bf --- /dev/null +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_top.dart @@ -0,0 +1,144 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:fluttericon/font_awesome5_icons.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import 'p_main.dart'; + +class TopsWidget extends StatefulWidget { + const TopsWidget({Key? key}) : super(key: key); + + @override + State createState() => _TopsWidgetState(); +} + +class _TopsWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + color: Color(0xFF141414), + + child: Padding(padding: EdgeInsets.fromLTRB(0, 50, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.fromLTRB(30, 0, 30, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Les Tops', style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500, fontSize: 25),), + Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)), + Text('Retrouvez ici les titres les plus écoutés', style: TextStyle(color: Colors.grey.withOpacity(0.4), fontSize: 15),), + ], + ), + ), + Expanded(child: ListView( + children: [ + TopWidget(), + TopWidget(), + TopWidget(), + TopWidget(), + TopWidget(), + TopWidget(), + ], + )), + + ], + ),), + ); + } + +} + +class TopWidget extends StatelessWidget{ + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.fromLTRB(30, 0, 30, 0), + width: double.infinity, + height: 200, + child: Column( + + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + alignment: AlignmentDirectional.centerEnd, + clipBehavior: Clip.none, + children: [ + Positioned(child: Icon(FontAwesomeIcons.champagneGlasses,size: 50,color: Colors.white,), + right: 20, + top: -15,), + Container( + width: double.infinity, + height: 35, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Color(0xFFD9D9D9).withOpacity(0.16), + ), + child: Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: EdgeInsets.fromLTRB(20, 0, 0, 0), + child: Text('Pour mon mariage',style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold,fontSize: 16),), + ), + ) + ), + ], + ), + SizedBox(height: 20,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(15, 0, 0, 0), + child: ClipRRect( + borderRadius: BorderRadius.circular(15), + child: FadeInImage.assetNetwork( + height: 120, + width: 120, + placeholder: "assets/images/loadingPlaceholder.gif", image: 'https://images.genius.com/ef4849be3da5fdb22ea9e656679be3a3.600x600x1.jpg'), + ), + ), + Stack( + children: [ + Container( + margin: EdgeInsets.fromLTRB(12, 5, 80, 60), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('BAMBINA', style: TextStyle(fontSize:25, fontWeight: FontWeight.w700, color: Colors.white),), + Text('PNL', style: TextStyle(fontSize:20, fontWeight: FontWeight.w400, color: Colors.grey),), + ], + ), + ), + Positioned( + bottom: 0, + right: 0, + child: Row( + children: [ + GradientText( + '7,2%', + style: const TextStyle(fontSize: 60, fontWeight: FontWeight.bold), + gradient: LinearGradient(colors: [ + Colors.orange, + Colors.red, + Colors.purple, + ]), + ), + ], + ), + ), + ], + ), + + ], + ), + ], + ), + ); + } +} diff --git a/Sources/dafl_project_flutter/pubspec.lock b/Sources/dafl_project_flutter/pubspec.lock index 96388e7..1ffe1de 100644 --- a/Sources/dafl_project_flutter/pubspec.lock +++ b/Sources/dafl_project_flutter/pubspec.lock @@ -177,6 +177,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "8.1.1" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "10.2.1" graphs: dependency: transitive description: diff --git a/Sources/dafl_project_flutter/pubspec.yaml b/Sources/dafl_project_flutter/pubspec.yaml index e41b996..7dfb82a 100644 --- a/Sources/dafl_project_flutter/pubspec.yaml +++ b/Sources/dafl_project_flutter/pubspec.yaml @@ -45,6 +45,7 @@ dependencies: vibration: ^1.7.6 postgresql2: ^1.0.3 path_provider: ^2.0.11 + font_awesome_flutter: ^10.2.1 dev_dependencies: flutter_test: