Browse Source

remove new

git@h5.yoqi.me 2 years ago
parent
commit
e081fda86f

+ 6 - 6
lib/generated/intl/messages_all.dart

@@ -20,8 +20,8 @@ import 'messages_zh.dart' as messages_zh;
 
 typedef Future<dynamic> LibraryLoader();
 Map<String, LibraryLoader> _deferredLibraries = {
-  'en': () => new Future.value(null),
-  'zh': () => new Future.value(null),
+  'en': () => Future.value(null),
+  'zh': () => Future.value(null),
 };
 
 MessageLookupByLibrary _findExact(String localeName) {
@@ -42,13 +42,13 @@ Future<bool> initializeMessages(String localeName) async {
     (locale) => _deferredLibraries[locale] != null,
     onFailure: (_) => null);
   if (availableLocale == null) {
-    return new Future.value(false);
+    return Future.value(false);
   }
   var lib = _deferredLibraries[availableLocale];
-  await (lib == null ? new Future.value(false) : lib());
-  initializeInternalMessageLookup(() => new CompositeMessageLookup());
+  await (lib == null ? Future.value(false) : lib());
+  initializeInternalMessageLookup(() => CompositeMessageLookup());
   messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
-  return new Future.value(true);
+  return Future.value(true);
 }
 
 bool _messagesExistFor(String locale) {

+ 2 - 2
lib/generated/intl/messages_en.dart

@@ -12,7 +12,7 @@
 import 'package:intl/intl.dart';
 import 'package:intl/message_lookup_by_library.dart';
 
-final messages = new MessageLookup();
+final messages = MessageLookup();
 
 typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
 
@@ -21,7 +21,7 @@ class MessageLookup extends MessageLookupByLibrary {
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   static _notInlinedMessages(_) => <String, Function> {
-    "btnNewGame" : MessageLookupByLibrary.simpleMessage("New Game"),
+    "btnNewGame" : MessageLookupByLibrary.simpleMessage("Game"),
     "labelBest" : MessageLookupByLibrary.simpleMessage("BEST"),
     "labelScore" : MessageLookupByLibrary.simpleMessage("SCORE"),
     "titleName" : MessageLookupByLibrary.simpleMessage("2048"),

+ 1 - 1
lib/generated/intl/messages_zh.dart

@@ -12,7 +12,7 @@
 import 'package:intl/intl.dart';
 import 'package:intl/message_lookup_by_library.dart';
 
-final messages = new MessageLookup();
+final messages = MessageLookup();
 
 typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
 

+ 2 - 2
lib/generated/l10n.dart

@@ -85,10 +85,10 @@ class S {
     );
   }
 
-  /// `New Game`
+  /// `Game`
   String get btnNewGame {
     return Intl.message(
-      'New Game',
+      'Game',
       name: 'btnNewGame',
       desc: '',
       args: [],

+ 3 - 3
lib/model/block_info.dart

@@ -1,5 +1,5 @@
 class BlockInfo {
-  BlockInfo({this.value, this.current, this.before, this.isNew = true}) {
+  BlockInfo({this.value, this.current, this.before, this.is= true}) {
     this.before = this.before == null ? this.current : this.before;
   }
 
@@ -8,12 +8,12 @@ class BlockInfo {
   int before;
   bool needMove = false;
   bool needCombine = false;
-  bool isNew = false;
+  bool is= false;
 
   void reset() {
     value = 0;
     needMove = false;
     needCombine = false;
-    isNew = false;
+    is= false;
   }
 }

+ 2 - 2
lib/router/routes.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/cupertino.dart';
 
 class Routes {
-  static final Router router = new Router(
+  static final Router router = Router(
     routerDelegate: null,
   );
   static const ROOT = '/';
@@ -9,7 +9,7 @@ class Routes {
 
   static Routes get instance {
     if (_instance == null) {
-      _instance = new Routes();
+      _instance = Routes();
     }
     return _instance;
   }

+ 4 - 4
lib/store/game_state.dart

@@ -12,7 +12,7 @@ class GameState {
 
   /// 初始化
   static GameState initial(int mode) {
-    var random = new Random(DateTime.now().millisecondsSinceEpoch);
+    var random = Random(DateTime.now().millisecondsSinceEpoch);
     var gamesize = mode * mode;
     var block1 = random.nextInt(gamesize);
     var block2 = random.nextInt(gamesize);
@@ -55,7 +55,7 @@ class GameState {
     for (var i = 0; i < mode; i++) {
       for (var j = 0; j < mode; j++) {
         var block = getBlock(i, j);
-        block.isNew = false;
+        block.is= false;
         if (block.value == 0) {
           count++;
         }
@@ -65,13 +65,13 @@ class GameState {
     // 有空格
     if (count > 0) {
       // 生成新的数字
-      var random = new Random(DateTime.now().millisecondsSinceEpoch);
+      var random = Random(DateTime.now().millisecondsSinceEpoch);
       var newpos = getBlankPosition(random.nextInt(count));
 
       var newblock = getBlock(newpos ~/ mode, newpos % mode);
       newblock.value = (random.nextInt(2) + 1) * 2;
       newblock.before = newblock.current = newpos;
-      newblock.isNew = true;
+      newblock.is= true;
       newblock.needCombine = newblock.needMove = false;
     }
 

+ 1 - 1
lib/views/block/new_block.dart

@@ -12,7 +12,7 @@ class NewBlock extends BaseBlock {
     AnimationController controller,
   }) : super(
           key: key,
-          animation: new Tween<double>(begin: 0.1, end: 1.0).animate(controller),
+          animation: Tween<double>(begin: 0.1, end: 1.0).animate(controller),
         );
 
   @override

+ 1 - 1
lib/views/block/static_block.dart

@@ -14,7 +14,7 @@ class StaticBlock extends BaseBlock {
   }) : super(
           key: key,
           animation:
-              new Tween<double>(begin: 0.0, end: 0.0).animate(controller),
+              Tween<double>(begin: 0.0, end: 0.0).animate(controller),
         );
 
   @override