86 lines
2.2 KiB
Dart
86 lines
2.2 KiB
Dart
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 'no_chats_model.dart';
|
|
export 'no_chats_model.dart';
|
|
|
|
class NoChatsWidget extends StatefulWidget {
|
|
const NoChatsWidget({
|
|
super.key,
|
|
this.icon,
|
|
String? title,
|
|
String? body,
|
|
}) : this.title = title ?? 'No Comments',
|
|
this.body = body ?? 'There are no comments associated with this post.';
|
|
|
|
final Widget? icon;
|
|
final String title;
|
|
final String body;
|
|
|
|
@override
|
|
State<NoChatsWidget> createState() => _NoChatsWidgetState();
|
|
}
|
|
|
|
class _NoChatsWidgetState extends State<NoChatsWidget> {
|
|
late NoChatsModel _model;
|
|
|
|
@override
|
|
void setState(VoidCallback callback) {
|
|
super.setState(callback);
|
|
_model.onUpdate();
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => NoChatsModel());
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_model.maybeDispose();
|
|
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Align(
|
|
alignment: AlignmentDirectional(0, -1),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
widget.icon!,
|
|
Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(0, 16, 0, 0),
|
|
child: Text(
|
|
widget.title,
|
|
textAlign: TextAlign.center,
|
|
style: FlutterFlowTheme.of(context).headlineSmall.override(
|
|
fontFamily: 'Outfit',
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
letterSpacing: 0,
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(16, 8, 16, 0),
|
|
child: Text(
|
|
widget.body,
|
|
textAlign: TextAlign.center,
|
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|