Files
numstation-flutter/lib/components/alert_box_custom_o_k_widget.dart
2023-12-27 16:10:09 +08:00

116 lines
3.4 KiB
Dart

import '/flutterlib/flutter_theme.dart';
import '/flutterlib/flutter_util.dart';
import '/flutterlib/flutter_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'alert_box_custom_o_k_model.dart';
export 'alert_box_custom_o_k_model.dart';
class AlertBoxCustomOKWidget extends StatefulWidget {
const AlertBoxCustomOKWidget({
Key? key,
this.text,
}) : super(key: key);
final String? text;
@override
_AlertBoxCustomOKWidgetState createState() => _AlertBoxCustomOKWidgetState();
}
class _AlertBoxCustomOKWidgetState extends State<AlertBoxCustomOKWidget> {
late AlertBoxCustomOKModel _model;
@override
void setState(VoidCallback callback) {
super.setState(callback);
_model.onUpdate();
}
@override
void initState() {
super.initState();
_model = createModel(context, () => AlertBoxCustomOKModel());
}
@override
void dispose() {
_model.maybeDispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
context.watch<FFAppState>();
return Container(
width: 339.0,
height: 192.0,
decoration: BoxDecoration(
color: FlutterTheme.of(context).secondaryBackground,
borderRadius: BorderRadius.circular(40.0),
),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: Align(
alignment: AlignmentDirectional(0.0, 0.0),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 24.0, 0.0),
child: Text(
widget.text!,
textAlign: TextAlign.center,
style: FlutterTheme.of(context).bodyMedium.override(
fontFamily: 'Readex Pro',
fontSize: 20.0,
),
),
),
),
),
Expanded(
child: Align(
alignment: AlignmentDirectional(0.0, 1.0),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 24.0),
child: FFButtonWidget(
onPressed: () async {
Navigator.pop(context);
},
text: FFLocalizations.of(context).getText(
'3jiglf6t' /* OK */,
),
options: FFButtonOptions(
width: 304.0,
height: 54.0,
padding:
EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0),
iconPadding:
EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
color: Color(0xFF009B9A),
textStyle: FlutterTheme.of(context).titleSmall.override(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 20.0,
),
elevation: 3.0,
borderSide: BorderSide(
color: Colors.transparent,
width: 1.0,
),
borderRadius: BorderRadius.circular(40.0),
),
),
),
),
),
],
),
);
}
}