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 'dart:io'; | |
import 'package:intl/intl.dart'; | |
import 'package:shelf/shelf.dart'; | |
import 'package:shelf/shelf_io.dart' as shelf_io; | |
void main(List<String> arguments) async { | |
var port = 8088; | |
var ip = "172.16.200.22"; | |
if (arguments.any((e) => e.startsWith('port='))) { |
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/widgets.dart'; | |
extension ViewMode on Widget { | |
bool renderMobileMode(BuildContext context) { | |
return MediaQuery.of(context).size.width < 600; | |
} | |
} |
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:http/http.dart' as http; | |
http.Client getClient() { | |
throw UnimplementedError('Unsupported'); | |
} |
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
class CaladriusBootstrap extends StatelessWidget { | |
final BootCompleted bootCompleted; | |
const CaladriusBootstrap(this.bootCompleted, {Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return BootStrap( | |
[ | |
LoginBootStep(), |
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:caladrius/main.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
typedef BootCompleted = Widget Function(); | |
class BootStrap extends StatefulWidget { | |
final List<BootstrapStep> steps; | |
final int currentIndex; | |
final BootCompleted bootCompleted; |
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:caladrius/component/bootstrap/bootstrap.dart'; | |
import 'package:caladrius/screens/corsHelp.dart'; | |
import 'package:caladrius/screens/dashboard.dart'; | |
import 'package:caladrius/component/bootstrap/CaladriusBootstrap.dart'; | |
import 'package:caladrius/screens/database.dart'; | |
import 'package:flutter/material.dart'; | |
class AppRouter { | |
//Create a root that ensures a login/session | |
static PageRoute bootstrapRoute(BootCompleted call, RoutingData data) => |
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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Caladrius', | |
initialRoute: 'dashboard', | |
onGenerateRoute: AppRouter.generateRoute, | |
theme: ThemeData( |
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'; | |
import 'package:charts_flutter/flutter.dart'; | |
import 'package:sirflutter/statistics.dart'; | |
class ResultChart extends StatelessWidget { | |
final Map<int, Statistic> dayData; | |
ResultChart(this.dayData); | |
@override | |
Widget build(BuildContext context) { |
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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:sirflutter/simulation_data.dart'; | |
typedef SettingChangedCallback = void Function(SirSimulation data); | |
class Settings extends StatelessWidget { | |
final VoidCallback expandToggleTap; | |
final SettingChangedCallback settingChangedCallback; |
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
var prefs = await SharedPreferences.getInstance(); | |
var savedHeight = prefs.getInt("maze_height") ?? 8; | |
var savedWidth = prefs.getInt("maze_width") ?? 8; | |
await prefs.setInt("maze_width", toInt(widthController.text,defaultValue: 8)); | |
await prefs.setInt("maze_height", toInt(heightController.text,defaultValue: 8)); |
NewerOlder