LCOV - code coverage report
Current view: top level - lib/views - globalsettingsview.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 0 25 0.0 %
Date: 2026-07-15 19:28:30 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:convert';
       2             : import 'package:cwtch/cwtch_icons_icons.dart';
       3             : import 'package:cwtch/views/globalsettingsaboutview.dart';
       4             : import 'package:cwtch/views/globalsettingsappearanceview.dart';
       5             : import 'package:cwtch/views/globalsettingsbehaviourview.dart';
       6             : import 'package:cwtch/views/globalsettingsexperimentsview.dart';
       7             : import 'package:flutter/material.dart';
       8             : import 'package:cwtch/settings.dart';
       9             : import 'package:provider/provider.dart';
      10             : import 'package:cwtch/l10n/app_localizations.dart';
      11             : 
      12             : import '../main.dart';
      13             : 
      14             : /// Global Settings View provides access to modify all the Globally Relevant Settings including Locale, Theme and Experiments.
      15             : class GlobalSettingsView extends StatefulWidget {
      16           0 :   @override
      17           0 :   _GlobalSettingsViewState createState() => _GlobalSettingsViewState();
      18             : }
      19             : 
      20             : class _GlobalSettingsViewState extends State<GlobalSettingsView> {
      21             :   ScrollController settingsListScrollController = ScrollController();
      22             : 
      23           0 :   @override
      24             :   void dispose() {
      25           0 :     super.dispose();
      26             :   }
      27             : 
      28           0 :   @override
      29             :   Widget build(BuildContext context) {
      30           0 :     return DefaultTabController(
      31             :       length: 4,
      32           0 :       child: Scaffold(
      33           0 :         appBar: AppBar(
      34           0 :           title: Text(AppLocalizations.of(context)!.cwtchSettingsTitle),
      35           0 :           bottom: TabBar(
      36             :             isScrollable: true,
      37           0 :             tabs: [
      38           0 :               Tab(key: Key("OpenSettingsAppearance"), icon: Icon(Icons.palette), text: AppLocalizations.of(context)!.settingsGroupAppearance),
      39           0 :               Tab(key: Key("OpenSettingsBehaviour"), icon: Icon(Icons.settings), text: AppLocalizations.of(context)!.settingGroupBehaviour),
      40           0 :               Tab(key: Key("OpenSettingsExperiments"), icon: Icon(CwtchIcons.enable_experiments), text: AppLocalizations.of(context)!.settingsGroupExperiments),
      41           0 :               Tab(icon: Icon(Icons.info), text: AppLocalizations.of(context)!.settingsGroupAbout),
      42             :             ],
      43             :           ),
      44             :         ),
      45           0 :         body: _buildSettingsList(),
      46             :       ),
      47             :     );
      48             :   }
      49             : 
      50           0 :   Widget _buildSettingsList() {
      51           0 :     return Consumer<Settings>(
      52           0 :       builder: (ccontext, settings, child) {
      53           0 :         return LayoutBuilder(
      54           0 :           builder: (BuildContext context, BoxConstraints viewportConstraints) {
      55           0 :             return TabBarView(children: [GlobalSettingsAppearanceView(), GlobalSettingsBehaviourView(), GlobalSettingsExperimentsView(), GlobalSettingsAboutView()]);
      56             :           },
      57             :         );
      58             :       },
      59             :     );
      60             :   }
      61             : }
      62             : 
      63             : /// Send an UpdateGlobalSettings to the Event Bus
      64           0 : saveSettings(context) {
      65           0 :   var settings = Provider.of<Settings>(context, listen: false);
      66           0 :   Provider.of<FlwtchState>(context, listen: false).cwtch.UpdateSettings(jsonEncode(settings.asJson()));
      67             : }

Generated by: LCOV version 1.14