Add application source code and update project structure
This commit is contained in:
24
Application Product/Source/source/lib/setting/setting_model.dart
Executable file
24
Application Product/Source/source/lib/setting/setting_model.dart
Executable file
@@ -0,0 +1,24 @@
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'setting_widget.dart' show SettingWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SettingModel extends FlutterFlowModel<SettingWidget> {
|
||||
/// State fields for stateful widgets in this page.
|
||||
|
||||
// State field(s) for SwitchListTile widget.
|
||||
bool? switchListTileValue1;
|
||||
// State field(s) for SwitchListTile widget.
|
||||
bool? switchListTileValue2;
|
||||
// State field(s) for SwitchListTile widget.
|
||||
bool? switchListTileValue3;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
168
Application Product/Source/source/lib/setting/setting_widget.dart
Executable file
168
Application Product/Source/source/lib/setting/setting_widget.dart
Executable file
@@ -0,0 +1,168 @@
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'setting_model.dart';
|
||||
export 'setting_model.dart';
|
||||
|
||||
class SettingWidget extends StatefulWidget {
|
||||
const SettingWidget({super.key});
|
||||
|
||||
@override
|
||||
State<SettingWidget> createState() => _SettingWidgetState();
|
||||
}
|
||||
|
||||
class _SettingWidgetState extends State<SettingWidget> {
|
||||
late SettingModel _model;
|
||||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => SettingModel());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
key: scaffoldKey,
|
||||
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
appBar: AppBar(
|
||||
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
'Settings Page',
|
||||
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
elevation: 0.0,
|
||||
),
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Choose what notifcations you want to recieve below and we will update the settings.',
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 0.0),
|
||||
child: SwitchListTile.adaptive(
|
||||
value: _model.switchListTileValue1 ??= true,
|
||||
onChanged: (newValue) async {
|
||||
safeSetState(() => _model.switchListTileValue1 = newValue!);
|
||||
},
|
||||
title: Text(
|
||||
'Push Notifications',
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
lineHeight: 2.0,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Receive Push notifications from our application on a semi regular basis.',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFF8B97A2),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
tileColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
activeColor: Color(0xFFEF3939),
|
||||
activeTrackColor: Color(0x4CEF3939),
|
||||
dense: false,
|
||||
controlAffinity: ListTileControlAffinity.trailing,
|
||||
contentPadding:
|
||||
EdgeInsetsDirectional.fromSTEB(24.0, 12.0, 24.0, 12.0),
|
||||
),
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
value: _model.switchListTileValue2 ??= true,
|
||||
onChanged: (newValue) async {
|
||||
safeSetState(() => _model.switchListTileValue2 = newValue!);
|
||||
},
|
||||
title: Text(
|
||||
'Email Notifications',
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
lineHeight: 2.0,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Receive email notifications from our marketing team about new features.',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFF8B97A2),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
tileColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
activeColor: Color(0xFFEF3939),
|
||||
activeTrackColor: Color(0x4CEF3939),
|
||||
dense: false,
|
||||
controlAffinity: ListTileControlAffinity.trailing,
|
||||
contentPadding:
|
||||
EdgeInsetsDirectional.fromSTEB(24.0, 12.0, 24.0, 12.0),
|
||||
),
|
||||
SwitchListTile.adaptive(
|
||||
value: _model.switchListTileValue3 ??= true,
|
||||
onChanged: (newValue) async {
|
||||
safeSetState(() => _model.switchListTileValue3 = newValue!);
|
||||
},
|
||||
title: Text(
|
||||
'Location Services',
|
||||
style: FlutterFlowTheme.of(context).bodyLarge.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
lineHeight: 2.0,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'Allow us to track your location, this helps keep track of spending and keeps you safe.',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: Color(0xFF8B97A2),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
tileColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
activeColor: Color(0xFFEF3939),
|
||||
activeTrackColor: Color(0x4CEF5239),
|
||||
dense: false,
|
||||
controlAffinity: ListTileControlAffinity.trailing,
|
||||
contentPadding:
|
||||
EdgeInsetsDirectional.fromSTEB(24.0, 12.0, 24.0, 12.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user