提交 a290cd06 authored 作者: yueweilu's avatar yueweilu

最近学习基本布局

上级 0f979ee6
...@@ -7,4 +7,5 @@ import 'package:flutter_book/store/index.dart'; ...@@ -7,4 +7,5 @@ import 'package:flutter_book/store/index.dart';
import '../models/user_model.dart'; import '../models/user_model.dart';
import '../services/index.dart'; import '../services/index.dart';
part 'account.dart'; part 'account.dart';
\ No newline at end of file part 'mine.dart';
\ No newline at end of file
part of apis;
abstract class MineAPI {
}
\ No newline at end of file
...@@ -30,12 +30,12 @@ class _CoursePageState extends State<CoursePage> { ...@@ -30,12 +30,12 @@ class _CoursePageState extends State<CoursePage> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
icon: const Icon(Ionicons.timer), icon: const Icon(Ionicons.timer),
// onPressed: () => context.pushNamed(Routes.msgs), onPressed: () => context.pushNamed(Routes.studyHistory),
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
// context.pushNamed(Routes.msgs); context.pushNamed(Routes.msgs);
controller.logout(context); // controller.logout(context);
}, },
child: badges.Badge( child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5, end: 0), position: badges.BadgePosition.topEnd(top: -5, end: 0),
......
...@@ -50,12 +50,12 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{ ...@@ -50,12 +50,12 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver{
builder: (controller) => BottomNavigationBar( builder: (controller) => BottomNavigationBar(
currentIndex:controller.currentPage , currentIndex:controller.currentPage ,
onTap: (page){ onTap: (page){
if (page != 1 && !UserStore.to.isLogin) { // if (page != 1 && !UserStore.to.isLogin) {
context.pushNamed(Routes.login); // context.pushNamed(Routes.login);
} else { // } else {
controller.pageController.jumpToPage(page); // controller.pageController.jumpToPage(page);
} // }
// controller.pageController.jumpToPage(page); controller.pageController.jumpToPage(page);
}, },
items: [ items: [
BottomNavigationBarItem( BottomNavigationBarItem(
......
part of study_history;
\ No newline at end of file
library study_history;
import 'package:flutter/material.dart';
import '../../theme.dart';
import '../../utils/index.dart';
part 'view.dart';
part 'controller.dart';
part 'widgets/item.dart';
\ No newline at end of file
part of study_history;
class StudyHistoryPage extends StatefulWidget {
const StudyHistoryPage({Key? key}) : super(key: key);
@override
State<StudyHistoryPage> createState() => _StudyHistoryPageState();
}
class _StudyHistoryPageState extends State<StudyHistoryPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text('最近学习'),
),
body: ListView.builder(
itemBuilder: (BuildContext context, int index) {
return BuildDayItem();
},
itemCount: 4,
),
);
}
}
part of study_history;
class BuildDayItem extends StatelessWidget {
const BuildDayItem({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
// height: 300,
margin: EdgeInsets.only(left: 10,top: 10,right: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colours.cC7.withOpacity(0.5),
offset: const Offset(1, 3),
blurRadius: 10,
spreadRadius: 0,
),
],
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 32,
color: Colors.cyan,
alignment: Alignment.centerLeft,
child: Text('今天',style: TextStyle(fontSize: 13,height: 1.4,color: Colours.c6),),
),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder:(BuildContext context, int index){
return _buildItem();
},
itemCount: 2,
)
],
),
);
}
Widget _buildItem(){
return Container(
margin: EdgeInsets.only(left: 10,right: 10),
child: Column(
children: [
Container(
color: Colours.cF0,
height: 2,
),
Container(
margin: EdgeInsets.only(top: 11.5,bottom: 14.5),
child: Row(
children: [
Container(
width: 72,
height: 87,
color: Colors.red,
),
Column(
children: [
Text('从现在开始,为精彩活过一百',style: TextStyle(fontSize: 14,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),maxLines: 1,overflow: TextOverflow.ellipsis,),
Text('李白',style: TextStyle(fontSize: 12,height: 1.4,color: Colours.c6),),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
color: Colors.cyan,
padding: const EdgeInsets.symmetric(horizontal: 3.5),
child: const Text('未学习',style: TextStyle(fontSize: 11,height: 1.3,color: Colours.c9),),
),
const Text('继续学习',style: TextStyle(fontSize: 11,height: 1.3,color: AppTheme.primary),)
],
)
],
)
],
),
)
],
),
);
}
}
...@@ -14,6 +14,7 @@ import 'package:flutter_book/pages/main/index.dart'; ...@@ -14,6 +14,7 @@ import 'package:flutter_book/pages/main/index.dart';
import 'package:flutter_book/pages/reset_pwd/index.dart'; import 'package:flutter_book/pages/reset_pwd/index.dart';
import 'package:flutter_book/pages/search/index.dart'; import 'package:flutter_book/pages/search/index.dart';
import 'package:flutter_book/pages/splash/index.dart'; import 'package:flutter_book/pages/splash/index.dart';
import 'package:flutter_book/pages/study_history/index.dart';
import 'package:flutter_book/pages/study_report/index.dart'; import 'package:flutter_book/pages/study_report/index.dart';
import 'package:flutter_book/pages/user_coin/index.dart'; import 'package:flutter_book/pages/user_coin/index.dart';
import 'package:flutter_book/pages/user_info/index.dart'; import 'package:flutter_book/pages/user_info/index.dart';
......
...@@ -65,6 +65,8 @@ abstract class Routes { ...@@ -65,6 +65,8 @@ abstract class Routes {
static const msgs = 'msgs'; static const msgs = 'msgs';
// 关于 // 关于
static const about = 'about'; static const about = 'about';
// 最近学习
static const studyHistory = 'study_history';
static final GoRouter config = GoRouter( static final GoRouter config = GoRouter(
...@@ -248,6 +250,15 @@ abstract class Routes { ...@@ -248,6 +250,15 @@ abstract class Routes {
child: const SearchPage() child: const SearchPage()
) )
), ),
GoRoute(
path: '/$studyHistory',
name: studyHistory,
pageBuilder: (context, state) =>CupertinoPage(
name: state.uri.toString(),
key: state.pageKey,
child: const StudyHistoryPage()
)
),
] ]
); );
......
...@@ -23,14 +23,15 @@ class Colours { ...@@ -23,14 +23,15 @@ class Colours {
static const c6 = Color(0xFF666666); static const c6 = Color(0xFF666666);
static const cLine = Color(0xFFF0F0F0); static const cLine = Color(0xFFF0F0F0);
static const cBlue = Color(0xFF2A82D9); static const cBlue = Color(0xFF2A82D9);
static const cE0 = Color(0xFFE0E0E0);
static const cE2 = Color(0xFFE2E2E2); static const cE2 = Color(0xFFE2E2E2);
static const cE5 = Color(0xFFE5E5E5); static const cE5 = Color(0xFFE5E5E5);
static const cE7 = Color(0xFFE7E7E7);
static const cF0 = Color(0xFFF0F0F0);
static const cF2 = Color(0xFFF2F2F2); static const cF2 = Color(0xFFF2F2F2);
static const cF4 = Color(0xFFF4F4F4); static const cF4 = Color(0xFFF4F4F4);
static const cF9 = Color(0xFFF9F9F9); static const cF9 = Color(0xFFF9F9F9);
static const cC7 = Color(0xFFC7C7C7); static const cC7 = Color(0xFFC7C7C7);
static const cE0 = Color(0xFFE0E0E0);
static const cE7 = Color(0xFFE7E7E7);
} }
class Gaps { class Gaps {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论