diff --git "a/Flutter \345\274\200\345\217\221\350\265\204\346\226\231\346\225\264\347\220\206.md" "b/Flutter \345\274\200\345\217\221\350\265\204\346\226\231\346\225\264\347\220\206.md" index 976077a9bff9783f564bfbb16efb3f16c859dade..2538531309faa03689694ff580804a30b9079aad 100644 --- "a/Flutter \345\274\200\345\217\221\350\265\204\346\226\231\346\225\264\347\220\206.md" +++ "b/Flutter \345\274\200\345\217\221\350\265\204\346\226\231\346\225\264\347\220\206.md" @@ -85,6 +85,11 @@ - [Provider](https://pub.dev/packages/provider) 4. 测试、性能 5. Flutter 编译成鸿蒙 app 及 其他 app +6. [Flutter FAQ](https://docs.flutter.cn/resources/faq) + +补充资料: + +1. Flutter widgets [link](https://docs.flutter.cn/reference/widgets) #### 1.2 进阶 diff --git a/flutter_samples/flutter_layout_application/lib/layout/project/resume.dart b/flutter_samples/flutter_layout_application/lib/layout/project/resume.dart new file mode 100644 index 0000000000000000000000000000000000000000..36ad9aaa91cf573ba75e495249753f6bd7f73e4b --- /dev/null +++ b/flutter_samples/flutter_layout_application/lib/layout/project/resume.dart @@ -0,0 +1,133 @@ +import 'package:flutter/material.dart'; + +class ResumeScreen extends StatelessWidget { + const ResumeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + // appBar: AppBar(title: Text('Resume')), + body: ListView( + padding: EdgeInsets.all(16.0), + children: [ + ResumeSection( + title: 'Personal Information', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'John Doe', + style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + ), + Text( + 'Software Engineer', + style: TextStyle(fontSize: 18, color: Colors.grey[700]), + ), + SizedBox(height: 8.0), + Text('Email: johndoe@example.com'), + Text('Phone: +1 (123) 456-7890'), + Text('LinkedIn: linkedin.com/in/johndoe'), + Text('GitHub: github.com/johndoe'), + ], + ), + ), + ResumeSection( + title: 'Skills', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('• Programming Languages: Dart, Java, Python, C++'), + Text('• Frameworks: Flutter, React, Spring Boot'), + Text('• Tools: Git, Docker, Kubernetes, Jenkins'), + ], + ), + ), + ResumeSection( + title: 'Work Experience', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Senior Software Engineer at Tech Corp (2020 - Present)'), + Text( + '• Led a team of 5 developers to deliver mobile applications.', + ), + Text('• Designed and implemented RESTful APIs using Node.js.'), + Text('• Optimized application performance by 30%.'), + SizedBox(height: 16.0), + Text('Software Developer at Innovate Inc (2017 - 2020)'), + Text('• Developed cross-platform mobile apps using Flutter.'), + Text( + '• Collaborated with designers to implement UI/UX designs.', + ), + ], + ), + ), + ResumeSection( + title: 'Education', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Bachelor of Science in Computer Science, University of Tech (2013 - 2017)', + ), + ], + ), + ), + ResumeSection( + title: 'Achievements', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('• Published research paper on AI in IEEE Journal (2021)'), + Text('• Won Best Hackathon Project Award at Tech Summit 2022'), + ], + ), + ), + ResumeSection( + title: 'Certifications', + content: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('• '), // 留空供填写 + Text('• '), // 留空供填写 + ], + ), + ), + ], + ), + ); + } +} + +// 新增模块化组件 +class ResumeSection extends StatelessWidget { + final String title; + final Widget content; + + ResumeSection({required this.title, required this.content}); + + @override + Widget build(BuildContext context) { + return Card( + margin: EdgeInsets.symmetric(vertical: 8.0), + child: Padding( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColor, + ), + ), + SizedBox(height: 8.0), + content, + ], + ), + ), + ); + } +} diff --git a/flutter_samples/flutter_layout_application/lib/main.dart b/flutter_samples/flutter_layout_application/lib/main.dart index 8fd02e3a78d41689fd51d13958a91aacc57652ab..9ba6a44e6009bdfee7c7c6d671ff3d87c5aa29d8 100644 --- a/flutter_samples/flutter_layout_application/lib/main.dart +++ b/flutter_samples/flutter_layout_application/lib/main.dart @@ -106,13 +106,14 @@ class _MyHomePageState extends State { ), ]; break; - case '项目': + case '项目实战': _cardItems = [ CardItem( title: '实战项目一', - content: '基础', + content: '第一个实战项目', key: 'column_layout_project', ), + CardItem(title: '实战项目二', content: '简历实战', key: 'resume_project'), ]; break; default: @@ -157,9 +158,9 @@ class _MyHomePageState extends State { ), ListTile( leading: Icon(Icons.work_outline_outlined), - title: const Text('项目'), + title: const Text('项目实战'), onTap: () { - _onCategorySelected('项目'); + _onCategorySelected('项目实战'); Navigator.pop(context); }, ), diff --git a/flutter_samples/flutter_layout_application/lib/preview_page.dart b/flutter_samples/flutter_layout_application/lib/preview_page.dart index 0cbaed5fcd612f11bbb1508074fde267e1640870..be6d7bc67672eab743560a15bed9364bf763384c 100644 --- a/flutter_samples/flutter_layout_application/lib/preview_page.dart +++ b/flutter_samples/flutter_layout_application/lib/preview_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_layout_application/layout/project/columnLayoutProject.dart'; +import 'package:flutter_layout_application/layout/project/resume.dart'; import 'package:flutter_layout_application/layout/singleColumnLayout.dart'; import 'package:flutter_layout_application/layout/singleLayout.dart'; import 'package:flutter_layout_application/layout/singleListViewBuilderLayout.dart'; @@ -39,6 +40,8 @@ class PreviewPage extends StatelessWidget { return SingleListViewRowLayout(cardItem: cardItem); } else if (cardItem.key == 'listview_builder_layout') { return SingleListViewBuilderLayout(cardItem: cardItem); + } else if (cardItem.key == 'resume_project') { + return ResumeScreen(); } else { return Text(cardItem.content); // 根据需求调整逻辑 }