bogui/lib/main.dart

45 lines
1.1 KiB
Dart
Raw Permalink Normal View History

2023-01-07 13:02:53 +01:00
import 'package:bogui/global.dart';
import 'package:bogui/screens/home.dart';
2023-01-07 08:11:30 +01:00
import 'package:flutter/material.dart';
2023-01-07 13:02:53 +01:00
import 'package:flutter_riverpod/flutter_riverpod.dart';
2023-01-07 08:11:30 +01:00
void main() {
2023-01-07 13:02:53 +01:00
runApp(const ProviderScope(child: MyApp()));
2023-01-07 08:11:30 +01:00
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
2023-01-07 09:50:54 +01:00
title: 'bogui',
2023-01-07 08:11:30 +01:00
theme: ThemeData(
2023-01-07 13:02:53 +01:00
appBarTheme: const AppBarTheme(
color: orangeC,
foregroundColor: Color.fromRGBO(33, 33, 33, 1),
2023-01-07 08:11:30 +01:00
),
2023-01-07 13:02:53 +01:00
brightness: Brightness.dark,
primaryColor: orangeC,
fontFamily: 'Georgia',
2023-01-07 08:11:30 +01:00
),
2023-02-22 22:23:01 +01:00
home: const Bogui(title: 'BoĞui'),
2023-01-07 08:11:30 +01:00
);
}
}
2023-01-08 03:46:34 +01:00
double truncateDouble(double val, int decimals) {
String valString = val.toString();
int dotIndex = valString.indexOf('.');
// not enough decimals
int totalDecimals = valString.length - dotIndex - 1;
if (totalDecimals < decimals) {
decimals = totalDecimals;
}
valString = valString.substring(0, dotIndex + decimals + 1);
return double.parse(valString);
2023-02-22 22:23:01 +01:00
}