Skip to content

Instantly share code, notes, and snippets.

@minhcasi
Created January 8, 2024 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minhcasi/6fd173237fb8bc7a204448cf6e4b81c0 to your computer and use it in GitHub Desktop.
Save minhcasi/6fd173237fb8bc7a204448cf6e4b81c0 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MeditationScreen(),
);
}
}
class MeditationScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
'https://placehold.co/563x1220?description=A%20group%20of%20people%20meditating%20in%20nature%20at%20sunset',
),
fit: BoxFit.cover,
),
),
),
SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'Quay lại',
style: TextStyle(
color: Colors.white,
fontSize: 18,
),
),
),
Expanded(
child: Container(),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
'Thiền',
style: TextStyle(
color: Colors.white,
fontSize: 36,
fontWeight: FontWeight.bold,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Text(
'Cho chúng tôi biết bạn đang cảm thấy như thế nào?',
style: TextStyle(
color: Colors.white,
fontSize: 18,
),
),
),
SizedBox(height: 16.0),
MeditationOption(
title: 'Khóa thiền thức tỉnh',
color: Color(0xFF8A56AC),
),
MeditationOption(
title: '7 Ngày học thiền từ con số 0',
color: Color(0xFFE76F51),
),
MeditationOption(
title: '30 ngày tạo lập thói quen hành Thiền',
color: Color(0xFF2A9D8F),
),
SizedBox(height: 16.0),
],
),
),
Align(
alignment: Alignment.bottomCenter,
child: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Color(0xFF222222),
selectedItemColor: Colors.yellow,
unselectedItemColor: Colors.white,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.self_improvement),
label: 'Thiền thức tỉnh',
),
BottomNavigationBarItem(
icon: Icon(Icons.access_time),
label: 'Hẹn giờ thiền',
),
BottomNavigationBarItem(
icon: Icon(Icons.auto_awesome),
label: 'Thiền nâng cao',
),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle),
label: 'Hồ sơ',
),
],
),
),
],
),
);
}
}
class MeditationOption extends StatelessWidget {
final String title;
final Color color;
const MeditationOption({
Key? key,
required this.title,
required this.color,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(16.0),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(0, 2),
),
],
),
child: Text(
title,
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment