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

Loading…
Cancel
Save