|
@@ -560,6 +560,13 @@ class _ImageButtonState extends State<ImageButton> {
|
560
|
560
|
}
|
561
|
561
|
}
|
562
|
562
|
|
|
563
|
+ String get uploadText => Localizations.localeOf(context) == Locale('zh', 'CN') ? '上传' : 'Upload';
|
|
564
|
+ String get fullImageText => Localizations.localeOf(context) == Locale('zh', 'CN') ? '原图' : 'Full image';
|
|
565
|
+ String get camera => Localizations.localeOf(context) == Locale('zh', 'CN') ? '拍照' : 'Camera';
|
|
566
|
+ String get album => Localizations.localeOf(context) == Locale('zh', 'CN') ? '相册' : 'Album';
|
|
567
|
+ I18nProvider get locale => Localizations.localeOf(context) == Locale('zh', 'CN') ? I18nProvider.chinese : I18nProvider.english;
|
|
568
|
+
|
|
569
|
+
|
563
|
570
|
Widget buildOverlay(BuildContext context) {
|
564
|
571
|
final theme = ZefyrTheme.of(context).toolbarTheme;
|
565
|
572
|
final toolbar = ZefyrToolbar.of(context);
|
|
@@ -586,7 +593,8 @@ class _ImageButtonState extends State<ImageButton> {
|
586
|
593
|
Expanded(
|
587
|
594
|
child: FlatButton(
|
588
|
595
|
shape: RoundedRectangleBorder(),
|
589
|
|
- color: Color(0xFFF6F6F6),
|
|
596
|
+ color: theme.captionColor,
|
|
597
|
+ padding: EdgeInsets.zero,
|
590
|
598
|
onPressed: () async {
|
591
|
599
|
// toolbar.editor.tapHandle =
|
592
|
600
|
// TapHandle.takePhoto;
|
|
@@ -594,7 +602,7 @@ class _ImageButtonState extends State<ImageButton> {
|
594
|
602
|
source: ImageSource.camera);
|
595
|
603
|
if (file != null) {
|
596
|
604
|
toolbar.closeOverlay();
|
597
|
|
- final image = await toolbar
|
|
605
|
+ await toolbar
|
598
|
606
|
.editor.imageDelegate
|
599
|
607
|
.picked(file, true);
|
600
|
608
|
}
|
|
@@ -612,7 +620,7 @@ class _ImageButtonState extends State<ImageButton> {
|
612
|
620
|
Padding(
|
613
|
621
|
padding: EdgeInsets.only(top: 6),
|
614
|
622
|
child: Text(
|
615
|
|
- '拍照',
|
|
623
|
+ camera,
|
616
|
624
|
style: TextStyle(
|
617
|
625
|
fontSize: 12,
|
618
|
626
|
color: Color(0xFF8C8C8C),
|
|
@@ -626,7 +634,8 @@ class _ImageButtonState extends State<ImageButton> {
|
626
|
634
|
Expanded(
|
627
|
635
|
child: FlatButton(
|
628
|
636
|
shape: RoundedRectangleBorder(),
|
629
|
|
- color: Color(0xFFF6F6F6),
|
|
637
|
+ color: theme.captionColor,
|
|
638
|
+ padding: EdgeInsets.zero,
|
630
|
639
|
onPressed: () {
|
631
|
640
|
final editor =
|
632
|
641
|
ZefyrToolbar.of(context).editor;
|
|
@@ -637,7 +646,7 @@ class _ImageButtonState extends State<ImageButton> {
|
637
|
646
|
rowCount: 4,
|
638
|
647
|
itemRadio: 1,
|
639
|
648
|
padding: 4,
|
640
|
|
- provider: I18nProvider.chinese,
|
|
649
|
+ provider: locale,
|
641
|
650
|
sortDelegate: SortDelegate.common,
|
642
|
651
|
pickType: PickType.onlyImage,
|
643
|
652
|
photoPathList: null,
|
|
@@ -670,7 +679,7 @@ class _ImageButtonState extends State<ImageButton> {
|
670
|
679
|
Padding(
|
671
|
680
|
padding: EdgeInsets.only(top: 6),
|
672
|
681
|
child: Text(
|
673
|
|
- '相册',
|
|
682
|
+ album,
|
674
|
683
|
style: TextStyle(
|
675
|
684
|
fontSize: 12,
|
676
|
685
|
color: Color(0xFF8C8C8C),
|
|
@@ -699,7 +708,7 @@ class _ImageButtonState extends State<ImageButton> {
|
699
|
708
|
padding: 4,
|
700
|
709
|
thumbSize: 300,
|
701
|
710
|
itemRadio: 0.5,
|
702
|
|
- provider: I18nProvider.chinese,
|
|
711
|
+ provider: locale,
|
703
|
712
|
sortDelegate: SortDelegate.common,
|
704
|
713
|
pickType: PickType.onlyImage,
|
705
|
714
|
photoPathList: null,
|
|
@@ -743,7 +752,7 @@ class _ImageButtonState extends State<ImageButton> {
|
743
|
752
|
padding:
|
744
|
753
|
EdgeInsets.symmetric(horizontal: 8),
|
745
|
754
|
child: Text(
|
746
|
|
- '原图',
|
|
755
|
+ fullImageText,
|
747
|
756
|
style: TextStyle(
|
748
|
757
|
color: theme.iconColor, fontSize: 16),
|
749
|
758
|
),
|
|
@@ -800,7 +809,7 @@ class _ImageButtonState extends State<ImageButton> {
|
800
|
809
|
alignment: Alignment.center,
|
801
|
810
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
802
|
811
|
child: Text(
|
803
|
|
- '上传 ${snapshot.data.asset.isNotEmpty ? "(${snapshot.data.asset.length})" : ''}',
|
|
812
|
+ '$uploadText ${snapshot.data.asset.isNotEmpty ? "(${snapshot.data.asset.length})" : ''}',
|
804
|
813
|
style: TextStyle(
|
805
|
814
|
color: Colors.white,
|
806
|
815
|
fontSize: 14,
|