Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmalpha_flutter
Commits
ad253d64
Commit
ad253d64
authored
Feb 19, 2019
by
艾娇平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
意见页面
parent
fd09a8a9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
268 additions
and
52 deletions
+268
-52
ALColors.dart
lib/macros/ALColors.dart
+27
-0
ALCommon.dart
lib/macros/ALCommon.dart
+63
-0
ALDevice.dart
lib/macros/ALDevice.dart
+17
-0
main.dart
lib/main.dart
+29
-35
opinion.dart
lib/opinion.dart
+115
-0
pubspec.lock
pubspec.lock
+17
-17
No files found.
lib/macros/ALColors.dart
0 → 100644
View file @
ad253d64
// Copyright 2019 All rights reserved.
// Authors: Mikasa Authors.
import
'dart:ui'
show
Color
;
import
'package:flutter/painting.dart'
;
// 关于颜色的定义
// Color(0xFF323232);
// FF 表示透明度 323232 表示RGB颜色值
class
ALColors
{
ALColors
.
_
();
static
const
Color
Color323232
=
Color
(
0xFF323232
);
static
const
Color
Color464646
=
Color
(
0xFF464646
);
static
const
Color
Color999999
=
Color
(
0xFF999999
);
static
const
Color
ColorFFFFFF
=
Color
(
0xFFffffff
);
static
const
Color
Color8E8E8E
=
Color
(
0xFF8e8e8e
);
static
const
Color
ColorC4C4C4
=
Color
(
0xFFc4c4c4
);
static
const
Color
ColorF8F8F8
=
Color
(
0xFFf8f8f8
);
static
const
Color
ColorE4E4E4
=
Color
(
0xFFe4e4e4
);
static
const
Color
ColorF4F3F8
=
Color
(
0xFFf4f3f8
);
static
const
Color
Color282828
=
Color
(
0xFF282828
);
static
const
Color
ColorE5E5E5
=
Color
(
0xFFe5e5e5
);
}
\ No newline at end of file
lib/macros/ALCommon.dart
0 → 100644
View file @
ad253d64
//
// ALCommon
//
// gmalpha_flutter
// Created by lxrent on 2019/2/19.
// Copyright © 2019 Gengmei. All rights reserved.
//
import
'package:flutter/material.dart'
;
import
'ALColors.dart'
;
class
ALAlphaButton
extends
FlatButton
{
// factory ALAlphaButton
/// Create a simple text button.
const
ALAlphaButton
({
Key
key
,
@required
VoidCallback
onPressed
,
ValueChanged
<
bool
>
onHighlightChanged
,
ButtonTextTheme
textTheme
,
Color
textColor
,
Color
disabledTextColor
,
Color
color
,
Color
disabledColor
,
Color
highlightColor
,
Color
splashColor
,
Brightness
colorBrightness
,
EdgeInsetsGeometry
padding
,
ShapeBorder
shape
,
Clip
clipBehavior
=
Clip
.
none
,
MaterialTapTargetSize
materialTapTargetSize
,
@required
Widget
child
,
})
:
super
(
key:
key
,
onPressed:
onPressed
,
onHighlightChanged:
onHighlightChanged
,
textTheme:
textTheme
,
textColor:
textColor
,
disabledTextColor:
disabledTextColor
,
color:
color
,
disabledColor:
disabledColor
,
highlightColor:
highlightColor
,
splashColor:
splashColor
,
colorBrightness:
colorBrightness
,
padding:
padding
,
shape:
shape
,
clipBehavior:
clipBehavior
,
materialTapTargetSize:
materialTapTargetSize
,
child:
child
,
);
@override
Widget
build
(
BuildContext
context
)
{
// TODO: implement build
return
FlatButton
(
onPressed:
onPressed
,
child:
child
,
color:
ALColors
.
Color323232
,
shape:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
0
)),
borderSide:
BorderSide
(
color:
ALColors
.
Color323232
)),
);
}
}
lib/macros/ALDevice.dart
0 → 100644
View file @
ad253d64
//
// ALDevice
//
// gm_alpha_flutter
// Created by lxrent on 2019/1/30.
// Copyright © 2019 Gengmei. All rights reserved.
//
import
'dart:ui'
;
class
ALDevice
{
ALDevice
.
_
();
static
bool
debug
=
!
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
static
double
width
=
window
.
physicalSize
.
width
;
static
double
height
=
window
.
physicalSize
.
height
;
}
\ No newline at end of file
lib/main.dart
View file @
ad253d64
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'battery.dart'
;
import
'battery.dart'
;
import
'dart:ui'
;
import
'opinion.dart'
;
import
'package:flutter/rendering.dart'
;
void
main
(
)
{
debugPaintSizeEnabled
=
false
;
//打开视觉调试开关
return
runApp
(
_widgetForRoute
(
window
.
defaultRouteName
));
}
class
ALRoute
{
ALRoute
.
_
();
static
const
String
Opinion
=
'opinion'
;
}
// 设置Native 跳转入口
Widget
_widgetForRoute
(
String
route
)
{
switch
(
route
)
{
case
'myApp'
:
return
new
MyApp
();
case
ALRoute
.
Opinion
:
return
new
Opinion
();
default
:
return
Center
(
child:
Text
(
'Unknown route:
$route
'
,
textDirection:
TextDirection
.
ltr
),
);
}
}
void
main
(
)
=>
runApp
(
MyApp
());
class
MyApp
extends
StatelessWidget
{
class
MyApp
extends
StatelessWidget
{
// This widget is the root of your application.
// This widget is the root of your application.
...
@@ -9,17 +35,7 @@ class MyApp extends StatelessWidget {
...
@@ -9,17 +35,7 @@ class MyApp extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
MaterialApp
(
title:
'Flutter Demo'
,
title:
'Flutter Demo'
,
theme:
ThemeData
(
theme:
ThemeData
.
light
(),
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or press Run > Flutter Hot Reload in a Flutter IDE). Notice that the
// counter didn't reset back to zero; the application is not restarted.
primarySwatch:
Colors
.
blue
,
),
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
),
home:
MyHomePage
(
title:
'Flutter Demo Home Page'
),
routes:
{
routes:
{
"/channeltest"
:
batteryChannelPage
,
"/channeltest"
:
batteryChannelPage
,
...
@@ -35,15 +51,6 @@ class MyApp extends StatelessWidget {
...
@@ -35,15 +51,6 @@ class MyApp extends StatelessWidget {
class
MyHomePage
extends
StatefulWidget
{
class
MyHomePage
extends
StatefulWidget
{
MyHomePage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
MyHomePage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final
String
title
;
final
String
title
;
@override
@override
...
@@ -82,20 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
...
@@ -82,20 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
// Center is a layout widget. It takes a single child and positions it
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
// in the middle of the parent.
child:
Column
(
child:
Column
(
// Column is also layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
children:
<
Widget
>[
Text
(
Text
(
...
...
lib/opinion.dart
0 → 100644
View file @
ad253d64
//
// opinion
//
// gmalpha_flutter
// Created by Mikasa on 2019/2/19.
// Copyright © 2019 Gengmei. All rights reserved.
//
import
'package:flutter/material.dart'
;
import
'macros/ALColors.dart'
;
import
'macros/ALDevice.dart'
;
//ALColors.ColorFFFFFF
class
Opinion
extends
StatelessWidget
{
// This widget is the root of your application.
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter Demo'
,
color:
ALColors
.
ColorFFFFFF
,
theme:
ThemeData
.
light
(),
home:
OpinionPage
(
title:
'意见和建议1111111'
),
// routes: {
// "/channeltest": batteryChannelPage,
// },
);
}
}
class
OpinionPage
extends
StatefulWidget
{
OpinionPage
({
Key
key
,
this
.
title
})
:
super
(
key:
key
);
final
String
title
;
@override
_OpinionPageState
createState
()
=>
_OpinionPageState
();
}
class
_OpinionPageState
extends
State
<
OpinionPage
>
{
TextEditingController
opinionCtrl
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
// appBar: AppBar(
// title: Text('Home'),
// ),
appBar:
PreferredSize
(
child:
Container
(
alignment:
Alignment
.
center
,
child:
Text
(
'意见与反馈'
,
style:
TextStyle
(
color:
ALColors
.
Color323232
,
fontSize:
18
),
),
),
preferredSize:
Size
(
320
,
64
)),
body:
Center
(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Container
(
margin:
EdgeInsets
.
only
(
left:
30
,
top:
42
,
right:
30
,
bottom:
0
),
height:
215
,
width:
ALDevice
.
width
,
child:
TextField
(
controller:
opinionCtrl
,
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
10
),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
0
)),
borderSide:
BorderSide
(
color:
ALColors
.
ColorC4C4C4
)
),
focusedBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
0
)),
borderSide:
BorderSide
(
color:
ALColors
.
ColorC4C4C4
)
),
hintText:
'意见与建议'
,
hintStyle:
TextStyle
(
color:
ALColors
.
ColorC4C4C4
,
fontSize:
14
,),
labelStyle:
TextStyle
(
color:
ALColors
.
Color323232
,
fontSize:
19
),
),
),
),
OutlineButton
(
child:
Text
(
'有阴影'
),
),
FlatButton
(
shape:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
0
)),
borderSide:
BorderSide
(
color:
ALColors
.
Color323232
)
),
child:
Text
(
'提交2222'
),
color:
ALColors
.
ColorFFFFFF
,
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
"/channeltest"
);
},
)
],
),
),
);
}
}
//
//class MyNarBar extends PreferredSizeWidget {
// @override
//}
pubspec.lock
View file @
ad253d64
...
@@ -5,35 +5,35 @@ packages:
...
@@ -5,35 +5,35 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: async
name: async
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.8"
version: "2.0.8"
boolean_selector:
boolean_selector:
dependency: transitive
dependency: transitive
description:
description:
name: boolean_selector
name: boolean_selector
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.0.4"
version: "1.0.4"
charcode:
charcode:
dependency: transitive
dependency: transitive
description:
description:
name: charcode
name: charcode
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.2"
version: "1.1.2"
collection:
collection:
dependency: transitive
dependency: transitive
description:
description:
name: collection
name: collection
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.14.11"
version: "1.14.11"
cupertino_icons:
cupertino_icons:
dependency: "direct main"
dependency: "direct main"
description:
description:
name: cupertino_icons
name: cupertino_icons
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.1.2"
version: "0.1.2"
flutter:
flutter:
...
@@ -50,28 +50,28 @@ packages:
...
@@ -50,28 +50,28 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: matcher
name: matcher
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.12.3+1"
version: "0.12.3+1"
meta:
meta:
dependency: transitive
dependency: transitive
description:
description:
name: meta
name: meta
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.6"
version: "1.1.6"
path:
path:
dependency: transitive
dependency: transitive
description:
description:
name: path
name: path
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.6.2"
version: "1.6.2"
quiver:
quiver:
dependency: transitive
dependency: transitive
description:
description:
name: quiver
name: quiver
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.1"
version: "2.0.1"
sky_engine:
sky_engine:
...
@@ -83,56 +83,56 @@ packages:
...
@@ -83,56 +83,56 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: source_span
name: source_span
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.4.1"
version: "1.4.1"
stack_trace:
stack_trace:
dependency: transitive
dependency: transitive
description:
description:
name: stack_trace
name: stack_trace
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.9.3"
version: "1.9.3"
stream_channel:
stream_channel:
dependency: transitive
dependency: transitive
description:
description:
name: stream_channel
name: stream_channel
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.6.8"
version: "1.6.8"
string_scanner:
string_scanner:
dependency: transitive
dependency: transitive
description:
description:
name: string_scanner
name: string_scanner
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.0.4"
version: "1.0.4"
term_glyph:
term_glyph:
dependency: transitive
dependency: transitive
description:
description:
name: term_glyph
name: term_glyph
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.0.1"
version: "1.0.1"
test_api:
test_api:
dependency: transitive
dependency: transitive
description:
description:
name: test_api
name: test_api
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "0.2.1"
version: "0.2.1"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
name: typed_data
name: typed_data
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "1.1.6"
version: "1.1.6"
vector_math:
vector_math:
dependency: transitive
dependency: transitive
description:
description:
name: vector_math
name: vector_math
url: "https://pub.
dartlang.org
"
url: "https://pub.
flutter-io.cn
"
source: hosted
source: hosted
version: "2.0.8"
version: "2.0.8"
sdks:
sdks:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment