Added content screen
BIN
assets/images/buttons/close.png
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
assets/images/buttons/microphone.png
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
assets/images/buttons/next.png
Normal file
After Width: | Height: | Size: 144 KiB |
BIN
assets/images/buttons/previous.png
Normal file
After Width: | Height: | Size: 158 KiB |
BIN
assets/images/buttons/sound.png
Normal file
After Width: | Height: | Size: 108 KiB |
BIN
assets/images/content_bg.png
Normal file
After Width: | Height: | Size: 205 KiB |
BIN
assets/images/content_score_board.png
Normal file
After Width: | Height: | Size: 97 KiB |
76
lib/view/screens/content.dart
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
import 'package:easy_learn/view/widgets/list_contents_box.dart';
|
||||||
|
import 'package:easy_learn/view/widgets/score_board.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:easy_learn/view/widgets/custom_button.dart';
|
||||||
|
|
||||||
|
class Content extends StatefulWidget {
|
||||||
|
const Content({Key? key, required this.category}) : super(key: key);
|
||||||
|
|
||||||
|
final String category;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ContentState createState() => _ContentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ContentState extends State<Content> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/content_bg.png'),
|
||||||
|
fit: BoxFit.cover
|
||||||
|
)
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(left: 10.0, bottom: 60.0),
|
||||||
|
child: const CustomButton(name: 'close', size: 60.0,)
|
||||||
|
),
|
||||||
|
const ScoreBoard(),
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(right: 10.0, bottom: 60.0),
|
||||||
|
child: const CustomButton(name: 'sound', size: 60.0,)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(left: 5.0),
|
||||||
|
child: const CustomButton(name: 'previous', size: 100.0,)
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 180,
|
||||||
|
height: 180,
|
||||||
|
child: ListContentsBox(
|
||||||
|
imagePath: 'assets/images/list_contents_animals.png',
|
||||||
|
title: 'Animals'
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(right: 5.0),
|
||||||
|
child: const CustomButton(name: 'next', size: 100.0,)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: const [
|
||||||
|
CustomButton(name: 'microphone', size: 190.0)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
40
lib/view/widgets/custom_button.dart
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class CustomButton extends StatefulWidget {
|
||||||
|
const CustomButton({Key? key, required this.name, required this.size}) : super(key: key);
|
||||||
|
|
||||||
|
final String name;
|
||||||
|
final double size;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_CustomButtonState createState() => _CustomButtonState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CustomButtonState extends State<CustomButton> {
|
||||||
|
bool isTap = false;
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
isTap = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onTapDown: (x) {
|
||||||
|
setState(() {
|
||||||
|
isTap = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 150),
|
||||||
|
width: isTap ? widget.size - 10 : widget.size,
|
||||||
|
height: isTap ? widget.size - 10 : widget.size,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/buttons/${widget.name}.png'),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
18
lib/view/widgets/score_board.dart
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ScoreBoard extends StatelessWidget {
|
||||||
|
const ScoreBoard({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: 250,
|
||||||
|
height: 200,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('assets/images/content_score_board.png'),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|