Skip to content

Instantly share code, notes, and snippets.

@mivoligo
Created November 11, 2023 21:12
Show Gist options
  • Save mivoligo/fa4bb74091f70e80e039fda1c8f18687 to your computer and use it in GitHub Desktop.
Save mivoligo/fa4bb74091f70e80e039fda1c8f18687 to your computer and use it in GitHub Desktop.
xenial-glacier-6407
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 255, 255, 255);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: const Bla(),
);
}
}
class Bla extends StatelessWidget {
const Bla({super.key});
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Column(
children: [
DecoratedBox(
decoration: BoxDecoration(
color: Colors.black87,
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stats(value: '12', title: 'rounds'),
Fighter(name: 'Fabio', surname: 'Wardleyhgjhgjh', score: '16-0-0'),
],
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'VS',
style: TextStyle(color: Colors.white),
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Fighter(
name: 'David',
surname: 'Adeleye',
score: '12-0-0',
isOnLeft: false,
),
Stats(value: '200+', title: 'lbs'),
],
),
),
],
),
),
),
Expanded(child: SizedBox()),
],
),
);
}
}
class Stats extends StatelessWidget {
const Stats({
super.key,
required this.value,
required this.title,
});
final String value;
final String title;
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: const BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Column(
children: [
Text(
value,
style: const TextStyle(color: Colors.green),
),
Text(
title,
style: const TextStyle(color: Colors.green),
),
],
),
),
);
}
}
class Fighter extends StatelessWidget {
const Fighter({
super.key,
required this.name,
required this.surname,
required this.score,
this.isOnLeft = true,
});
final String name;
final String surname;
final String score;
final bool isOnLeft;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: isOnLeft ? CrossAxisAlignment.end : CrossAxisAlignment.start,
children: [
Text(
name,
style: const TextStyle(color: Colors.white),
),
Text(
surname.toUpperCase(),
style: const TextStyle(color: Colors.white),
),
Text(
score,
style: const TextStyle(color: Colors.white54),
),
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment