Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d02e85a

Browse files
authored
Merge pull request #28 from VB10/feature/null-safety
feature/null safety
2 parents 69b6624 + 7ebece0 commit d02e85a

File tree

97 files changed

+654
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+654
-517
lines changed

‎ios/Podfile.lock‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ PODS:
55
- FMDB (2.7.5):
66
- FMDB/standard (= 2.7.5)
77
- FMDB/standard (2.7.5)
8+
- package_info (0.0.1):
9+
- Flutter
810
- path_provider (0.0.1):
911
- Flutter
1012
- share (0.0.1):
@@ -20,6 +22,7 @@ PODS:
2022
DEPENDENCIES:
2123
- device_info (from `.symlinks/plugins/device_info/ios`)
2224
- Flutter (from `Flutter`)
25+
- package_info (from `.symlinks/plugins/package_info/ios`)
2326
- path_provider (from `.symlinks/plugins/path_provider/ios`)
2427
- share (from `.symlinks/plugins/share/ios`)
2528
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
@@ -35,6 +38,8 @@ EXTERNAL SOURCES:
3538
:path: ".symlinks/plugins/device_info/ios"
3639
Flutter:
3740
:path: Flutter
41+
package_info:
42+
:path: ".symlinks/plugins/package_info/ios"
3843
path_provider:
3944
:path: ".symlinks/plugins/path_provider/ios"
4045
share:
@@ -50,6 +55,7 @@ SPEC CHECKSUMS:
5055
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
5156
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
5257
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
58+
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
5359
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
5460
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
5561
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d

‎ios/Runner/Info.plist‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,10 @@
3939
</array>
4040
<key>UIViewControllerBasedStatusBarAppearance</key>
4141
<false/>
42+
<key>CFBundleLocalizations</key>
43+
<array>
44+
<string>en</string>
45+
<string>tr</string>
46+
</array>
4247
</dict>
4348
</plist>

‎lib/core/base/model/base_model.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
abstract class BaseModel<T> {
2-
Map<String, Object> toJson();
2+
Map<String, Object?> toJson();
33
T fromJson(Map<String, Object> json);
44
}

‎lib/core/base/model/base_view_model.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import '../../init/network/network_manager.dart';
77
import '../../init/network/vexana_manager.dart';
88

