Add application source code and update project structure
This commit is contained in:
19
Application Product/Source/source/lib/widget/temp/temp_model.dart
Executable file
19
Application Product/Source/source/lib/widget/temp/temp_model.dart
Executable file
@@ -0,0 +1,19 @@
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'temp_widget.dart' show TempWidget;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class TempModel extends FlutterFlowModel<TempWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
// State field(s) for Slider widget.
|
||||
double? sliderValue;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
|
||||
@override
|
||||
void dispose() {}
|
||||
}
|
||||
185
Application Product/Source/source/lib/widget/temp/temp_widget.dart
Executable file
185
Application Product/Source/source/lib/widget/temp/temp_widget.dart
Executable file
@@ -0,0 +1,185 @@
|
||||
import '/flutter_flow/flutter_flow_theme.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'temp_model.dart';
|
||||
export 'temp_model.dart';
|
||||
|
||||
class TempWidget extends StatefulWidget {
|
||||
const TempWidget({super.key});
|
||||
|
||||
@override
|
||||
State<TempWidget> createState() => _TempWidgetState();
|
||||
}
|
||||
|
||||
class _TempWidgetState extends State<TempWidget> {
|
||||
late TempModel _model;
|
||||
|
||||
@override
|
||||
void setState(VoidCallback callback) {
|
||||
super.setState(callback);
|
||||
_model.onUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => TempModel());
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => safeSetState(() {}));
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.maybeDispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(16.0, 16.0, 16.0, 16.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
blurRadius: 4.0,
|
||||
color: Color(0x33000000),
|
||||
offset: Offset(
|
||||
0.0,
|
||||
2.0,
|
||||
),
|
||||
spreadRadius: 0.0,
|
||||
)
|
||||
],
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Heating',
|
||||
style:
|
||||
FlutterFlowTheme.of(context).headlineSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Current temperature',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 60.0,
|
||||
height: 60.0,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFEF3939),
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.thermostat,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
size: 30.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'22°C',
|
||||
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: Color(0xFFA10808),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Target',
|
||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||
fontFamily: 'Inter',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'24°C',
|
||||
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: Color(0xFFA10808),
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
].divide(SizedBox(width: 16.0)),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Slider(
|
||||
activeColor: Color(0xFFA10808),
|
||||
inactiveColor: Color(0x33000000),
|
||||
min: 15.0,
|
||||
max: 30.0,
|
||||
value: _model.sliderValue ??= 24.0,
|
||||
onChanged: (newValue) {
|
||||
newValue = double.parse(newValue.toStringAsFixed(4));
|
||||
safeSetState(() => _model.sliderValue = newValue);
|
||||
},
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'15°C',
|
||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||
fontFamily: 'Inter',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'30°C',
|
||||
style: FlutterFlowTheme.of(context).bodySmall.override(
|
||||
fontFamily: 'Inter',
|
||||
color: FlutterFlowTheme.of(context).secondaryText,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
].divide(SizedBox(height: 16.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user