-
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.
Merge pull request #99 from alessioC42/proprietary-components
Proprietary components
- Loading branch information
Showing
8 changed files
with
119 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,70 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
import '../../../client/storage.dart'; | ||
|
||
class CountlySettingsScreen extends StatelessWidget { | ||
const CountlySettingsScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text("Countly"), | ||
), | ||
body: const Body() | ||
); | ||
} | ||
} | ||
|
||
class Body extends StatefulWidget { | ||
const Body({super.key}); | ||
|
||
@override | ||
State<Body> createState() => _BodyState(); | ||
} | ||
|
||
class _BodyState extends State<Body> { | ||
bool enabled = true; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
globalStorage.read(key: "enable-countly").then((value) { | ||
if (value == null) { | ||
globalStorage.write(key: "enable-countly", value: "false"); | ||
enabled = false; | ||
} else { | ||
enabled = value == "true"; | ||
} | ||
setState(() {}); | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListView( | ||
children: [ | ||
ListTile( | ||
leading: const Icon(Icons.info), | ||
title: const Text('Countly Server'), | ||
subtitle: const Text('Wir nutzen Countly um anonyme Bugreports automatisch an die Entwickler zu senden. Dabei werden keine Daten an dritte weitergegeben.'), | ||
onTap: () { | ||
launchUrl(Uri.parse("https://countly.com/lite") | ||
); | ||
}, | ||
), | ||
SwitchListTile( | ||
value: enabled, | ||
title: const Text("Anonyme Bugreports senden"), | ||
onChanged: (state) async { | ||
setState(() { | ||
enabled = state; | ||
}); | ||
await globalStorage.write(key: "enable-countly", value: state.toString()); | ||
}), | ||
], | ||
); | ||
} | ||
} | ||
|
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