-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
220 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_wcao/ui/tag.dart'; | ||
import 'package:flutter_wcao/ui/theme.dart'; | ||
|
||
class MineAddTag extends StatefulWidget { | ||
const MineAddTag({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<MineAddTag> createState() => _MineAddTagState(); | ||
} | ||
|
||
class _MineAddTagState extends State<MineAddTag> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('添加标签'), | ||
actions: [ | ||
TextButton( | ||
onPressed: () {}, | ||
child: Text( | ||
'完成', | ||
style: TextStyle(color: WcaoTheme.base), | ||
), | ||
) | ||
], | ||
), | ||
body: DefaultTabController( | ||
length: 4, | ||
child: SafeArea( | ||
child: Column( | ||
children: [ | ||
Container( | ||
width: double.infinity, | ||
padding: | ||
const EdgeInsets.symmetric(horizontal: 12, vertical: 12), | ||
color: WcaoTheme.primary.withOpacity(.25), | ||
child: Wrap( | ||
alignment: WrapAlignment.center, | ||
spacing: 12, | ||
runSpacing: 12, | ||
children: List.generate( | ||
12, | ||
(index) => Tag( | ||
'乐观注意', | ||
backgroundColor: WcaoTheme.primary, | ||
color: Colors.white, | ||
close: true, | ||
borderRadius: BorderRadius.circular(20), | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 6, | ||
vertical: 6, | ||
), | ||
), | ||
), | ||
), | ||
), | ||
Container( | ||
margin: const EdgeInsets.only(top: 12), | ||
child: TabBar( | ||
padding: const EdgeInsets.symmetric(horizontal: 12), | ||
labelStyle: const TextStyle(fontWeight: FontWeight.normal), | ||
labelColor: WcaoTheme.primary, | ||
unselectedLabelColor: WcaoTheme.base, | ||
indicatorColor: WcaoTheme.primary, | ||
indicatorPadding: const EdgeInsets.symmetric(horizontal: 24), | ||
tabs: const [ | ||
Tab(text: '星座'), | ||
Tab(text: '年代'), | ||
Tab(text: '兴趣'), | ||
Tab(text: '特质'), | ||
], | ||
), | ||
), | ||
Expanded( | ||
child: Container( | ||
margin: const EdgeInsets.only(top: 12), | ||
child: TabBarView( | ||
children: [ | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 24), | ||
child: tabbarView1(), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 24), | ||
child: tabbarView2(), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 24), | ||
child: tabbarView3(), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 24), | ||
child: tabbarView4(), | ||
), | ||
], | ||
), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
Wrap tabbarView4() { | ||
return Wrap( | ||
runSpacing: 12, | ||
spacing: 12, | ||
alignment: WrapAlignment.spaceBetween, | ||
children: List.generate( | ||
16, | ||
(index) => Tag( | ||
'长得帅', | ||
border: Border.all(width: .5, color: WcaoTheme.outline), | ||
backgroundColor: Colors.white, | ||
color: WcaoTheme.base, | ||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), | ||
borderRadius: BorderRadius.circular(24), | ||
), | ||
), | ||
); | ||
} | ||
|
||
Wrap tabbarView3() { | ||
return Wrap( | ||
runSpacing: 12, | ||
spacing: 12, | ||
alignment: WrapAlignment.spaceBetween, | ||
children: List.generate( | ||
16, | ||
(index) => Tag( | ||
'钓鱼', | ||
border: Border.all(width: .5, color: WcaoTheme.outline), | ||
backgroundColor: Colors.white, | ||
color: WcaoTheme.base, | ||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), | ||
borderRadius: BorderRadius.circular(24), | ||
), | ||
), | ||
); | ||
} | ||
|
||
Wrap tabbarView2() { | ||
return Wrap( | ||
runSpacing: 12, | ||
spacing: 12, | ||
alignment: WrapAlignment.spaceBetween, | ||
children: List.generate( | ||
16, | ||
(index) => Tag( | ||
'90年代', | ||
border: Border.all(width: .5, color: WcaoTheme.outline), | ||
backgroundColor: Colors.white, | ||
color: WcaoTheme.base, | ||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), | ||
borderRadius: BorderRadius.circular(24), | ||
), | ||
), | ||
); | ||
} | ||
|
||
Wrap tabbarView1() { | ||
return Wrap( | ||
runSpacing: 12, | ||
spacing: 12, | ||
alignment: WrapAlignment.spaceBetween, | ||
children: List.generate( | ||
16, | ||
(index) => Tag( | ||
'双鱼座', | ||
border: Border.all(width: .5, color: WcaoTheme.outline), | ||
backgroundColor: Colors.white, | ||
color: WcaoTheme.base, | ||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), | ||
borderRadius: BorderRadius.circular(24), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,12 +182,10 @@ packages: | |
flutter_wcao: | ||
dependency: "direct main" | ||
description: | ||
path: "." | ||
ref: main | ||
resolved-ref: "934d579ad23a9c7e99c228dc858ef2446a125ef1" | ||
url: "[email protected]:cu-yang/flutter_wcao.git" | ||
source: git | ||
version: "0.0.3+1" | ||
name: flutter_wcao | ||
url: "https://pub.flutter-io.cn" | ||
source: hosted | ||
version: "0.0.3+2" | ||
flutter_web_plugins: | ||
dependency: transitive | ||
description: flutter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,10 +41,7 @@ dependencies: | |
group_button: ^5.0.1 | ||
pull_to_refresh: ^2.0.0 | ||
dart_mock: ^2.0.0 | ||
flutter_wcao: | ||
git: | ||
url: [email protected]:cu-yang/flutter_wcao.git | ||
ref: main | ||
flutter_wcao: ^0.0.3+2 | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.