518 lines
25 KiB
Dart
518 lines
25 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:provider/provider.dart';
|
|
//import 'package:collection/collection.dart';
|
|
import 'dart:math';
|
|
|
|
import '../../app.dart';
|
|
import '../../common/constants.dart';
|
|
import '../../common/utils.dart';
|
|
import '../../data/repository/_dao.dart';
|
|
import '../../data/models/_models.dart';
|
|
import '../components/_components.dart';
|
|
|
|
class Following_s3l5View extends StatefulWidget {
|
|
final Object? extra;
|
|
|
|
Following_s3l5View({super.key, this.extra});
|
|
|
|
@override
|
|
State<Following_s3l5View> createState() => _Following_s3l5ViewState();
|
|
}
|
|
|
|
class _Following_s3l5ViewState extends State<Following_s3l5View> {
|
|
late Following_s3l5Controller _view;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_view = Following_s3l5Controller()..selectedIndex = widget.extra as int;
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final app = context.watch<AppController>();
|
|
return ChangeNotifierProvider(
|
|
create: (context) => _view,
|
|
child: Consumer<Following_s3l5Controller>(
|
|
builder: (context, view, child) => Scaffold(
|
|
backgroundColor: Color(0xffffffff),
|
|
appBar: AppBar(
|
|
elevation: 0,
|
|
centerTitle: false,
|
|
automaticallyImplyLeading: false,
|
|
backgroundColor: Color(0xffffffff),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
|
title: Text(
|
|
Constants.following_,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 20,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
leading: IconButton(
|
|
icon: Icon(Icons.arrow_back, color: Color(0xff212435), size: 24),
|
|
onPressed: () {
|
|
app.back();
|
|
},
|
|
),
|
|
),
|
|
body: Padding(
|
|
padding: EdgeInsets.all(16),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 16),
|
|
child: TextField710_3r6r(Constants.search_),
|
|
),
|
|
ListView(
|
|
scrollDirection: Axis.vertical,
|
|
padding: EdgeInsets.all(0),
|
|
shrinkWrap: true,
|
|
physics: ScrollPhysics(),
|
|
children: [
|
|
Row703_gnuw(
|
|
Constants.following_,
|
|
Constants.k13Articles_,
|
|
Constants.johnHawkins_,
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRraGrytZ8u02sInXmIguSY2bdhVAYtmqJC-vJzrJBzIbJeex1dXb-a1PuIFCIL_qj7DkU&usqp=CAU',
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
width: 60,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
|
child: Image.network(
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRWHjMzM5qzBjS64SJEIyCQkLgXODzDLznFPOt54tmyPNXP3BQ78_AN83FAlbeGujmuPCg&usqp=CAU',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(
|
|
Constants.kevin_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 8, 0, 0),
|
|
child: Text(
|
|
Constants.k10Articles_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xbe8a8989),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
padding: EdgeInsets.all(0),
|
|
width: 80,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff000000),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(22.0),
|
|
),
|
|
child: Text(
|
|
Constants.following_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xffffffff),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
width: 60,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
|
child: Image.network(
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQAxDgR_pCrTRrc1IgCv6mFaAQg8czsfkdULquUavCyXAlDqNYawOm4q3VsSuyUFqw_Ygc&usqp=CAU',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(
|
|
Constants.rose_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 8, 0, 0),
|
|
child: Text(
|
|
Constants.k6Articles_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xbe8a8989),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
padding: EdgeInsets.all(0),
|
|
width: 80,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff000000),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(22.0),
|
|
),
|
|
child: Text(
|
|
Constants.following_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xffffffff),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
width: 60,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
|
child: Image.network(
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRAL5lx462Rjn-dAsEQHumnRJATsXmXbP2mxHWzbFr_RKitmboHvkL-gnOFfOi-gbyZW60&usqp=CAU',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(
|
|
Constants.renne_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 8, 0, 0),
|
|
child: Text(
|
|
Constants.k5Articles_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xbe8a8989),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
padding: EdgeInsets.all(0),
|
|
width: 80,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff000000),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(22.0),
|
|
),
|
|
child: Text(
|
|
Constants.following_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xffffffff),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
width: 60,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
|
child: Image.network(
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMBF7GiWBnuwHZEoUkGAktUZR91Ge2bVJ9rhYg7-YRz0M7tdM-8Os4tSZno4Jd6j5p9p8&usqp=CAU',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(
|
|
Constants.doran_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 8, 0, 0),
|
|
child: Text(
|
|
Constants.k24Articles_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xbe8a8989),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
padding: EdgeInsets.all(0),
|
|
width: 80,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff000000),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(22.0),
|
|
),
|
|
child: Text(
|
|
Constants.following_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xffffffff),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
height: 60,
|
|
width: 60,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(shape: BoxShape.circle),
|
|
child: Image.network(
|
|
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSNys7iFvBBxifr5E1pgSgnlKxZ8G9HO-47sSR1oW57o1QAXA3YuXsmpVq1WZk9-HkoZls&usqp=CAU',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Padding(
|
|
padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Text(
|
|
Constants.marie_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 8, 0, 0),
|
|
child: Text(
|
|
Constants.k8Articles_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xbe8a8989),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
margin: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
padding: EdgeInsets.all(0),
|
|
width: 80,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff000000),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(22.0),
|
|
),
|
|
child: Text(
|
|
Constants.following_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 12,
|
|
color: Color(0xffffffff),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class Following_s3l5Controller with ChangeNotifier {
|
|
int? selectedIndex;
|
|
|
|
dynamic getModel(Dao repository) {
|
|
final items = repository.getAll();
|
|
return (selectedIndex == null || selectedIndex! >= items.length)
|
|
? repository.create()
|
|
: items[selectedIndex!];
|
|
}
|
|
}
|