blob: 256365b0e998fdf0c7361bf7f5a17f6c80520909 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// SPDX-License-Identifier: Apache-2.0
import 'package:flutter/material.dart';
class PerformanceMode extends StatelessWidget {
const PerformanceMode({Key? key, this.size, required this.mode})
: super(key: key);
final Size? size;
final String mode;
@override
Widget build(BuildContext context) {
return Container(
width: size?.width ?? 20,
height: size?.height ?? 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: (mode == "sport")
? Colors.deepPurple
: (mode == "economy")
? Colors.green
: Colors.transparent),
child: Center(
child: Text(
mode.toUpperCase(),
style: const TextStyle(
color: Colors.black, fontWeight: FontWeight.bold, fontSize: 12),
),
),
);
}
}
|