kopia lustrzana https://gitlab.com/mysocialportal/relatica
				
				
				
			
		
			
				
	
	
		
			37 wiersze
		
	
	
		
			1001 B
		
	
	
	
		
			Dart
		
	
	
			
		
		
	
	
			37 wiersze
		
	
	
		
			1001 B
		
	
	
	
		
			Dart
		
	
	
| import 'package:flutter/material.dart';
 | |
| import 'package:friendica_portal/services/setting_service.dart';
 | |
| import 'package:provider/provider.dart';
 | |
| 
 | |
| import '../controls/standard_appbar.dart';
 | |
| 
 | |
| class SettingsScreen extends StatelessWidget {
 | |
|   @override
 | |
|   Widget build(BuildContext context) {
 | |
|     final settings = context.watch<SettingsService>();
 | |
|     return Scaffold(
 | |
|         appBar: StandardAppBar.build(context, 'Settings'),
 | |
|         body: Center(
 | |
|           child: Padding(
 | |
|             padding: const EdgeInsets.all(8.0),
 | |
|             child: ListView(
 | |
|               children: [
 | |
|                 buildLowBandwidthWidget(settings),
 | |
|               ],
 | |
|             ),
 | |
|           ),
 | |
|         ));
 | |
|   }
 | |
| 
 | |
|   Widget buildLowBandwidthWidget(SettingsService settings) {
 | |
|     return ListTile(
 | |
|       title: const Text('Low bandwidth mode'),
 | |
|       trailing: Checkbox(
 | |
|         onChanged: (value) {
 | |
|           settings.lowBandwidthMode = value ?? false;
 | |
|         },
 | |
|         value: settings.lowBandwidthMode,
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |