message pop up

pull/81/head
Lucas Delanier 3 years ago
parent 0de7e05eea
commit 8e87374d07

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -1,4 +1,5 @@
import 'dart:async';
import 'package:dafl_project_flutter/views/pages/main/w_bottomsheet.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'dart:math';
import './views/pages/home/p_home.dart';
@ -80,7 +81,7 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
void endPosition() {
void endPosition(context) {
_isDragging = false;
notifyListeners();
@ -89,7 +90,7 @@ class CardProvider extends ChangeNotifier{
switch (status) {
case CardStatus.like:
like();
like(context);
break;
case CardStatus.disLike:
dislike();
@ -170,7 +171,7 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
void like() {
void like(context) {
print("like");
_angle = 20;
_position += Offset(2 * _screenSize.width, 0);
@ -191,6 +192,7 @@ class CardProvider extends ChangeNotifier{
await Future.delayed(Duration(milliseconds: 200));
resetPosition();
}
}

@ -29,6 +29,7 @@ class _MainPageState extends State<MainPage> {
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
return Scaffold(
resizeToAvoidBottomInset: false,
body: screens[_index],
bottomNavigationBar: NavigationBarTheme(
data: NavigationBarThemeData(

@ -0,0 +1,3 @@
import 'package:flutter/cupertino.dart';

@ -149,7 +149,7 @@ class _CardWidgetState extends State<CardWidget>{
onPanEnd: (details) {
final provider = Provider.of<CardProvider>(context, listen: false);
provider.endPosition();
provider.endPosition(this.context);
},

@ -109,9 +109,21 @@ class _SpotsWidgetState extends State<SpotsWidget> {
width: width*0.1,
),
GestureDetector(
onLongPress: (){
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
constraints: BoxConstraints(
maxWidth: 600,
maxHeight: double.infinity,
),
builder: (context) => buildSheet(),);
},
onTap: () {
final provider = Provider.of<CardProvider>(context, listen: false);
provider.like();
provider.like(this.context);
},
child: Image.asset(
'assets/images/bouton_like.png',
@ -171,6 +183,85 @@ class _SpotsWidgetState extends State<SpotsWidget> {
);
}
Widget buildSheet() => Container(
height: 550,
width: 330,
decoration: BoxDecoration(
color: Color(0xFF232123),
borderRadius: BorderRadius.only(
topRight: Radius.circular(30),
topLeft: Radius.circular(30),
),
),
child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: 5,
width: 130,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFF8A8A8A),
),
),
SizedBox(height: 30,),
Container(
width: double.infinity,
height: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFF302C30),
),
child: Padding(
padding: EdgeInsets.all(20),
child: TextField(
maxLength: 200,
style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),
expands: true,
maxLines: null,
keyboardType: TextInputType.multiline,
decoration: InputDecoration(
hintStyle: TextStyle(
color: Colors.white,
),
border: InputBorder.none,
hintText: "Mon message",
),
),
),
),
SizedBox(height: 20,),
SizedBox(
width: double.infinity,
height: 70,
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Color(0xFF3F1DC3),
textStyle: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17)
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text("Envoyer"),
Opacity(opacity: 0.2,
child: Image.asset("assets/images/send_logo.png",),)
],
),
),
)
],
),
),
);
}

Loading…
Cancel
Save