116 lines
3.4 KiB
Dart
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_model.dart';
|
|
export 'alert_box_custom_model.dart';
|
|
|
|
class AlertBoxCustomWidget extends StatefulWidget {
|
|
const AlertBoxCustomWidget({
|
|
Key? key,
|
|
this.text,
|
|
}) : super(key: key);
|
|
|
|
final String? text;
|
|
|
|
@override
|
|
_AlertBoxCustomWidgetState createState() => _AlertBoxCustomWidgetState();
|
|
}
|
|
|
|
class _AlertBoxCustomWidgetState extends State<AlertBoxCustomWidget> {
|
|
late AlertBoxCustomModel _model;
|
|
|
|
@override
|
|
void setState(VoidCallback callback) {
|
|
super.setState(callback);
|
|
_model.onUpdate();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => AlertBoxCustomModel());
|
|
}
|
|
|
|
@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 {
|
|
context.safePop();
|
|
},
|
|
text: FFLocalizations.of(context).getText(
|
|
'4g627wq8' /* Back */,
|
|
),
|
|
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(0xFF9B0025),
|
|
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),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|