45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
import 'package:bogui/global.dart';
|
|
import 'package:bogui/screens/home.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
void main() {
|
|
runApp(const ProviderScope(child: MyApp()));
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'bogui',
|
|
theme: ThemeData(
|
|
appBarTheme: const AppBarTheme(
|
|
color: orangeC,
|
|
foregroundColor: Color.fromRGBO(33, 33, 33, 1),
|
|
),
|
|
brightness: Brightness.dark,
|
|
primaryColor: orangeC,
|
|
fontFamily: 'Georgia',
|
|
),
|
|
home: const Bogui(title: 'BoĞui'),
|
|
);
|
|
}
|
|
}
|
|
|
|
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);
|
|
}
|