修复投票文字溢出问题

hmxc
小赖 4 years ago
parent 7522de6181
commit cd84ba5ee3

@ -0,0 +1,7 @@
class AppConfig {
///API Key
static const caiYunAPI = 'YETFbiaWktYHfCQE';
///AppID
static const wechatAppId = 'wxd7bdef0d4849ddb8';
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/config.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -50,6 +51,7 @@ void main() async {
jpush.applyPushAuthority( jpush.applyPushAuthority(
new NotificationSettingsIOS(sound: true, alert: true, badge: true)); new NotificationSettingsIOS(sound: true, alert: true, badge: true));
DeveloperUtil.setDev(true); DeveloperUtil.setDev(true);
registerWxApi(appId: AppConfig.wechatAppId);
runApp(MyApp()); runApp(MyApp());
} }
@ -61,12 +63,6 @@ class MyApp extends StatefulWidget {
} }
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
registerWxApi(appId: 'wxd7bdef0d4849ddb8');
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MultiProvider( return MultiProvider(

@ -151,19 +151,15 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
finishVoted finishVoted
? Row( ? Row(
children: [ children: [
SizedBox( LinearProgressIndicator(
width: 290.w, value: _percent * 0.01,
child: LinearProgressIndicator( ).expand(),
value: _percent,
),
),
8.w.widthBox, 8.w.widthBox,
'${_percent.toStringAsFixed(2)}%' '${_percent.toStringAsFixed(2)}%'
.text .text
.color(ktextSubColor) .color(ktextSubColor)
.size(24.sp) .size(24.sp)
.make() .make(),
.expand(),
], ],
) )
: SizedBox() : SizedBox()

@ -1,3 +1,4 @@
import 'package:akuCommunity/constants/config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart';
@ -160,7 +161,7 @@ class AppProvider extends ChangeNotifier {
// Location get location => _location; // Location get location => _location;
getWeather() async { getWeather() async {
Response response = await Dio().get( Response response = await Dio().get(
'https://api.caiyunapp.com/v2.5/YETFbiaWktYHfCQE/${_location['longitude']},${_location['latitude']}/realtime.json', 'https://api.caiyunapp.com/v2.5/${AppConfig.caiYunAPI}/${_location['longitude']},${_location['latitude']}/realtime.json',
); );
LoggerData.addData(response); LoggerData.addData(response);
_weatherModel = RealTimeWeatherModel.fromJson(response.data); _weatherModel = RealTimeWeatherModel.fromJson(response.data);

Loading…
Cancel
Save