Can’t Import to File Flutter

You need 0xFF you lost two FF character
code snippet

Color bcolorg13 = Color(0xFFaed6dc);
Color bcolorg12 = Color(0xFFFF9A8D);
Color bcolorg11 = Color(0xFF322e2f);
Color bcolorg21 = Color(0xFF24695c);
Color bcolorg22 = Color(0xFFc18e60);
Color bcolorg23 = Color(0xFFeed8d5);
Color bcolorbg = Color(0xFFFFFFFF);

working demo

enter image description here

full code

import 'package:flutter/material.dart';

Color bcolorg13 = Color(0xFFaed6dc);
Color bcolorg12 = Color(0xFFFF9A8D);
Color bcolorg11 = Color(0xFF322e2f);
Color bcolorg21 = Color(0xFF24695c);
Color bcolorg22 = Color(0xFFc18e60);
Color bcolorg23 = Color(0xFFeed8d5);
Color bcolorbg = Color(0xFFFFFFFF);

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  AppBar buildAppBar() {
    return AppBar(
      backgroundColor: bcolorg12,
      elevation: 0,
      centerTitle: true,
      title: Text(
        'Login',
        style: TextStyle(
          color: bcolorg12,
        ),
      ),
      leading: IconButton(
          icon: Icon(
            Icons.arrow_back_ios,
            color: bcolorg13,
          ),
          onPressed: null),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: buildAppBar(),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top