-
Notifications
You must be signed in to change notification settings - Fork 109
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
1 parent
bdfc43f
commit c233b0b
Showing
4 changed files
with
79 additions
and
38 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
tdesign-component/example/lib/component_test/test_navbar.dart
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,42 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:tdesign_flutter/tdesign_flutter.dart'; | ||
|
||
void main(){ | ||
runApp( MaterialApp( | ||
home: Builder(builder: (context){ | ||
return Scaffold( | ||
// appBar: TDNavBar(), | ||
appBar: PreferredSize( | ||
preferredSize: Size(MediaQuery.of(context).size.width,MediaQuery.of(context).size.height + MediaQuery.of(context).padding.top), | ||
child: Padding( | ||
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), | ||
child: TDNavBar( | ||
useDefaultBack: false, | ||
// screenAdaptation: false, | ||
centerTitle: false, | ||
titleMargin: 0, | ||
titleWidget: TDSearchBar( | ||
needCancel: false, | ||
autoHeight: true, | ||
padding: const EdgeInsets.fromLTRB(0, 2, 0, 2), | ||
placeHolder: '搜索预设文案', | ||
mediumStyle: true, | ||
style: TDSearchStyle.round, | ||
onTextChanged: (String text) { | ||
print('input:$text'); | ||
}, | ||
), | ||
rightBarItems: [ | ||
TDNavBarItem(icon: TDIcons.home,iconSize: 24), | ||
TDNavBarItem(icon: TDIcons.ellipsis,iconSize: 24) | ||
] | ||
), | ||
), | ||
), | ||
body: Center( | ||
child: TDText("测试文案"), | ||
), | ||
); | ||
},), | ||
)); | ||
} |
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