Files
xiaojia22326@163.com c4cbd02123 fix:code
2019-01-31 17:18:16 +08:00

54 lines
1.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class SizeOverflowBoxDefault extends StatelessWidget {
final double curSizeWidth;
final double curSizeHeight;
final String text;
SizeOverflowBoxDefault(
{Key key, this.curSizeWidth, this.curSizeHeight, this.text})
: super(key: key);
@override
Widget build(BuildContext context) {
return SizedOverflowBox(
size: Size(curSizeWidth, curSizeHeight),
alignment: Alignment.centerRight,
//size属性设置了大小container 里面的大小失效,
child: Container(
color: Color(0xfff06292),
width: 50.0,
height: 50.0,
child: Text(
text,
style: TextStyle(color: Colors.white),
),
),
);
}
}
class SizeBoxDefault extends StatelessWidget {
final double curWidth;
final double curHeight;
SizeBoxDefault({Key key, this.curHeight, this.curWidth}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: curWidth,
height: curHeight,
child: const Card(
child: Text(
'SizedBox',
style: TextStyle(color: Colors.white),
textDirection: TextDirection.rtl,
),
color: Color(0xfff06292),
),
);
}
}