Backend Structure implemented All Ratings will be pulled and validated Pop Up notfies user about all his ratings If confirmed, data will be send to the supabase server (if any data was found) No comments were made, who else needs to read this?
133 lines
5.8 KiB
Dart
133 lines
5.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
|
import 'package:mensaapp/modules/ratingEmote.dart';
|
|
import 'package:mensaapp/modules/ratingStars.dart';
|
|
import 'package:mensaapp/providers/languageProvider.dart';
|
|
import 'package:mensaapp/providers/spezielleErnaehrungProvider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
class PageSpezielleErnaehrung extends StatelessWidget {
|
|
const PageSpezielleErnaehrung({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final FocusNode _focus = FocusNode();
|
|
|
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
_focus.unfocus();
|
|
},
|
|
child: Scaffold(
|
|
body: Stack(
|
|
children: [
|
|
Center(
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width * 0.8,
|
|
height: MediaQuery.of(context).size.height,
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
|
fit: BoxFit.cover,
|
|
colorFilter: ColorFilter.mode(
|
|
Colors.white.withOpacity(0.6), BlendMode.dstATop),
|
|
)),
|
|
),
|
|
),
|
|
Center(
|
|
child: SingleChildScrollView(
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withOpacity(0.9),
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(80),
|
|
bottomRight: Radius.circular(80))),
|
|
width: 650,
|
|
height: 450,
|
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageSpecial"]["question1"],
|
|
style: TextStyle(fontSize: 35),
|
|
),
|
|
Consumer<SpezielleErnaehrungProvider>(
|
|
builder:
|
|
(context, spezielleErnaehrungProvider, child) {
|
|
return RatingStars(
|
|
onRate: (value) {
|
|
spezielleErnaehrungProvider
|
|
.setRatingFrage1(value);
|
|
},
|
|
initRating: spezielleErnaehrungProvider
|
|
.frage1,
|
|
);
|
|
},
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageSpecial"]["question2"],
|
|
style: TextStyle(fontSize: 35),
|
|
),
|
|
Consumer<SpezielleErnaehrungProvider>(
|
|
builder:
|
|
(context, spezielleErnaehrungProvider, child) {
|
|
return RatingStars(
|
|
onRate: (value) {
|
|
spezielleErnaehrungProvider
|
|
.setRatingFrage2(value);
|
|
},
|
|
initRating:
|
|
spezielleErnaehrungProvider.frage2,
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(
|
|
height: 50,
|
|
),
|
|
Consumer<SpezielleErnaehrungProvider>(
|
|
builder: (context, spezielleErnaehrungProvider, child) {
|
|
return TextFormField(
|
|
initialValue: spezielleErnaehrungProvider.freiText,
|
|
onChanged: (value) {
|
|
spezielleErnaehrungProvider.setFreiText(value);
|
|
},
|
|
autofocus: false,
|
|
maxLength: 500,
|
|
maxLines: 5,
|
|
focusNode: _focus,
|
|
decoration: InputDecoration(
|
|
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
|
labelStyle: const TextStyle(fontSize: 20),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(15)),
|
|
),
|
|
style: TextStyle(fontSize: 20),
|
|
);
|
|
},
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
});
|
|
}
|
|
}
|