"Fossies" - the Fresh Open Source Software Archive

Member "flutter-1.22.4/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo_edit_board_point.dart" (13 Nov 2020, 1131 Bytes) of package /linux/misc/flutter-1.22.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Dart source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Copyright 2014 The Flutter Authors. All rights reserved.
    2 // Use of this source code is governed by a BSD-style license that can be
    3 // found in the LICENSE file.
    4 
    5 import 'package:flutter/material.dart';
    6 import 'transformations_demo_board.dart';
    7 import 'transformations_demo_color_picker.dart';
    8 
    9 // The panel for editing a board point.
   10 @immutable
   11 class EditBoardPoint extends StatelessWidget {
   12   const EditBoardPoint({
   13     Key key,
   14     @required this.boardPoint,
   15     this.onColorSelection,
   16   }) : assert(boardPoint != null),
   17        super(key: key);
   18 
   19   final BoardPoint boardPoint;
   20   final ValueChanged<Color> onColorSelection;
   21 
   22   @override
   23   Widget build (BuildContext context) {
   24     return Column(
   25       crossAxisAlignment: CrossAxisAlignment.stretch,
   26       children: <Widget>[
   27         Text(
   28           '${boardPoint.q}, ${boardPoint.r}',
   29           textAlign: TextAlign.right,
   30           style: const TextStyle(fontWeight: FontWeight.bold),
   31         ),
   32         ColorPicker(
   33           colors: boardPointColors,
   34           selectedColor: boardPoint.color,
   35           onColorSelection: onColorSelection,
   36         ),
   37       ],
   38     );
   39   }
   40 }