add screenutil support

null_safety
小赖 4 years ago
parent 73b546c493
commit 41b1baedc3

@ -1,3 +1,4 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:ansu_ui/buttons/as_button.dart';
import 'package:flutter/material.dart';
@ -6,9 +7,10 @@ void main() {
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: false);
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
@ -60,6 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: ListView(
children: [
ASButton(),
SizedBox(height: 12.w),
],
),
);

@ -69,6 +69,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_screenutil:
dependency: transitive
description:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
flutter_test:
dependency: "direct dev"
description: flutter

@ -1,3 +1,4 @@
library ansu_ui;
export 'buttons/as_button.dart';
export 'package:flutter_screenutil/flutter_screenutil.dart';

@ -55,6 +55,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_screenutil:
dependency: "direct main"
description:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
flutter_test:
dependency: "direct dev"
description: flutter

@ -2,7 +2,6 @@ name: ansu_ui
description: A new Flutter package.
version: 0.0.1
author:
homepage:
environment:
sdk: ">=2.7.0 <3.0.0"
@ -11,6 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_screenutil: ^3.2.0
dev_dependencies:
flutter_test:
@ -21,7 +21,6 @@ dev_dependencies:
# The following section is specific to Flutter.
flutter:
# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
@ -32,7 +31,6 @@ flutter:
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a

Loading…
Cancel
Save