change screen call with parameter to reconize witch screen to display
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
25d036cc63
commit
a2257a8711
@ -0,0 +1,91 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
import '../model/Round.dart';
|
||||||
|
import '../widgets/button_new_party.dart';
|
||||||
|
import '../widgets/ingame_widgets.dart';
|
||||||
|
import '../widgets/scores_list_widget.dart';
|
||||||
|
|
||||||
|
class InGameScreen extends StatefulWidget {
|
||||||
|
final Round currentRound;
|
||||||
|
const InGameScreen({Key? key, required this.currentRound}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<InGameScreen> createState() => _InGameScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InGameScreenState extends State<InGameScreen> {
|
||||||
|
late Widget widgetHolder;
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
if (widget.currentRound.firstThrow == null)
|
||||||
|
widgetHolder = InGameCardThrow(numberThrow: 1);
|
||||||
|
else if (widget.currentRound.secondThrow == null) {
|
||||||
|
widgetHolder = InGameCardThrow(numberThrow: 2);
|
||||||
|
} else {
|
||||||
|
widgetHolder = InGameCardThrow(numberThrow: 3);
|
||||||
|
}
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [
|
||||||
|
Color(0xff19BDE0),
|
||||||
|
Color(0xff4A17DC),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 120,
|
||||||
|
),
|
||||||
|
widgetHolder,
|
||||||
|
Spacer(),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
widgetHolder = InGameCardThrow(
|
||||||
|
numberThrow: 2,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
"PLAY",
|
||||||
|
style: GoogleFonts.roboto(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 40,
|
||||||
|
color: Color(0xff1ABAE0)),
|
||||||
|
),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
side: BorderSide(
|
||||||
|
width: 7,
|
||||||
|
color: Color(0xff1ABAE0),
|
||||||
|
),
|
||||||
|
onPrimary: Colors.transparent,
|
||||||
|
primary: Colors.transparent,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(55),
|
||||||
|
),
|
||||||
|
minimumSize: Size(200, 80),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue