1
This commit is contained in:
parent
577a4e6b8f
commit
0f7a9489a9
@ -31,178 +31,14 @@ class HomePage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
_buildHead(),
|
_buildHead(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
_buildDailyQuote(),
|
||||||
_buildDailyQuote(),
|
Expanded(child: Container()),
|
||||||
Column(
|
_buildTools(),
|
||||||
children: [
|
Expanded(child: Container()),
|
||||||
const SizedBox(height: 66),
|
_buildTranslate(),
|
||||||
Row(
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: logic.onTapPhotos,
|
|
||||||
child: Container(
|
|
||||||
width: 72,
|
|
||||||
height: 72,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color(0xffD2FFFB),
|
|
||||||
borderRadius: BorderRadius.circular(36),
|
|
||||||
),
|
|
||||||
child: Image.asset(
|
|
||||||
Assets.imagesPhoto,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(top: 10),
|
|
||||||
child: Text(
|
|
||||||
"Photo",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: logic.openFaceToFace,
|
|
||||||
child: Container(
|
|
||||||
width: 72,
|
|
||||||
height: 72,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color(0xffE1E2FE),
|
|
||||||
borderRadius: BorderRadius.circular(36),
|
|
||||||
),
|
|
||||||
child: Image.asset(
|
|
||||||
Assets.imagesDialog,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(top: 10),
|
|
||||||
child: Text(
|
|
||||||
"Face2face",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: logic.openTranslateHistory,
|
|
||||||
child: Container(
|
|
||||||
width: 72,
|
|
||||||
height: 72,
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color(0xffFEE5C5),
|
|
||||||
borderRadius: BorderRadius.circular(36),
|
|
||||||
),
|
|
||||||
child: Image.asset(
|
|
||||||
Assets.imagesHistory,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(top: 10),
|
|
||||||
child: Text(
|
|
||||||
"History",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 96),
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: logic.openTranslate,
|
|
||||||
child: Container(
|
|
||||||
height: 76,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color.fromARGB(
|
|
||||||
213,
|
|
||||||
69,
|
|
||||||
168,
|
|
||||||
254,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.5,
|
|
||||||
color: const Color(0xff0087FF),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(left: 20),
|
|
||||||
child: Text(
|
|
||||||
"Type to Translate",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
right: 20,
|
|
||||||
),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: logic.onTapSpeak,
|
|
||||||
child: Container(
|
|
||||||
height: 36,
|
|
||||||
width: 36,
|
|
||||||
padding: const EdgeInsets.all(5),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: const Color(0xff8BCFFE),
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(18),
|
|
||||||
),
|
|
||||||
child: SvgPicture.asset(
|
|
||||||
Assets.svgHomeVoice,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
const LanguageBar(),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -446,4 +282,170 @@ class HomePage extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildTools() {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: logic.onTapPhotos,
|
||||||
|
child: Container(
|
||||||
|
width: 72,
|
||||||
|
height: 72,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xffD2FFFB),
|
||||||
|
borderRadius: BorderRadius.circular(36),
|
||||||
|
),
|
||||||
|
child: Image.asset(
|
||||||
|
Assets.imagesPhoto,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: Text(
|
||||||
|
"Photo",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: logic.openFaceToFace,
|
||||||
|
child: Container(
|
||||||
|
width: 72,
|
||||||
|
height: 72,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xffE1E2FE),
|
||||||
|
borderRadius: BorderRadius.circular(36),
|
||||||
|
),
|
||||||
|
child: Image.asset(
|
||||||
|
Assets.imagesDialog,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: Text(
|
||||||
|
"Face2face",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: logic.openTranslateHistory,
|
||||||
|
child: Container(
|
||||||
|
width: 72,
|
||||||
|
height: 72,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xffFEE5C5),
|
||||||
|
borderRadius: BorderRadius.circular(36),
|
||||||
|
),
|
||||||
|
child: Image.asset(
|
||||||
|
Assets.imagesHistory,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: Text(
|
||||||
|
"History",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildTranslate() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: logic.openTranslate,
|
||||||
|
child: Container(
|
||||||
|
height: 76,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color.fromARGB(
|
||||||
|
213,
|
||||||
|
69,
|
||||||
|
168,
|
||||||
|
254,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.5,
|
||||||
|
color: const Color(0xff0087FF),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 20),
|
||||||
|
child: Text(
|
||||||
|
"Type to Translate",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
right: 20,
|
||||||
|
),
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: logic.onTapSpeak,
|
||||||
|
child: Container(
|
||||||
|
height: 36,
|
||||||
|
width: 36,
|
||||||
|
padding: const EdgeInsets.all(5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xff8BCFFE),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(18),
|
||||||
|
),
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
Assets.svgHomeVoice,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
const LanguageBar(),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user