Created
February 8, 2025 17:37
-
-
Save rmathys/4ce547347ebd3c34537e2f252ed1eba2 to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData(useMaterial3: true), | |
home: const HomePage(), | |
); | |
} | |
} | |
class HomePage extends StatelessWidget { | |
const HomePage({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: const Color(0xFFF5F7FA), | |
body: SafeArea( | |
child: Row( | |
children: [ | |
Expanded( | |
flex: 2, | |
child: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
const Text( | |
'M75.3 Calcific tendinitis of the shoulder', | |
style: TextStyle( | |
fontSize: 20, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
'Inflammation of the tendons in the shoulder joint', | |
style: TextStyle( | |
fontSize: 16, | |
color: Colors.grey, | |
), | |
), | |
const SizedBox(height: 16), | |
Row( | |
children: List.generate( | |
5, | |
(index) => Padding( | |
padding: const EdgeInsets.only(right: 8.0), | |
child: Image.network( | |
'https://placehold.co/60x60?description=X-ray%20image%20${index + 1}', | |
width: 60, | |
height: 60, | |
), | |
), | |
), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
'All X-ray images (12)', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
const SizedBox(height: 16), | |
const Text( | |
'AI tips', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
"Nikolas's condition is improving, with pain diminishing. Continue monitoring.", | |
style: TextStyle(fontSize: 16), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
'Book an appointment', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
const SizedBox(height: 16), | |
const Text( | |
'Specialist reports', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
_buildSpecialistReport( | |
'Dr. John Smith', | |
'Apr 21, 2024 • Orthopedist', | |
'Routine check', | |
), | |
_buildSpecialistReport( | |
'Dr. Emily Johnson', | |
'Apr 9, 2024 • Rheumatologist', | |
'Review', | |
), | |
_buildSpecialistReport( | |
'Dr. Caron Wilson', | |
'Mar 22, 2024 • Physical Therapist', | |
'Ultrasound', | |
), | |
const SizedBox(height: 8), | |
const Text( | |
'All reports (5)', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
const Spacer(), | |
const Text( | |
'More details', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
], | |
), | |
), | |
), | |
Expanded( | |
flex: 3, | |
child: Center( | |
child: Container( | |
width: 300, | |
height: 500, | |
color: Colors.grey[300], | |
child: const Center( | |
child: Text( | |
'3D Patient Placeholder', | |
style: TextStyle( | |
fontSize: 24, | |
color: Colors.black54, | |
), | |
), | |
), | |
), | |
), | |
), | |
Expanded( | |
flex: 2, | |
child: Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Row( | |
children: [ | |
CircleAvatar( | |
radius: 30, | |
backgroundImage: NetworkImage( | |
'https://placehold.co/60x60?description=Profile%20picture', | |
), | |
), | |
const SizedBox(width: 16), | |
Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: const [ | |
Text( | |
'Nikolas Pascal, 32 y.o.', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
Text( | |
'800 Bay St, San Francisco, CA 94133', | |
style: TextStyle( | |
fontSize: 14, | |
color: Colors.grey, | |
), | |
), | |
], | |
), | |
], | |
), | |
const SizedBox(height: 16), | |
_buildHealthMetric('FBS', 'Elevated', '116 mg/dL', true), | |
_buildHealthMetric('BP', 'Normal range', '120/80 mmHg', false), | |
_buildHealthMetric('HR', 'Stable', '72 bpm', false), | |
_buildHealthMetric('HbA1c', 'Good control', '5.5%', false), | |
const SizedBox(height: 16), | |
ElevatedButton( | |
onPressed: () {}, | |
style: ElevatedButton.styleFrom( | |
backgroundColor: Colors.blue, | |
minimumSize: const Size.fromHeight(40), | |
), | |
child: const Text('Assign tests'), | |
), | |
const SizedBox(height: 16), | |
const Text( | |
'Activity score', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
_buildActivityScore('Kcal', '1,236/day'), | |
_buildActivityScore('Steps', '8,152/day'), | |
_buildActivityScore('Sleep', '6.4 hours/day'), | |
const SizedBox(height: 16), | |
const Text( | |
'AI tips', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
"Nikolas doesn't sleep much and has gained weight, this could be the reason for his fatigue.", | |
style: TextStyle(fontSize: 16), | |
), | |
const SizedBox(height: 8), | |
const Text( | |
'Book sleep specialist', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
const SizedBox(height: 16), | |
const Text( | |
'All activities', | |
style: TextStyle( | |
color: Colors.blue, | |
fontSize: 16, | |
), | |
), | |
const Spacer(), | |
const Text( | |
'Consultations history', | |
style: TextStyle( | |
fontSize: 18, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(height: 8), | |
_buildConsultationHistory('Dr. John Smith', 'Routine check'), | |
], | |
), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
Widget _buildSpecialistReport(String name, String date, String type) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 4.0), | |
child: Row( | |
children: [ | |
CircleAvatar( | |
radius: 20, | |
backgroundImage: NetworkImage( | |
'https://placehold.co/40x40?description=Doctor%20profile%20picture', | |
), | |
), | |
const SizedBox(width: 8), | |
Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text( | |
name, | |
style: const TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
Text( | |
date, | |
style: const TextStyle( | |
fontSize: 14, | |
color: Colors.grey, | |
), | |
), | |
], | |
), | |
const Spacer(), | |
Text( | |
type, | |
style: const TextStyle( | |
fontSize: 14, | |
color: Colors.blue, | |
), | |
), | |
], | |
), | |
); | |
} | |
Widget _buildHealthMetric(String title, String status, String value, bool isCritical) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 4.0), | |
child: Row( | |
children: [ | |
Text( | |
title, | |
style: const TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const SizedBox(width: 8), | |
Text( | |
status, | |
style: TextStyle( | |
fontSize: 14, | |
color: isCritical ? Colors.red : Colors.green, | |
), | |
), | |
const Spacer(), | |
Text( | |
value, | |
style: const TextStyle( | |
fontSize: 16, | |
), | |
), | |
], | |
), | |
); | |
} | |
Widget _buildActivityScore(String title, String value) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 4.0), | |
child: Row( | |
children: [ | |
Text( | |
title, | |
style: const TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const Spacer(), | |
Text( | |
value, | |
style: const TextStyle( | |
fontSize: 16, | |
), | |
), | |
], | |
), | |
); | |
} | |
Widget _buildConsultationHistory(String doctor, String type) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 4.0), | |
child: Row( | |
children: [ | |
CircleAvatar( | |
radius: 20, | |
backgroundImage: NetworkImage( | |
'https://placehold.co/40x40?description=Doctor%20profile%20picture', | |
), | |
), | |
const SizedBox(width: 8), | |
Text( | |
doctor, | |
style: const TextStyle( | |
fontSize: 16, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
const Spacer(), | |
Text( | |
type, | |
style: const TextStyle( | |
fontSize: 14, | |
color: Colors.blue, | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment