fixed project structure issues. now removing flutterflow dependencies.
This commit is contained in:
@@ -0,0 +1,252 @@
|
||||
import '/components/conversation_options/conversation_options_widget.dart';
|
||||
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 'conversations_list_model.dart';
|
||||
export 'conversations_list_model.dart';
|
||||
|
||||
class ConversationsListWidget extends StatefulWidget {
|
||||
const ConversationsListWidget({super.key});
|
||||
|
||||
@override
|
||||
State<ConversationsListWidget> createState() =>
|
||||
_ConversationsListWidgetState();
|
||||
}
|
||||
|
||||
class _ConversationsListWidgetState extends State<ConversationsListWidget> {
|
||||
late ConversationsListModel _model;
|
||||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_model = createModel(context, () => ConversationsListModel());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_model.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _model.unfocusNode.canRequestFocus
|
||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||
: FocusScope.of(context).unfocus(),
|
||||
child: Scaffold(
|
||||
key: scaffoldKey,
|
||||
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
floatingActionButton: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onLongPress: () async {
|
||||
await showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
enableDrag: false,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _model.unfocusNode.canRequestFocus
|
||||
? FocusScope.of(context).requestFocus(_model.unfocusNode)
|
||||
: FocusScope.of(context).unfocus(),
|
||||
child: Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: ConversationOptionsWidget(),
|
||||
),
|
||||
);
|
||||
},
|
||||
).then((value) => safeSetState(() {}));
|
||||
|
||||
context.pushNamed('Conversation');
|
||||
},
|
||||
child: FloatingActionButton(
|
||||
onPressed: () async {
|
||||
context.pushNamed('Conversation');
|
||||
},
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
elevation: 8,
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: FlutterFlowTheme.of(context).info,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
appBar: AppBar(
|
||||
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text(
|
||||
'My Chats',
|
||||
style: FlutterFlowTheme.of(context).headlineLarge.override(
|
||||
fontFamily: 'Outfit',
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
actions: const [],
|
||||
centerTitle: false,
|
||||
elevation: 0,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 0, 0),
|
||||
child: Text(
|
||||
'AI conversations',
|
||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(0, 0),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
reverse: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
children: [
|
||||
Align(
|
||||
alignment: const AlignmentDirectional(0, 0),
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onTap: () async {
|
||||
context.pushNamed('Conversation');
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
),
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(0, 0),
|
||||
child: Icon(
|
||||
Icons.settings_outlined,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryText,
|
||||
size: 48,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: const AlignmentDirectional(-1, 0),
|
||||
child: Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
constraints: BoxConstraints(
|
||||
minWidth:
|
||||
MediaQuery.sizeOf(context).width,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(-1, 0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'Hello World',
|
||||
style:
|
||||
FlutterFlowTheme.of(context)
|
||||
.headlineLarge
|
||||
.override(
|
||||
fontFamily: 'Outfit',
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment:
|
||||
const AlignmentDirectional(-1, 0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Hello World',
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily:
|
||||
'Readex Pro',
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryText,
|
||||
size: 48,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user