From e6759b818673f42a0d81d99467d8b6e5b1cb73fd Mon Sep 17 00:00:00 2001 From: ducafecat Date: Thu, 16 Apr 2020 05:27:34 +0800 Subject: [PATCH] =?UTF-8?q?add=20->=20=E8=AF=A6=E6=83=85=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++ lib/common/widgets/app.dart | 8 +++-- lib/pages/details/details.dart | 56 ++++++++++++++++++++++++++++++++++ pubspec.lock | 7 +++++ 4 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 lib/pages/details/details.dart diff --git a/.gitignore b/.gitignore index ae1f183..de9ae6a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ lib/generated_plugin_registrant.dart # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +# Tuture-related files + +.tuture diff --git a/lib/common/widgets/app.dart b/lib/common/widgets/app.dart index b707894..c2e5ba1 100644 --- a/lib/common/widgets/app.dart +++ b/lib/common/widgets/app.dart @@ -11,9 +11,11 @@ Widget transparentAppBar({ return AppBar( backgroundColor: Colors.transparent, elevation: 0, - title: Center( - child: title, - ), + title: title != null + ? Center( + child: title, + ) + : null, leading: leading, actions: actions, ); diff --git a/lib/pages/details/details.dart b/lib/pages/details/details.dart new file mode 100644 index 0000000..13d6742 --- /dev/null +++ b/lib/pages/details/details.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_ducafecat_news/common/values/values.dart'; +import 'package:flutter_ducafecat_news/common/widgets/widgets.dart'; + +class DetailsPage extends StatefulWidget { + DetailsPage({Key key}) : super(key: key); + + @override + _DetailsPageState createState() => _DetailsPageState(); +} + +class _DetailsPageState extends State { + // 顶部导航 + Widget _buildAppBar() { + return transparentAppBar( + context: context, + leading: IconButton( + icon: Icon( + Icons.arrow_back, + color: AppColors.primaryText, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + actions: [ + IconButton( + icon: Icon( + Icons.bookmark_border, + color: AppColors.primaryText, + ), + onPressed: () {}, + ), + IconButton( + icon: Icon( + Icons.share, + color: AppColors.primaryText, + ), + onPressed: () {}, + ) + ]); + } + + // 正文 + Widget _buildPageView() { + return Container(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: _buildAppBar(), + body: _buildPageView(), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 612ce79..8866e07 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -111,6 +111,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.2" flutter_screenutil: dependency: "direct main" description: