627 lines
29 KiB
Dart
627 lines
29 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 Dashboard_jvxmView extends StatefulWidget {
|
|
final Object? extra;
|
|
|
|
Dashboard_jvxmView({super.key, this.extra});
|
|
|
|
@override
|
|
State<Dashboard_jvxmView> createState() => _Dashboard_jvxmViewState();
|
|
}
|
|
|
|
class _Dashboard_jvxmViewState extends State<Dashboard_jvxmView> {
|
|
late Dashboard_jvxmController _view;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_view = Dashboard_jvxmController()..selectedIndex = widget.extra as int;
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ChangeNotifierProvider(
|
|
create: (context) => _view,
|
|
child: Consumer<Dashboard_jvxmController>(
|
|
builder: (context, view, child) => Scaffold(
|
|
backgroundColor: Color(0xffffffff),
|
|
appBar: AppBar2944_rotl(Constants.home_),
|
|
body: Stack(
|
|
alignment: Alignment.topLeft,
|
|
children: [
|
|
SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.all(16),
|
|
child: Text(
|
|
Constants.notebooks_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(0),
|
|
height: 170,
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.zero,
|
|
),
|
|
child: ListView(
|
|
scrollDirection: Axis.horizontal,
|
|
padding: EdgeInsets.fromLTRB(16, 0, 0, 0),
|
|
shrinkWrap: true,
|
|
physics: ScrollPhysics(),
|
|
children: [
|
|
Container2930_qyoo(
|
|
Constants.youtubeIdeas_,
|
|
'https://cdn4.iconfinder.com/data/icons/xicons/25/xicons_about_book-128.png',
|
|
Icons.more_horiz,
|
|
Icons.push_pin,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 0, 16, 0),
|
|
padding: EdgeInsets.all(12),
|
|
width: 150,
|
|
height: 170,
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
SizedBox(height: 16, width: 16),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
ImageIcon(
|
|
NetworkImage(
|
|
'https://cdn4.iconfinder.com/data/icons/xicons/25/xicons_about_book-128.png',
|
|
),
|
|
size: 80,
|
|
color: Color(0xff3a57e8),
|
|
),
|
|
Text(
|
|
Constants.userResearchMovieApp_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 0, 16, 0),
|
|
padding: EdgeInsets.all(12),
|
|
width: 150,
|
|
height: 170,
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
SizedBox(height: 16, width: 16),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
ImageIcon(
|
|
NetworkImage(
|
|
'https://cdn4.iconfinder.com/data/icons/xicons/25/xicons_about_book-128.png',
|
|
),
|
|
size: 80,
|
|
color: Color(0xffe4c00d),
|
|
),
|
|
Text(
|
|
Constants.webDevelopPortfolio_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container2930_2rhj(
|
|
Constants.youtubeIdeas_,
|
|
'https://cdn4.iconfinder.com/data/icons/xicons/25/xicons_about_book-128.png',
|
|
Icons.more_horiz,
|
|
Icons.push_pin,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(16, 16, 16, 0),
|
|
child: Text(
|
|
Constants.notes_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
GridView(
|
|
padding: EdgeInsets.all(16),
|
|
shrinkWrap: true,
|
|
scrollDirection: Axis.vertical,
|
|
physics: NeverScrollableScrollPhysics(),
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 2,
|
|
crossAxisSpacing: 16,
|
|
mainAxisSpacing: 16,
|
|
childAspectRatio: 0.6,
|
|
),
|
|
children: [
|
|
Container2933_cvn3(
|
|
Constants.ideas_,
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
Constants.webIdeas_,
|
|
Icons.more_horiz,
|
|
Icons.push_pin,
|
|
),
|
|
Container2934_5anc(
|
|
Constants.uX_,
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
Constants.theRoleOfCreativityInUXD_,
|
|
Icons.more_horiz,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
SizedBox(height: 16, width: 16),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 8),
|
|
child: Text(
|
|
Constants.chap1_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Text(
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 4,
|
|
horizontal: 8,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x343a57e8),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
),
|
|
child: Text(
|
|
Constants.story_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff3a57e8),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Icon(
|
|
Icons.push_pin,
|
|
color: Color(0xffffc000),
|
|
size: 24,
|
|
),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 8),
|
|
child: Text(
|
|
Constants.chap2_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Text(
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 4,
|
|
horizontal: 8,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x343a57e8),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
),
|
|
child: Text(
|
|
Constants.ideas_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff3a57e8),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Icon(
|
|
Icons.push_pin,
|
|
color: Color(0xffffc000),
|
|
size: 24,
|
|
),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 8),
|
|
child: Text(
|
|
Constants.webIdeas_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Text(
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 4,
|
|
horizontal: 8,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x343a57e8),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
),
|
|
child: Text(
|
|
Constants.ideas_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff3a57e8),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x00ffffff),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
border: Border.all(
|
|
color: Color(0x4d9e9e9e),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment:
|
|
MainAxisAlignment.spaceBetween,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Icon(
|
|
Icons.push_pin,
|
|
color: Color(0xffffc000),
|
|
size: 24,
|
|
),
|
|
Icon(
|
|
Icons.more_horiz,
|
|
color: Color(0xff212435),
|
|
size: 24,
|
|
),
|
|
],
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0, 16, 0, 8),
|
|
child: Text(
|
|
Constants.chap3_,
|
|
textAlign: TextAlign.start,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 16,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Text(
|
|
Constants.loremIpsumOrLipsumAsItI_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff000000),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
padding: EdgeInsets.symmetric(
|
|
vertical: 4,
|
|
horizontal: 8,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Color(0x343a57e8),
|
|
shape: BoxShape.rectangle,
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
),
|
|
child: Text(
|
|
Constants.story_,
|
|
textAlign: TextAlign.start,
|
|
overflow: TextOverflow.clip,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontStyle: FontStyle.normal,
|
|
fontSize: 14,
|
|
color: Color(0xff3a57e8),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Align2939_fgkc(Icons.add),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class Dashboard_jvxmController with ChangeNotifier {
|
|
int? selectedIndex;
|
|
|
|
dynamic getModel(Dao repository) {
|
|
final items = repository.getAll();
|
|
return (selectedIndex == null || selectedIndex! >= items.length)
|
|
? repository.create()
|
|
: items[selectedIndex!];
|
|
}
|
|
}
|