99
abstract class BaseViewModel {
10-
BuildContext context;
10+
BuildContext? context;
1111

12-
ICoreDio coreDio = NetworkManager.instance.coreDio;
13-
VexanaManager vexanaManager = VexanaManager.instance;
12+
ICoreDioNullSafety? coreDio = NetworkManager.instance!.coreDio;
13+
VexanaManager? vexanaManager = VexanaManager.instance;
1414
LocaleManager localeManager = LocaleManager.instance;
1515
NavigationService navigation = NavigationService.instance;
1616

‎lib/core/base/view/base_widget.dart‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,16 @@ class BaseView<T extends Store> extends StatefulWidget {
55
final Widget Function(BuildContext context, T value) onPageBuilder;
66
final T viewModel;
77
final Function(T model) onModelReady;
8-
final VoidCallback onDispose;
8+
final VoidCallback? onDispose;
99

10-
const BaseView(
11-
{Key key,
12-
@required this.viewModel,
13-
@required this.onPageBuilder,
14-
this.onModelReady,
15-
this.onDispose})
16-
: super(key: key);
10+
const BaseView({Key? key, required this.viewModel, required this.onPageBuilder, required this.onModelReady, this.onDispose}) : super(key: key);
1711

1812
@override
1913
_BaseViewState<T> createState() => _BaseViewState<T>();
2014
}
2115

2216
class _BaseViewState<T extends Store> extends State<BaseView<T>> {
23-
T model;
17+
lateT model;
2418
@override
2519
void initState() {
2620
model = widget.viewModel;
@@ -31,7 +25,7 @@ class _BaseViewState<T extends Store> extends State<BaseView<T>> {
3125
@override
3226
void dispose() {
3327
super.dispose();
34-
if (widget.onDispose != null) widget.onDispose();
28+
if (widget.onDispose != null) widget.onDispose!();
3529
}
3630

3731
@override

‎lib/core/components/button/icon_button.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
33
import 'normal_button.dart';
44

55
class IconNormalButton extends StatelessWidget {
6-
final VoidCallback onPressed;
6+
final VoidCallback? onPressed;
77
final IconData icon;
88

9-
const IconNormalButton({Key key, this.onPressed, @required this.icon}) : super(key: key);
9+
const IconNormalButton({Key? key, this.onPressed, required this.icon}) : super(key: key);
1010
@override
1111
Widget build(BuildContext context) {
1212
return NormalButton(
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
import 'package:flutter/material.dart';
22

33
class NormalButton extends StatelessWidget {
4-
final Widget child;
4+
final Widget? child;
55

6-
final VoidCallback onPressed;
6+
final VoidCallback? onPressed;
77

8-
const NormalButton({Key key, this.child, this.onPressed}) : super(key: key);
8+
const NormalButton({Key? key, this.child, this.onPressed}) : super(key: key);
99
@override
1010
Widget build(BuildContext context) {
11-
return RaisedButton(
12-
padding: EdgeInsets.all(15),
13-
elevation: 10,
11+
return ElevatedButton(
12+
style: ButtonStyle(
13+
padding: MaterialStateProperty.all(EdgeInsets.all(15)),
14+
elevation: MaterialStateProperty.all(10),
15+
),
1416
onPressed: onPressed,
1517
child: child,
1618
);
1719
}
1820
}
21+
22+
// BEFORE: NULL SAFETY
23+
// return RaisedButton(
24+
// padding: EdgeInsets.all(15),
25+
// elevation: 10,
26+
// onPressed: onPressed,
27+
// child: child,
28+
// );

‎lib/core/components/button/title_text_button.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
33
import 'normal_button.dart';
44

55
class TitleTextButton extends StatelessWidget {
6-
final VoidCallback onPressed;
6+
final VoidCallback? onPressed;
77
final String text;
88

9-
const TitleTextButton({Key key, this.onPressed, @required this.text}) : super(key: key);
9+
const TitleTextButton({Key? key, this.onPressed, required this.text}) : super(key: key);
1010
@override
1111
Widget build(BuildContext context) {
1212
return NormalButton(

‎lib/core/components/column/form_column.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'package:flutter/material.dart';
22

33
class FormColumn extends StatelessWidget {
4-
final List<Widget> children;
4+
final List<Widget>? children;
55

6-
const FormColumn({Key key, this.children}) : super(key: key);
6+
const FormColumn({Key? key, this.children}) : super(key: key);
77
@override
88
Widget build(BuildContext context) {
99
return Row(
@@ -12,7 +12,7 @@ class FormColumn extends StatelessWidget {
1212
Expanded(
1313
flex: 8,
1414
child: Column(
15-
children: children,
15+
children: children!,
1616
),
1717
),
1818
Spacer(flex: 1),

‎lib/core/components/decoration/circle_decoration.dart‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import 'package:flutter/material.dart';
33
class CircleDecoration extends Decoration {
44
final BoxPainter _painter;
55

6-
CircleDecoration({@required Color color, @required double radius}) : _painter = _CirclePainter(color, radius);
6+
CircleDecoration({required Color color, required double radius}) : _painter = _CirclePainter(color, radius);
77

88
@override
9-
BoxPainter createBoxPainter([onChanged]) => _painter;
9+
BoxPainter createBoxPainter([VoidCallback?onChanged]) => _painter;
1010
}
1111

1212
class _CirclePainter extends BoxPainter {
1313
final Paint _paint;
1414
final double radius;
1515

16-
Offset circleOffset;
16+
lateOffset circleOffset;
1717

1818
_CirclePainter(Color color, this.radius)
1919
: _paint = Paint()
@@ -22,7 +22,7 @@ class _CirclePainter extends BoxPainter {
2222

2323
@override
2424
void paint(Canvas canvas, Offset offset, ImageConfiguration cfg) {
25-
circleOffset = offset + Offset(cfg.size.width / 2, cfg.size.height - radius - 5);
25+
circleOffset = offset + Offset(cfg.size!.width / 2, cfg.size!.height - radius - 5);
2626
canvas.drawCircle(circleOffset, radius, _paint);
2727
}
2828
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /