|
|
@ -1,4 +1,5 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
import 'package:vibration/vibration.dart';
|
|
|
|
import 'package:vibration/vibration.dart';
|
|
|
|
import 'dart:math';
|
|
|
|
import 'dart:math';
|
|
|
@ -9,6 +10,7 @@ import 'package:flutter/services.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:rive/rive.dart' as riv;
|
|
|
|
import 'package:rive/rive.dart' as riv;
|
|
|
|
import '../controller/controller.dart';
|
|
|
|
import '../controller/controller.dart';
|
|
|
|
|
|
|
|
import 'package:home_indicator/home_indicator.dart';
|
|
|
|
import '../model/music.dart';
|
|
|
|
import '../model/music.dart';
|
|
|
|
import 'model/music.dart';
|
|
|
|
import 'model/music.dart';
|
|
|
|
import 'model/spot.dart';
|
|
|
|
import 'model/spot.dart';
|
|
|
@ -22,12 +24,11 @@ void main() {
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
Controller controller = Controller();
|
|
|
|
Controller controller = Controller();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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){
|
|
|
|
Paint.enableDithering = true;
|
|
|
|
Paint.enableDithering = true;
|
|
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
|
|
|
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]);
|
|
|
|
return ChangeNotifierProvider(
|
|
|
|
return ChangeNotifierProvider(
|
|
|
|
create: (context) => CardProvider(),
|
|
|
|
create: (context) => CardProvider(),
|
|
|
|
child: MaterialApp(
|
|
|
|
child: MaterialApp(
|
|
|
@ -159,8 +160,8 @@ class CardProvider extends ChangeNotifier{
|
|
|
|
_position -= Offset(0, -_screenSize.height);
|
|
|
|
_position -= Offset(0, -_screenSize.height);
|
|
|
|
_discovery_card();
|
|
|
|
_discovery_card();
|
|
|
|
print("discovery");
|
|
|
|
print("discovery");
|
|
|
|
if(MyApp().controller.currentUser.Discovery.contains(MyApp().controller.currentUser.Spots2?.last.music)){
|
|
|
|
if(MyApp().controller.currentUser.Discovery.contains(MyApp().controller.currentUser.Spots2.last.music)){
|
|
|
|
MyApp().controller.currentUser.Discovery.remove(MyApp().controller.currentUser.Spots2?.last.music);
|
|
|
|
MyApp().controller.currentUser.Discovery.remove(MyApp().controller.currentUser.Spots2.last.music);
|
|
|
|
Fluttertoast.showToast(
|
|
|
|
Fluttertoast.showToast(
|
|
|
|
msg: 'Supprimer',
|
|
|
|
msg: 'Supprimer',
|
|
|
|
toastLength: Toast.LENGTH_SHORT,
|
|
|
|
toastLength: Toast.LENGTH_SHORT,
|
|
|
@ -203,14 +204,17 @@ class CardProvider extends ChangeNotifier{
|
|
|
|
maxWidth: 600,
|
|
|
|
maxWidth: 600,
|
|
|
|
maxHeight: double.infinity,
|
|
|
|
maxHeight: double.infinity,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
builder: (context) => buildSheet(),);
|
|
|
|
builder: (context) => buildSheet(context),);
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Widget buildSheet(){
|
|
|
|
Widget buildSheet(context){
|
|
|
|
final messageTextField = TextEditingController();
|
|
|
|
final messageTextField = TextEditingController();
|
|
|
|
return Container(
|
|
|
|
return SingleChildScrollView(
|
|
|
|
height: 550,
|
|
|
|
padding:
|
|
|
|
width: 350,
|
|
|
|
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 500,
|
|
|
|
|
|
|
|
width: 380,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
boxShadow: [
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
BoxShadow(
|
|
|
@ -259,6 +263,7 @@ class CardProvider extends ChangeNotifier{
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
keyboardAppearance: Brightness.dark,
|
|
|
|
controller: messageTextField,
|
|
|
|
controller: messageTextField,
|
|
|
|
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),
|
|
|
@ -306,6 +311,7 @@ class CardProvider extends ChangeNotifier{
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|