-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
261 additions
and
74 deletions.
There are no files selected for viewing
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
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
6 changes: 6 additions & 0 deletions
6
android/app/src/main/kotlin/de/thebotdev/physik_lk/MainActivity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package de.thebotdev.physik_lk | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
class MainActivity: FlutterActivity() { | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
import 'package:package_info/package_info.dart'; | ||
|
||
abstract class AppInfo{ | ||
abstract class AppInfo { | ||
String get appVersion; | ||
String get appName; | ||
} | ||
|
||
class AppInfoImpl implements AppInfo{ | ||
final PackageInfo _packageInfo; | ||
class AppInfoImpl implements AppInfo { | ||
final PackageInfo packageInfo; | ||
|
||
AppInfoImpl(this._packageInfo); | ||
AppInfoImpl({this.packageInfo}); | ||
@override | ||
String get appName => _packageInfo.appName; | ||
String get appName { | ||
if (packageInfo != null) { | ||
return packageInfo.appName; | ||
} else { | ||
return "Web App"; | ||
} | ||
} | ||
|
||
@override | ||
String get appVersion => _packageInfo.version; | ||
|
||
} | ||
String get appVersion { | ||
if (packageInfo != null) { | ||
return packageInfo.version; | ||
} else { | ||
return "v.1.1.3"; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import 'package:data_connection_checker/data_connection_checker.dart'; | ||
|
||
abstract class NetworkInfo{ | ||
abstract class NetworkInfo { | ||
Future<bool> get isConnected; | ||
} | ||
|
||
class NetworkInfoImpl implements NetworkInfo{ | ||
class NetworkInfoImpl implements NetworkInfo { | ||
final DataConnectionChecker connectionChecker; | ||
NetworkInfoImpl(this.connectionChecker); | ||
NetworkInfoImpl({this.connectionChecker}); | ||
@override | ||
Future<bool> get isConnected => connectionChecker.hasConnection; | ||
|
||
} | ||
Future<bool> get isConnected { | ||
if (connectionChecker != null) { | ||
return connectionChecker.hasConnection; | ||
} else { | ||
return Future.value(true); | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:list_tile_switch/list_tile_switch.dart'; | ||
import 'package:physik_lp_app_rewrite/core/util/shared_prefrences/shared_prefs_cdots.dart'; | ||
|
||
import '../../../../../injection_container.dart'; | ||
|
||
class CDotSetting extends StatefulWidget { | ||
CDotSetting({Key key}) : super(key: key); | ||
|
||
@override | ||
_CDotSettingState createState() => _CDotSettingState(); | ||
} | ||
|
||
class _CDotSettingState extends State<CDotSetting> { | ||
bool _value = sl<SharedPrefsCDots>().cDotsSetting; | ||
@override | ||
Widget build(BuildContext context) { | ||
return ListTileSwitch( | ||
value: _value, | ||
onChanged: (value) { | ||
setState(() { | ||
_value = value; | ||
}); | ||
sl<SharedPrefsCDots>().cDotsSetting = value; | ||
}, | ||
switchActiveColor: Theme.of(context).accentColor, | ||
title: Text( | ||
"CDots", | ||
style: Theme.of(context).primaryTextTheme.bodyText1, | ||
)); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
class SharedPrefsCDots { | ||
final SharedPreferences prefs; | ||
SharedPrefsCDots({@required this.prefs}); | ||
|
||
/// Liefert zurück, ob CDots ausgewählt sind, falls nichts gespeichert ist | ||
/// wird false zurück gegeben | ||
bool get cDotsSetting { | ||
return prefs.getBool("cdots_enabled") ?? false; | ||
} | ||
|
||
set cDotsSetting(bool setting) { | ||
prefs.setBool("cdots_enabled", setting); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.