265 lines
9.8 KiB
Dart
265 lines
9.8 KiB
Dart
import '/flutter_flow/flutter_flow_animations.dart';
|
|
import '/flutter_flow/flutter_flow_icon_button.dart';
|
|
import '/flutter_flow/flutter_flow_theme.dart';
|
|
import '/flutter_flow/flutter_flow_util.dart';
|
|
import '/flutter_flow/flutter_flow_widgets.dart';
|
|
import 'dart:math';
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/scheduler.dart';
|
|
import 'package:flutter_animate/flutter_animate.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'image_details_model.dart';
|
|
export 'image_details_model.dart';
|
|
|
|
class ImageDetailsWidget extends StatefulWidget {
|
|
const ImageDetailsWidget({super.key});
|
|
|
|
@override
|
|
State<ImageDetailsWidget> createState() => _ImageDetailsWidgetState();
|
|
}
|
|
|
|
class _ImageDetailsWidgetState extends State<ImageDetailsWidget>
|
|
with TickerProviderStateMixin {
|
|
late ImageDetailsModel _model;
|
|
|
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
final animationsMap = <String, AnimationInfo>{};
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_model = createModel(context, () => ImageDetailsModel());
|
|
|
|
animationsMap.addAll({
|
|
'imageOnPageLoadAnimation': AnimationInfo(
|
|
trigger: AnimationTrigger.onPageLoad,
|
|
effectsBuilder: () => [
|
|
VisibilityEffect(duration: 1.ms),
|
|
FadeEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: 0.0,
|
|
end: 1.0,
|
|
),
|
|
MoveEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: Offset(0.0, 30.0),
|
|
end: Offset(0.0, 0.0),
|
|
),
|
|
ScaleEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: Offset(0.7, 0.7),
|
|
end: Offset(1.0, 1.0),
|
|
),
|
|
],
|
|
),
|
|
'rowOnPageLoadAnimation': AnimationInfo(
|
|
trigger: AnimationTrigger.onPageLoad,
|
|
effectsBuilder: () => [
|
|
VisibilityEffect(duration: 1.ms),
|
|
FadeEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: 0.0,
|
|
end: 1.0,
|
|
),
|
|
MoveEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: Offset(0.0, 30.0),
|
|
end: Offset(0.0, 0.0),
|
|
),
|
|
TiltEffect(
|
|
curve: Curves.easeInOut,
|
|
delay: 0.0.ms,
|
|
duration: 300.0.ms,
|
|
begin: Offset(-0.698, 0),
|
|
end: Offset(0, 0),
|
|
),
|
|
],
|
|
),
|
|
});
|
|
}
|
|
|
|
@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,
|
|
appBar: AppBar(
|
|
backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,
|
|
automaticallyImplyLeading: false,
|
|
leading: FlutterFlowIconButton(
|
|
borderColor: Colors.transparent,
|
|
borderRadius: 30,
|
|
borderWidth: 1,
|
|
buttonSize: 60,
|
|
icon: Icon(
|
|
Icons.arrow_back_rounded,
|
|
color: FlutterFlowTheme.of(context).primaryText,
|
|
size: 30,
|
|
),
|
|
onPressed: () async {
|
|
context.pop();
|
|
},
|
|
),
|
|
actions: [],
|
|
centerTitle: false,
|
|
elevation: 0,
|
|
),
|
|
body: SafeArea(
|
|
top: true,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(12),
|
|
child: Hero(
|
|
tag: 'hero',
|
|
transitionOnUserGestures: true,
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(8),
|
|
child: CachedNetworkImage(
|
|
fadeInDuration: Duration(milliseconds: 500),
|
|
fadeOutDuration: Duration(milliseconds: 500),
|
|
imageUrl: 'https://picsum.photos/seed/150/600',
|
|
width: double.infinity,
|
|
fit: BoxFit.fitWidth,
|
|
memCacheWidth: 1200,
|
|
memCacheHeight: 1200,
|
|
),
|
|
),
|
|
).animateOnPageLoad(
|
|
animationsMap['imageOnPageLoadAnimation']!),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(12, 12, 12, 32),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(0, 4, 8, 16),
|
|
child: Container(
|
|
width: 36,
|
|
height: 36,
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).accent1,
|
|
borderRadius: BorderRadius.circular(12),
|
|
shape: BoxShape.rectangle,
|
|
border: Border.all(
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
width: 2,
|
|
),
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.all(2),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(8),
|
|
child: CachedNetworkImage(
|
|
fadeInDuration: Duration(milliseconds: 200),
|
|
fadeOutDuration: Duration(milliseconds: 200),
|
|
imageUrl:
|
|
'https://images.unsplash.com/photo-1521572267360-ee0c2909d518?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYyMDF8MHwxfHNlYXJjaHwyMHx8cHJvZmlsZXxlbnwwfHx8fDE2OTU4MjQ5OTN8MA&ixlib=rb-4.0.3&q=80&w=1080',
|
|
width: 44,
|
|
height: 44,
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Flexible(
|
|
child: Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 8),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
SelectionArea(
|
|
child: AutoSizeText(
|
|
'Thanks so much! We really do appreciate it!',
|
|
textAlign: TextAlign.start,
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
lineHeight: 1.5,
|
|
),
|
|
)),
|
|
Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(
|
|
0, 4, 0, 0),
|
|
child: Text(
|
|
'Just Now',
|
|
style: FlutterFlowTheme.of(context)
|
|
.labelSmall
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
),
|
|
),
|
|
),
|
|
].divide(SizedBox(width: 4)),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 4, 0, 0),
|
|
child: SelectionArea(
|
|
child: AutoSizeText(
|
|
'Thanks so much! We really do appreciate it!',
|
|
textAlign: TextAlign.start,
|
|
style: FlutterFlowTheme.of(context)
|
|
.labelLarge
|
|
.override(
|
|
fontFamily: 'Readex Pro',
|
|
letterSpacing: 0,
|
|
lineHeight: 1.5,
|
|
),
|
|
)),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
).animateOnPageLoad(animationsMap['rowOnPageLoadAnimation']!),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|