Suite API
continuous-integration/drone/push Build is passing Details

messagerie_lucas_test
Félix MIELCAREK 3 years ago
parent b1addf51bb
commit 98f5ed17e2

@ -15,8 +15,6 @@ void main() {
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@ -65,7 +63,6 @@ class CardProvider extends ChangeNotifier{
notifyListeners();
}
void setScreenSize(Size screenSize) => _screenSize = screenSize;
void startPosition(DragStartDetails details) {
@ -88,7 +85,6 @@ class CardProvider extends ChangeNotifier{
final status = getStatus(force: true);
switch (status) {
case CardStatus.like:
like(context);
@ -106,6 +102,7 @@ class CardProvider extends ChangeNotifier{
resetPosition();
}
}
void resetPosition() {
_isDragging = false;
_position = Offset.zero;
@ -154,6 +151,7 @@ class CardProvider extends ChangeNotifier{
}
}
}
void dislike() {
Vibration.vibrate(duration: 20, amplitude: 60);
print("dislike");
@ -176,8 +174,7 @@ class CardProvider extends ChangeNotifier{
gravity: ToastGravity.TOP,
timeInSecForIosWeb: 2,
backgroundColor: Colors.deepPurple,
textColor: Colors.white
);
textColor: Colors.white);
notifyListeners();
}
@ -198,9 +195,11 @@ class CardProvider extends ChangeNotifier{
maxWidth: 600,
maxHeight: double.infinity,
),
builder: (context) => buildSheet(),);
builder: (context) => buildSheet(),
);
notifyListeners();
}
Widget buildSheet() => Container(
height: 550,
width: 350,
@ -232,7 +231,6 @@ class CardProvider extends ChangeNotifier{
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Container(
height: 5,
width: 130,
@ -241,7 +239,9 @@ class CardProvider extends ChangeNotifier{
color: Color(0xFF8A8A8A),
),
),
SizedBox(height: 30,),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 300,
@ -253,7 +253,11 @@ class CardProvider extends ChangeNotifier{
padding: EdgeInsets.all(20),
child: TextField(
maxLength: 300,
style: TextStyle(fontFamily: 'DMSans', color: Colors.white.withOpacity(1) ,fontSize: 17, fontWeight: FontWeight.w200),
style: TextStyle(
fontFamily: 'DMSans',
color: Colors.white.withOpacity(1),
fontSize: 17,
fontWeight: FontWeight.w200),
expands: true,
maxLines: null,
keyboardType: TextInputType.multiline,
@ -267,7 +271,9 @@ class CardProvider extends ChangeNotifier{
),
),
),
SizedBox(height: 20,),
SizedBox(
height: 20,
),
SizedBox(
width: double.infinity,
height: 70,
@ -275,19 +281,21 @@ class CardProvider extends ChangeNotifier{
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Color(0xFF3F1DC3),
textStyle: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold),
textStyle:
TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17)
),
borderRadius: BorderRadius.circular(17)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text("Envoyer"),
Opacity(opacity: 0.2,
child: Image.asset("assets/images/send_logo.png",),)
Opacity(
opacity: 0.2,
child: Image.asset(
"assets/images/send_logo.png",
),
)
],
),
),
@ -295,10 +303,8 @@ class CardProvider extends ChangeNotifier{
],
),
),
);
void like(context) {
Vibration.vibrate(duration: 20, amplitude: 60);
print("like");
@ -306,7 +312,6 @@ class CardProvider extends ChangeNotifier{
_position += Offset(2 * _screenSize.width, 0);
_nextCard();
notifyListeners();
}
Future _nextCard() async {
@ -326,10 +331,8 @@ class CardProvider extends ChangeNotifier{
await Future.delayed(Duration(milliseconds: 200));
resetPosition();
}
}
class Splash extends StatefulWidget {
const Splash({Key? key}) : super(key: key);
@ -338,24 +341,17 @@ class Splash extends StatefulWidget {
}
class _SplashState extends State<Splash> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
Timer(Duration(seconds: 2), () {
Navigator.pushReplacement(context,
MaterialPageRoute(builder:
(context) =>MainPage()
)
);
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (context) => MainPage()));
});
});
}
@override
Widget build(BuildContext context) {
return Scaffold(

Loading…
Cancel
Save