File size: 1,396 Bytes
b47b8bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>中文 Flutter 项目 - 预览 (请先使用 Flutter Build 构建)</title>
  <style>
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
      font-family: sans-serif;
      background-color: #f0f2f5;
    }
    .container {
      text-align: center;
      padding: 40px;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    h1 { color: #6200ee; }
    p { color: #666; }
    .btn {
      background: #6200ee;
      color: white;
      border: none;
      padding: 10px 20px;
      border-radius: 20px;
      cursor: pointer;
      font-size: 16px;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>中文 Flutter 项目首页</h1>
    <p>这是一个 Flutter 项目的 Web 预览占位符。</p>
    <p>如果你看到这个页面,说明你还没有使用 <code>flutter build web</code> 进行构建。</p>
    <div id="counter-section">
      <p>你点击按钮的次数如下:</p>
      <h2 id="counter">0</h2>
      <button class="btn" onclick="increment()">增加计数</button>
    </div>
  </div>
  <script>
    let count = 0;
    function increment() {
      count++;
      document.getElementById('counter').innerText = count;
    }
  </script>
</body>
</html>